Invokes the ANTLR Translator generator on a grammar file.
addClasspathEntry
protected void addClasspathEntry(String resource)
Search for the given resource and add the directory or archive
that contains it to the classpath.
Doesn't work for archives in JDK 1.1 as the URL returned by
getResource doesn't contain the name of the archive.
resource
- the resource name to search for
createClasspath
public Path createClasspath()
Adds a classpath to be set
because a directory might be given for Antlr debug.
createJvmarg
public Commandline.Argument createJvmarg()
Adds a new JVM argument.
- create a new JVM argument so that any argument can be passed to the JVM.
init
public void init()
throws BuildException
Adds the jars or directories containing Antlr
this should make the forked JVM work without having to
specify it directly.
- init in interface Task
is272
protected boolean is272()
Whether the antlr version is 2.7.2 (or higher).
- true if the version of Antlr present is 2.7.2 or later.
setDebug
public void setDebug(boolean enable)
Sets a flag to enable ParseView debugging
setDiagnostic
public void setDiagnostic(boolean enable)
Sets a flag to emit diagnostic text
setDir
public void setDir(File d)
The working directory of the process
d
- the working directory
setFork
public void setFork(boolean s)
setGlib
public void setGlib(File superGrammar)
Sets an optional super grammar file
superGrammar
- the super grammar file
setGlib
public void setGlib(String superGrammar)
since ant 1.6
Sets an optional super grammar file.
Use setGlib(File superGrammar) instead.
superGrammar
- the super grammar filename
setHtml
public void setHtml(boolean enable)
If true, emit html
setOutputdirectory
public void setOutputdirectory(File outputDirectory)
The directory to write the generated files to.
outputDirectory
- the output directory
setTarget
public void setTarget(File target)
The grammar file to process.
setTrace
public void setTrace(boolean enable)
If true, enables all tracing.
setTraceLexer
public void setTraceLexer(boolean enable)
If true, enables lexer tracing.
setTraceParser
public void setTraceParser(boolean enable)
If true, enables parser tracing.
setTraceTreeWalker
public void setTraceTreeWalker(boolean enable)
Sets a flag to allow the user to enable tree walker tracing