ppg.spec
Class CUPSpec

java.lang.Object
  extended by ppg.spec.Spec
      extended by ppg.spec.CUPSpec
All Implemented Interfaces:
Unparse

public class CUPSpec
extends Spec


Field Summary
 
Fields inherited from class ppg.spec.Spec
actionCode, child, imports, initCode, packageName, parserCode, prec, scanCode, symbols
 
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)
           
 
Method Summary
 void addProductions(Production p)
           
 void addSymbols(java.util.Vector syms)
           
 java.lang.Object clone()
           
 CUPSpec coalesce()
          Combine the chain of inheritance into one CUP spec
 void dropAllProductions(java.lang.String nt)
           
 void dropProductions(Nonterminal nt)
           
 void dropProductions(Production p)
           
 void dropSymbol(java.lang.String gs)
           
 void export(java.io.PrintStream out)
          Write out the CUP specification to the stream
 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.
 void removeEmptyProductions()
           
 void setStart(java.lang.String startSym)
           
 void unparse(CodeWriter cw)
          Write a human-readable representation of the parse tree
 
Methods inherited from class ppg.spec.Spec
addImports, parseChain, replaceCode, setChild, setPkgName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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)
Method Detail

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