C# Class Antlr4.Runtime.Vocabulary

This class provides a default implementation of the IVocabulary interface.
Inheritance: IVocabulary
Show file Open project: sharwell/antlr4cs

Public Methods

Method Description
FromTokenNames ( string tokenNames ) : IVocabulary

Returns a Vocabulary instance from the specified set of token names. This method acts as a compatibility layer for the single tokenNames array generated by previous releases of ANTLR.

The resulting vocabulary instance returns for GetLiteralName(int) and GetSymbolicName(int) , and the value from tokenNames for the display names.

Vocabulary ( string literalNames, string symbolicNames ) : System

Constructs a new instance of Vocabulary from the specified literal and symbolic token names.

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

Constructs a new instance of Vocabulary from the specified literal, symbolic, and display token names.

Private Methods

Method Description
GetDisplayName ( int tokenType ) : string
GetLiteralName ( int tokenType ) : string
GetSymbolicName ( int tokenType ) : string

Method Details

FromTokenNames() public static method

Returns a Vocabulary instance from the specified set of token names. This method acts as a compatibility layer for the single tokenNames array generated by previous releases of ANTLR.

The resulting vocabulary instance returns for GetLiteralName(int) and GetSymbolicName(int) , and the value from tokenNames for the display names.

public static FromTokenNames ( string tokenNames ) : IVocabulary
tokenNames string /// The token names, or /// /// if no token names are /// available. ///
return IVocabulary

Vocabulary() public method

Constructs a new instance of Vocabulary from the specified literal and symbolic token names.
public Vocabulary ( string literalNames, string symbolicNames ) : 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. ///
return System

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