Class ANTLR
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.optional.ANTLR
-
Field Summary
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addClasspathEntry
(String resource) Search for the given resource and add the directory or archive that contains it to the classpath.Adds a classpath to be set because a directory might be given for Antlr debug.Adds a new JVM argument.void
execute()
Execute the task.void
init()
Adds the jars or directories containing Antlr this should make the forked JVM work without having to specify it directly.protected boolean
is272()
Whether the antlr version is 2.7.2 (or higher).void
setDebug
(boolean enable) Sets a flag to enable ParseView debuggingvoid
setDiagnostic
(boolean enable) Sets a flag to emit diagnostic textvoid
The working directory of the processvoid
setFork
(boolean s) void
Sets an optional super grammar filevoid
Deprecated.since ant 1.6void
setHtml
(boolean enable) If true, emit htmlvoid
setOutputdirectory
(File outputDirectory) The directory to write the generated files to.void
The grammar file to process.void
setTrace
(boolean enable) If true, enables all tracing.void
setTraceLexer
(boolean enable) If true, enables lexer tracing.void
setTraceParser
(boolean enable) If true, enables parser tracing.void
setTraceTreeWalker
(boolean enable) Sets a flag to allow the user to enable tree walker tracingMethods 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
-
Constructor Details
-
ANTLR
public ANTLR()Constructor for ANTLR task.
-
-
Method Details
-
setTarget
The grammar file to process.- Parameters:
target
- the grammar file
-
setOutputdirectory
The directory to write the generated files to.- Parameters:
outputDirectory
- the output directory
-
setGlib
Deprecated.since ant 1.6Sets an optional super grammar file. Use setGlib(File superGrammar) instead.- Parameters:
superGrammar
- the super grammar filename
-
setGlib
Sets an optional super grammar file- Parameters:
superGrammar
- the super grammar file- Since:
- ant 1.6
-
setDebug
public void setDebug(boolean enable) Sets a flag to enable ParseView debugging- Parameters:
enable
- aboolean
value
-
setHtml
public void setHtml(boolean enable) If true, emit html- Parameters:
enable
- aboolean
value
-
setDiagnostic
public void setDiagnostic(boolean enable) Sets a flag to emit diagnostic text- Parameters:
enable
- aboolean
value
-
setTrace
public void setTrace(boolean enable) If true, enables all tracing.- Parameters:
enable
- aboolean
value
-
setTraceParser
public void setTraceParser(boolean enable) If true, enables parser tracing.- Parameters:
enable
- aboolean
value
-
setTraceLexer
public void setTraceLexer(boolean enable) If true, enables lexer tracing.- Parameters:
enable
- aboolean
value
-
setTraceTreeWalker
public void setTraceTreeWalker(boolean enable) Sets a flag to allow the user to enable tree walker tracing- Parameters:
enable
- aboolean
value
-
setFork
public void setFork(boolean s) - Parameters:
s
- aboolean
value
-
setDir
The working directory of the process- Parameters:
d
- the working directory
-
createClasspath
Adds a classpath to be set because a directory might be given for Antlr debug.- Returns:
- a path to be configured
-
createJvmarg
Adds a new JVM argument.- Returns:
- create a new JVM argument so that any argument can be passed to the JVM.
- See Also:
-
init
Adds the jars or directories containing Antlr this should make the forked JVM work without having to specify it directly.- Overrides:
init
in classTask
- Throws:
BuildException
- on error
-
addClasspathEntry
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.
- Parameters:
resource
- the resource name to search for
-
execute
Execute the task.- Overrides:
execute
in classTask
- Throws:
BuildException
- on error
-
is272
protected boolean is272()Whether the antlr version is 2.7.2 (or higher).- Returns:
- true if the version of Antlr present is 2.7.2 or later.
- Since:
- Ant 1.6
-