|
Ant task for Antlr3.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.antlr.ANTLR3
public class ANTLR3
Invokes the ANTLR3 Translator generator on a grammar file.
Field Summary | |
---|---|
private java.io.ByteArrayOutputStream |
bos
captures ANTLR's output |
private org.apache.tools.ant.types.CommandlineJava |
commandline
|
private java.lang.String |
conversiontimeout
Whether to override the default conversion timeout with -Xconversiontimeout nnnn |
private boolean |
dbgST
put tags at start/stop of all templates in output |
private boolean |
debug
The debug attribute |
private boolean |
depend
depend |
private boolean |
dfa
The dfa attribute |
private boolean |
diagnostic
optional flag to print out a diagnostic file |
private org.apache.tools.ant.util.FileUtils |
fileUtils
Instance of a utility class to use for file operations. |
private boolean |
fork
fork |
private boolean |
grammarTree
print AST |
private java.io.File |
libDirectory
location of token files |
private boolean |
make
The make attribute |
private java.lang.String |
maxinlinedfastates
Set limit to max DFA states before table used rather than inlining with -Xmaxinlinedfastates m |
private java.lang.String |
messageFormatName
name of output style for messages |
private boolean |
multiThreaded
multi threaded analysis |
private boolean |
nfa
The nfa attribute |
private boolean |
nocollapse
collapse incident edges into DFA states |
private boolean |
noMergeStopStates
do not merge stop states |
private boolean |
noprune
test lookahead against EBNF block exit branches |
private java.io.File |
outputDirectory
where to output the result |
private boolean |
print
The print attribute |
private boolean |
profile
The profile attribute |
private boolean |
report
The report attribute |
private java.io.File |
superGrammar
an optional super grammar file |
private java.io.File |
target
the file to process |
private boolean |
trace
optional flag to add methods |
private boolean |
traceLexer
optional flag to add trace methods to the lexer only |
private boolean |
traceParser
optional flag to add trace methods to the parser only |
private boolean |
verbose
The verbose attribute |
private java.io.File |
workingdir
working directory |
Fields inherited from class org.apache.tools.ant.Task |
---|
taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
description, location, project |
Constructor Summary | |
---|---|
ANTLR3()
|
Method Summary | |
---|---|
private boolean |
addAntlrJarsToClasspath(java.lang.String antlrLibDir,
java.lang.String envVariable)
If the environment variable ANTLR_LIBDIR or ANTLR_HOME is defined and points to the installation directory of antlr3 then look for all antlr-*.jar and stringtemplate-*.jar files in the lib directory and add them to the classpath. |
protected void |
addClasspathEntry(java.lang.String resource,
java.lang.String msg)
Search for the given resource and add the directory or archive that contains it to the classpath. |
org.apache.tools.ant.types.Path |
createClasspath()
Adds a classpath to be set because a directory might be given for Antlr debug. |
org.apache.tools.ant.types.Commandline.Argument |
createJvmarg()
Adds a new JVM argument. |
private boolean |
dependencyCheck()
|
void |
execute()
|
java.io.File |
getOutputdirectory()
The directory to write the generated files to. |
void |
init()
Adds the jars or directories containing Antlr and associates. |
private void |
populateAttributes()
A refactored method for populating all the command line arguments based on the user-specified attributes. |
private int |
run(java.lang.String[] command,
java.io.OutputStream out,
java.io.OutputStream err)
execute in a forked VM |
void |
setConversiontimeout(java.lang.String conversiontimeoutString)
Deprecated. |
void |
setDbgST(boolean enable)
test lookahead against EBNF block exit branches |
void |
setDebug(boolean enable)
Sets a flag to enable ParseView debugging |
void |
setDepend(boolean s)
Deprecated. |
void |
setDfa(boolean enable)
Sets a flag to enable nfa generation |
void |
setDiagnostic(boolean enable)
Deprecated. |
void |
setDir(java.io.File d)
The working directory of the process |
void |
setFork(boolean s)
|
void |
setGlib(java.io.File superGrammarFile)
Deprecated. |
void |
setGrammartree(boolean enable)
Set a flag to enable printing of the grammar tree |
void |
setLibdirectory(java.io.File libDirectoryFile)
The token files output directory. |
void |
setMake(boolean enable)
Sets a flag to enable build only if generated files older than grammar |
void |
setMaxInlineDFAStates(java.lang.String maxinlinedfastatesString)
override the default limit before table used rather han inlining with -Xmaxinlinedfastates m |
void |
setMessageformat(java.lang.String name)
The output style for messages. |
void |
setMultithreaded(boolean enable)
Run the analysis multithreaded |
void |
setNfa(boolean enable)
Sets a flag to enable nfa generation |
void |
setNocollapse(boolean enable)
collapse incident edges into DFA states |
void |
setNoMergeStopStates(boolean enable)
do not merge stop states |
void |
setNoprune(boolean enable)
test lookahead against EBNF block exit branches |
void |
setOutputdirectory(java.io.File outputDirectoryFile)
The directory to write the generated files to. |
void |
setPrint(boolean enable)
Sets a flag to print out the grammar without actions |
void |
setProfile(boolean enable)
Sets a flag to enable profiling |
void |
setReport(boolean enable)
Sets a flag to enable report statistics |
void |
setTarget(java.io.File targetFile)
The grammar file to process. |
void |
setTrace(boolean enable)
If true, generate a recognizer that traces rule entry/exit. |
void |
setTraceLexer(boolean enable)
Deprecated. |
void |
setTraceParser(boolean enable)
Deprecated. |
void |
setVerbose(boolean enable)
Sets a flag to enable verbose mode |
private java.lang.String[] |
splitRightHandSide(java.lang.String fileNames,
java.lang.String pattern)
|
private void |
validateAttributes()
|
Methods inherited from class org.apache.tools.ant.Task |
---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, 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 |
Field Detail |
---|
private org.apache.tools.ant.types.CommandlineJava commandline
private java.io.File target
private java.io.File outputDirectory
private java.io.File libDirectory
private java.io.File superGrammar
private boolean depend
private boolean fork
private java.lang.String messageFormatName
private boolean diagnostic
private boolean trace
private boolean traceParser
private boolean traceLexer
private java.io.File workingdir
private java.io.ByteArrayOutputStream bos
private boolean debug
private boolean verbose
private boolean report
private boolean print
private boolean profile
private boolean nfa
private boolean dfa
private boolean make
private boolean multiThreaded
private boolean noMergeStopStates
private boolean nocollapse
private boolean noprune
private boolean dbgST
private boolean grammarTree
private org.apache.tools.ant.util.FileUtils fileUtils
private java.lang.String conversiontimeout
private java.lang.String maxinlinedfastates
Constructor Detail |
---|
public ANTLR3()
Method Detail |
---|
public void setTarget(java.io.File targetFile)
public void setOutputdirectory(java.io.File outputDirectoryFile)
public java.io.File getOutputdirectory()
public void setLibdirectory(java.io.File libDirectoryFile)
public void setMessageformat(java.lang.String name)
public void setGlib(java.io.File superGrammarFile)
public void setDebug(boolean enable)
public void setVerbose(boolean enable)
public void setReport(boolean enable)
public void setPrint(boolean enable)
public void setProfile(boolean enable)
public void setNfa(boolean enable)
public void setDfa(boolean enable)
public void setMake(boolean enable)
public void setMultithreaded(boolean enable)
enable
- public void setNoMergeStopStates(boolean enable)
enable
- public void setNocollapse(boolean enable)
enable
- public void setNoprune(boolean enable)
enable
- public void setDbgST(boolean enable)
enable
- public void setConversiontimeout(java.lang.String conversiontimeoutString)
conversiontimeoutString
- public void setMaxInlineDFAStates(java.lang.String maxinlinedfastatesString)
maxinlinedfastatesString
- public void setGrammartree(boolean enable)
public void setDepend(boolean s)
public void setDiagnostic(boolean enable)
public void setTrace(boolean enable)
public void setTraceParser(boolean enable)
public void setTraceLexer(boolean enable)
public void setFork(boolean s)
public void setDir(java.io.File d)
public org.apache.tools.ant.types.Path createClasspath()
public org.apache.tools.ant.types.Commandline.Argument createJvmarg()
setFork(boolean)
public void init() throws org.apache.tools.ant.BuildException
init
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
protected void addClasspathEntry(java.lang.String resource, java.lang.String msg)
Doesn't work for archives in JDK 1.1 as the URL returned by getResource doesn't contain the name of the archive.
private boolean addAntlrJarsToClasspath(java.lang.String antlrLibDir, java.lang.String envVariable)
public void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
private void populateAttributes()
private void validateAttributes() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
private boolean dependencyCheck() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
private java.lang.String[] splitRightHandSide(java.lang.String fileNames, java.lang.String pattern)
private int run(java.lang.String[] command, java.io.OutputStream out, java.io.OutputStream err) throws java.io.IOException
java.io.IOException
|
Ant task for Antlr3.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |