ppg.spec
Class CUPSpec
java.lang.Object
ppg.spec.Spec
ppg.spec.CUPSpec
- All Implemented Interfaces:
- Unparse
public class CUPSpec
- extends Spec
Constructor Summary |
CUPSpec(java.lang.String pkg,
java.util.Vector imp,
java.util.Vector codeParts,
java.util.Vector syms,
java.util.Vector precedence,
java.lang.String startSym,
java.util.Vector prods)
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CUPSpec
public CUPSpec(java.lang.String pkg,
java.util.Vector imp,
java.util.Vector codeParts,
java.util.Vector syms,
java.util.Vector precedence,
java.lang.String startSym,
java.util.Vector prods)
setStart
public void setStart(java.lang.String startSym)
coalesce
public CUPSpec coalesce()
- Description copied from class:
Spec
- Combine the chain of inheritance into one CUP spec
- Specified by:
coalesce
in class Spec
findProduction
public Production findProduction(Production p)
- Provides a copy of the production that was present in the original
grammar, but is equal (minus semantic actions) to the given production set.
Thus, we transfer the semantic actions without having to re-specify them.
removeEmptyProductions
public void removeEmptyProductions()
clone
public java.lang.Object clone()
- Overrides:
clone
in class java.lang.Object
addSymbols
public void addSymbols(java.util.Vector syms)
dropSymbol
public void dropSymbol(java.lang.String gs)
throws PPGError
- Throws:
PPGError
dropProductions
public void dropProductions(Production p)
dropProductions
public void dropProductions(Nonterminal nt)
dropAllProductions
public void dropAllProductions(java.lang.String nt)
addProductions
public void addProductions(Production p)
unparse
public void unparse(CodeWriter cw)
- Description copied from interface:
Unparse
- Write a human-readable representation of the parse tree
export
public void export(java.io.PrintStream out)
throws java.lang.Exception
- Write out the CUP specification to the stream
- Throws:
java.lang.Exception