Package compilation.analysis.lexical
Class Token
- java.lang.Object
-
- compilation.analysis.lexical.Token
-
public final class Token extends java.lang.ObjectThe Token class is used to store information about characters in the form of a Token.It takes the type, syntax, value, and position of a piece of text, and is then used to represent that text from that point on.
- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description Token(TokenType type, java.lang.String syntax, int position)Constructs a Token object initialised with information about a piece of text, but without a value.Token(TokenType type, java.lang.String syntax, java.lang.Object value, int position)Constructs a Token object initialised with information about a piece of text.
-
-
-
Constructor Detail
-
Token
public Token(TokenType type, java.lang.String syntax, java.lang.Object value, int position)
Constructs a Token object initialised with information about a piece of text.A SourceSpan object is automatically generated based on the position and length of the syntax.
- Parameters:
type- The TokenType of the textsyntax- The text itselfvalue- The value of the textposition- The position of the text relative to the String it originates from
-
Token
public Token(TokenType type, java.lang.String syntax, int position)
Constructs a Token object initialised with information about a piece of text, but without a value.A SourceSpan object is automatically generated based on the position and length of the syntax. The Tokens 'value' field is set to null.
- Parameters:
type- The TokenType of the textsyntax- The text itselfposition- The position of the text relative to the String it originates from
-
-