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

GetVocabulary() private method

private GetVocabulary ( ) : Antlr4.Runtime.IVocabulary
return Antlr4.Runtime.IVocabulary
        public virtual IVocabulary GetVocabulary()
        {
            return new Vocabulary(GetTokenLiteralNames(), GetTokenSymbolicNames());
        }

Usage Example

 public GrammarParserInterpreter(Grammar g, ATN atn, ITokenStream input)
     : base(g.fileName, g.GetVocabulary(),
           g.GetRuleNames(),
           atn, // must run ATN through serializer to set some state flags
           input)
 {
     this.g = g;
     decisionStatesThatSetOuterAltNumInContext = FindOuterMostDecisionStates();
     stateToAltsMap = new int[g.atn.states.Count][];
 }