org.metasyntactic.math.automata
Class Production

java.lang.Object
  |
  +--org.metasyntactic.math.automata.Production
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable
Direct Known Subclasses:
LR0Item

public class Production
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

A grammar naturally describes the hierarchical structure of many programming language contructs. This structure is normally expressed as a set of rules or productions. In a production, lexical elements like the keywords and tokens can be intermixed with variables and non-terminals. Each production consists of a non-terminal, called the left-side of the production, an arrow, and a sequence of tokens and/or non-terminals, called the right-side of the production.

See Also:
Serialized Form

Field Summary
protected  java.lang.Object variable
           
protected  java.util.List yield
           
 
Constructor Summary
protected Production()
           
  Production(java.lang.Object variable, java.util.List yield)
          Creates new Rule
  Production(Production copy)
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object o)
           
 java.lang.Object get(int i)
           
 java.lang.Object getVariable()
           
 java.util.List getYield()
           
 int hashCode()
           
 java.lang.String toLatex()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

variable

protected java.lang.Object variable

yield

protected java.util.List yield
Constructor Detail

Production

protected Production()

Production

public Production(java.lang.Object variable,
                  java.util.List yield)
Creates new Rule


Production

public Production(Production copy)
Method Detail

getVariable

public java.lang.Object getVariable()

getYield

public java.util.List getYield()

get

public java.lang.Object get(int i)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toLatex

public java.lang.String toLatex()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable