CogPar
A versatile parser for mathematical expressions.
 All Classes Functions Variables
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
uk.co.cogitolearning.cogpar.Token Class Reference

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.

Detailed Description

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.

Constructor & Destructor Documentation

uk.co.cogitolearning.cogpar.Token.Token ( int  token,
String  sequence,
int  pos 
)

Construct the token with its values.

Parameters
tokenthe token identifier
sequencethe string that the token was created from
posthe position of the token in the input string

Definition at line 69 of file Token.java.


The documentation for this class was generated from the following file: