A token that is produced by Tokenizer and fed into Parser.parse. More...
Public Member Functions | |
| Token (int token, String sequence, int pos) | |
| Construct the token with its values. | |
Public Attributes | |
| final int | token |
| the token identifier | |
| final String | sequence |
| the string that the token was created from | |
| final int | pos |
| the position of the token in the input string | |
Static Public Attributes | |
| static final int | EPSILON = 0 |
| Token id for the epsilon terminal. | |
| static final int | PLUSMINUS = 1 |
| Token id for plus or minus. | |
| static final int | MULTDIV = 2 |
| Token id for multiplication or division. | |
| static final int | RAISED = 3 |
| Token id for the exponentiation symbol. | |
| static final int | FUNCTION = 4 |
| Token id for function names. | |
| static final int | OPEN_BRACKET = 5 |
| Token id for opening brackets. | |
| static final int | CLOSE_BRACKET = 6 |
| Token id for closing brackets. | |
| static final int | NUMBER = 7 |
| Token id for numbers. | |
| static final int | VARIABLE = 8 |
| Token id for variable names. | |
A token that is produced by Tokenizer and fed into Parser.parse.
A token consists of a token identifier, a string that the token was created from and the position in the input string that the token was found.
The token id must be one of a number of pre-defined values
Definition at line 35 of file Token.java.
| uk.co.cogitolearning.cogpar.Token.Token | ( | int | token, |
| String | sequence, | ||
| int | pos | ||
| ) |
Construct the token with its values.
| token | the token identifier |
| sequence | the string that the token was created from |
| pos | the position of the token in the input string |
Definition at line 69 of file Token.java.
1.8.1.2