Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.sablecc.sablecc
Class Symbol  view Symbol download Symbol.java

java.lang.Object
  extended byorg.sablecc.sablecc.Symbol
All Implemented Interfaces:
java.lang.Comparable

final class Symbol
extends java.lang.Object
implements java.lang.Comparable


Field Summary
(package private)  java.lang.String errorName
           
(package private)  int index
           
private static boolean modified_
           
(package private)  java.lang.String name
           
private static java.util.TreeMap names
           
private static java.util.Vector nonterminals
           
private static Symbol[] nonterminals_
           
private static Symbol[] symbols_
           
(package private)  boolean terminal
           
private static java.util.Vector terminals
           
private static Symbol[] terminals_
           
 
Constructor Summary
(package private) Symbol(java.lang.String name, java.lang.String errorName, boolean terminal)
           
 
Method Summary
 int compareTo(java.lang.Object object)
          Compares this object with another, and returns a numerical result based on the comparison.
private static void computeArrays()
           
(package private) static Symbol[] nonterminals()
           
static void reinit()
           
(package private) static Symbol symbol(int index, boolean terminal)
           
(package private) static Symbol symbol(java.lang.String name)
           
(package private) static Symbol[] symbols()
           
(package private) static Symbol[] terminals()
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

terminals

private static java.util.Vector terminals

nonterminals

private static java.util.Vector nonterminals

names

private static java.util.TreeMap names

modified_

private static boolean modified_

symbols_

private static Symbol[] symbols_

terminals_

private static Symbol[] terminals_

nonterminals_

private static Symbol[] nonterminals_

name

final java.lang.String name

errorName

final java.lang.String errorName

terminal

final boolean terminal

index

final int index
Constructor Detail

Symbol

Symbol(java.lang.String name,
       java.lang.String errorName,
       boolean terminal)
Method Detail

reinit

public static void reinit()

symbol

static Symbol symbol(java.lang.String name)

symbol

static Symbol symbol(int index,
                     boolean terminal)

computeArrays

private static void computeArrays()

symbols

static Symbol[] symbols()

terminals

static Symbol[] terminals()

nonterminals

static Symbol[] nonterminals()

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


compareTo

public int compareTo(java.lang.Object object)
Description copied from interface: java.lang.Comparable
Compares this object with another, and returns a numerical result based on the comparison. If the result is negative, this object sorts less than the other; if 0, the two are equal, and if positive, this object sorts greater than the other. To translate this into boolean, simply perform o1.compareTo(o2) <op> 0, where op is one of <, <=, =, !=, >, or >=.

You must make sure that the comparison is mutual, ie. sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) (where sgn() is defined as -1, 0, or 1 based on the sign). This includes throwing an exception in either direction if the two are not comparable; hence, compareTo(null) should always throw an Exception.

You should also ensure transitivity, in two forms: x.compareTo(y) > 0 && y.compareTo(z) > 0 implies x.compareTo(z) > 0; and x.compareTo(y) == 0 implies x.compareTo(z) == y.compareTo(z).

Specified by:
compareTo in interface java.lang.Comparable