org.apache.tools.ant.antlr
Class ANTLR3

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.tools.ant.antlr.ANTLR3
All Implemented Interfaces:
java.lang.Cloneable

public class ANTLR3
extends org.apache.tools.ant.Task

Invokes the ANTLR3 Translator generator on a grammar file.


Field Summary
 
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
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.
 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.
 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
 
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
 

Constructor Detail

ANTLR3

public ANTLR3()
Method Detail

setTarget

public void setTarget(java.io.File targetFile)
The grammar file to process.


setOutputdirectory

public void setOutputdirectory(java.io.File outputDirectoryFile)
The directory to write the generated files to.


getOutputdirectory

public java.io.File getOutputdirectory()
The directory to write the generated files to.

Returns:
output directory

setLibdirectory

public void setLibdirectory(java.io.File libDirectoryFile)
The token files output directory.


setMessageformat

public void setMessageformat(java.lang.String name)
The output style for messages.


setGlib

public void setGlib(java.io.File superGrammarFile)
Deprecated. 

Sets an optional super grammar file


setDebug

public void setDebug(boolean enable)
Sets a flag to enable ParseView debugging


setVerbose

public void setVerbose(boolean enable)
Sets a flag to enable verbose mode


setReport

public void setReport(boolean enable)
Sets a flag to enable report statistics


setPrint

public void setPrint(boolean enable)
Sets a flag to print out the grammar without actions


setProfile

public void setProfile(boolean enable)
Sets a flag to enable profiling


setNfa

public void setNfa(boolean enable)
Sets a flag to enable nfa generation


setDfa

public void setDfa(boolean enable)
Sets a flag to enable nfa generation


setMake

public void setMake(boolean enable)
Sets a flag to enable build only if generated files older than grammar


setMultithreaded

public void setMultithreaded(boolean enable)
Run the analysis multithreaded

Parameters:
enable -

setNoMergeStopStates

public void setNoMergeStopStates(boolean enable)
do not merge stop states

Parameters:
enable -

setNocollapse

public void setNocollapse(boolean enable)
collapse incident edges into DFA states

Parameters:
enable -

setNoprune

public void setNoprune(boolean enable)
test lookahead against EBNF block exit branches

Parameters:
enable -

setDbgST

public void setDbgST(boolean enable)
test lookahead against EBNF block exit branches

Parameters:
enable -

setConversiontimeout

public void setConversiontimeout(java.lang.String conversiontimeoutString)
Deprecated. 

override the default conversion timeout with -Xconversiontimeout nnnn

Parameters:
conversiontimeoutString -

setMaxInlineDFAStates

public void setMaxInlineDFAStates(java.lang.String maxinlinedfastatesString)
override the default limit before table used rather han inlining with -Xmaxinlinedfastates m

Parameters:
maxinlinedfastatesString -

setGrammartree

public void setGrammartree(boolean enable)
Set a flag to enable printing of the grammar tree


setDepend

public void setDepend(boolean s)
Deprecated. 

Set a flag to enable dependency checking by ANTLR itself The depend option is always used implicitely inside the antlr3 task


setDiagnostic

public void setDiagnostic(boolean enable)
Deprecated. 

Sets a flag to emit diagnostic text


setTrace

public void setTrace(boolean enable)
If true, generate a recognizer that traces rule entry/exit.


setTraceParser

public void setTraceParser(boolean enable)
Deprecated. 

If true, enables parser tracing.


setTraceLexer

public void setTraceLexer(boolean enable)
Deprecated. 

If true, enables lexer tracing.


setFork

public void setFork(boolean s)

setDir

public void setDir(java.io.File d)
The working directory of the process


createClasspath

public org.apache.tools.ant.types.Path createClasspath()
Adds a classpath to be set because a directory might be given for Antlr debug.


createJvmarg

public org.apache.tools.ant.types.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:
setFork(boolean)

init

public void init()
          throws org.apache.tools.ant.BuildException
Adds the jars or directories containing Antlr and associates. This should make the forked JVM work without having to specify it directly.

Overrides:
init in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException

addClasspathEntry

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.

Doesn't work for archives in JDK 1.1 as the URL returned by getResource doesn't contain the name of the archive.


execute

public void execute()
             throws org.apache.tools.ant.BuildException
Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException