java_cup
Class AntTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by java_cup.AntTask
All Implemented Interfaces:
java.lang.Cloneable

public class AntTask
extends org.apache.tools.ant.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:
Main

Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
AntTask()
           
 
Method Summary
 void configure()
          Configures cup accordings to the settings of this class
 void execute()
          Run the Ant task.
 void setCompact_red(boolean b)
           
 void setDir(java.io.File destinationDir)
           
 void setDump_grammar(boolean b)
           
 void setDump_states(boolean b)
           
 void setDump_tables(boolean b)
           
 void setDump(boolean b)
           
 void setExpect(int i)
           
 void setFile(java.io.File file)
           
 void setInterface(boolean symInterface)
           
 void setNonterms(boolean b)
           
 void setNopositions(boolean b)
           
 void setNoscanner(boolean b)
           
 void setNosummary(boolean b)
           
 void setNowarn(boolean b)
           
 void setPackage(java.lang.String name)
           
 void setParser(java.lang.String name)
           
 void setProgress(boolean b)
           
 void setSymbols(java.lang.String name)
           
 void setTime(boolean b)
           
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AntTask

public AntTask()
Method Detail

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Run the Ant task. Assumes that options have already been set with setter methods by Ant.

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException - if build fails

configure

public void configure()
               throws java.io.FileNotFoundException
Configures cup accordings to the settings of this class

Throws:
java.io.FileNotFoundException - if inputFile does not exist

setDir

public void setDir(java.io.File destinationDir)

setFile

public void setFile(java.io.File file)

setParser

public void setParser(java.lang.String name)

setSymbols

public void setSymbols(java.lang.String name)

setPackage

public void setPackage(java.lang.String name)

setInterface

public void setInterface(boolean symInterface)

setCompact_red

public void setCompact_red(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)

setDump

public void setDump(boolean b)

setExpect

public void setExpect(int i)

setNopositions

public void setNopositions(boolean b)

setNonterms

public void setNonterms(boolean b)

setNosummary

public void setNosummary(boolean b)

setNowarn

public void setNowarn(boolean b)

setProgress

public void setProgress(boolean b)

setTime

public void setTime(boolean b)

setNoscanner

public void setNoscanner(boolean b)