Antlr4.Runtime.Vocabulary.Vocabulary C# (CSharp) Method

Vocabulary() public method

Constructs a new instance of Vocabulary from the specified literal, symbolic, and display token names.
public Vocabulary ( string literalNames, string symbolicNames, string displayNames ) : System
literalNames string /// The literal names assigned to tokens, or /// /// if no literal names are assigned. ///
symbolicNames string /// The symbolic names assigned to tokens, or /// /// if no symbolic names are assigned. ///
displayNames string /// The display names assigned to tokens, or /// /// to use the values in /// /// and /// /// as /// the source of display names, as described in /// /// . ///
return System
        public Vocabulary(string[] literalNames, string[] symbolicNames, string[] displayNames)
        {
            this.literalNames = literalNames != null ? literalNames : EmptyNames;
            this.symbolicNames = symbolicNames != null ? symbolicNames : EmptyNames;
            this.displayNames = displayNames != null ? displayNames : EmptyNames;
            // See note here on -1 part: https://github.com/antlr/antlr4/pull/1146
            this.maxTokenType = Math.Max(this.displayNames.Length, Math.Max(this.literalNames.Length, this.symbolicNames.Length)) - 1;
        }

Same methods

Vocabulary::Vocabulary ( string literalNames, string symbolicNames ) : System