Top Description Fields Constructors Methods
java_cup.runtime

public Class Symbol

extends Object
Class Inheritance

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.
Author
Frank Flannery
Version
last updated: 7/3/96

Field Summary

Modifier and TypeField and Description
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.

public int
right

The data passed to parser

public int
sym

The symbol number of the terminal or non terminal being represented

pack-priv boolean
used_by_parser

This allows us to catch some errors caused by scanners recycling symbols.

public Object

Constructor Summary

AccessConstructor and Description
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

pack-priv
Symbol(int sym_num, int state)

Constructor to give a start state

Method Summary

Modifier and TypeMethod and Description
public String
toString()

Overrides java.lang.Object.toString.

Printing this token out.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

leftback to summary
public int left

The data passed to parser

parse_stateback to summary
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.

symback to summary
public int sym

The symbol number of the terminal or non terminal being represented

used_by_parserback to summary
pack-priv boolean used_by_parser

This allows us to catch some errors caused by scanners recycling symbols. For the use of the parser only. [CSA, 23-Jul-1999]

valueback to summary
public Object value

Constructor Detail

Symbolback to summary
public Symbol(int id, int l, int r, Object o)

Constructor for l,r values

Symbolback to summary
public Symbol(int id, Object o)

Constructor for no l,r values

Symbolback to summary
public Symbol(int id, int l, int r)

Constructor for no value

Symbolback to summary
public Symbol(int sym_num)

Constructor for no value or l,r

Symbolback to summary
pack-priv Symbol(int sym_num, int state)

Constructor to give a start state

Method Detail

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Printing this token out. (Override for pretty-print).

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.