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
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
variable
protected java.lang.Object variable
yield
protected java.util.List yield
Production
protected Production()
Production
public Production(java.lang.Object variable,
java.util.List yield)
- Creates new Rule
Production
public Production(Production copy)
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