public class Parser extends Object
Modifier and Type | Field and Description |
---|---|
static Token |
DIV_TOKEN |
static Token |
LEFT_PAREN_TOKEN |
static Token |
MINUS_TOKEN |
static Token |
PLUS_TOKEN |
static Token |
RIGHT_PAREN_TOKEN |
static Token |
TIMES_TOKEN |
Modifier and Type | Method and Description |
---|---|
AST |
parse()
Parses the list of tokens provided in the constructor.
|
public static final Token LEFT_PAREN_TOKEN
public static final Token RIGHT_PAREN_TOKEN
public static final Token PLUS_TOKEN
public static final Token MINUS_TOKEN
public static final Token TIMES_TOKEN
public static final Token DIV_TOKEN
public AST parse() throws ParserException
ParserException
- If the tokens could not be parsed, e.g., with the
input )3(
.