Package org.acplt.oncrpc.apps.jrpcgen.cup_runtime

# Class Symbol

java.lang.Object
org.acplt.oncrpc.apps.jrpcgen.cup_runtime.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

Fields
Modifier and Type
Field
Description
`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

Constructors
Constructor
Description
`Symbol(int sym_num)`
`Symbol(int id, int l, int r)`
`Symbol(int id, int l, int r, Object o)`
`Symbol(int id, Object o)`

## Method Summary

Modifier and Type
Method
Description
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### sym

public int sym
The symbol number of the terminal or non terminal being represented

### parse_state

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.

### left

public int left
The data passed to parser

### right

public int right
The data passed to parser

### value

public Object value

## Constructor Details

### Symbol

public Symbol(int id, int l, int r, Object o)

Parameters:
  `id` - Id of the symbol type
  `l` - Left position of the symbol in the original input file
  `r` - Right position of the symbol in the original input file
  `o` - Lexical value of the symbol

### Symbol

public Symbol(int id, Object o)

Parameters:
  `id` - Id of the symbol type
  `o` - Lexical value of the symbol

### Symbol

public Symbol(int id, int l, int r)

Parameters:
  `id` - Id of the symbool type
  `l` - Left position of the symbol in the original input file
  `r` - Right position of the symbol in the original input file

### Symbol

public Symbol(int sym_num)

Parameters:
  `sym_num` - Number (aka Id) of the symbol type

## Method Details

### toString

public String toString()

Overrides:
  `toString` in class `Object`
Returns:
  The string representation of the symbol.