java_cup.runtime
Class Symbol
public
class
Symbol
extends Object
Defines the Symbol class, which is used to represent all terminals
and nonterminals while parsing. The lexer should pass CUP Symbols
and CUP returns a Symbol.
Version: last updated: 7/3/96
Author: Frank Flannery
Field Summary |
int | left
The data passed to parser
|
int | parse_state The parse state to be recorded on the parse stack with this symbol.
|
int | right
The data passed to parser
|
int | sym The symbol number of the terminal or non terminal being represented |
Object | value |
Constructor Summary |
| Symbol(int id, Symbol left, Symbol right, Object o)
|
| Symbol(int id, Symbol left, Symbol right) |
| Symbol(int id, int l, int r, Object o)
Constructor for l,r values
|
| Symbol(int id, Object o)
Constructor for no l,r values
|
| Symbol(int id, int l, int r)
Constructor for no value
|
| Symbol(int sym_num)
Constructor for no value or l,r
|
public int left
The data passed to parser
public int parse_state
The parse state to be recorded on the parse stack with this symbol.
This field is for the convenience of the parser and shouldn't be
modified except by the parser.
public int right
The data passed to parser
public int sym
The symbol number of the terminal or non terminal being represented
public Object value
public Symbol(int id, int l, int r, Object o)
Constructor for l,r values
public Symbol(int id, Object o)
Constructor for no l,r values
public Symbol(int id, int l, int r)
Constructor for no value
public Symbol(int sym_num)
Constructor for no value or l,r
public String toString()
Printing this token out. (Override for pretty-print).