Antlr4.Codegen.DefaultOutputModelFactory.List C# (CSharp) Method

List() private method

private List ( ) : IList
return IList
        public static IList<SrcOp> List(params SrcOp[] values)
        {
            return new List<SrcOp>(values);
        }

Same methods

DefaultOutputModelFactory::List ( IEnumerable values ) : IList

Usage Example

        public virtual void BuildNormalRuleFunction(Rule r, RuleFunction function)
        {
            CodeGenerator gen = @delegate.GetGenerator();
            // TRIGGER factory functions for rule alts, elements
            GrammarASTAdaptor    adaptor = new GrammarASTAdaptor(r.ast.Token.InputStream);
            GrammarAST           blk     = (GrammarAST)r.ast.GetFirstChildWithType(ANTLRParser.BLOCK);
            CommonTreeNodeStream nodes   = new CommonTreeNodeStream(adaptor, blk);

            walker = new SourceGenTriggers(nodes, this);
            try
            {
                // walk AST of rule alts/elements
                function.code = DefaultOutputModelFactory.List(walker.block(null, null));
                function.hasLookaheadBlock = walker.hasLookaheadBlock;
            }
            catch (Antlr.Runtime.RecognitionException e)
            {
                @delegate.GetGenerator().tool.ConsoleError.WriteLine(e.Message);
                @delegate.GetGenerator().tool.ConsoleError.WriteLine(e.StackTrace);
            }

            function.ctxType = @delegate.GetTarget().GetRuleFunctionContextStructName(function);

            function.postamble = RulePostamble(function, r);
        }