VocabularyImpl class

This class provides a default implementation of the Vocabulary interface.

Implemented types

Constructors

VocabularyImpl(List<String?> literalNames, List<String?> symbolicNames, [List<String?> displayNames = EMPTY_NAMES])
Constructs a new instance of VocabularyImpl from the specified literal, symbolic, and display token names.

Properties

displayNames List<String?>
final
hashCode int
The hash code for this object.
no setterinherited
literalNames List<String?>
final
maxTokenType int
Returns the highest token type value. It can be used to iterate from zero to that number, inclusively, thus querying all stored entries. @return the highest token type value
getter/setter pairoverride-getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
symbolicNames List<String?>
final

Methods

getDisplayName(int tokenType) String
Gets the display name of a token type.
override
getLiteralName(int tokenType) String?
Gets the string literal associated with a token type. The string returned by this method, when not null, can be used unaltered in a parser grammar to represent this token type.
override
getSymbolicName(int tokenType) String?
Gets the symbolic name associated with a token type. The string returned by this method, when not null, can be used unaltered in a parser grammar to represent this token type.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

EMPTY_VOCABULARY VocabularyImpl
Gets an empty Vocabulary instance.
final

Static Methods

fromTokenNames(List<String?>? tokenNames) Vocabulary
Returns a VocabularyImpl 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.

Constants

EMPTY_NAMES → const List<String>