org.apache.tools.ant.taskdefs.optional

Class ANTLR

public class ANTLR extends Task

Invokes the ANTLR Translator generator on a grammar file.
Constructor Summary
ANTLR()
Method Summary
protected voidaddClasspathEntry(String resource)
Search for the given resource and add the directory or archive that contains it to the classpath.
PathcreateClasspath()
Adds a classpath to be set because a directory might be given for Antlr debug.
Commandline.ArgumentcreateJvmarg()
Adds a new JVM argument.
voidexecute()
voidinit()
Adds the jars or directories containing Antlr this should make the forked JVM work without having to specify it directly.
protected booleanis272()
Whether the antlr version is 2.7.2 (or higher).
voidsetDebug(boolean enable)
Sets a flag to enable ParseView debugging
voidsetDiagnostic(boolean enable)
Sets a flag to emit diagnostic text
voidsetDir(File d)
The working directory of the process
voidsetFork(boolean s)
voidsetGlib(String superGrammar)
Sets an optional super grammar file.
voidsetGlib(File superGrammar)
Sets an optional super grammar file
voidsetHtml(boolean enable)
If true, emit html
voidsetOutputdirectory(File outputDirectory)
The directory to write the generated files to.
voidsetTarget(File target)
The grammar file to process.
voidsetTrace(boolean enable)
If true, enables all tracing.
voidsetTraceLexer(boolean enable)
If true, enables lexer tracing.
voidsetTraceParser(boolean enable)
If true, enables parser tracing.
voidsetTraceTreeWalker(boolean enable)
Sets a flag to allow the user to enable tree walker tracing

Constructor Detail

ANTLR

public ANTLR()

Method Detail

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.

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.

Returns: create a new JVM argument so that any argument can be passed to the JVM.

See Also: ANTLR

execute

public void execute()

init

public void init()
Adds the jars or directories containing Antlr this should make the forked JVM work without having to specify it directly.

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

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

setFork

public void setFork(boolean s)

UNKNOWN: ignore="true"

setGlib

public void setGlib(String superGrammar)

Deprecated: since ant 1.6

Sets an optional super grammar file. Use setGlib(File superGrammar) instead.

setGlib

public void setGlib(File superGrammar)
Sets an optional super grammar file

Since: ant 1.6

setHtml

public void setHtml(boolean enable)
If true, emit html

setOutputdirectory

public void setOutputdirectory(File outputDirectory)
The directory to write the generated files to.

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
Copyright