|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--tracer.expression.Symbol
An input symbol in an expression.
| Field Summary | |
ExprNode |
enode
The reduced expression node, if symbol type if SYM_EXPRNODE. |
Function |
func
The function of a TK_FUNCTION token. |
double |
nval
The value of a TK_NUMBER token. |
(package private) static int[][] |
precTab
Precedence table used for parsing the expression. |
int |
stype
Symbol type of the symbol. |
static int |
SYM_EXPRNODE
The symbol type representing a reduced expression node. |
static int |
SYM_TERMINAL
The symbol type representing a terminal symbol. |
static int |
SYM_UNKNOWN
The symbol type representing unknown symbol. |
static int |
TK_BRACKETL
The token representing a left bracket in an expression. |
static int |
TK_BRACKETR
The token representing a right bracket in an expression. |
static int |
TK_DIV
The token representing a division sign in an expression. |
static int |
TK_EOE
The token representing the end of an expression. |
static int |
TK_FUNCTION
The token representing a function in an expression. |
static int |
TK_MINUS
The token representing a minus sign in an expression. |
static int |
TK_MULT
The token representing a multply sign in an expression. |
static int |
TK_NUMBER
The token representing a number in an expression. |
static int |
TK_PLUS
The token representing a plus sign in an expression. |
static int |
TK_POW
The token representing a power sign in an expression. |
static int |
TK_VARIABLE
The token representing a variable in an expression. |
int |
ttype
The terminal type of the symbol, if symbol type if SYM_TERMINAL. |
Variable |
variable
The variable of a TK_VARIABLE token. |
| Constructor Summary | |
Symbol()
Create an empty symbol. |
|
Symbol(int type,
ExprNode en)
Create a Function token with symbol type specified as SYM_EXPRNODE, and an expression node. |
|
Symbol(int type,
int tk)
Create a token symbol with symbol type and token type. |
|
Symbol(int type,
int tk,
char vchar)
|
|
Symbol(int type,
int tk,
double val)
Create a Number token with symbol type specified as SYM_TERMINAL, token type specified as TK_NUMBER and a value |
|
Symbol(int type,
int tk,
java.lang.String str)
Create a Variable token or Function token with symbol type specified as SYM_TERMINAL. |
|
| Method Summary | |
boolean |
equal(Symbol a)
Returns true if current symbol has the same precedence as symbol a. |
boolean |
greater(Symbol a)
Returns true if current symbol has higher precedence than symbol a. |
boolean |
isEOE()
Returns true if the symbol represents the end of an expression. |
boolean |
isExprNode()
Returns true if the symbol represents an expression node. |
boolean |
less(Symbol a)
Returns true if current symbol has lower precedence than symbol a. |
(package private) static int |
precTabIndex(int token)
Convert a token type to an index in the precedence table. |
java.lang.String |
toString()
Returns the string representation of the current symbol. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final int SYM_UNKNOWN
public static final int SYM_EXPRNODE
public static final int SYM_TERMINAL
public static final int TK_EOE
public static final int TK_NUMBER
public static final int TK_VARIABLE
public static final int TK_BRACKETL
public static final int TK_BRACKETR
public static final int TK_PLUS
public static final int TK_MINUS
public static final int TK_MULT
public static final int TK_DIV
public static final int TK_POW
public static final int TK_FUNCTION
public int stype
public int ttype
public ExprNode enode
public double nval
public Function func
public Variable variable
static int[][] precTab
| Constructor Detail |
public Symbol()
public Symbol(int type,
int tk)
public Symbol(int type,
int tk,
double val)
public Symbol(int type,
int tk,
char vchar)
throws ExpressionParseException
public Symbol(int type,
int tk,
java.lang.String str)
throws ExpressionParseException
public Symbol(int type,
ExprNode en)
| Method Detail |
static int precTabIndex(int token)
throws ExpressionParseException
public boolean isEOE()
public boolean isExprNode()
public boolean less(Symbol a)
throws ExpressionParseException
public boolean equal(Symbol a)
throws ExpressionParseException
public boolean greater(Symbol a)
throws ExpressionParseException
public java.lang.String toString()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||