Antlr4.Tool.Grammar.Grammar C# (CSharp) Method

Grammar() public method

public Grammar ( AntlrTool tool, [ ast ) : System.Collections.Generic
tool AntlrTool
ast [
return System.Collections.Generic
        public Grammar(AntlrTool tool, [NotNull] GrammarRootAST ast)
        {
            if (ast == null)
            {
                throw new ArgumentNullException(nameof(ast));
            }

            if (ast.tokenStream == null)
            {
                throw new ArgumentException("ast must have a token stream", nameof(ast));
            }

            this.tool = tool;
            this.ast = ast;
            this.name = (ast.GetChild(0)).Text;
            this.tokenStream = ast.tokenStream;
            this.originalTokenStream = this.tokenStream;

            InitTokenSymbolTables();
        }

Same methods

Grammar::Grammar ( string grammarText ) : System.Collections.Generic
Grammar::Grammar ( string grammarText, ANTLRToolListener listener ) : System.Collections.Generic
Grammar::Grammar ( string grammarText, LexerGrammar tokenVocabSource ) : System.Collections.Generic
Grammar::Grammar ( string fileName, string grammarText ) : System.Collections.Generic
Grammar::Grammar ( string fileName, string grammarText, Grammar tokenVocabSource, [ listener ) : System.Collections.Generic
Grammar::Grammar ( string fileName, string grammarText, [ listener ) : System.Collections.Generic