java_cup.anttask

Class CUPTask

public class CUPTask extends Task

java_cup.anttask.CUPTask.java

Author: Michael Petter, 2003 Ant-Task for CUP Parser Generator for Java -- tested with Ant 1.5.1; -- compiles with javac -classpath .:${ANT_HOME}/lib/ant.jar java_cup.anttask.CUPTask.java -- overrides org.apache.tools.ant.taskdefs.Java -- providing cool interface to CUP -- mapping all existing parameters to attributes -- trys to add new useful features to CUP, like - automatic package discovery - re-generate .java only when necessary - possibility to generate into a dest-directory my code is not perfect (in some cases it is pretty ugly :-) ), but i didn't encounter any major error until now

Method Summary
voidexecute()
executes the task parses all attributes and validates options...
StringgetDestdir()
Gets the value of destdir
StringgetExpect()
Gets the value of expect
booleangetForce()
Gets the value of force
StringgetPackage()
Gets the value of _package
StringgetParser()
Gets the value of parser
booleangetQuiet()
Gets the value of quiet
StringgetSrcfile()
Get the Srcfile value.
StringgetSymbols()
Gets the value of symbols
protected Stringinspect(String cupfile)
Let's search for package name
booleanisCompact_red()
Gets the value of compact_red
booleanisDebug()
Gets the value of debug
booleanisDump()
Gets the value of dump
booleanisDump_grammar()
Gets the value of dump_grammar
booleanisDump_states()
Gets the value of dump_states
booleanisDump_tables()
Gets the value of dump_tables
booleanisInterface()
Gets the value of _interface
booleanisNonterms()
Gets the value of nonterms
booleanisNopositions()
Gets the value of nopositions
booleanisNoscanner()
Gets the value of noscanner
booleanisNosummary()
Gets the value of nosummary
booleanisNowarn()
Gets the value of nowarn
booleanisProgress()
Gets the value of progress
booleanisTime()
Gets the value of time
voidsetCompact_red(boolean argCompact_red)
Sets the value of compact_red
voidsetDebug(boolean argDebug)
Sets the value of debug
voidsetDestdir(String destdir)
Sets the value of destdir
voidsetDump(boolean argDump)
Sets the value of dump
voidsetDump_grammar(boolean argDump_grammar)
Sets the value of dump_grammar
voidsetDump_states(boolean argDump_states)
Sets the value of dump_states
voidsetDump_tables(boolean argDump_tables)
Sets the value of dump_tables
voidsetExpect(String argExpect)
Sets the value of expect
voidsetForce(boolean argforce)
Sets the value of force
voidsetInterface(boolean arg_interface)
Sets the value of _interface
voidsetNonterms(boolean argNonterms)
Sets the value of nonterms
voidsetNopositions(boolean argNopositions)
Sets the value of nopositions
voidsetNoscanner(boolean argNoscanner)
Sets the value of noscanner
voidsetNosummary(boolean argNosummary)
Sets the value of nosummary
voidsetNowarn(boolean argNowarn)
Sets the value of nowarn
voidsetPackage(String arg_package)
Sets the value of _package
voidsetParser(String argParser)
Sets the value of parser
voidsetProgress(boolean argProgress)
Sets the value of progress
voidsetQuiet(boolean argquiet)
Sets the value of quiet
voidsetSrcfile(String newSrcfile)
Set the Srcfile value.
voidsetSymbols(String argSymbols)
Sets the value of symbols
voidsetTime(boolean argTime)
Sets the value of time

Method Detail

execute

public void execute()
executes the task parses all attributes and validates options...

getDestdir

public String getDestdir()
Gets the value of destdir

Returns: the value of destdir

getExpect

public String getExpect()
Gets the value of expect

Returns: the value of expect

getForce

public boolean getForce()
Gets the value of force

Returns: the value of force

getPackage

public String getPackage()
Gets the value of _package

Returns: the value of _package

getParser

public String getParser()
Gets the value of parser

Returns: the value of parser

getQuiet

public boolean getQuiet()
Gets the value of quiet

Returns: the value of quiet

getSrcfile

public String getSrcfile()
Get the Srcfile value.

Returns: the Srcfile value.

getSymbols

public String getSymbols()
Gets the value of symbols

Returns: the value of symbols

inspect

protected String inspect(String cupfile)
Let's search for package name

Parameters: cupfile where we have to search for the package name

Returns: the package folder structure

isCompact_red

public boolean isCompact_red()
Gets the value of compact_red

Returns: the value of compact_red

isDebug

public boolean isDebug()
Gets the value of debug

Returns: the value of debug

isDump

public boolean isDump()
Gets the value of dump

Returns: the value of dump

isDump_grammar

public boolean isDump_grammar()
Gets the value of dump_grammar

Returns: the value of dump_grammar

isDump_states

public boolean isDump_states()
Gets the value of dump_states

Returns: the value of dump_states

isDump_tables

public boolean isDump_tables()
Gets the value of dump_tables

Returns: the value of dump_tables

isInterface

public boolean isInterface()
Gets the value of _interface

Returns: the value of _interface

isNonterms

public boolean isNonterms()
Gets the value of nonterms

Returns: the value of nonterms

isNopositions

public boolean isNopositions()
Gets the value of nopositions

Returns: the value of nopositions

isNoscanner

public boolean isNoscanner()
Gets the value of noscanner

Returns: the value of noscanner

isNosummary

public boolean isNosummary()
Gets the value of nosummary

Returns: the value of nosummary

isNowarn

public boolean isNowarn()
Gets the value of nowarn

Returns: the value of nowarn

isProgress

public boolean isProgress()
Gets the value of progress

Returns: the value of progress

isTime

public boolean isTime()
Gets the value of time

Returns: the value of time

setCompact_red

public void setCompact_red(boolean argCompact_red)
Sets the value of compact_red

Parameters: argCompact_red Value to assign to this.compact_red

setDebug

public void setDebug(boolean argDebug)
Sets the value of debug

Parameters: argDebug Value to assign to this.debug

setDestdir

public void setDestdir(String destdir)
Sets the value of destdir

Parameters: arg_package Value to assign to this.destdir

setDump

public void setDump(boolean argDump)
Sets the value of dump

Parameters: argDump Value to assign to this.dump

setDump_grammar

public void setDump_grammar(boolean argDump_grammar)
Sets the value of dump_grammar

Parameters: argDump_grammar Value to assign to this.dump_grammar

setDump_states

public void setDump_states(boolean argDump_states)
Sets the value of dump_states

Parameters: argDump_states Value to assign to this.dump_states

setDump_tables

public void setDump_tables(boolean argDump_tables)
Sets the value of dump_tables

Parameters: argDump_tables Value to assign to this.dump_tables

setExpect

public void setExpect(String argExpect)
Sets the value of expect

Parameters: argExpect Value to assign to this.expect

setForce

public void setForce(boolean argforce)
Sets the value of force

Parameters: arg_package Value to assign to this.force

setInterface

public void setInterface(boolean arg_interface)
Sets the value of _interface

Parameters: arg_interface Value to assign to this._interface

setNonterms

public void setNonterms(boolean argNonterms)
Sets the value of nonterms

Parameters: argNonterms Value to assign to this.nonterms

setNopositions

public void setNopositions(boolean argNopositions)
Sets the value of nopositions

Parameters: argNopositions Value to assign to this.nopositions

setNoscanner

public void setNoscanner(boolean argNoscanner)
Sets the value of noscanner

Parameters: argNoscanner Value to assign to this.noscanner

setNosummary

public void setNosummary(boolean argNosummary)
Sets the value of nosummary

Parameters: argNosummary Value to assign to this.nosummary

setNowarn

public void setNowarn(boolean argNowarn)
Sets the value of nowarn

Parameters: argNowarn Value to assign to this.nowarn

setPackage

public void setPackage(String arg_package)
Sets the value of _package

Parameters: arg_package Value to assign to this._package

setParser

public void setParser(String argParser)
Sets the value of parser

Parameters: argParser Value to assign to this.parser

setProgress

public void setProgress(boolean argProgress)
Sets the value of progress

Parameters: argProgress Value to assign to this.progress

setQuiet

public void setQuiet(boolean argquiet)
Sets the value of quiet

Parameters: arg_quiet Value to assign to this.quiet

setSrcfile

public void setSrcfile(String newSrcfile)
Set the Srcfile value.

Parameters: newSrcfile The new Srcfile value.

setSymbols

public void setSymbols(String argSymbols)
Sets the value of symbols

Parameters: argSymbols Value to assign to this.symbols

setTime

public void setTime(boolean argTime)
Sets the value of time

Parameters: argTime Value to assign to this.time