java.lang.Object
gnu.jel.Parser
public class Parser
extends java.lang.Object
-
Field Summary
Fields
Modifier and Type |
Field |
Description |
protected int |
c |
|
int |
ct_column |
Column, where the current token started
|
int |
ct_line |
Line, where the current token started
|
int |
type |
type of the current token
|
java.lang.Object |
val |
value of the current token wrapped into a reflection object
|
-
Constructor Summary
Constructors
Constructor |
Description |
Parser(java.lang.String in,
Library lib) |
Initializes the parser.
|
-
Method Summary
Modifier and Type |
Method |
Description |
protected void |
consume(int cc) |
|
void |
error(int code,
java.lang.Object param,
int column) |
|
boolean |
isCast() |
|
void |
nextToken() |
|
OP |
parse(java.lang.Class<?> resultType) |
Parses expression.
|
protected int |
read() |
Reads character from underlying Reader.
|
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
-
public int ct_column
Column, where the current token started
-
public int ct_line
Line, where the current token started
-
public java.lang.Object val
value of the current token wrapped into a reflection object
-
public int type
type of the current token
-
Constructor Details
-
public Parser(
java.lang.String in,
Library lib)
Initializes the parser.
- Parameters:
in
- expression to parse
lib
- library to resolve functions in
-
Method Details
-
protected int read()
Reads character from underlying Reader.
Additionally it counts line and column numbers. The read character
is automatically set as a current char of this Tokenizer.
- Returns:
- next character from the selected input.
-
-
-
-
-
Parses expression.
- Parameters:
resultType
- the type to convert the result into
- Returns:
- top of the parse tree
- Throws:
CompilationException