Static
Private
_implementationThe Token class is a simple class representing the tokens that conform the source code, and it only contains information. The internal state has 4 fields for that:
_tag
, indicating the kind of token this one is,_value
, with the information in the source code that generates the token, and_span
(_start
and _end
positions), with information about the span of the
value
in the source code.
It also has functions to produce printable information of the token, and to inform if the
token is a "filler" -- see Token for an explanation on "fillers".The tag of the token, indicating the kind of token this one is.
The value of the token, with the information in the source code that generates the token.
Indicates if the token is a filler token. A filler token is one that is used by the Gobstones lexer to fill the space in between structural tokens (such as keywords, identifiers, and numbers), and that is ignored by the parser. Tokens that are not fillers are called GTokens.
A token consists of a tag
indicating its kind, a value
, with the information in the
source code that generates the token, and possibly information about the position of that
information in the source code.
indicating the kind of token to create.
with the information in the source code that generates the token.
the span in the source where this token comes from.
Private
_spanThe span in the source where this token is (start and end positions of it).
Private
_tagThe tag of the token, indicating the kind of token this one is.
Private
_valueThe value of the token, with the information in the source code that generates the token.
Static
loweridStatic
numStatic
stringStatic
symbidStatic
symbolStatic
upperid
The Token class is a simple class representing the tokens that conform the source code, and it only contains information: the kind of token, the information in the source code that generates the token, and information about the position of that information in the source. In addition to the operations to create it and to access the mentioned information, it has a way to obtain a printable version of the token, and to inform if the token is a "filler". Filler tokens are those used by the Gobstones lexer to fill the space in between structural tokens (such as keywords, identifiers, and numbers), and that are ignored by the parser. Tokens that are not fillers will be called GTokens.