java_cup

Class AntTask

public class AntTask extends Task

An Ant task class for CUP, supports all CUP options available on the command line.

The option names are the same as on the command line. Options without parameters are booleans in Ant (-nosummary becomes nosummary="true")

Example build.xml file for Ant (assumes that java_cup classes are available in classpath):

 
 <project name="cup" default="jar">
 
 <taskdef classname="java_cup.AntTask" name="cup" />
 
 <target name="compile" depends="cup">
   <javac srcdir="." destdir="bin" target="1.1" classpath="." />  
 </target> 
 
 <target name="cup">
   <cup file="java_cup/parser.cup" dir="java_cup" nosummary="true" />
 </target>

 <target name="jar" depends="compile">
   <jar basedir="bin" includes="java_cup/**" jarfile="java_cup.jar" />
 </target>
 </project>
 

Author: Gerwin Klein

See Also:

Method Summary
voidconfigure()
Configures cup accordings to the settings of this class
voidexecute()
Run the Ant task.
voidsetCompact_red(boolean b)
voidsetDir(File destinationDir)
voidsetDump(boolean b)
voidsetDump_grammar(boolean b)
voidsetDump_states(boolean b)
voidsetDump_tables(boolean b)
voidsetExpect(int i)
voidsetFile(File file)
voidsetInterface(boolean symInterface)
voidsetNonterms(boolean b)
voidsetNopositions(boolean b)
voidsetNoscanner(boolean b)
voidsetNosummary(boolean b)
voidsetNowarn(boolean b)
voidsetPackage(String name)
voidsetParser(String name)
voidsetProgress(boolean b)
voidsetSymbols(String name)
voidsetTime(boolean b)

Method Detail

configure

public void configure()
Configures cup accordings to the settings of this class

Throws: FileNotFoundException if inputFile does not exist

execute

public void execute()
Run the Ant task. Assumes that options have already been set with setter methods by Ant.

Throws: BuildException if build fails

setCompact_red

public void setCompact_red(boolean b)

setDir

public void setDir(File destinationDir)

setDump

public void setDump(boolean b)

setDump_grammar

public void setDump_grammar(boolean b)

setDump_states

public void setDump_states(boolean b)

setDump_tables

public void setDump_tables(boolean b)

setExpect

public void setExpect(int i)

setFile

public void setFile(File file)

setInterface

public void setInterface(boolean symInterface)

setNonterms

public void setNonterms(boolean b)

setNopositions

public void setNopositions(boolean b)

setNoscanner

public void setNoscanner(boolean b)

setNosummary

public void setNosummary(boolean b)

setNowarn

public void setNowarn(boolean b)

setPackage

public void setPackage(String name)

setParser

public void setParser(String name)

setProgress

public void setProgress(boolean b)

setSymbols

public void setSymbols(String name)

setTime

public void setTime(boolean b)