|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava_cup.symbol
java_cup.terminal
This class represents a terminal symbol in the grammar. Each terminal has a textual name, an index, and a string which indicates the type of object it will be implemented with at runtime (i.e. the class of object that will be returned by the scanner and pushed on the parse stack to represent it).
Field Summary | |
protected static java.util.Hashtable |
_all
Table of all terminals. |
protected static java.util.Hashtable |
_all_by_index
Table of all terminals indexed by their index number. |
private int |
_precedence_num
|
private int |
_precedence_side
|
static terminal |
EOF
Special terminal for end of input. |
static terminal |
error
special terminal used for error recovery |
protected static int |
next_index
Static counter to assign unique index. |
Fields inherited from class java_cup.symbol |
_index, _name, _stack_type, _use_count |
Constructor Summary | |
terminal(java.lang.String nm)
Constructor with default type. |
|
terminal(java.lang.String nm,
java.lang.String tp)
Constructor for non-precedented terminal |
|
terminal(java.lang.String nm,
java.lang.String tp,
int precedence_side,
int precedence_num)
Full constructor. |
Method Summary | |
static java.util.Enumeration |
all()
Access to all terminals. |
static terminal |
find(int indx)
Lookup a terminal by index. |
static terminal |
find(java.lang.String with_name)
Lookup a terminal by name string. |
boolean |
is_non_term()
Report this symbol as not being a non-terminal. |
static int |
number()
Total number of terminals. |
int |
precedence_num()
get the precedence of a terminal |
int |
precedence_side()
|
void |
set_precedence(int p,
int new_prec)
set the precedence of a terminal |
java.lang.String |
toString()
Convert to a string. |
Methods inherited from class java_cup.symbol |
index, name, note_use, stack_type, use_count |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private int _precedence_num
private int _precedence_side
protected static java.util.Hashtable _all
protected static java.util.Hashtable _all_by_index
protected static int next_index
public static final terminal EOF
public static final terminal error
Constructor Detail |
public terminal(java.lang.String nm, java.lang.String tp, int precedence_side, int precedence_num)
nm
- the name of the terminal.tp
- the type of the terminal.public terminal(java.lang.String nm, java.lang.String tp)
public terminal(java.lang.String nm)
nm
- the name of the terminal.Method Detail |
public static java.util.Enumeration all()
public static terminal find(java.lang.String with_name)
public static terminal find(int indx)
public static int number()
public boolean is_non_term()
is_non_term
in class symbol
public java.lang.String toString()
toString
in class symbol
public int precedence_num()
public int precedence_side()
public void set_precedence(int p, int new_prec)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |