Google

JavaCC (Apache Ant API)

org.apache.tools.ant.taskdefs.optional.javacc
Class JavaCC


java.lang.Object

  |

  +--org.apache.tools.ant.ProjectComponent

        |

        +--org.apache.tools.ant.Task

              |

              +--org.apache.tools.ant.taskdefs.optional.javacc.JavaCC


public class JavaCC
extends Task

JavaCC compiler compiler task.

Author:
thomas.haas@softwired-inc.com
, Michael Saunders michael@amtec.com

Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
JavaCC()
           
 
Method Summary
 void execute()
          Called by the project to let the task do its work.
protected static java.io.File getArchiveFile(java.io.File home)
          Helper class to retrieve the path used to store the JavaCC.zip which is different from versions.
 void setBuildparser(boolean buildParser)
          Sets the BUILD_PARSER grammar option.
 void setBuildtokenmanager(boolean buildTokenManager)
          Sets the BUILD_TOKEN_MANAGER grammar option.
 void setCachetokens(boolean cacheTokens)
          Sets the CACHE_TOKENS grammar option.
 void setChoiceambiguitycheck(int choiceAmbiguityCheck)
          Sets the CHOICE_AMBIGUITY_CHECK grammar option.
 void setCommontokenaction(boolean commonTokenAction)
          Sets the COMMON_TOKEN_ACTION grammar option.
 void setDebuglookahead(boolean debugLookahead)
          Sets the DEBUG_LOOKAHEAD grammar option.
 void setDebugparser(boolean debugParser)
          Sets the DEBUG_PARSER grammar option.
 void setDebugtokenmanager(boolean debugTokenManager)
          Sets the DEBUG_TOKEN_MANAGER grammar option.
 void setErrorreporting(boolean errorReporting)
          Sets the ERROR_REPORTING grammar option.
 void setForcelacheck(boolean forceLACheck)
          Sets the FORCE_LA_CHECK grammar option.
 void setIgnorecase(boolean ignoreCase)
          Sets the IGNORE_CASE grammar option.
 void setJavacchome(java.io.File javaccHome)
          The directory containing the JavaCC distribution.
 void setJavaunicodeescape(boolean javaUnicodeEscape)
          Sets the JAVA_UNICODE_ESCAPE grammar option.
 void setLookahead(int lookahead)
          Sets the LOOKAHEAD grammar option.
 void setOptimizetokenmanager(boolean optimizeTokenManager)
          Sets the OPTIMIZE_TOKEN_MANAGER grammar option.
 void setOtherambiguityCheck(int otherAmbiguityCheck)
          Sets the OTHER_AMBIGUITY_CHECK grammar option.
 void setOutputdirectory(java.io.File outputDirectory)
          The directory to write the generated files to.
 void setSanitycheck(boolean sanityCheck)
          Sets the SANITY_CHECK grammar option.
 void setStatic(boolean staticParser)
          Sets the STATIC grammar option.
 void setTarget(java.io.File target)
          The grammar file to process.
 void setUnicodeinput(boolean unicodeInput)
          Sets the UNICODE_INPUT grammar option.
 void setUsercharstream(boolean userCharStream)
          Sets the USER_CHAR_STREAM grammar option.
 void setUsertokenmanager(boolean userTokenManager)
          Sets the USER_TOKEN_MANAGER grammar option.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaCC


public JavaCC()
Method Detail

setLookahead


public void setLookahead(int lookahead)
Sets the LOOKAHEAD grammar option.


setChoiceambiguitycheck


public void setChoiceambiguitycheck(int choiceAmbiguityCheck)
Sets the CHOICE_AMBIGUITY_CHECK grammar option.


setOtherambiguityCheck


public void setOtherambiguityCheck(int otherAmbiguityCheck)
Sets the OTHER_AMBIGUITY_CHECK grammar option.


setStatic


public void setStatic(boolean staticParser)
Sets the STATIC grammar option.


setDebugparser


public void setDebugparser(boolean debugParser)
Sets the DEBUG_PARSER grammar option.


setDebuglookahead


public void setDebuglookahead(boolean debugLookahead)
Sets the DEBUG_LOOKAHEAD grammar option.


setDebugtokenmanager


public void setDebugtokenmanager(boolean debugTokenManager)
Sets the DEBUG_TOKEN_MANAGER grammar option.


setOptimizetokenmanager


public void setOptimizetokenmanager(boolean optimizeTokenManager)
Sets the OPTIMIZE_TOKEN_MANAGER grammar option.


setErrorreporting


public void setErrorreporting(boolean errorReporting)
Sets the ERROR_REPORTING grammar option.


setJavaunicodeescape


public void setJavaunicodeescape(boolean javaUnicodeEscape)
Sets the JAVA_UNICODE_ESCAPE grammar option.


setUnicodeinput


public void setUnicodeinput(boolean unicodeInput)
Sets the UNICODE_INPUT grammar option.


setIgnorecase


public void setIgnorecase(boolean ignoreCase)
Sets the IGNORE_CASE grammar option.


setCommontokenaction


public void setCommontokenaction(boolean commonTokenAction)
Sets the COMMON_TOKEN_ACTION grammar option.


setUsertokenmanager


public void setUsertokenmanager(boolean userTokenManager)
Sets the USER_TOKEN_MANAGER grammar option.


setUsercharstream


public void setUsercharstream(boolean userCharStream)
Sets the USER_CHAR_STREAM grammar option.


setBuildparser


public void setBuildparser(boolean buildParser)
Sets the BUILD_PARSER grammar option.


setBuildtokenmanager


public void setBuildtokenmanager(boolean buildTokenManager)
Sets the BUILD_TOKEN_MANAGER grammar option.


setSanitycheck


public void setSanitycheck(boolean sanityCheck)
Sets the SANITY_CHECK grammar option.


setForcelacheck


public void setForcelacheck(boolean forceLACheck)
Sets the FORCE_LA_CHECK grammar option.


setCachetokens


public void setCachetokens(boolean cacheTokens)
Sets the CACHE_TOKENS grammar option.


setOutputdirectory


public void setOutputdirectory(java.io.File outputDirectory)
The directory to write the generated files to. If not set, the files are written to the directory containing the grammar file.


setTarget


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


setJavacchome


public void setJavacchome(java.io.File javaccHome)
The directory containing the JavaCC distribution.


execute


public void execute()
             throws BuildException
Description copied from class: Task
Called by the project to let the task do its work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running "ant target1 target2" will run all tasks in target3 twice.

Overrides:
execute in class Task
Throws:
BuildException - if something goes wrong with the build

getArchiveFile


protected static java.io.File getArchiveFile(java.io.File home)
                                      throws BuildException
Helper class to retrieve the path used to store the JavaCC.zip which is different from versions.

Parameters:
home - the javacc home path directory.
Returns:
the file object pointing to the JavaCC archive.
Throws:
BuildException - thrown if the home directory is invalid or if the archive could not be found despite attemps to do so.


Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.