Token Object

 

Description

The Token Object inherits from the Symbol Object and used to represent and organize parsed data. Unlike symbols, which are used to represent a category of  terminals and nonterminals, tokens represent different instances of these symbols. For instance, the common "identifier" is a specific type of symbol, but can exist in various forms such as "Value1", "cat", "Sacramento", etc... 

The information that is read from the source text is stored into the 'data' property which can be modified at the developer's will. These objects can be created at runtime.

 

Properties

Property Data Type Access Description
ColumnNumber Integer (32-bit) Read/Write Returns/sets the column number where the token was read. This can be used to track when indentation changes or for highlighting a piece of information. The value stored in this property is passive and has no effect on how the system performs.  It was added in version 2.5 of the Engine.
Data Variant Read/Write Returns/sets the information stored in the token. This can be either an standard data type or an object reference.
Kind SymbolTypeConstants Read only Returns an enumerated data type that denotes the symbol class of the token.
LineNumber Integer (32-bit) Read/Write Returns/sets the line number where the token was read. This can be used to track when indentation changes or for highlighting a piece of information. The value stored in this property is passive and has no effect on how the system performs. It was added in version 2.5 of the Engine.
Name String Read only Returns the name of the token. This is equivalent to the parent symbol's name.
ParentSymbol Symbol Read/Write Returns a reference the token's parent symbol.
TableIndex Integer (16-bit) Read only Returns the index of the token's parent symbol in the GOLDParser object's symbol table.
Text String Read only Returns the text representation of the token's parent symbol. In the case of nonterminals, the name is delimited by angle brackets, special terminals are delimited by parenthesis and terminals are delimited by single quotes (if special characters are present).

 

Methods

This object does not contain any methods.