Antlr4.Codegen.ActionTranslator.TranslateAction C# (CSharp) Method

TranslateAction() public static method

public static TranslateAction ( OutputModelFactory factory, RuleFunction rf, Antlr.Runtime.IToken tokenWithinAction, ActionAST node ) : IList
factory OutputModelFactory
rf Antlr4.Codegen.Model.RuleFunction
tokenWithinAction Antlr.Runtime.IToken
node Antlr4.Tool.Ast.ActionAST
return IList
        public static IList<ActionChunk> TranslateAction(OutputModelFactory factory,
                                                        RuleFunction rf,
                                                        IToken tokenWithinAction,
                                                        ActionAST node)
        {
            string action = tokenWithinAction.Text;
            if (action != null && action.Length > 0 && action[0] == '{')
            {
                int firstCurly = action.IndexOf('{');
                int lastCurly = action.LastIndexOf('}');
                if (firstCurly >= 0 && lastCurly >= 0)
                {
                    action = action.Substring(firstCurly + 1, lastCurly - firstCurly - 1); // trim {...}
                }
            }

            return TranslateActionChunk(factory, rf, action, node);
        }