You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by jv...@locus.apache.org on 2000/09/12 03:42:19 UTC

cvs commit: jakarta-velocity/src/java/org/apache/velocity/processor/javacc/visitor CacheMode.java BaseVisitor.java DumpMode.java NoCacheMode.java

jvanzyl     00/09/11 18:42:18

  Modified:    examples test.sh test1.wm test2.wm velocity.properties
               src/java/org/apache/velocity Template.java
               src/java/org/apache/velocity/processor JavaCCProcessor.java
                        Processor.java
               src/java/org/apache/velocity/processor/javacc/parser
                        ASTAndNode.java ASTAssignment.java ASTBlock.java
                        ASTDivNode.java ASTEQNode.java
                        ASTElseIfStatement.java ASTElseStatement.java
                        ASTExpression.java ASTFalse.java
                        ASTForeachStatement.java ASTGENode.java
                        ASTGTNode.java ASTIdentifier.java
                        ASTIfStatement.java ASTIncludeStatement.java
                        ASTLENode.java ASTLTNode.java ASTMethod.java
                        ASTModNode.java ASTMulNode.java ASTNENode.java
                        ASTNotNode.java ASTOrNode.java
                        ASTParamStatement.java ASTParameter.java
                        ASTParameters.java ASTProperty.java
                        ASTPropertyMethod.java ASTReference.java
                        ASTSetStatement.java ASTStringLiteral.java
                        ASTSubtractNode.java ASTText.java ASTTrue.java
                        ASTUseStatement.java ASTVariable.java
                        ASTprocess.java Parser.java
                        ParserTreeConstants.java ParserVisitor.java
                        TokenMgrError.java
               src/java/org/apache/velocity/processor/javacc/visitor
                        BaseVisitor.java DumpMode.java NoCacheMode.java
  Added:       src/java/org/apache/velocity/processor/javacc/parser/velocity
                        JJTParserState.java Parser.java Parser.jj
                        Parser.jjt ParserConstants.java
                        ParserTokenManager.java build remove.list remove.sh
               src/java/org/apache/velocity/processor/javacc/parser/webmacro
                        JJTParserState.java Parser.java Parser.jj
                        Parser.jjt ParserConstants.java
                        ParserTokenManager.java build remove.list remove.sh
               src/java/org/apache/velocity/processor/javacc/visitor
                        CacheMode.java
  Removed:     src/java/org/apache/velocity/processor/javacc/parser
                        JJTParserState.java Parser.jj Parser.jjt
                        ParserConstants.java ParserTokenManager.java
  Log:
  - multiple syntaxes now work. you can choose what syntax you would
    like to use in the velocity.props file. look in the examples
    directory. right now there are two syntaxes: webmacro and
    velocity. the only different being the block signifiers:
    {} for velocity, and #begin/#end for webmacro. more then
    likely the block signifiers will disappear from the velocity
    syntax.
  
  Revision  Changes    Path
  1.2       +1 -1      jakarta-velocity/examples/test.sh
  
  Index: test.sh
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/examples/test.sh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- test.sh	2000/09/06 09:13:22	1.1
  +++ test.sh	2000/09/12 01:42:00	1.2
  @@ -1 +1 @@
  -java -cp .:../bin/classes Test test2.wm > output
  +java -cp .:../bin/classes Test test2.vm > output
  
  
  
  1.3       +5 -0      jakarta-velocity/examples/test1.wm
  
  Index: test1.wm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/examples/test1.wm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- test1.wm	2000/09/08 21:06:26	1.2
  +++ test1.wm	2000/09/12 01:42:01	1.3
  @@ -1 +1,6 @@
  +
  +
   $hashtable.Bar
  +
  +$provider.Title
  +
  
  
  
  1.3       +6 -2      jakarta-velocity/examples/test2.wm
  
  Index: test2.wm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/examples/test2.wm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- test2.wm	2000/09/08 21:06:26	1.2
  +++ test2.wm	2000/09/12 01:42:01	1.3
  @@ -1,6 +1,6 @@
  +<html>
  +<body>
   
  -&&
  -
   $hashtable.Bar
   
   #if (true)
  @@ -206,3 +206,7 @@
   #begin
       It still sucks!
   #end    
  +
  +
  +</body>
  +</html>
  
  
  
  1.3       +2 -1      jakarta-velocity/examples/velocity.properties
  
  Index: velocity.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/examples/velocity.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- velocity.properties	2000/09/08 21:06:26	1.2
  +++ velocity.properties	2000/09/12 01:42:01	1.3
  @@ -21,7 +21,8 @@
   # These are case sensitive
   
   template.processor = JavaCC
  -template.syntax = webmacro
  +template.syntax = velocity
  +#template.syntax = webmacro
   template.mode=NoCache
   #template.mode=Dump
   
  
  
  
  1.2       +7 -4      jakarta-velocity/src/java/org/apache/velocity/Template.java
  
  Index: Template.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/Template.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Template.java	2000/09/06 09:13:25	1.1
  +++ Template.java	2000/09/12 01:42:02	1.2
  @@ -80,7 +80,7 @@
    * template.parse();
    *
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
  - * @version $Id: Template.java,v 1.1 2000/09/06 09:13:25 jvanzyl Exp $
  + * @version $Id: Template.java,v 1.2 2000/09/12 01:42:02 jvanzyl Exp $
    */
   public class Template
   {
  @@ -93,8 +93,11 @@
       private static String MODE = Configuration.getString(MODE_PROPERTY, "");
   
       private static final String PROCESSOR_PROPERTY = "template.processor";
  -    private static String PROCESSOR_TYPE = Configuration.getString(PROCESSOR_PROPERTY, "");
  +    private static String PROCESSOR = Configuration.getString(PROCESSOR_PROPERTY, "");
   
  +    private static final String SYNTAX_PROPERTY = "template.syntax";
  +    private static String SYNTAX = Configuration.getString(SYNTAX_PROPERTY, "");
  +
       // So now, after a template is constructed all the
       // initial processing is done.
   
  @@ -108,9 +111,9 @@
           try
           {
               processor = (Processor) Class.forName(
  -                PROCESSOR_PACKAGE + "." + PROCESSOR_TYPE + "Processor").newInstance();
  +                PROCESSOR_PACKAGE + "." + PROCESSOR + "Processor").newInstance();
               
  -            processor.preParse(MODE, inputStream);
  +            processor.preParse(MODE, SYNTAX, inputStream);
           }            
           catch(Exception e)
           {
  
  
  
  1.2       +10 -4     jakarta-velocity/src/java/org/apache/velocity/processor/JavaCCProcessor.java
  
  Index: JavaCCProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/JavaCCProcessor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JavaCCProcessor.java	2000/09/06 09:13:27	1.1
  +++ JavaCCProcessor.java	2000/09/12 01:42:02	1.2
  @@ -22,17 +22,23 @@
   {
       private static final String VISITOR_PACKAGE = 
           "org.apache.velocity.processor.javacc.visitor";
  -    
  +
  +    private static final String PARSER_PACKAGE = 
  +        "org.apache.velocity.processor.javacc.parser";
  +
       private Parser parser;
       private SimpleNode root;
       private BaseVisitor visitor;
       
  -    public void preParse(String mode, InputStream inputStream)
  +    public void preParse(String mode, String syntax, InputStream inputStream)
       {
           try
           {
  -            parser = new Parser(inputStream);
  -            parser.parse();
  +            parser = (Parser) Class.forName(
  +                PARSER_PACKAGE + "." + syntax + "." + "Parser").newInstance();
  +            
  +            //parser = new Parser(inputStream);
  +            parser.parse(inputStream);
               root = parser.getRoot();
               
               visitor = (BaseVisitor) Class.forName(
  
  
  
  1.2       +1 -1      jakarta-velocity/src/java/org/apache/velocity/processor/Processor.java
  
  Index: Processor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/Processor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Processor.java	2000/09/06 09:13:27	1.1
  +++ Processor.java	2000/09/12 01:42:02	1.2
  @@ -6,6 +6,6 @@
   
   public interface Processor
   {
  -    public void preParse(String mode, InputStream inputStream);
  +    public void preParse(String mode, String syntax, InputStream inputStream);
       public void merge(Context context, Writer writer);
   }
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTAndNode.java
  
  Index: ASTAndNode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTAndNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTAndNode.java	2000/09/08 21:06:27	1.1
  +++ ASTAndNode.java	2000/09/12 01:42:04	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTAssignment.java
  
  Index: ASTAssignment.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTAssignment.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTAssignment.java	2000/09/08 21:06:27	1.1
  +++ ASTAssignment.java	2000/09/12 01:42:04	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTBlock.java
  
  Index: ASTBlock.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTBlock.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTBlock.java	2000/09/06 09:13:30	1.1
  +++ ASTBlock.java	2000/09/12 01:42:04	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTDivNode.java
  
  Index: ASTDivNode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTDivNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTDivNode.java	2000/09/08 21:06:27	1.1
  +++ ASTDivNode.java	2000/09/12 01:42:04	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTEQNode.java
  
  Index: ASTEQNode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTEQNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTEQNode.java	2000/09/08 21:06:27	1.1
  +++ ASTEQNode.java	2000/09/12 01:42:04	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTElseIfStatement.java
  
  Index: ASTElseIfStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTElseIfStatement.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTElseIfStatement.java	2000/09/06 09:13:30	1.1
  +++ ASTElseIfStatement.java	2000/09/12 01:42:04	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTElseStatement.java
  
  Index: ASTElseStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTElseStatement.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTElseStatement.java	2000/09/06 09:13:30	1.1
  +++ ASTElseStatement.java	2000/09/12 01:42:04	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTExpression.java
  
  Index: ASTExpression.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTExpression.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTExpression.java	2000/09/06 09:13:30	1.1
  +++ ASTExpression.java	2000/09/12 01:42:04	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTFalse.java
  
  Index: ASTFalse.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTFalse.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTFalse.java	2000/09/06 09:13:30	1.1
  +++ ASTFalse.java	2000/09/12 01:42:04	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTForeachStatement.java
  
  Index: ASTForeachStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTForeachStatement.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTForeachStatement.java	2000/09/06 09:13:30	1.1
  +++ ASTForeachStatement.java	2000/09/12 01:42:04	1.2
  @@ -12,7 +12,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTGENode.java
  
  Index: ASTGENode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTGENode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTGENode.java	2000/09/08 21:06:27	1.1
  +++ ASTGENode.java	2000/09/12 01:42:05	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTGTNode.java
  
  Index: ASTGTNode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTGTNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTGTNode.java	2000/09/08 21:06:27	1.1
  +++ ASTGTNode.java	2000/09/12 01:42:05	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTIdentifier.java
  
  Index: ASTIdentifier.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTIdentifier.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTIdentifier.java	2000/09/06 09:13:30	1.1
  +++ ASTIdentifier.java	2000/09/12 01:42:05	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTIfStatement.java
  
  Index: ASTIfStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTIfStatement.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTIfStatement.java	2000/09/06 09:13:30	1.1
  +++ ASTIfStatement.java	2000/09/12 01:42:05	1.2
  @@ -12,7 +12,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTIncludeStatement.java
  
  Index: ASTIncludeStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTIncludeStatement.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTIncludeStatement.java	2000/09/06 09:13:30	1.1
  +++ ASTIncludeStatement.java	2000/09/12 01:42:05	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTLENode.java
  
  Index: ASTLENode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTLENode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTLENode.java	2000/09/08 21:06:27	1.1
  +++ ASTLENode.java	2000/09/12 01:42:05	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTLTNode.java
  
  Index: ASTLTNode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTLTNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTLTNode.java	2000/09/08 21:06:27	1.1
  +++ ASTLTNode.java	2000/09/12 01:42:05	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTMethod.java
  
  Index: ASTMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTMethod.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTMethod.java	2000/09/06 09:13:30	1.1
  +++ ASTMethod.java	2000/09/12 01:42:05	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTModNode.java
  
  Index: ASTModNode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTModNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTModNode.java	2000/09/08 21:06:27	1.1
  +++ ASTModNode.java	2000/09/12 01:42:06	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTMulNode.java
  
  Index: ASTMulNode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTMulNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTMulNode.java	2000/09/08 21:06:27	1.1
  +++ ASTMulNode.java	2000/09/12 01:42:06	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTNENode.java
  
  Index: ASTNENode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTNENode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTNENode.java	2000/09/08 21:06:27	1.1
  +++ ASTNENode.java	2000/09/12 01:42:06	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTNotNode.java
  
  Index: ASTNotNode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTNotNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTNotNode.java	2000/09/08 21:06:27	1.1
  +++ ASTNotNode.java	2000/09/12 01:42:06	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTOrNode.java
  
  Index: ASTOrNode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTOrNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTOrNode.java	2000/09/08 21:06:27	1.1
  +++ ASTOrNode.java	2000/09/12 01:42:06	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTParamStatement.java
  
  Index: ASTParamStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTParamStatement.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTParamStatement.java	2000/09/06 09:13:30	1.1
  +++ ASTParamStatement.java	2000/09/12 01:42:06	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTParameter.java
  
  Index: ASTParameter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTParameter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTParameter.java	2000/09/06 09:13:30	1.1
  +++ ASTParameter.java	2000/09/12 01:42:07	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTParameters.java
  
  Index: ASTParameters.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTParameters.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTParameters.java	2000/09/06 09:13:30	1.1
  +++ ASTParameters.java	2000/09/12 01:42:07	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTProperty.java
  
  Index: ASTProperty.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTProperty.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTProperty.java	2000/09/06 09:13:30	1.1
  +++ ASTProperty.java	2000/09/12 01:42:07	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTPropertyMethod.java
  
  Index: ASTPropertyMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTPropertyMethod.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTPropertyMethod.java	2000/09/06 09:13:30	1.1
  +++ ASTPropertyMethod.java	2000/09/12 01:42:07	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTReference.java
  
  Index: ASTReference.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTReference.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTReference.java	2000/09/06 09:13:30	1.1
  +++ ASTReference.java	2000/09/12 01:42:07	1.2
  @@ -12,7 +12,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
     
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTSetStatement.java
  
  Index: ASTSetStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTSetStatement.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTSetStatement.java	2000/09/06 09:13:30	1.1
  +++ ASTSetStatement.java	2000/09/12 01:42:07	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTStringLiteral.java
  
  Index: ASTStringLiteral.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTStringLiteral.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTStringLiteral.java	2000/09/06 09:13:30	1.1
  +++ ASTStringLiteral.java	2000/09/12 01:42:07	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTSubtractNode.java
  
  Index: ASTSubtractNode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTSubtractNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTSubtractNode.java	2000/09/08 21:06:27	1.1
  +++ ASTSubtractNode.java	2000/09/12 01:42:07	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTText.java
  
  Index: ASTText.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTText.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTText.java	2000/09/06 09:13:30	1.1
  +++ ASTText.java	2000/09/12 01:42:07	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTTrue.java
  
  Index: ASTTrue.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTTrue.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTTrue.java	2000/09/06 09:13:30	1.1
  +++ ASTTrue.java	2000/09/12 01:42:07	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTUseStatement.java
  
  Index: ASTUseStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTUseStatement.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTUseStatement.java	2000/09/06 09:13:30	1.1
  +++ ASTUseStatement.java	2000/09/12 01:42:07	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTVariable.java
  
  Index: ASTVariable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTVariable.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTVariable.java	2000/09/06 09:13:30	1.1
  +++ ASTVariable.java	2000/09/12 01:42:08	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.2       +0 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTprocess.java
  
  Index: ASTprocess.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ASTprocess.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ASTprocess.java	2000/09/06 09:13:30	1.1
  +++ ASTprocess.java	2000/09/12 01:42:08	1.2
  @@ -11,7 +11,6 @@
       super(p, id);
     }
   
  -
     /** Accept the visitor. **/
     public Object jjtAccept(ParserVisitor visitor, Object data) {
       return visitor.visit(this, data);
  
  
  
  1.4       +5 -2338   jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/Parser.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Parser.java	2000/09/08 21:06:27	1.3
  +++ Parser.java	2000/09/12 01:42:08	1.4
  @@ -1,2343 +1,10 @@
  -/* Generated By:JJTree&JavaCC: Do not edit this line. Parser.java */
   package org.apache.velocity.processor.javacc.parser;
   
  -import java.io.*;
  -import java.util.*;
  +import java.io.InputStream;
   
  -/**
  - * This class is responsible for parsing a Velocity
  - * template. This class was generated by JavaCC using
  - * the JJTree extension to produce an Abstract
  - * Syntax Tree (AST) of the template.
  - *
  - * Please look at the Parser.jjt file which is
  - * what controls the generation of this class.
  - *
  - * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
  - * @version $Id: Parser.java,v 1.3 2000/09/08 21:06:27 jvanzyl Exp $
  - */
  -public class Parser/*@bgen(jjtree)*/implements ParserTreeConstants, ParserConstants {/*@bgen(jjtree)*/
  -  protected JJTParserState jjtree = new JJTParserState();
  -
  -    SimpleNode root;
  -
  -    public void parse() throws ParseException
  -    {
  -        root = process();
  -    }
  -
  -    public SimpleNode getRoot()
  -    {
  -        return root;
  -    }
  -
  -/**
  - * This method is what starts the whole parsing
  - * process. After the parsing is complete and
  - * the template has been turned into an AST,
  - * this method returns the root of AST which
  - * can subsequently be traversed by a visitor
  - * which implements the ParserVisitor interface
  - * which is generated automatically by JavaCC
  - */
  -  final public SimpleNode process() throws ParseException {
  -                        /*@bgen(jjtree) process */
  -  ASTprocess jjtn000 = new ASTprocess(this, JJTPROCESS);
  -  boolean jjtc000 = true;
  -  jjtree.openNodeScope(jjtn000);
  -    try {
  -      label_1:
  -      while (true) {
  -        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -        case DOLLAR:
  -        case DOT:
  -        case LPAREN:
  -        case RPAREN:
  -        case COMMA:
  -        case QUOTE:
  -        case UNDERSCORE:
  -        case MINUS:
  -        case PLUS:
  -        case MULTIPLY:
  -        case DIVIDE:
  -        case MODULUS:
  -        case LOGICAL_AND:
  -        case LOGICAL_OR:
  -        case LOGICAL_LT:
  -        case LOGICAL_LE:
  -        case LOGICAL_GT:
  -        case LOGICAL_GE:
  -        case LOGICAL_EQUALS:
  -        case LOGICAL_NOT_EQUALS:
  -        case LOGICAL_NOT:
  -        case EQUALS:
  -        case IN:
  -        case TRUE:
  -        case FALSE:
  -        case STRING_LITERAL:
  -        case BEGIN:
  -        case INCLUDE_DIRECTIVE:
  -        case PARSE_DIRECTIVE:
  -        case IF_DIRECTIVE:
  -        case ELSEIF_DIRECTIVE:
  -        case FOREACH_DIRECTIVE:
  -        case SET_DIRECTIVE:
  -        case PARAM_DIRECTIVE:
  -        case USE_DIRECTIVE:
  -        case STOP_DIRECTIVE:
  -        case ALPHA_CHAR:
  -        case IDENTIFIER:
  -        case DIDENTIFIER:
  -        case TEXT:
  -          ;
  -          break;
  -        default:
  -          jj_la1[0] = jj_gen;
  -          break label_1;
  -        }
  -        Statement();
  -      }
  -      jj_consume_token(0);
  -     jjtree.closeNodeScope(jjtn000, true);
  -     jjtc000 = false;
  -     {if (true) return jjtn000;}
  -    } catch (Throwable jjte000) {
  -     if (jjtc000) {
  -       jjtree.clearNodeScope(jjtn000);
  -       jjtc000 = false;
  -     } else {
  -       jjtree.popNode();
  -     }
  -     if (jjte000 instanceof RuntimeException) {
  -       {if (true) throw (RuntimeException)jjte000;}
  -     }
  -     if (jjte000 instanceof ParseException) {
  -       {if (true) throw (ParseException)jjte000;}
  -     }
  -     {if (true) throw (Error)jjte000;}
  -    } finally {
  -     if (jjtc000) {
  -       jjtree.closeNodeScope(jjtn000, true);
  -     }
  -    }
  -    throw new Error("Missing return statement in function");
  -  }
  -
  -/*
  - * Expression syntax follows.
  - */
  -  final public void Expression() throws ParseException {
  -    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -    case DIDENTIFIER:
  -      Reference();
  -      break;
  -    case TRUE:
  -      True();
  -      break;
  -    case FALSE:
  -      False();
  -      break;
  -    default:
  -      jj_la1[1] = jj_gen;
  -      if (jj_2_1(2147483647)) {
  -        Assignment();
  -      } else {
  -        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -        case LPAREN:
  -        case LOGICAL_NOT:
  -        case STRING_LITERAL:
  -        case IDENTIFIER:
  -          ConditionalOrExpression();
  -          break;
  -        default:
  -          jj_la1[2] = jj_gen;
  -          jj_consume_token(-1);
  -          throw new ParseException();
  -        }
  -      }
  -    }
  -  }
  -
  -  final public void Assignment() throws ParseException {
  -                                    /*@bgen(jjtree) #Assignment( 2) */
  -  ASTAssignment jjtn000 = new ASTAssignment(this, JJTASSIGNMENT);
  -  boolean jjtc000 = true;
  -  jjtree.openNodeScope(jjtn000);
  -    try {
  -      PrimaryExpression();
  -      jj_consume_token(EQUALS);
  -      Expression();
  -    } catch (Throwable jjte000) {
  -      if (jjtc000) {
  -        jjtree.clearNodeScope(jjtn000);
  -        jjtc000 = false;
  -      } else {
  -        jjtree.popNode();
  -      }
  -      if (jjte000 instanceof RuntimeException) {
  -        {if (true) throw (RuntimeException)jjte000;}
  -      }
  -      if (jjte000 instanceof ParseException) {
  -        {if (true) throw (ParseException)jjte000;}
  -      }
  -      {if (true) throw (Error)jjte000;}
  -    } finally {
  -      if (jjtc000) {
  -        jjtree.closeNodeScope(jjtn000,  2);
  -      }
  -    }
  -  }
  -
  -  final public void ConditionalOrExpression() throws ParseException {
  -    ConditionalAndExpression();
  -    label_2:
  -    while (true) {
  -      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -      case LOGICAL_OR:
  -        ;
  -        break;
  -      default:
  -        jj_la1[3] = jj_gen;
  -        break label_2;
  -      }
  -      jj_consume_token(LOGICAL_OR);
  -                   ASTOrNode jjtn001 = new ASTOrNode(this, JJTORNODE);
  -                   boolean jjtc001 = true;
  -                   jjtree.openNodeScope(jjtn001);
  -      try {
  -        ConditionalAndExpression();
  -      } catch (Throwable jjte001) {
  -                   if (jjtc001) {
  -                     jjtree.clearNodeScope(jjtn001);
  -                     jjtc001 = false;
  -                   } else {
  -                     jjtree.popNode();
  -                   }
  -                   if (jjte001 instanceof RuntimeException) {
  -                     {if (true) throw (RuntimeException)jjte001;}
  -                   }
  -                   if (jjte001 instanceof ParseException) {
  -                     {if (true) throw (ParseException)jjte001;}
  -                   }
  -                   {if (true) throw (Error)jjte001;}
  -      } finally {
  -                   if (jjtc001) {
  -                     jjtree.closeNodeScope(jjtn001,  2);
  -                   }
  -      }
  -    }
  -  }
  -
  -  final public void ConditionalAndExpression() throws ParseException {
  -    EqualityExpression();
  -    label_3:
  -    while (true) {
  -      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -      case LOGICAL_AND:
  -        ;
  -        break;
  -      default:
  -        jj_la1[4] = jj_gen;
  -        break label_3;
  -      }
  -      jj_consume_token(LOGICAL_AND);
  -                     ASTAndNode jjtn001 = new ASTAndNode(this, JJTANDNODE);
  -                     boolean jjtc001 = true;
  -                     jjtree.openNodeScope(jjtn001);
  -      try {
  -        EqualityExpression();
  -      } catch (Throwable jjte001) {
  -                     if (jjtc001) {
  -                       jjtree.clearNodeScope(jjtn001);
  -                       jjtc001 = false;
  -                     } else {
  -                       jjtree.popNode();
  -                     }
  -                     if (jjte001 instanceof RuntimeException) {
  -                       {if (true) throw (RuntimeException)jjte001;}
  -                     }
  -                     if (jjte001 instanceof ParseException) {
  -                       {if (true) throw (ParseException)jjte001;}
  -                     }
  -                     {if (true) throw (Error)jjte001;}
  -      } finally {
  -                     if (jjtc001) {
  -                       jjtree.closeNodeScope(jjtn001,  2);
  -                     }
  -      }
  -    }
  -  }
  -
  -/*
  -
  -void ConditionalAndExpression() #void : {}
  -{
  -  InclusiveOrExpression()
  -  ( <LOGICAL_AND>  InclusiveOrExpression() #AndNode(2) )*
  -}
  -
  -
  -void InclusiveOrExpression() #void : {}
  -{
  -  ExclusiveOrExpression()
  -  ( "|" ExclusiveOrExpression() #BitwiseOrNode(2) )*
  -}
  -
  -void ExclusiveOrExpression() #void : {}
  +public interface Parser
   {
  -  AndExpression()
  -  ( "^" AndExpression() #BitwiseXorNode(2) )*
  -}
  -
  -void AndExpression() #void : {}
  -{
  -  EqualityExpression()
  -  ( "&" EqualityExpression() #BitwiseAndNode(2) )*
  -}
  -
  -*/
  -  final public void EqualityExpression() throws ParseException {
  -    RelationalExpression();
  -    label_4:
  -    while (true) {
  -      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -      case LOGICAL_EQUALS:
  -      case LOGICAL_NOT_EQUALS:
  -        ;
  -        break;
  -      default:
  -        jj_la1[5] = jj_gen;
  -        break label_4;
  -      }
  -      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -      case LOGICAL_EQUALS:
  -        jj_consume_token(LOGICAL_EQUALS);
  -                             ASTEQNode jjtn001 = new ASTEQNode(this, JJTEQNODE);
  -                             boolean jjtc001 = true;
  -                             jjtree.openNodeScope(jjtn001);
  -        try {
  -          RelationalExpression();
  -        } catch (Throwable jjte001) {
  -                             if (jjtc001) {
  -                               jjtree.clearNodeScope(jjtn001);
  -                               jjtc001 = false;
  -                             } else {
  -                               jjtree.popNode();
  -                             }
  -                             if (jjte001 instanceof RuntimeException) {
  -                               {if (true) throw (RuntimeException)jjte001;}
  -                             }
  -                             if (jjte001 instanceof ParseException) {
  -                               {if (true) throw (ParseException)jjte001;}
  -                             }
  -                             {if (true) throw (Error)jjte001;}
  -        } finally {
  -                             if (jjtc001) {
  -                               jjtree.closeNodeScope(jjtn001,  2);
  -                             }
  -        }
  -        break;
  -      case LOGICAL_NOT_EQUALS:
  -        jj_consume_token(LOGICAL_NOT_EQUALS);
  -                                 ASTNENode jjtn002 = new ASTNENode(this, JJTNENODE);
  -                                 boolean jjtc002 = true;
  -                                 jjtree.openNodeScope(jjtn002);
  -        try {
  -          RelationalExpression();
  -        } catch (Throwable jjte002) {
  -                                 if (jjtc002) {
  -                                   jjtree.clearNodeScope(jjtn002);
  -                                   jjtc002 = false;
  -                                 } else {
  -                                   jjtree.popNode();
  -                                 }
  -                                 if (jjte002 instanceof RuntimeException) {
  -                                   {if (true) throw (RuntimeException)jjte002;}
  -                                 }
  -                                 if (jjte002 instanceof ParseException) {
  -                                   {if (true) throw (ParseException)jjte002;}
  -                                 }
  -                                 {if (true) throw (Error)jjte002;}
  -        } finally {
  -                                 if (jjtc002) {
  -                                   jjtree.closeNodeScope(jjtn002,  2);
  -                                 }
  -        }
  -        break;
  -      default:
  -        jj_la1[6] = jj_gen;
  -        jj_consume_token(-1);
  -        throw new ParseException();
  -      }
  -    }
  -  }
  -
  -  final public void RelationalExpression() throws ParseException {
  -    AdditiveExpression();
  -    label_5:
  -    while (true) {
  -      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -      case LOGICAL_LT:
  -      case LOGICAL_LE:
  -      case LOGICAL_GT:
  -      case LOGICAL_GE:
  -        ;
  -        break;
  -      default:
  -        jj_la1[7] = jj_gen;
  -        break label_5;
  -      }
  -      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -      case LOGICAL_LT:
  -        jj_consume_token(LOGICAL_LT);
  -                         ASTLTNode jjtn001 = new ASTLTNode(this, JJTLTNODE);
  -                         boolean jjtc001 = true;
  -                         jjtree.openNodeScope(jjtn001);
  -        try {
  -          AdditiveExpression();
  -        } catch (Throwable jjte001) {
  -                         if (jjtc001) {
  -                           jjtree.clearNodeScope(jjtn001);
  -                           jjtc001 = false;
  -                         } else {
  -                           jjtree.popNode();
  -                         }
  -                         if (jjte001 instanceof RuntimeException) {
  -                           {if (true) throw (RuntimeException)jjte001;}
  -                         }
  -                         if (jjte001 instanceof ParseException) {
  -                           {if (true) throw (ParseException)jjte001;}
  -                         }
  -                         {if (true) throw (Error)jjte001;}
  -        } finally {
  -                         if (jjtc001) {
  -                           jjtree.closeNodeScope(jjtn001,  2);
  -                         }
  -        }
  -        break;
  -      case LOGICAL_GT:
  -        jj_consume_token(LOGICAL_GT);
  -                         ASTGTNode jjtn002 = new ASTGTNode(this, JJTGTNODE);
  -                         boolean jjtc002 = true;
  -                         jjtree.openNodeScope(jjtn002);
  -        try {
  -          AdditiveExpression();
  -        } catch (Throwable jjte002) {
  -                         if (jjtc002) {
  -                           jjtree.clearNodeScope(jjtn002);
  -                           jjtc002 = false;
  -                         } else {
  -                           jjtree.popNode();
  -                         }
  -                         if (jjte002 instanceof RuntimeException) {
  -                           {if (true) throw (RuntimeException)jjte002;}
  -                         }
  -                         if (jjte002 instanceof ParseException) {
  -                           {if (true) throw (ParseException)jjte002;}
  -                         }
  -                         {if (true) throw (Error)jjte002;}
  -        } finally {
  -                         if (jjtc002) {
  -                           jjtree.closeNodeScope(jjtn002,  2);
  -                         }
  -        }
  -        break;
  -      case LOGICAL_LE:
  -        jj_consume_token(LOGICAL_LE);
  -                         ASTLENode jjtn003 = new ASTLENode(this, JJTLENODE);
  -                         boolean jjtc003 = true;
  -                         jjtree.openNodeScope(jjtn003);
  -        try {
  -          AdditiveExpression();
  -        } catch (Throwable jjte003) {
  -                         if (jjtc003) {
  -                           jjtree.clearNodeScope(jjtn003);
  -                           jjtc003 = false;
  -                         } else {
  -                           jjtree.popNode();
  -                         }
  -                         if (jjte003 instanceof RuntimeException) {
  -                           {if (true) throw (RuntimeException)jjte003;}
  -                         }
  -                         if (jjte003 instanceof ParseException) {
  -                           {if (true) throw (ParseException)jjte003;}
  -                         }
  -                         {if (true) throw (Error)jjte003;}
  -        } finally {
  -                         if (jjtc003) {
  -                           jjtree.closeNodeScope(jjtn003,  2);
  -                         }
  -        }
  -        break;
  -      case LOGICAL_GE:
  -        jj_consume_token(LOGICAL_GE);
  -                         ASTGENode jjtn004 = new ASTGENode(this, JJTGENODE);
  -                         boolean jjtc004 = true;
  -                         jjtree.openNodeScope(jjtn004);
  -        try {
  -          AdditiveExpression();
  -        } catch (Throwable jjte004) {
  -                         if (jjtc004) {
  -                           jjtree.clearNodeScope(jjtn004);
  -                           jjtc004 = false;
  -                         } else {
  -                           jjtree.popNode();
  -                         }
  -                         if (jjte004 instanceof RuntimeException) {
  -                           {if (true) throw (RuntimeException)jjte004;}
  -                         }
  -                         if (jjte004 instanceof ParseException) {
  -                           {if (true) throw (ParseException)jjte004;}
  -                         }
  -                         {if (true) throw (Error)jjte004;}
  -        } finally {
  -                         if (jjtc004) {
  -                           jjtree.closeNodeScope(jjtn004,  2);
  -                         }
  -        }
  -        break;
  -      default:
  -        jj_la1[8] = jj_gen;
  -        jj_consume_token(-1);
  -        throw new ParseException();
  -      }
  -    }
  -  }
  -
  -  final public void AdditiveExpression() throws ParseException {
  -    MultiplicativeExpression();
  -    label_6:
  -    while (true) {
  -      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -      case MINUS:
  -      case PLUS:
  -        ;
  -        break;
  -      default:
  -        jj_la1[9] = jj_gen;
  -        break label_6;
  -      }
  -      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -      case PLUS:
  -        jj_consume_token(PLUS);
  -                    ASTAddNode jjtn001 = new ASTAddNode(this, JJTADDNODE);
  -                    boolean jjtc001 = true;
  -                    jjtree.openNodeScope(jjtn001);
  -        try {
  -          MultiplicativeExpression();
  -        } catch (Throwable jjte001) {
  -                    if (jjtc001) {
  -                      jjtree.clearNodeScope(jjtn001);
  -                      jjtc001 = false;
  -                    } else {
  -                      jjtree.popNode();
  -                    }
  -                    if (jjte001 instanceof RuntimeException) {
  -                      {if (true) throw (RuntimeException)jjte001;}
  -                    }
  -                    if (jjte001 instanceof ParseException) {
  -                      {if (true) throw (ParseException)jjte001;}
  -                    }
  -                    {if (true) throw (Error)jjte001;}
  -        } finally {
  -                    if (jjtc001) {
  -                      jjtree.closeNodeScope(jjtn001,  2);
  -                    }
  -        }
  -        break;
  -      case MINUS:
  -        jj_consume_token(MINUS);
  -                    ASTSubtractNode jjtn002 = new ASTSubtractNode(this, JJTSUBTRACTNODE);
  -                    boolean jjtc002 = true;
  -                    jjtree.openNodeScope(jjtn002);
  -        try {
  -          MultiplicativeExpression();
  -        } catch (Throwable jjte002) {
  -                    if (jjtc002) {
  -                      jjtree.clearNodeScope(jjtn002);
  -                      jjtc002 = false;
  -                    } else {
  -                      jjtree.popNode();
  -                    }
  -                    if (jjte002 instanceof RuntimeException) {
  -                      {if (true) throw (RuntimeException)jjte002;}
  -                    }
  -                    if (jjte002 instanceof ParseException) {
  -                      {if (true) throw (ParseException)jjte002;}
  -                    }
  -                    {if (true) throw (Error)jjte002;}
  -        } finally {
  -                    if (jjtc002) {
  -                      jjtree.closeNodeScope(jjtn002,  2);
  -                    }
  -        }
  -        break;
  -      default:
  -        jj_la1[10] = jj_gen;
  -        jj_consume_token(-1);
  -        throw new ParseException();
  -      }
  -    }
  -  }
  -
  -  final public void MultiplicativeExpression() throws ParseException {
  -    UnaryExpression();
  -    label_7:
  -    while (true) {
  -      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -      case MULTIPLY:
  -      case DIVIDE:
  -      case MODULUS:
  -        ;
  -        break;
  -      default:
  -        jj_la1[11] = jj_gen;
  -        break label_7;
  -      }
  -      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -      case MULTIPLY:
  -        jj_consume_token(MULTIPLY);
  -                  ASTMulNode jjtn001 = new ASTMulNode(this, JJTMULNODE);
  -                  boolean jjtc001 = true;
  -                  jjtree.openNodeScope(jjtn001);
  -        try {
  -          UnaryExpression();
  -        } catch (Throwable jjte001) {
  -                  if (jjtc001) {
  -                    jjtree.clearNodeScope(jjtn001);
  -                    jjtc001 = false;
  -                  } else {
  -                    jjtree.popNode();
  -                  }
  -                  if (jjte001 instanceof RuntimeException) {
  -                    {if (true) throw (RuntimeException)jjte001;}
  -                  }
  -                  if (jjte001 instanceof ParseException) {
  -                    {if (true) throw (ParseException)jjte001;}
  -                  }
  -                  {if (true) throw (Error)jjte001;}
  -        } finally {
  -                  if (jjtc001) {
  -                    jjtree.closeNodeScope(jjtn001,  2);
  -                  }
  -        }
  -        break;
  -      case DIVIDE:
  -        jj_consume_token(DIVIDE);
  -                  ASTDivNode jjtn002 = new ASTDivNode(this, JJTDIVNODE);
  -                  boolean jjtc002 = true;
  -                  jjtree.openNodeScope(jjtn002);
  -        try {
  -          UnaryExpression();
  -        } catch (Throwable jjte002) {
  -                  if (jjtc002) {
  -                    jjtree.clearNodeScope(jjtn002);
  -                    jjtc002 = false;
  -                  } else {
  -                    jjtree.popNode();
  -                  }
  -                  if (jjte002 instanceof RuntimeException) {
  -                    {if (true) throw (RuntimeException)jjte002;}
  -                  }
  -                  if (jjte002 instanceof ParseException) {
  -                    {if (true) throw (ParseException)jjte002;}
  -                  }
  -                  {if (true) throw (Error)jjte002;}
  -        } finally {
  -                  if (jjtc002) {
  -                    jjtree.closeNodeScope(jjtn002,  2);
  -                  }
  -        }
  -        break;
  -      case MODULUS:
  -        jj_consume_token(MODULUS);
  -                  ASTModNode jjtn003 = new ASTModNode(this, JJTMODNODE);
  -                  boolean jjtc003 = true;
  -                  jjtree.openNodeScope(jjtn003);
  -        try {
  -          UnaryExpression();
  -        } catch (Throwable jjte003) {
  -                  if (jjtc003) {
  -                    jjtree.clearNodeScope(jjtn003);
  -                    jjtc003 = false;
  -                  } else {
  -                    jjtree.popNode();
  -                  }
  -                  if (jjte003 instanceof RuntimeException) {
  -                    {if (true) throw (RuntimeException)jjte003;}
  -                  }
  -                  if (jjte003 instanceof ParseException) {
  -                    {if (true) throw (ParseException)jjte003;}
  -                  }
  -                  {if (true) throw (Error)jjte003;}
  -        } finally {
  -                  if (jjtc003) {
  -                    jjtree.closeNodeScope(jjtn003,  2);
  -                  }
  -        }
  -        break;
  -      default:
  -        jj_la1[12] = jj_gen;
  -        jj_consume_token(-1);
  -        throw new ParseException();
  -      }
  -    }
  -  }
  -
  -  final public void UnaryExpression() throws ParseException {
  -    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -    case LOGICAL_NOT:
  -      jj_consume_token(LOGICAL_NOT);
  -                    ASTNotNode jjtn001 = new ASTNotNode(this, JJTNOTNODE);
  -                    boolean jjtc001 = true;
  -                    jjtree.openNodeScope(jjtn001);
  -      try {
  -        UnaryExpression();
  -      } catch (Throwable jjte001) {
  -                    if (jjtc001) {
  -                      jjtree.clearNodeScope(jjtn001);
  -                      jjtc001 = false;
  -                    } else {
  -                      jjtree.popNode();
  -                    }
  -                    if (jjte001 instanceof RuntimeException) {
  -                      {if (true) throw (RuntimeException)jjte001;}
  -                    }
  -                    if (jjte001 instanceof ParseException) {
  -                      {if (true) throw (ParseException)jjte001;}
  -                    }
  -                    {if (true) throw (Error)jjte001;}
  -      } finally {
  -                    if (jjtc001) {
  -                      jjtree.closeNodeScope(jjtn001,  1);
  -                    }
  -      }
  -      break;
  -    case LPAREN:
  -    case STRING_LITERAL:
  -    case IDENTIFIER:
  -      PrimaryExpression();
  -      break;
  -    default:
  -      jj_la1[13] = jj_gen;
  -      jj_consume_token(-1);
  -      throw new ParseException();
  -    }
  -  }
  -
  -  final public void PrimaryExpression() throws ParseException {
  -    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -    case STRING_LITERAL:
  -      StringLiteral();
  -      break;
  -    case IDENTIFIER:
  -      Identifier();
  -      break;
  -    case LPAREN:
  -      jj_consume_token(LPAREN);
  -      Expression();
  -      jj_consume_token(RPAREN);
  -      break;
  -    default:
  -      jj_la1[14] = jj_gen;
  -      jj_consume_token(-1);
  -      throw new ParseException();
  -    }
  -  }
  -
  -/**
  - * These are the types of statements that
  - * are acceptable in Velocity templates.
  - * I have not found that the order here
  - * matters much. Someone please correct
  - * me here if I'm wrong.
  - */
  -  final public void Statement() throws ParseException {
  -    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -    case DOLLAR:
  -    case DOT:
  -    case LPAREN:
  -    case RPAREN:
  -    case COMMA:
  -    case QUOTE:
  -    case UNDERSCORE:
  -    case MINUS:
  -    case PLUS:
  -    case MULTIPLY:
  -    case DIVIDE:
  -    case MODULUS:
  -    case LOGICAL_AND:
  -    case LOGICAL_OR:
  -    case LOGICAL_LT:
  -    case LOGICAL_LE:
  -    case LOGICAL_GT:
  -    case LOGICAL_GE:
  -    case LOGICAL_EQUALS:
  -    case LOGICAL_NOT_EQUALS:
  -    case LOGICAL_NOT:
  -    case EQUALS:
  -    case IN:
  -    case TRUE:
  -    case FALSE:
  -    case STRING_LITERAL:
  -    case ALPHA_CHAR:
  -    case IDENTIFIER:
  -    case TEXT:
  -      Text();
  -      break;
  -    case BEGIN:
  -      Block();
  -      break;
  -    case IF_DIRECTIVE:
  -      IfStatement();
  -      break;
  -    case ELSEIF_DIRECTIVE:
  -      ElseIfStatement();
  -      break;
  -    case FOREACH_DIRECTIVE:
  -      ForeachStatement();
  -      break;
  -    case INCLUDE_DIRECTIVE:
  -      IncludeStatement();
  -      break;
  -    case SET_DIRECTIVE:
  -      SetStatement();
  -      break;
  -    case PARSE_DIRECTIVE:
  -      ParseStatement();
  -      break;
  -    case USE_DIRECTIVE:
  -      UseStatement();
  -      break;
  -    case PARAM_DIRECTIVE:
  -      ParamStatement();
  -      break;
  -    case STOP_DIRECTIVE:
  -      StopStatement();
  -      break;
  -    case DIDENTIFIER:
  -      Reference();
  -      break;
  -    default:
  -      jj_la1[15] = jj_gen;
  -      jj_consume_token(-1);
  -      throw new ParseException();
  -    }
  -  }
  -
  -  final public void StringLiteral() throws ParseException {
  -                        /*@bgen(jjtree) StringLiteral */
  -  ASTStringLiteral jjtn000 = new ASTStringLiteral(this, JJTSTRINGLITERAL);
  -  boolean jjtc000 = true;
  -  jjtree.openNodeScope(jjtn000);
  -    try {
  -      jj_consume_token(STRING_LITERAL);
  -    } finally {
  -      if (jjtc000) {
  -        jjtree.closeNodeScope(jjtn000, true);
  -      }
  -    }
  -  }
  -
  -/**
  - * This method corresponds to variable
  - * references in Velocity templates.
  - * The following are examples of variable
  - * references that may be found in a
  - * template:
  - *
  - * $foo
  - * $bar
  - *
  - */
  -  final public void Identifier() throws ParseException {
  -                     /*@bgen(jjtree) Identifier */
  -  ASTIdentifier jjtn000 = new ASTIdentifier(this, JJTIDENTIFIER);
  -  boolean jjtc000 = true;
  -  jjtree.openNodeScope(jjtn000);
  -    try {
  -      jj_consume_token(IDENTIFIER);
  -    } finally {
  -      if (jjtc000) {
  -        jjtree.closeNodeScope(jjtn000, true);
  -      }
  -    }
  -  }
  -
  -/**
  - * This method has yet to be fully implemented
  - * but will allow arbitrarily nested method
  - * calls
  - */
  -  final public void Parameter() throws ParseException {
  -    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -    case DIDENTIFIER:
  -      Reference();
  -      break;
  -    case STRING_LITERAL:
  -      StringLiteral();
  -      break;
  -    default:
  -      jj_la1[16] = jj_gen;
  -      jj_consume_token(-1);
  -      throw new ParseException();
  -    }
  -  }
  -
  -/**
  - * This method has yet to be fully implemented
  - * but will allow arbitrarily nested method
  - * calls
  - */
  -  final public void Method() throws ParseException {
  -                 /*@bgen(jjtree) Method */
  -  ASTMethod jjtn000 = new ASTMethod(this, JJTMETHOD);
  -  boolean jjtc000 = true;
  -  jjtree.openNodeScope(jjtn000);
  -    try {
  -      Identifier();
  -      jj_consume_token(LPAREN);
  -      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -      case STRING_LITERAL:
  -      case DIDENTIFIER:
  -        Parameter();
  -        label_8:
  -        while (true) {
  -          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -          case COMMA:
  -            ;
  -            break;
  -          default:
  -            jj_la1[17] = jj_gen;
  -            break label_8;
  -          }
  -          jj_consume_token(COMMA);
  -          Parameter();
  -        }
  -        break;
  -      default:
  -        jj_la1[18] = jj_gen;
  -        ;
  -      }
  -      jj_consume_token(RPAREN);
  -    } catch (Throwable jjte000) {
  -      if (jjtc000) {
  -        jjtree.clearNodeScope(jjtn000);
  -        jjtc000 = false;
  -      } else {
  -        jjtree.popNode();
  -      }
  -      if (jjte000 instanceof RuntimeException) {
  -        {if (true) throw (RuntimeException)jjte000;}
  -      }
  -      if (jjte000 instanceof ParseException) {
  -        {if (true) throw (ParseException)jjte000;}
  -      }
  -      {if (true) throw (Error)jjte000;}
  -    } finally {
  -      if (jjtc000) {
  -        jjtree.closeNodeScope(jjtn000, true);
  -      }
  -    }
  -  }
  -
  -  final public void Reference() throws ParseException {
  -                    /*@bgen(jjtree) Reference */
  -  ASTReference jjtn000 = new ASTReference(this, JJTREFERENCE);
  -  boolean jjtc000 = true;
  -  jjtree.openNodeScope(jjtn000);
  -    try {
  -      jj_consume_token(DIDENTIFIER);
  -      label_9:
  -      while (true) {
  -        if (jj_2_2(2)) {
  -          ;
  -        } else {
  -          break label_9;
  -        }
  -        jj_consume_token(DOT);
  -        if (jj_2_3(3)) {
  -          Method();
  -        } else {
  -          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -          case IDENTIFIER:
  -            Identifier();
  -            break;
  -          default:
  -            jj_la1[19] = jj_gen;
  -            jj_consume_token(-1);
  -            throw new ParseException();
  -          }
  -        }
  -      }
  -    } catch (Throwable jjte000) {
  -      if (jjtc000) {
  -        jjtree.clearNodeScope(jjtn000);
  -        jjtc000 = false;
  -      } else {
  -        jjtree.popNode();
  -      }
  -      if (jjte000 instanceof RuntimeException) {
  -        {if (true) throw (RuntimeException)jjte000;}
  -      }
  -      if (jjte000 instanceof ParseException) {
  -        {if (true) throw (ParseException)jjte000;}
  -      }
  -      {if (true) throw (Error)jjte000;}
  -    } finally {
  -      if (jjtc000) {
  -        jjtree.closeNodeScope(jjtn000, true);
  -      }
  -    }
  -  }
  -
  -  final public void True() throws ParseException {
  -               /*@bgen(jjtree) True */
  -  ASTTrue jjtn000 = new ASTTrue(this, JJTTRUE);
  -  boolean jjtc000 = true;
  -  jjtree.openNodeScope(jjtn000);
  -    try {
  -      jj_consume_token(TRUE);
  -    } finally {
  -      if (jjtc000) {
  -        jjtree.closeNodeScope(jjtn000, true);
  -      }
  -    }
  -  }
  -
  -  final public void False() throws ParseException {
  -                /*@bgen(jjtree) False */
  -  ASTFalse jjtn000 = new ASTFalse(this, JJTFALSE);
  -  boolean jjtc000 = true;
  -  jjtree.openNodeScope(jjtn000);
  -    try {
  -      jj_consume_token(FALSE);
  -    } finally {
  -      if (jjtc000) {
  -        jjtree.closeNodeScope(jjtn000, true);
  -      }
  -    }
  -  }
  -
  -/*
  -void Expression() : {}
  -{
  -    Reference() | True() | False()
  -}
  -*/
  -
  -/**
  - * This method corresponds to a block in
  - * a Velocity template. Blocks are
  - * currently associated with:
  - *
  - * #if
  - * #foreach
  - * #while (not implemented)
  - *
  - */
  -  final public void Block() throws ParseException {
  -                /*@bgen(jjtree) Block */
  -  ASTBlock jjtn000 = new ASTBlock(this, JJTBLOCK);
  -  boolean jjtc000 = true;
  -  jjtree.openNodeScope(jjtn000);
  -    try {
  -      jj_consume_token(BEGIN);
  -      label_10:
  -      while (true) {
  -        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -        case DOLLAR:
  -        case DOT:
  -        case LPAREN:
  -        case RPAREN:
  -        case COMMA:
  -        case QUOTE:
  -        case UNDERSCORE:
  -        case MINUS:
  -        case PLUS:
  -        case MULTIPLY:
  -        case DIVIDE:
  -        case MODULUS:
  -        case LOGICAL_AND:
  -        case LOGICAL_OR:
  -        case LOGICAL_LT:
  -        case LOGICAL_LE:
  -        case LOGICAL_GT:
  -        case LOGICAL_GE:
  -        case LOGICAL_EQUALS:
  -        case LOGICAL_NOT_EQUALS:
  -        case LOGICAL_NOT:
  -        case EQUALS:
  -        case IN:
  -        case TRUE:
  -        case FALSE:
  -        case STRING_LITERAL:
  -        case BEGIN:
  -        case INCLUDE_DIRECTIVE:
  -        case PARSE_DIRECTIVE:
  -        case IF_DIRECTIVE:
  -        case ELSEIF_DIRECTIVE:
  -        case FOREACH_DIRECTIVE:
  -        case SET_DIRECTIVE:
  -        case PARAM_DIRECTIVE:
  -        case USE_DIRECTIVE:
  -        case STOP_DIRECTIVE:
  -        case ALPHA_CHAR:
  -        case IDENTIFIER:
  -        case DIDENTIFIER:
  -        case TEXT:
  -          ;
  -          break;
  -        default:
  -          jj_la1[20] = jj_gen;
  -          break label_10;
  -        }
  -        Statement();
  -      }
  -      jj_consume_token(END);
  -    } catch (Throwable jjte000) {
  -      if (jjtc000) {
  -        jjtree.clearNodeScope(jjtn000);
  -        jjtc000 = false;
  -      } else {
  -        jjtree.popNode();
  -      }
  -      if (jjte000 instanceof RuntimeException) {
  -        {if (true) throw (RuntimeException)jjte000;}
  -      }
  -      if (jjte000 instanceof ParseException) {
  -        {if (true) throw (ParseException)jjte000;}
  -      }
  -      {if (true) throw (Error)jjte000;}
  -    } finally {
  -      if (jjtc000) {
  -        jjtree.closeNodeScope(jjtn000, true);
  -      }
  -    }
  -  }
  -
  -/**
  - * This method is responsible for allowing
  - * all non-grammar text to pass through
  - * unscathed.
  - */
  -  final public void Text() throws ParseException {
  -               /*@bgen(jjtree) Text */
  -  ASTText jjtn000 = new ASTText(this, JJTTEXT);
  -  boolean jjtc000 = true;
  -  jjtree.openNodeScope(jjtn000);
  -    try {
  -      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -      case TEXT:
  -        jj_consume_token(TEXT);
  -        break;
  -      case ALPHA_CHAR:
  -        jj_consume_token(ALPHA_CHAR);
  -        break;
  -      case IDENTIFIER:
  -        jj_consume_token(IDENTIFIER);
  -        break;
  -      case DOLLAR:
  -        jj_consume_token(DOLLAR);
  -        break;
  -      case DOT:
  -        jj_consume_token(DOT);
  -        break;
  -      case LPAREN:
  -        jj_consume_token(LPAREN);
  -        break;
  -      case RPAREN:
  -        jj_consume_token(RPAREN);
  -        break;
  -      case COMMA:
  -        jj_consume_token(COMMA);
  -        break;
  -      case QUOTE:
  -        jj_consume_token(QUOTE);
  -        break;
  -      case MINUS:
  -        jj_consume_token(MINUS);
  -        break;
  -      case PLUS:
  -        jj_consume_token(PLUS);
  -        break;
  -      case MULTIPLY:
  -        jj_consume_token(MULTIPLY);
  -        break;
  -      case DIVIDE:
  -        jj_consume_token(DIVIDE);
  -        break;
  -      case MODULUS:
  -        jj_consume_token(MODULUS);
  -        break;
  -      case UNDERSCORE:
  -        jj_consume_token(UNDERSCORE);
  -        break;
  -      case EQUALS:
  -        jj_consume_token(EQUALS);
  -        break;
  -      case IN:
  -        jj_consume_token(IN);
  -        break;
  -      case TRUE:
  -        jj_consume_token(TRUE);
  -        break;
  -      case FALSE:
  -        jj_consume_token(FALSE);
  -        break;
  -      case STRING_LITERAL:
  -        jj_consume_token(STRING_LITERAL);
  -        break;
  -      case LOGICAL_AND:
  -        jj_consume_token(LOGICAL_AND);
  -        break;
  -      case LOGICAL_OR:
  -        jj_consume_token(LOGICAL_OR);
  -        break;
  -      case LOGICAL_LT:
  -        jj_consume_token(LOGICAL_LT);
  -        break;
  -      case LOGICAL_LE:
  -        jj_consume_token(LOGICAL_LE);
  -        break;
  -      case LOGICAL_GT:
  -        jj_consume_token(LOGICAL_GT);
  -        break;
  -      case LOGICAL_GE:
  -        jj_consume_token(LOGICAL_GE);
  -        break;
  -      case LOGICAL_EQUALS:
  -        jj_consume_token(LOGICAL_EQUALS);
  -        break;
  -      case LOGICAL_NOT_EQUALS:
  -        jj_consume_token(LOGICAL_NOT_EQUALS);
  -        break;
  -      case LOGICAL_NOT:
  -        jj_consume_token(LOGICAL_NOT);
  -        break;
  -      default:
  -        jj_la1[21] = jj_gen;
  -        jj_consume_token(-1);
  -        throw new ParseException();
  -      }
  -    } finally {
  -      if (jjtc000) {
  -        jjtree.closeNodeScope(jjtn000, true);
  -      }
  -    }
  -  }
  -
  -/**
  - * This method corresponds to an #if directive
  - * in a Velocity template. The following are
  - * examples if #if constructs that are
  - * acceptable in a template:
  - *
  - * #if ($customer.owesMoney() && $customer.Name == "Fred") (not implemented)
  - * {
  - *     Pay up, or else!
  - * }
  - * #else
  - * {
  - *     Thankyou for your patronage.
  - * }
  - *
  - * #if ($dynanmicContent)
  - * {
  - *     This is our $dynamicContent
  - * }
  - *
  - * #if ($customer.owesMoney())
  - * {
  - *     You better pay up!
  - * }
  - *
  - */
  -  final public void IfStatement() throws ParseException {
  -                      /*@bgen(jjtree) IfStatement */
  -  ASTIfStatement jjtn000 = new ASTIfStatement(this, JJTIFSTATEMENT);
  -  boolean jjtc000 = true;
  -  jjtree.openNodeScope(jjtn000);
  -    try {
  -      jj_consume_token(IF_DIRECTIVE);
  -      jj_consume_token(LPAREN);
  -      Expression();
  -      jj_consume_token(RPAREN);
  -      Statement();
  -      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -      case ELSE_DIRECTIVE:
  -        ElseStatement();
  -        break;
  -      default:
  -        jj_la1[22] = jj_gen;
  -        ;
  -      }
  -    } catch (Throwable jjte000) {
  -    if (jjtc000) {
  -      jjtree.clearNodeScope(jjtn000);
  -      jjtc000 = false;
  -    } else {
  -      jjtree.popNode();
  -    }
  -    if (jjte000 instanceof RuntimeException) {
  -      {if (true) throw (RuntimeException)jjte000;}
  -    }
  -    if (jjte000 instanceof ParseException) {
  -      {if (true) throw (ParseException)jjte000;}
  -    }
  -    {if (true) throw (Error)jjte000;}
  -    } finally {
  -    if (jjtc000) {
  -      jjtree.closeNodeScope(jjtn000, true);
  -    }
  -    }
  -  }
  -
  -  final public void ElseStatement() throws ParseException {
  -                        /*@bgen(jjtree) ElseStatement */
  -  ASTElseStatement jjtn000 = new ASTElseStatement(this, JJTELSESTATEMENT);
  -  boolean jjtc000 = true;
  -  jjtree.openNodeScope(jjtn000);
  -    try {
  -      jj_consume_token(ELSE_DIRECTIVE);
  -      Statement();
  -    } catch (Throwable jjte000) {
  -      if (jjtc000) {
  -        jjtree.clearNodeScope(jjtn000);
  -        jjtc000 = false;
  -      } else {
  -        jjtree.popNode();
  -      }
  -      if (jjte000 instanceof RuntimeException) {
  -        {if (true) throw (RuntimeException)jjte000;}
  -      }
  -      if (jjte000 instanceof ParseException) {
  -        {if (true) throw (ParseException)jjte000;}
  -      }
  -      {if (true) throw (Error)jjte000;}
  -    } finally {
  -      if (jjtc000) {
  -        jjtree.closeNodeScope(jjtn000, true);
  -      }
  -    }
  -  }
  -
  -  final public void ElseIfStatement() throws ParseException {
  -                          /*@bgen(jjtree) ElseIfStatement */
  -  ASTElseIfStatement jjtn000 = new ASTElseIfStatement(this, JJTELSEIFSTATEMENT);
  -  boolean jjtc000 = true;
  -  jjtree.openNodeScope(jjtn000);
  -    try {
  -      jj_consume_token(ELSEIF_DIRECTIVE);
  -      jj_consume_token(LPAREN);
  -      Expression();
  -      jj_consume_token(RPAREN);
  -      Statement();
  -      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -      case ELSE_DIRECTIVE:
  -        ElseStatement();
  -        break;
  -      default:
  -        jj_la1[23] = jj_gen;
  -        ;
  -      }
  -    } catch (Throwable jjte000) {
  -    if (jjtc000) {
  -      jjtree.clearNodeScope(jjtn000);
  -      jjtc000 = false;
  -    } else {
  -      jjtree.popNode();
  -    }
  -    if (jjte000 instanceof RuntimeException) {
  -      {if (true) throw (RuntimeException)jjte000;}
  -    }
  -    if (jjte000 instanceof ParseException) {
  -      {if (true) throw (ParseException)jjte000;}
  -    }
  -    {if (true) throw (Error)jjte000;}
  -    } finally {
  -    if (jjtc000) {
  -      jjtree.closeNodeScope(jjtn000, true);
  -    }
  -    }
  -  }
  -
  -/**
  - * This method corresponds to a #foreach
  - * directive in a Velocity template. The
  - * following are examples of #foreach
  - * constructs that are acceptable in
  - * a template:
  - *
  - * #foreach $element in $list
  - * {
  - *     This is the fifth $element
  - * }
  - *
  - * #foreach $element in $foo.List
  - * {
  - *     This is the fifth $element
  - * }
  - *
  - * #foreach $element in $foo.getList()
  - * {
  - *     This is the fifth $element
  - * }
  - *
  - */
  -  final public void ForeachStatement() throws ParseException {
  -                           /*@bgen(jjtree) ForeachStatement */
  -  ASTForeachStatement jjtn000 = new ASTForeachStatement(this, JJTFOREACHSTATEMENT);
  -  boolean jjtc000 = true;
  -  jjtree.openNodeScope(jjtn000);
  -    try {
  -      jj_consume_token(FOREACH_DIRECTIVE);
  -      Reference();
  -      jj_consume_token(IN);
  -      Reference();
  -      Statement();
  -    } catch (Throwable jjte000) {
  -    if (jjtc000) {
  -      jjtree.clearNodeScope(jjtn000);
  -      jjtc000 = false;
  -    } else {
  -      jjtree.popNode();
  -    }
  -    if (jjte000 instanceof RuntimeException) {
  -      {if (true) throw (RuntimeException)jjte000;}
  -    }
  -    if (jjte000 instanceof ParseException) {
  -      {if (true) throw (ParseException)jjte000;}
  -    }
  -    {if (true) throw (Error)jjte000;}
  -    } finally {
  -    if (jjtc000) {
  -      jjtree.closeNodeScope(jjtn000, true);
  -    }
  -    }
  -  }
  -
  -/**
  - * This method corresponds to an #include
  - * directive in a Velocity template. The
  - * following are examples of #include
  - * constructs that are acceptable in
  - * a template:
  - *
  - * #include "foo.inc" 
  - */
  -  final public void IncludeStatement() throws ParseException {
  -    jj_consume_token(INCLUDE_DIRECTIVE);
  -    jj_consume_token(STRING_LITERAL);
  -  }
  -
  -/**
  - * This method corresponds to a #set
  - * directive in a Velocity template. The
  - * following are examples of #set
  - * constructs that are acceptable in
  - * a template:
  - *
  - * #set name = "Fred"
  - * #set $Customer.Name = "Sidney"
  - * #set $Database.findItem($partNum).Description = $newDescription (not implemented)
  - *
  - */
  -  final public void SetStatement() throws ParseException {
  -                       /*@bgen(jjtree) SetStatement */
  -  ASTSetStatement jjtn000 = new ASTSetStatement(this, JJTSETSTATEMENT);
  -  boolean jjtc000 = true;
  -  jjtree.openNodeScope(jjtn000);
  -    try {
  -      jj_consume_token(SET_DIRECTIVE);
  -      Reference();
  -      jj_consume_token(EQUALS);
  -      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -      case STRING_LITERAL:
  -        StringLiteral();
  -        break;
  -      case DIDENTIFIER:
  -        Reference();
  -        break;
  -      case TRUE:
  -        True();
  -        break;
  -      case FALSE:
  -        False();
  -        break;
  -      default:
  -        jj_la1[24] = jj_gen;
  -        jj_consume_token(-1);
  -        throw new ParseException();
  -      }
  -    } catch (Throwable jjte000) {
  -    if (jjtc000) {
  -      jjtree.clearNodeScope(jjtn000);
  -      jjtc000 = false;
  -    } else {
  -      jjtree.popNode();
  -    }
  -    if (jjte000 instanceof RuntimeException) {
  -      {if (true) throw (RuntimeException)jjte000;}
  -    }
  -    if (jjte000 instanceof ParseException) {
  -      {if (true) throw (ParseException)jjte000;}
  -    }
  -    {if (true) throw (Error)jjte000;}
  -    } finally {
  -    if (jjtc000) {
  -      jjtree.closeNodeScope(jjtn000, true);
  -    }
  -    }
  -  }
  -
  -/**
  - * This method corresponds to a #parse
  - * directive in a Velocity template. The
  - * following are examples of #parse
  - * constructs that are acceptable in
  - * a template:
  - *
  - * #parse "bar.vt"
  - */
  -  final public void ParseStatement() throws ParseException {
  -    jj_consume_token(PARSE_DIRECTIVE);
  -    jj_consume_token(STRING_LITERAL);
  -  }
  -
  -/**
  - * This method corresponds to a #use
  - * directive in a Velocity template. The
  - * following are examples of #use
  - * constructs that are acceptable in
  - * a template:
  - *
  - * This has not been implemented and may
  - * not need to be because the Velocity
  - * parser doesn't have any problem with
  - * normal text that isn't part of Velocity's
  - * grammar.
  - *
  - */
  -  final public void UseStatement() throws ParseException {
  -                       /*@bgen(jjtree) UseStatement */
  -  ASTUseStatement jjtn000 = new ASTUseStatement(this, JJTUSESTATEMENT);
  -  boolean jjtc000 = true;
  -  jjtree.openNodeScope(jjtn000);
  -    try {
  -      jj_consume_token(USE_DIRECTIVE);
  -    } finally {
  -    if (jjtc000) {
  -      jjtree.closeNodeScope(jjtn000, true);
  -    }
  -    }
  -  }
  -
  -/**
  - * This method corresponds to a #param
  - * directive in a Velocity template. The
  - * following are examples of #param
  - * constructs that are acceptable in
  - * a template:
  - *
  - * #param $language = "en"
  - *
  - */
  -  final public void ParamStatement() throws ParseException {
  -                         /*@bgen(jjtree) ParamStatement */
  -  ASTParamStatement jjtn000 = new ASTParamStatement(this, JJTPARAMSTATEMENT);
  -  boolean jjtc000 = true;
  -  jjtree.openNodeScope(jjtn000);
  -    try {
  -      jj_consume_token(PARAM_DIRECTIVE);
  -      Reference();
  -      jj_consume_token(EQUALS);
  -      jj_consume_token(STRING_LITERAL);
  -    } catch (Throwable jjte000) {
  -    if (jjtc000) {
  -      jjtree.clearNodeScope(jjtn000);
  -      jjtc000 = false;
  -    } else {
  -      jjtree.popNode();
  -    }
  -    if (jjte000 instanceof RuntimeException) {
  -      {if (true) throw (RuntimeException)jjte000;}
  -    }
  -    if (jjte000 instanceof ParseException) {
  -      {if (true) throw (ParseException)jjte000;}
  -    }
  -    {if (true) throw (Error)jjte000;}
  -    } finally {
  -    if (jjtc000) {
  -      jjtree.closeNodeScope(jjtn000, true);
  -    }
  -    }
  -  }
  -
  -/**
  - * This method corresponds to the #stop
  - * directive which just simulates and EOF
  - * so that parsing stops. The #stop directive
  - * is really only useful for debugging
  - * purposes.
  - */
  -  final public void StopStatement() throws ParseException {
  -    jj_consume_token(STOP_DIRECTIVE);
  -  }
  -
  -  final private boolean jj_2_1(int xla) {
  -    jj_la = xla; jj_lastpos = jj_scanpos = token;
  -    boolean retval = !jj_3_1();
  -    jj_save(0, xla);
  -    return retval;
  -  }
  -
  -  final private boolean jj_2_2(int xla) {
  -    jj_la = xla; jj_lastpos = jj_scanpos = token;
  -    boolean retval = !jj_3_2();
  -    jj_save(1, xla);
  -    return retval;
  -  }
  -
  -  final private boolean jj_2_3(int xla) {
  -    jj_la = xla; jj_lastpos = jj_scanpos = token;
  -    boolean retval = !jj_3_3();
  -    jj_save(2, xla);
  -    return retval;
  -  }
  -
  -  final private boolean jj_3R_49() {
  -    if (jj_scan_token(LOGICAL_LE)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_40()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_48() {
  -    if (jj_scan_token(LOGICAL_GT)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_40()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_13() {
  -    if (jj_3R_17()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_scan_token(LPAREN)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    Token xsp;
  -    xsp = jj_scanpos;
  -    if (jj_3R_18()) jj_scanpos = xsp;
  -    else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_scan_token(RPAREN)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_47() {
  -    if (jj_scan_token(LOGICAL_LT)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_40()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_41() {
  -    Token xsp;
  -    xsp = jj_scanpos;
  -    if (jj_3R_47()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_48()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_49()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_50()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_43() {
  -    if (jj_scan_token(LOGICAL_NOT_EQUALS)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_38()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_38() {
  -    if (jj_3R_40()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    Token xsp;
  -    while (true) {
  -      xsp = jj_scanpos;
  -      if (jj_3R_41()) { jj_scanpos = xsp; break; }
  -      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    }
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_39() {
  -    Token xsp;
  -    xsp = jj_scanpos;
  -    if (jj_3R_42()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_43()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_42() {
  -    if (jj_scan_token(LOGICAL_EQUALS)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_38()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_21() {
  -    Token xsp;
  -    xsp = jj_scanpos;
  -    if (jj_3R_27()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_28()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_27() {
  -    if (jj_3R_29()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_36() {
  -    if (jj_3R_38()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    Token xsp;
  -    while (true) {
  -      xsp = jj_scanpos;
  -      if (jj_3R_39()) { jj_scanpos = xsp; break; }
  -      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    }
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_17() {
  -    if (jj_scan_token(IDENTIFIER)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_12() {
  -    if (jj_3R_17()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_19() {
  -    if (jj_scan_token(STRING_LITERAL)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_37() {
  -    if (jj_scan_token(LOGICAL_AND)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_36()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_34() {
  -    if (jj_3R_36()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    Token xsp;
  -    while (true) {
  -      xsp = jj_scanpos;
  -      if (jj_3R_37()) { jj_scanpos = xsp; break; }
  -      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    }
  -    return false;
  -  }
  -
  -  final private boolean jj_3_3() {
  -    if (jj_3R_13()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_44() {
  -    if (jj_scan_token(COMMA)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_21()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_35() {
  -    if (jj_scan_token(LOGICAL_OR)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_34()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3_1() {
  -    if (jj_3R_11()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_scan_token(EQUALS)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_33() {
  -    if (jj_3R_34()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    Token xsp;
  -    while (true) {
  -      xsp = jj_scanpos;
  -      if (jj_3R_35()) { jj_scanpos = xsp; break; }
  -      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    }
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_32() {
  -    if (jj_3R_11()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_scan_token(EQUALS)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_20()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_16() {
  -    if (jj_scan_token(LPAREN)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_20()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_scan_token(RPAREN)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_15() {
  -    if (jj_3R_17()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_11() {
  -    Token xsp;
  -    xsp = jj_scanpos;
  -    if (jj_3R_14()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_15()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_16()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_14() {
  -    if (jj_3R_19()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_26() {
  -    if (jj_3R_33()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_25() {
  -    if (jj_3R_32()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_18() {
  -    if (jj_3R_21()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    Token xsp;
  -    while (true) {
  -      xsp = jj_scanpos;
  -      if (jj_3R_44()) { jj_scanpos = xsp; break; }
  -      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    }
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_56() {
  -    if (jj_3R_11()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_24() {
  -    if (jj_3R_31()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_55() {
  -    if (jj_scan_token(LOGICAL_NOT)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_51()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_51() {
  -    Token xsp;
  -    xsp = jj_scanpos;
  -    if (jj_3R_55()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_56()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_23() {
  -    if (jj_3R_30()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_22() {
  -    if (jj_3R_29()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_20() {
  -    Token xsp;
  -    xsp = jj_scanpos;
  -    if (jj_3R_22()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_23()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_24()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_25()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_26()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3_2() {
  -    if (jj_scan_token(DOT)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    Token xsp;
  -    xsp = jj_scanpos;
  -    if (jj_3_3()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_12()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_59() {
  -    if (jj_scan_token(MODULUS)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_51()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_58() {
  -    if (jj_scan_token(DIVIDE)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_51()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_31() {
  -    if (jj_scan_token(FALSE)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_57() {
  -    if (jj_scan_token(MULTIPLY)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_51()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_52() {
  -    Token xsp;
  -    xsp = jj_scanpos;
  -    if (jj_3R_57()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_58()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_59()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_54() {
  -    if (jj_scan_token(MINUS)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_45()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_53() {
  -    if (jj_scan_token(PLUS)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_45()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_46() {
  -    Token xsp;
  -    xsp = jj_scanpos;
  -    if (jj_3R_53()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_54()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_30() {
  -    if (jj_scan_token(TRUE)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_45() {
  -    if (jj_3R_51()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    Token xsp;
  -    while (true) {
  -      xsp = jj_scanpos;
  -      if (jj_3R_52()) { jj_scanpos = xsp; break; }
  -      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    }
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_29() {
  -    if (jj_scan_token(DIDENTIFIER)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    Token xsp;
  -    while (true) {
  -      xsp = jj_scanpos;
  -      if (jj_3_2()) { jj_scanpos = xsp; break; }
  -      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    }
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_28() {
  -    if (jj_3R_19()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_50() {
  -    if (jj_scan_token(LOGICAL_GE)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_40()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_40() {
  -    if (jj_3R_45()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    Token xsp;
  -    while (true) {
  -      xsp = jj_scanpos;
  -      if (jj_3R_46()) { jj_scanpos = xsp; break; }
  -      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    }
  -    return false;
  -  }
  -
  -  public ParserTokenManager token_source;
  -  ASCII_CharStream jj_input_stream;
  -  public Token token, jj_nt;
  -  private int jj_ntk;
  -  private Token jj_scanpos, jj_lastpos;
  -  private int jj_la;
  -  public boolean lookingAhead = false;
  -  private boolean jj_semLA;
  -  private int jj_gen;
  -  final private int[] jj_la1 = new int[25];
  -  final private int[] jj_la1_0 = {0xffffffc0,0x60000000,0x84000100,0x80000,0x40000,0x3000000,0x3000000,0xf00000,0xf00000,0x6000,0x6000,0x38000,0x38000,0x84000100,0x80000100,0xffffffc0,0x80000000,0x400,0x80000000,0x0,0xffffffc0,0xffffffc0,0x0,0x0,0xe0000000,};
  -  final private int[] jj_la1_1 = {0x39fbd,0x10000,0x8000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8000,0x8000,0x39fbd,0x10000,0x0,0x10000,0x8000,0x39fbd,0x29000,0x40,0x40,0x10000,};
  -  final private JJCalls[] jj_2_rtns = new JJCalls[3];
  -  private boolean jj_rescan = false;
  -  private int jj_gc = 0;
  -
  -  public Parser(java.io.InputStream stream) {
  -    jj_input_stream = new ASCII_CharStream(stream, 1, 1);
  -    token_source = new ParserTokenManager(jj_input_stream);
  -    token = new Token();
  -    jj_ntk = -1;
  -    jj_gen = 0;
  -    for (int i = 0; i < 25; i++) jj_la1[i] = -1;
  -    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  -  }
  -
  -  public void ReInit(java.io.InputStream stream) {
  -    jj_input_stream.ReInit(stream, 1, 1);
  -    token_source.ReInit(jj_input_stream);
  -    token = new Token();
  -    jj_ntk = -1;
  -    jjtree.reset();
  -    jj_gen = 0;
  -    for (int i = 0; i < 25; i++) jj_la1[i] = -1;
  -    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  -  }
  -
  -  public Parser(java.io.Reader stream) {
  -    jj_input_stream = new ASCII_CharStream(stream, 1, 1);
  -    token_source = new ParserTokenManager(jj_input_stream);
  -    token = new Token();
  -    jj_ntk = -1;
  -    jj_gen = 0;
  -    for (int i = 0; i < 25; i++) jj_la1[i] = -1;
  -    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  -  }
  -
  -  public void ReInit(java.io.Reader stream) {
  -    jj_input_stream.ReInit(stream, 1, 1);
  -    token_source.ReInit(jj_input_stream);
  -    token = new Token();
  -    jj_ntk = -1;
  -    jjtree.reset();
  -    jj_gen = 0;
  -    for (int i = 0; i < 25; i++) jj_la1[i] = -1;
  -    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  -  }
  -
  -  public Parser(ParserTokenManager tm) {
  -    token_source = tm;
  -    token = new Token();
  -    jj_ntk = -1;
  -    jj_gen = 0;
  -    for (int i = 0; i < 25; i++) jj_la1[i] = -1;
  -    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  -  }
  -
  -  public void ReInit(ParserTokenManager tm) {
  -    token_source = tm;
  -    token = new Token();
  -    jj_ntk = -1;
  -    jjtree.reset();
  -    jj_gen = 0;
  -    for (int i = 0; i < 25; i++) jj_la1[i] = -1;
  -    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  -  }
  -
  -  final private Token jj_consume_token(int kind) throws ParseException {
  -    Token oldToken;
  -    if ((oldToken = token).next != null) token = token.next;
  -    else token = token.next = token_source.getNextToken();
  -    jj_ntk = -1;
  -    if (token.kind == kind) {
  -      jj_gen++;
  -      if (++jj_gc > 100) {
  -        jj_gc = 0;
  -        for (int i = 0; i < jj_2_rtns.length; i++) {
  -          JJCalls c = jj_2_rtns[i];
  -          while (c != null) {
  -            if (c.gen < jj_gen) c.first = null;
  -            c = c.next;
  -          }
  -        }
  -      }
  -      return token;
  -    }
  -    token = oldToken;
  -    jj_kind = kind;
  -    throw generateParseException();
  -  }
  -
  -  final private boolean jj_scan_token(int kind) {
  -    if (jj_scanpos == jj_lastpos) {
  -      jj_la--;
  -      if (jj_scanpos.next == null) {
  -        jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
  -      } else {
  -        jj_lastpos = jj_scanpos = jj_scanpos.next;
  -      }
  -    } else {
  -      jj_scanpos = jj_scanpos.next;
  -    }
  -    if (jj_rescan) {
  -      int i = 0; Token tok = token;
  -      while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
  -      if (tok != null) jj_add_error_token(kind, i);
  -    }
  -    return (jj_scanpos.kind != kind);
  -  }
  -
  -  final public Token getNextToken() {
  -    if (token.next != null) token = token.next;
  -    else token = token.next = token_source.getNextToken();
  -    jj_ntk = -1;
  -    jj_gen++;
  -    return token;
  -  }
  -
  -  final public Token getToken(int index) {
  -    Token t = lookingAhead ? jj_scanpos : token;
  -    for (int i = 0; i < index; i++) {
  -      if (t.next != null) t = t.next;
  -      else t = t.next = token_source.getNextToken();
  -    }
  -    return t;
  -  }
  -
  -  final private int jj_ntk() {
  -    if ((jj_nt=token.next) == null)
  -      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
  -    else
  -      return (jj_ntk = jj_nt.kind);
  -  }
  -
  -  private java.util.Vector jj_expentries = new java.util.Vector();
  -  private int[] jj_expentry;
  -  private int jj_kind = -1;
  -  private int[] jj_lasttokens = new int[100];
  -  private int jj_endpos;
  -
  -  private void jj_add_error_token(int kind, int pos) {
  -    if (pos >= 100) return;
  -    if (pos == jj_endpos + 1) {
  -      jj_lasttokens[jj_endpos++] = kind;
  -    } else if (jj_endpos != 0) {
  -      jj_expentry = new int[jj_endpos];
  -      for (int i = 0; i < jj_endpos; i++) {
  -        jj_expentry[i] = jj_lasttokens[i];
  -      }
  -      boolean exists = false;
  -      for (java.util.Enumeration enum = jj_expentries.elements(); enum.hasMoreElements();) {
  -        int[] oldentry = (int[])(enum.nextElement());
  -        if (oldentry.length == jj_expentry.length) {
  -          exists = true;
  -          for (int i = 0; i < jj_expentry.length; i++) {
  -            if (oldentry[i] != jj_expentry[i]) {
  -              exists = false;
  -              break;
  -            }
  -          }
  -          if (exists) break;
  -        }
  -      }
  -      if (!exists) jj_expentries.addElement(jj_expentry);
  -      if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
  -    }
  -  }
  -
  -  final public ParseException generateParseException() {
  -    jj_expentries.removeAllElements();
  -    boolean[] la1tokens = new boolean[51];
  -    for (int i = 0; i < 51; i++) {
  -      la1tokens[i] = false;
  -    }
  -    if (jj_kind >= 0) {
  -      la1tokens[jj_kind] = true;
  -      jj_kind = -1;
  -    }
  -    for (int i = 0; i < 25; i++) {
  -      if (jj_la1[i] == jj_gen) {
  -        for (int j = 0; j < 32; j++) {
  -          if ((jj_la1_0[i] & (1<<j)) != 0) {
  -            la1tokens[j] = true;
  -          }
  -          if ((jj_la1_1[i] & (1<<j)) != 0) {
  -            la1tokens[32+j] = true;
  -          }
  -        }
  -      }
  -    }
  -    for (int i = 0; i < 51; i++) {
  -      if (la1tokens[i]) {
  -        jj_expentry = new int[1];
  -        jj_expentry[0] = i;
  -        jj_expentries.addElement(jj_expentry);
  -      }
  -    }
  -    jj_endpos = 0;
  -    jj_rescan_token();
  -    jj_add_error_token(0, 0);
  -    int[][] exptokseq = new int[jj_expentries.size()][];
  -    for (int i = 0; i < jj_expentries.size(); i++) {
  -      exptokseq[i] = (int[])jj_expentries.elementAt(i);
  -    }
  -    return new ParseException(token, exptokseq, tokenImage);
  -  }
  -
  -  final public void enable_tracing() {
  -  }
  -
  -  final public void disable_tracing() {
  -  }
  -
  -  final private void jj_rescan_token() {
  -    jj_rescan = true;
  -    for (int i = 0; i < 3; i++) {
  -      JJCalls p = jj_2_rtns[i];
  -      do {
  -        if (p.gen > jj_gen) {
  -          jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
  -          switch (i) {
  -            case 0: jj_3_1(); break;
  -            case 1: jj_3_2(); break;
  -            case 2: jj_3_3(); break;
  -          }
  -        }
  -        p = p.next;
  -      } while (p != null);
  -    }
  -    jj_rescan = false;
  -  }
  -
  -  final private void jj_save(int index, int xla) {
  -    JJCalls p = jj_2_rtns[index];
  -    while (p.gen > jj_gen) {
  -      if (p.next == null) { p = p.next = new JJCalls(); break; }
  -      p = p.next;
  -    }
  -    p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
  -  }
  -
  -  static final class JJCalls {
  -    int gen;
  -    Token first;
  -    int arg;
  -    JJCalls next;
  -  }
  -
  +    public Token getToken(int t);
  +    public void parse(InputStream i) throws ParseException;
  +    public SimpleNode getRoot();
   }
  
  
  
  1.3       +35 -31    jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ParserTreeConstants.java
  
  Index: ParserTreeConstants.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ParserTreeConstants.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ParserTreeConstants.java	2000/09/08 21:06:27	1.2
  +++ ParserTreeConstants.java	2000/09/12 01:42:08	1.3
  @@ -5,43 +5,46 @@
   public interface ParserTreeConstants
   {
     public int JJTPROCESS = 0;
  -  public int JJTVOID = 1;
  +  public int JJTEXPRESSION = 1;
     public int JJTASSIGNMENT = 2;
  -  public int JJTORNODE = 3;
  -  public int JJTANDNODE = 4;
  -  public int JJTEQNODE = 5;
  -  public int JJTNENODE = 6;
  -  public int JJTLTNODE = 7;
  -  public int JJTGTNODE = 8;
  -  public int JJTLENODE = 9;
  -  public int JJTGENODE = 10;
  -  public int JJTADDNODE = 11;
  -  public int JJTSUBTRACTNODE = 12;
  -  public int JJTMULNODE = 13;
  -  public int JJTDIVNODE = 14;
  -  public int JJTMODNODE = 15;
  -  public int JJTNOTNODE = 16;
  -  public int JJTSTRINGLITERAL = 17;
  -  public int JJTIDENTIFIER = 18;
  -  public int JJTMETHOD = 19;
  -  public int JJTREFERENCE = 20;
  -  public int JJTTRUE = 21;
  -  public int JJTFALSE = 22;
  -  public int JJTBLOCK = 23;
  -  public int JJTTEXT = 24;
  -  public int JJTIFSTATEMENT = 25;
  -  public int JJTELSESTATEMENT = 26;
  -  public int JJTELSEIFSTATEMENT = 27;
  -  public int JJTFOREACHSTATEMENT = 28;
  -  public int JJTSETSTATEMENT = 29;
  -  public int JJTUSESTATEMENT = 30;
  -  public int JJTPARAMSTATEMENT = 31;
  +  public int JJTVOID = 3;
  +  public int JJTORNODE = 4;
  +  public int JJTANDNODE = 5;
  +  public int JJTEQNODE = 6;
  +  public int JJTNENODE = 7;
  +  public int JJTLTNODE = 8;
  +  public int JJTGTNODE = 9;
  +  public int JJTLENODE = 10;
  +  public int JJTGENODE = 11;
  +  public int JJTADDNODE = 12;
  +  public int JJTSUBTRACTNODE = 13;
  +  public int JJTMULNODE = 14;
  +  public int JJTDIVNODE = 15;
  +  public int JJTMODNODE = 16;
  +  public int JJTNOTNODE = 17;
  +  public int JJTNUMBERLITERAL = 18;
  +  public int JJTSTRINGLITERAL = 19;
  +  public int JJTIDENTIFIER = 20;
  +  public int JJTMETHOD = 21;
  +  public int JJTREFERENCE = 22;
  +  public int JJTTRUE = 23;
  +  public int JJTFALSE = 24;
  +  public int JJTBLOCK = 25;
  +  public int JJTTEXT = 26;
  +  public int JJTIFSTATEMENT = 27;
  +  public int JJTELSESTATEMENT = 28;
  +  public int JJTELSEIFSTATEMENT = 29;
  +  public int JJTFOREACHSTATEMENT = 30;
  +  public int JJTSETSTATEMENT = 31;
  +  public int JJTUSESTATEMENT = 32;
  +  public int JJTPARAMSTATEMENT = 33;
   
   
     public String[] jjtNodeName = {
       "process",
  -    "void",
  +    "Expression",
       "Assignment",
  +    "void",
       "OrNode",
       "AndNode",
       "EQNode",
  @@ -56,6 +59,7 @@
       "DivNode",
       "ModNode",
       "NotNode",
  +    "NumberLiteral",
       "StringLiteral",
       "Identifier",
       "Method",
  
  
  
  1.3       +2 -0      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ParserVisitor.java
  
  Index: ParserVisitor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/ParserVisitor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ParserVisitor.java	2000/09/08 21:06:27	1.2
  +++ ParserVisitor.java	2000/09/12 01:42:08	1.3
  @@ -6,6 +6,7 @@
   {
     public Object visit(SimpleNode node, Object data);
     public Object visit(ASTprocess node, Object data);
  +  public Object visit(ASTExpression node, Object data);
     public Object visit(ASTAssignment node, Object data);
     public Object visit(ASTOrNode node, Object data);
     public Object visit(ASTAndNode node, Object data);
  @@ -21,6 +22,7 @@
     public Object visit(ASTDivNode node, Object data);
     public Object visit(ASTModNode node, Object data);
     public Object visit(ASTNotNode node, Object data);
  +  public Object visit(ASTNumberLiteral node, Object data);
     public Object visit(ASTStringLiteral node, Object data);
     public Object visit(ASTIdentifier node, Object data);
     public Object visit(ASTMethod node, Object data);
  
  
  
  1.2       +5 -5      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/TokenMgrError.java
  
  Index: TokenMgrError.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/TokenMgrError.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TokenMgrError.java	2000/09/06 09:13:30	1.1
  +++ TokenMgrError.java	2000/09/12 01:42:09	1.2
  @@ -10,28 +10,28 @@
      /**
       * Lexical error occured.
       */
  -   static final int LEXICAL_ERROR = 0;
  +   public static final int LEXICAL_ERROR = 0;
   
      /**
       * An attempt wass made to create a second instance of a static token manager.
       */
  -   static final int STATIC_LEXER_ERROR = 1;
  +   public static final int STATIC_LEXER_ERROR = 1;
   
      /**
       * Tried to change to an invalid lexical state.
       */
  -   static final int INVALID_LEXICAL_STATE = 2;
  +   public static final int INVALID_LEXICAL_STATE = 2;
   
      /**
       * Detected (and bailed out of) an infinite loop in the token manager.
       */
  -   static final int LOOP_DETECTED = 3;
  +   public static final int LOOP_DETECTED = 3;
   
      /**
       * Indicates the reason why the exception is thrown. It will have
       * one of the above 4 values.
       */
  -   int errorCode;
  +   public int errorCode;
   
      /**
       * Replaces unprintable characters by their espaced (or unicode escaped)
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/velocity/JJTParserState.java
  
  Index: JJTParserState.java
  ===================================================================
  /* Generated By:JJTree: Do not edit this line. JJTParserState.java */
  
  package org.apache.velocity.processor.javacc.parser.velocity;
  
  import org.apache.velocity.processor.javacc.parser.*;
  
  class JJTParserState {
    private java.util.Stack nodes;
    private java.util.Stack marks;
  
    private int sp;		// number of nodes on stack
    private int mk;		// current mark
    private boolean node_created;
  
    JJTParserState() {
      nodes = new java.util.Stack();
      marks = new java.util.Stack();
      sp = 0;
      mk = 0;
    }
  
    /* Determines whether the current node was actually closed and
       pushed.  This should only be called in the final user action of a
       node scope.  */
    boolean nodeCreated() {
      return node_created;
    }
  
    /* Call this to reinitialize the node stack.  It is called
       automatically by the parser's ReInit() method. */
    void reset() {
      nodes.removeAllElements();
      marks.removeAllElements();
      sp = 0;
      mk = 0;
    }
  
    /* Returns the root node of the AST.  It only makes sense to call
       this after a successful parse. */
    Node rootNode() {
      return (Node)nodes.elementAt(0);
    }
  
    /* Pushes a node on to the stack. */
    void pushNode(Node n) {
      nodes.push(n);
      ++sp;
    }
  
    /* Returns the node on the top of the stack, and remove it from the
       stack.  */
    Node popNode() {
      if (--sp < mk) {
        mk = ((Integer)marks.pop()).intValue();
      }
      return (Node)nodes.pop();
    }
  
    /* Returns the node currently on the top of the stack. */
    Node peekNode() {
      return (Node)nodes.peek();
    }
  
    /* Returns the number of children on the stack in the current node
       scope. */
    int nodeArity() {
      return sp - mk;
    }
  
  
    void clearNodeScope(Node n) {
      while (sp > mk) {
        popNode();
      }
      mk = ((Integer)marks.pop()).intValue();
    }
  
  
    void openNodeScope(Node n) {
      marks.push(new Integer(mk));
      mk = sp;
      n.jjtOpen();
    }
  
  
    /* A definite node is constructed from a specified number of
       children.  That number of nodes are popped from the stack and
       made the children of the definite node.  Then the definite node
       is pushed on to the stack. */
    void closeNodeScope(Node n, int num) {
      mk = ((Integer)marks.pop()).intValue();
      while (num-- > 0) {
        Node c = popNode();
        c.jjtSetParent(n);
        n.jjtAddChild(c, num);
      }
      n.jjtClose();
      pushNode(n);
      node_created = true;
    }
  
  
    /* A conditional node is constructed if its condition is true.  All
       the nodes that have been pushed since the node was opened are
       made children of the the conditional node, which is then pushed
       on to the stack.  If the condition is false the node is not
       constructed and they are left on the stack. */
    void closeNodeScope(Node n, boolean condition) {
      if (condition) {
        int a = nodeArity();
        mk = ((Integer)marks.pop()).intValue();
        while (a-- > 0) {
  	Node c = popNode();
  	c.jjtSetParent(n);
  	n.jjtAddChild(c, a);
        }
        n.jjtClose();
        pushNode(n);
        node_created = true;
      } else {
        mk = ((Integer)marks.pop()).intValue();
        node_created = false;
      }
    }
  }
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/velocity/Parser.java
  
  Index: Parser.java
  ===================================================================
  /* Generated By:JJTree&JavaCC: Do not edit this line. Parser.java */
  package org.apache.velocity.processor.javacc.parser.velocity;
  
  import java.io.*;
  import java.util.*;
  
  import org.apache.velocity.processor.javacc.parser.*;
  
  /**
   * This class is responsible for parsing a Velocity
   * template. This class was generated by JavaCC using
   * the JJTree extension to produce an Abstract
   * Syntax Tree (AST) of the template.
   *
   * Please look at the Parser.jjt file which is
   * what controls the generation of this class.
   *
   * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
   * @version $Id: Parser.java,v 1.1 2000/09/12 01:42:15 jvanzyl Exp $
   */
  public class Parser implements/*@bgen(jjtree)*/ ParserTreeConstants,org.apache.velocity.processor.javacc.parser.Parser, ParserConstants {/*@bgen(jjtree)*/
    protected JJTParserState jjtree = new JJTParserState();
  
      SimpleNode root;
  
      public Parser()
      {
      }
  
      public void parse(InputStream stream) throws ParseException
      {
          jj_input_stream = new ASCII_CharStream(stream, 1, 1);
          token_source = new ParserTokenManager(jj_input_stream);
          token = new Token();
          jj_ntk = -1;
          jj_gen = 0;
          for (int i = 0; i < 23; i++) jj_la1[i] = -1;
          for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  
          root = process();
      }
  
      public SimpleNode getRoot()
      {
          return root;
      }
  
  /**
   * This method is what starts the whole parsing
   * process. After the parsing is complete and
   * the template has been turned into an AST,
   * this method returns the root of AST which
   * can subsequently be traversed by a visitor
   * which implements the ParserVisitor interface
   * which is generated automatically by JavaCC
   */
    final public SimpleNode process() throws ParseException {
                          /*@bgen(jjtree) process */
    ASTprocess jjtn000 = new ASTprocess(this, JJTPROCESS);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        label_1:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case DOLLAR:
          case DOT:
          case LPAREN:
          case RPAREN:
          case COMMA:
          case QUOTE:
          case UNDERSCORE:
          case NUMBER_LITERAL:
          case MINUS:
          case PLUS:
          case MULTIPLY:
          case DIVIDE:
          case MODULUS:
          case LOGICAL_AND:
          case LOGICAL_OR:
          case LOGICAL_LT:
          case LOGICAL_LE:
          case LOGICAL_GT:
          case LOGICAL_GE:
          case LOGICAL_EQUALS:
          case LOGICAL_NOT_EQUALS:
          case LOGICAL_NOT:
          case EQUALS:
          case IN:
          case TRUE:
          case FALSE:
          case STRING_LITERAL:
          case BEGIN:
          case INCLUDE_DIRECTIVE:
          case PARSE_DIRECTIVE:
          case IF_DIRECTIVE:
          case ELSEIF_DIRECTIVE:
          case FOREACH_DIRECTIVE:
          case SET_DIRECTIVE:
          case PARAM_DIRECTIVE:
          case USE_DIRECTIVE:
          case STOP_DIRECTIVE:
          case ALPHA_CHAR:
          case IDENTIFIER:
          case DIDENTIFIER:
          case TEXT:
            ;
            break;
          default:
            jj_la1[0] = jj_gen;
            break label_1;
          }
          Statement();
        }
        jj_consume_token(0);
       jjtree.closeNodeScope(jjtn000, true);
       jjtc000 = false;
       {if (true) return jjtn000;}
      } catch (Throwable jjte000) {
       if (jjtc000) {
         jjtree.clearNodeScope(jjtn000);
         jjtc000 = false;
       } else {
         jjtree.popNode();
       }
       if (jjte000 instanceof RuntimeException) {
         {if (true) throw (RuntimeException)jjte000;}
       }
       if (jjte000 instanceof ParseException) {
         {if (true) throw (ParseException)jjte000;}
       }
       {if (true) throw (Error)jjte000;}
      } finally {
       if (jjtc000) {
         jjtree.closeNodeScope(jjtn000, true);
       }
      }
      throw new Error("Missing return statement in function");
    }
  
  /*
   * Expression syntax follows.
   */
  
  /*
  void Expression() : {}
  {
      //Reference()
      True()
  |   False()
  |   LOOKAHEAD( PrimaryExpression() "=" ) Assignment()
  |   ConditionalOrExpression()
  }
  */
    final public void Expression() throws ParseException {
                       /*@bgen(jjtree) Expression */
    ASTExpression jjtn000 = new ASTExpression(this, JJTEXPRESSION);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case STRING_LITERAL:
          StringLiteral();
          break;
        case NUMBER_LITERAL:
          NumberLiteral();
          break;
        case DIDENTIFIER:
          Reference();
          break;
        case TRUE:
          True();
          break;
        case FALSE:
          False();
          break;
        default:
          jj_la1[1] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte000;}
        }
        if (jjte000 instanceof ParseException) {
          {if (true) throw (ParseException)jjte000;}
        }
        {if (true) throw (Error)jjte000;}
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
    final public void Assignment() throws ParseException {
                                      /*@bgen(jjtree) #Assignment( 2) */
    ASTAssignment jjtn000 = new ASTAssignment(this, JJTASSIGNMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        PrimaryExpression();
        jj_consume_token(EQUALS);
        Expression();
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte000;}
        }
        if (jjte000 instanceof ParseException) {
          {if (true) throw (ParseException)jjte000;}
        }
        {if (true) throw (Error)jjte000;}
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000,  2);
        }
      }
    }
  
    final public void ConditionalOrExpression() throws ParseException {
      ConditionalAndExpression();
      label_2:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case LOGICAL_OR:
          ;
          break;
        default:
          jj_la1[2] = jj_gen;
          break label_2;
        }
        jj_consume_token(LOGICAL_OR);
                     ASTOrNode jjtn001 = new ASTOrNode(this, JJTORNODE);
                     boolean jjtc001 = true;
                     jjtree.openNodeScope(jjtn001);
        try {
          ConditionalAndExpression();
        } catch (Throwable jjte001) {
                     if (jjtc001) {
                       jjtree.clearNodeScope(jjtn001);
                       jjtc001 = false;
                     } else {
                       jjtree.popNode();
                     }
                     if (jjte001 instanceof RuntimeException) {
                       {if (true) throw (RuntimeException)jjte001;}
                     }
                     if (jjte001 instanceof ParseException) {
                       {if (true) throw (ParseException)jjte001;}
                     }
                     {if (true) throw (Error)jjte001;}
        } finally {
                     if (jjtc001) {
                       jjtree.closeNodeScope(jjtn001,  2);
                     }
        }
      }
    }
  
    final public void ConditionalAndExpression() throws ParseException {
      EqualityExpression();
      label_3:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case LOGICAL_AND:
          ;
          break;
        default:
          jj_la1[3] = jj_gen;
          break label_3;
        }
        jj_consume_token(LOGICAL_AND);
                       ASTAndNode jjtn001 = new ASTAndNode(this, JJTANDNODE);
                       boolean jjtc001 = true;
                       jjtree.openNodeScope(jjtn001);
        try {
          EqualityExpression();
        } catch (Throwable jjte001) {
                       if (jjtc001) {
                         jjtree.clearNodeScope(jjtn001);
                         jjtc001 = false;
                       } else {
                         jjtree.popNode();
                       }
                       if (jjte001 instanceof RuntimeException) {
                         {if (true) throw (RuntimeException)jjte001;}
                       }
                       if (jjte001 instanceof ParseException) {
                         {if (true) throw (ParseException)jjte001;}
                       }
                       {if (true) throw (Error)jjte001;}
        } finally {
                       if (jjtc001) {
                         jjtree.closeNodeScope(jjtn001,  2);
                       }
        }
      }
    }
  
  /*
  
  void ConditionalAndExpression() #void : {}
  {
    InclusiveOrExpression()
    ( <LOGICAL_AND>  InclusiveOrExpression() #AndNode(2) )*
  }
  
  
  void InclusiveOrExpression() #void : {}
  {
    ExclusiveOrExpression()
    ( "|" ExclusiveOrExpression() #BitwiseOrNode(2) )*
  }
  
  void ExclusiveOrExpression() #void : {}
  {
    AndExpression()
    ( "^" AndExpression() #BitwiseXorNode(2) )*
  }
  
  void AndExpression() #void : {}
  {
    EqualityExpression()
    ( "&" EqualityExpression() #BitwiseAndNode(2) )*
  }
  
  */
    final public void EqualityExpression() throws ParseException {
      RelationalExpression();
      label_4:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case LOGICAL_EQUALS:
        case LOGICAL_NOT_EQUALS:
          ;
          break;
        default:
          jj_la1[4] = jj_gen;
          break label_4;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case LOGICAL_EQUALS:
          jj_consume_token(LOGICAL_EQUALS);
                               ASTEQNode jjtn001 = new ASTEQNode(this, JJTEQNODE);
                               boolean jjtc001 = true;
                               jjtree.openNodeScope(jjtn001);
          try {
            RelationalExpression();
          } catch (Throwable jjte001) {
                               if (jjtc001) {
                                 jjtree.clearNodeScope(jjtn001);
                                 jjtc001 = false;
                               } else {
                                 jjtree.popNode();
                               }
                               if (jjte001 instanceof RuntimeException) {
                                 {if (true) throw (RuntimeException)jjte001;}
                               }
                               if (jjte001 instanceof ParseException) {
                                 {if (true) throw (ParseException)jjte001;}
                               }
                               {if (true) throw (Error)jjte001;}
          } finally {
                               if (jjtc001) {
                                 jjtree.closeNodeScope(jjtn001,  2);
                               }
          }
          break;
        case LOGICAL_NOT_EQUALS:
          jj_consume_token(LOGICAL_NOT_EQUALS);
                                   ASTNENode jjtn002 = new ASTNENode(this, JJTNENODE);
                                   boolean jjtc002 = true;
                                   jjtree.openNodeScope(jjtn002);
          try {
            RelationalExpression();
          } catch (Throwable jjte002) {
                                   if (jjtc002) {
                                     jjtree.clearNodeScope(jjtn002);
                                     jjtc002 = false;
                                   } else {
                                     jjtree.popNode();
                                   }
                                   if (jjte002 instanceof RuntimeException) {
                                     {if (true) throw (RuntimeException)jjte002;}
                                   }
                                   if (jjte002 instanceof ParseException) {
                                     {if (true) throw (ParseException)jjte002;}
                                   }
                                   {if (true) throw (Error)jjte002;}
          } finally {
                                   if (jjtc002) {
                                     jjtree.closeNodeScope(jjtn002,  2);
                                   }
          }
          break;
        default:
          jj_la1[5] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
    }
  
    final public void RelationalExpression() throws ParseException {
      AdditiveExpression();
      label_5:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case LOGICAL_LT:
        case LOGICAL_LE:
        case LOGICAL_GT:
        case LOGICAL_GE:
          ;
          break;
        default:
          jj_la1[6] = jj_gen;
          break label_5;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case LOGICAL_LT:
          jj_consume_token(LOGICAL_LT);
                           ASTLTNode jjtn001 = new ASTLTNode(this, JJTLTNODE);
                           boolean jjtc001 = true;
                           jjtree.openNodeScope(jjtn001);
          try {
            AdditiveExpression();
          } catch (Throwable jjte001) {
                           if (jjtc001) {
                             jjtree.clearNodeScope(jjtn001);
                             jjtc001 = false;
                           } else {
                             jjtree.popNode();
                           }
                           if (jjte001 instanceof RuntimeException) {
                             {if (true) throw (RuntimeException)jjte001;}
                           }
                           if (jjte001 instanceof ParseException) {
                             {if (true) throw (ParseException)jjte001;}
                           }
                           {if (true) throw (Error)jjte001;}
          } finally {
                           if (jjtc001) {
                             jjtree.closeNodeScope(jjtn001,  2);
                           }
          }
          break;
        case LOGICAL_GT:
          jj_consume_token(LOGICAL_GT);
                           ASTGTNode jjtn002 = new ASTGTNode(this, JJTGTNODE);
                           boolean jjtc002 = true;
                           jjtree.openNodeScope(jjtn002);
          try {
            AdditiveExpression();
          } catch (Throwable jjte002) {
                           if (jjtc002) {
                             jjtree.clearNodeScope(jjtn002);
                             jjtc002 = false;
                           } else {
                             jjtree.popNode();
                           }
                           if (jjte002 instanceof RuntimeException) {
                             {if (true) throw (RuntimeException)jjte002;}
                           }
                           if (jjte002 instanceof ParseException) {
                             {if (true) throw (ParseException)jjte002;}
                           }
                           {if (true) throw (Error)jjte002;}
          } finally {
                           if (jjtc002) {
                             jjtree.closeNodeScope(jjtn002,  2);
                           }
          }
          break;
        case LOGICAL_LE:
          jj_consume_token(LOGICAL_LE);
                           ASTLENode jjtn003 = new ASTLENode(this, JJTLENODE);
                           boolean jjtc003 = true;
                           jjtree.openNodeScope(jjtn003);
          try {
            AdditiveExpression();
          } catch (Throwable jjte003) {
                           if (jjtc003) {
                             jjtree.clearNodeScope(jjtn003);
                             jjtc003 = false;
                           } else {
                             jjtree.popNode();
                           }
                           if (jjte003 instanceof RuntimeException) {
                             {if (true) throw (RuntimeException)jjte003;}
                           }
                           if (jjte003 instanceof ParseException) {
                             {if (true) throw (ParseException)jjte003;}
                           }
                           {if (true) throw (Error)jjte003;}
          } finally {
                           if (jjtc003) {
                             jjtree.closeNodeScope(jjtn003,  2);
                           }
          }
          break;
        case LOGICAL_GE:
          jj_consume_token(LOGICAL_GE);
                           ASTGENode jjtn004 = new ASTGENode(this, JJTGENODE);
                           boolean jjtc004 = true;
                           jjtree.openNodeScope(jjtn004);
          try {
            AdditiveExpression();
          } catch (Throwable jjte004) {
                           if (jjtc004) {
                             jjtree.clearNodeScope(jjtn004);
                             jjtc004 = false;
                           } else {
                             jjtree.popNode();
                           }
                           if (jjte004 instanceof RuntimeException) {
                             {if (true) throw (RuntimeException)jjte004;}
                           }
                           if (jjte004 instanceof ParseException) {
                             {if (true) throw (ParseException)jjte004;}
                           }
                           {if (true) throw (Error)jjte004;}
          } finally {
                           if (jjtc004) {
                             jjtree.closeNodeScope(jjtn004,  2);
                           }
          }
          break;
        default:
          jj_la1[7] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
    }
  
    final public void AdditiveExpression() throws ParseException {
      MultiplicativeExpression();
      label_6:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case MINUS:
        case PLUS:
          ;
          break;
        default:
          jj_la1[8] = jj_gen;
          break label_6;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case PLUS:
          jj_consume_token(PLUS);
                      ASTAddNode jjtn001 = new ASTAddNode(this, JJTADDNODE);
                      boolean jjtc001 = true;
                      jjtree.openNodeScope(jjtn001);
          try {
            MultiplicativeExpression();
          } catch (Throwable jjte001) {
                      if (jjtc001) {
                        jjtree.clearNodeScope(jjtn001);
                        jjtc001 = false;
                      } else {
                        jjtree.popNode();
                      }
                      if (jjte001 instanceof RuntimeException) {
                        {if (true) throw (RuntimeException)jjte001;}
                      }
                      if (jjte001 instanceof ParseException) {
                        {if (true) throw (ParseException)jjte001;}
                      }
                      {if (true) throw (Error)jjte001;}
          } finally {
                      if (jjtc001) {
                        jjtree.closeNodeScope(jjtn001,  2);
                      }
          }
          break;
        case MINUS:
          jj_consume_token(MINUS);
                      ASTSubtractNode jjtn002 = new ASTSubtractNode(this, JJTSUBTRACTNODE);
                      boolean jjtc002 = true;
                      jjtree.openNodeScope(jjtn002);
          try {
            MultiplicativeExpression();
          } catch (Throwable jjte002) {
                      if (jjtc002) {
                        jjtree.clearNodeScope(jjtn002);
                        jjtc002 = false;
                      } else {
                        jjtree.popNode();
                      }
                      if (jjte002 instanceof RuntimeException) {
                        {if (true) throw (RuntimeException)jjte002;}
                      }
                      if (jjte002 instanceof ParseException) {
                        {if (true) throw (ParseException)jjte002;}
                      }
                      {if (true) throw (Error)jjte002;}
          } finally {
                      if (jjtc002) {
                        jjtree.closeNodeScope(jjtn002,  2);
                      }
          }
          break;
        default:
          jj_la1[9] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
    }
  
    final public void MultiplicativeExpression() throws ParseException {
      UnaryExpression();
      label_7:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case MULTIPLY:
        case DIVIDE:
        case MODULUS:
          ;
          break;
        default:
          jj_la1[10] = jj_gen;
          break label_7;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case MULTIPLY:
          jj_consume_token(MULTIPLY);
                    ASTMulNode jjtn001 = new ASTMulNode(this, JJTMULNODE);
                    boolean jjtc001 = true;
                    jjtree.openNodeScope(jjtn001);
          try {
            UnaryExpression();
          } catch (Throwable jjte001) {
                    if (jjtc001) {
                      jjtree.clearNodeScope(jjtn001);
                      jjtc001 = false;
                    } else {
                      jjtree.popNode();
                    }
                    if (jjte001 instanceof RuntimeException) {
                      {if (true) throw (RuntimeException)jjte001;}
                    }
                    if (jjte001 instanceof ParseException) {
                      {if (true) throw (ParseException)jjte001;}
                    }
                    {if (true) throw (Error)jjte001;}
          } finally {
                    if (jjtc001) {
                      jjtree.closeNodeScope(jjtn001,  2);
                    }
          }
          break;
        case DIVIDE:
          jj_consume_token(DIVIDE);
                    ASTDivNode jjtn002 = new ASTDivNode(this, JJTDIVNODE);
                    boolean jjtc002 = true;
                    jjtree.openNodeScope(jjtn002);
          try {
            UnaryExpression();
          } catch (Throwable jjte002) {
                    if (jjtc002) {
                      jjtree.clearNodeScope(jjtn002);
                      jjtc002 = false;
                    } else {
                      jjtree.popNode();
                    }
                    if (jjte002 instanceof RuntimeException) {
                      {if (true) throw (RuntimeException)jjte002;}
                    }
                    if (jjte002 instanceof ParseException) {
                      {if (true) throw (ParseException)jjte002;}
                    }
                    {if (true) throw (Error)jjte002;}
          } finally {
                    if (jjtc002) {
                      jjtree.closeNodeScope(jjtn002,  2);
                    }
          }
          break;
        case MODULUS:
          jj_consume_token(MODULUS);
                    ASTModNode jjtn003 = new ASTModNode(this, JJTMODNODE);
                    boolean jjtc003 = true;
                    jjtree.openNodeScope(jjtn003);
          try {
            UnaryExpression();
          } catch (Throwable jjte003) {
                    if (jjtc003) {
                      jjtree.clearNodeScope(jjtn003);
                      jjtc003 = false;
                    } else {
                      jjtree.popNode();
                    }
                    if (jjte003 instanceof RuntimeException) {
                      {if (true) throw (RuntimeException)jjte003;}
                    }
                    if (jjte003 instanceof ParseException) {
                      {if (true) throw (ParseException)jjte003;}
                    }
                    {if (true) throw (Error)jjte003;}
          } finally {
                    if (jjtc003) {
                      jjtree.closeNodeScope(jjtn003,  2);
                    }
          }
          break;
        default:
          jj_la1[11] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
    }
  
    final public void UnaryExpression() throws ParseException {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case LOGICAL_NOT:
        jj_consume_token(LOGICAL_NOT);
                      ASTNotNode jjtn001 = new ASTNotNode(this, JJTNOTNODE);
                      boolean jjtc001 = true;
                      jjtree.openNodeScope(jjtn001);
        try {
          UnaryExpression();
        } catch (Throwable jjte001) {
                      if (jjtc001) {
                        jjtree.clearNodeScope(jjtn001);
                        jjtc001 = false;
                      } else {
                        jjtree.popNode();
                      }
                      if (jjte001 instanceof RuntimeException) {
                        {if (true) throw (RuntimeException)jjte001;}
                      }
                      if (jjte001 instanceof ParseException) {
                        {if (true) throw (ParseException)jjte001;}
                      }
                      {if (true) throw (Error)jjte001;}
        } finally {
                      if (jjtc001) {
                        jjtree.closeNodeScope(jjtn001,  1);
                      }
        }
        break;
      case LPAREN:
      case NUMBER_LITERAL:
      case STRING_LITERAL:
      case DIDENTIFIER:
        PrimaryExpression();
        break;
      default:
        jj_la1[12] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    }
  
    final public void PrimaryExpression() throws ParseException {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case STRING_LITERAL:
        StringLiteral();
        break;
      case NUMBER_LITERAL:
        NumberLiteral();
        break;
      case DIDENTIFIER:
        Reference();
        break;
      case LPAREN:
        jj_consume_token(LPAREN);
        Expression();
        jj_consume_token(RPAREN);
        break;
      default:
        jj_la1[13] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    }
  
  /**
   * These are the types of statements that
   * are acceptable in Velocity templates.
   * I have not found that the order here
   * matters much. Someone please correct
   * me here if I'm wrong.
   */
    final public void Statement() throws ParseException {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case DOLLAR:
      case DOT:
      case LPAREN:
      case RPAREN:
      case COMMA:
      case QUOTE:
      case UNDERSCORE:
      case NUMBER_LITERAL:
      case MINUS:
      case PLUS:
      case MULTIPLY:
      case DIVIDE:
      case MODULUS:
      case LOGICAL_AND:
      case LOGICAL_OR:
      case LOGICAL_LT:
      case LOGICAL_LE:
      case LOGICAL_GT:
      case LOGICAL_GE:
      case LOGICAL_EQUALS:
      case LOGICAL_NOT_EQUALS:
      case LOGICAL_NOT:
      case EQUALS:
      case IN:
      case TRUE:
      case FALSE:
      case STRING_LITERAL:
      case ALPHA_CHAR:
      case IDENTIFIER:
      case TEXT:
        Text();
        break;
      case BEGIN:
        Block();
        break;
      case IF_DIRECTIVE:
        IfStatement();
        break;
      case ELSEIF_DIRECTIVE:
        ElseIfStatement();
        break;
      case FOREACH_DIRECTIVE:
        ForeachStatement();
        break;
      case INCLUDE_DIRECTIVE:
        IncludeStatement();
        break;
      case SET_DIRECTIVE:
        SetStatement();
        break;
      case PARSE_DIRECTIVE:
        ParseStatement();
        break;
      case USE_DIRECTIVE:
        UseStatement();
        break;
      case PARAM_DIRECTIVE:
        ParamStatement();
        break;
      case STOP_DIRECTIVE:
        StopStatement();
        break;
      case DIDENTIFIER:
        Reference();
        break;
      default:
        jj_la1[14] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    }
  
    final public void NumberLiteral() throws ParseException {
                          /*@bgen(jjtree) NumberLiteral */
    ASTNumberLiteral jjtn000 = new ASTNumberLiteral(this, JJTNUMBERLITERAL);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(NUMBER_LITERAL);
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
    final public void StringLiteral() throws ParseException {
                          /*@bgen(jjtree) StringLiteral */
    ASTStringLiteral jjtn000 = new ASTStringLiteral(this, JJTSTRINGLITERAL);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(STRING_LITERAL);
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
  /**
   * This method corresponds to variable
   * references in Velocity templates.
   * The following are examples of variable
   * references that may be found in a
   * template:
   *
   * $foo
   * $bar
   *
   */
    final public void Identifier() throws ParseException {
                       /*@bgen(jjtree) Identifier */
    ASTIdentifier jjtn000 = new ASTIdentifier(this, JJTIDENTIFIER);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(IDENTIFIER);
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
  /**
   * This method has yet to be fully implemented
   * but will allow arbitrarily nested method
   * calls
   */
    final public void Parameter() throws ParseException {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case DIDENTIFIER:
        Reference();
        break;
      case STRING_LITERAL:
        StringLiteral();
        break;
      default:
        jj_la1[15] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    }
  
  /**
   * This method has yet to be fully implemented
   * but will allow arbitrarily nested method
   * calls
   */
    final public void Method() throws ParseException {
                   /*@bgen(jjtree) Method */
    ASTMethod jjtn000 = new ASTMethod(this, JJTMETHOD);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        Identifier();
        jj_consume_token(LPAREN);
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case STRING_LITERAL:
        case DIDENTIFIER:
          Parameter();
          label_8:
          while (true) {
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case COMMA:
              ;
              break;
            default:
              jj_la1[16] = jj_gen;
              break label_8;
            }
            jj_consume_token(COMMA);
            Parameter();
          }
          break;
        default:
          jj_la1[17] = jj_gen;
          ;
        }
        jj_consume_token(RPAREN);
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte000;}
        }
        if (jjte000 instanceof ParseException) {
          {if (true) throw (ParseException)jjte000;}
        }
        {if (true) throw (Error)jjte000;}
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
    final public void Reference() throws ParseException {
                      /*@bgen(jjtree) Reference */
    ASTReference jjtn000 = new ASTReference(this, JJTREFERENCE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(DIDENTIFIER);
        label_9:
        while (true) {
          if (jj_2_1(2)) {
            ;
          } else {
            break label_9;
          }
          jj_consume_token(DOT);
          if (jj_2_2(3)) {
            Method();
          } else {
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case IDENTIFIER:
              Identifier();
              break;
            default:
              jj_la1[18] = jj_gen;
              jj_consume_token(-1);
              throw new ParseException();
            }
          }
        }
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte000;}
        }
        if (jjte000 instanceof ParseException) {
          {if (true) throw (ParseException)jjte000;}
        }
        {if (true) throw (Error)jjte000;}
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
    final public void True() throws ParseException {
                 /*@bgen(jjtree) True */
    ASTTrue jjtn000 = new ASTTrue(this, JJTTRUE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(TRUE);
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
    final public void False() throws ParseException {
                  /*@bgen(jjtree) False */
    ASTFalse jjtn000 = new ASTFalse(this, JJTFALSE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(FALSE);
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
  /**
   * This method corresponds to a block in
   * a Velocity template. Blocks are
   * currently associated with:
   *
   * #if
   * #foreach
   * #while (not implemented)
   *
   */
    final public void Block() throws ParseException {
                  /*@bgen(jjtree) Block */
    ASTBlock jjtn000 = new ASTBlock(this, JJTBLOCK);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(BEGIN);
        label_10:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case DOLLAR:
          case DOT:
          case LPAREN:
          case RPAREN:
          case COMMA:
          case QUOTE:
          case UNDERSCORE:
          case NUMBER_LITERAL:
          case MINUS:
          case PLUS:
          case MULTIPLY:
          case DIVIDE:
          case MODULUS:
          case LOGICAL_AND:
          case LOGICAL_OR:
          case LOGICAL_LT:
          case LOGICAL_LE:
          case LOGICAL_GT:
          case LOGICAL_GE:
          case LOGICAL_EQUALS:
          case LOGICAL_NOT_EQUALS:
          case LOGICAL_NOT:
          case EQUALS:
          case IN:
          case TRUE:
          case FALSE:
          case STRING_LITERAL:
          case BEGIN:
          case INCLUDE_DIRECTIVE:
          case PARSE_DIRECTIVE:
          case IF_DIRECTIVE:
          case ELSEIF_DIRECTIVE:
          case FOREACH_DIRECTIVE:
          case SET_DIRECTIVE:
          case PARAM_DIRECTIVE:
          case USE_DIRECTIVE:
          case STOP_DIRECTIVE:
          case ALPHA_CHAR:
          case IDENTIFIER:
          case DIDENTIFIER:
          case TEXT:
            ;
            break;
          default:
            jj_la1[19] = jj_gen;
            break label_10;
          }
          Statement();
        }
        jj_consume_token(END);
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte000;}
        }
        if (jjte000 instanceof ParseException) {
          {if (true) throw (ParseException)jjte000;}
        }
        {if (true) throw (Error)jjte000;}
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
  /**
   * This method is responsible for allowing
   * all non-grammar text to pass through
   * unscathed.
   */
    final public void Text() throws ParseException {
                 /*@bgen(jjtree) Text */
    ASTText jjtn000 = new ASTText(this, JJTTEXT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case TEXT:
          jj_consume_token(TEXT);
          break;
        case ALPHA_CHAR:
          jj_consume_token(ALPHA_CHAR);
          break;
        case IDENTIFIER:
          jj_consume_token(IDENTIFIER);
          break;
        case DOLLAR:
          jj_consume_token(DOLLAR);
          break;
        case DOT:
          jj_consume_token(DOT);
          break;
        case LPAREN:
          jj_consume_token(LPAREN);
          break;
        case RPAREN:
          jj_consume_token(RPAREN);
          break;
        case COMMA:
          jj_consume_token(COMMA);
          break;
        case QUOTE:
          jj_consume_token(QUOTE);
          break;
        case MINUS:
          jj_consume_token(MINUS);
          break;
        case PLUS:
          jj_consume_token(PLUS);
          break;
        case MULTIPLY:
          jj_consume_token(MULTIPLY);
          break;
        case DIVIDE:
          jj_consume_token(DIVIDE);
          break;
        case MODULUS:
          jj_consume_token(MODULUS);
          break;
        case UNDERSCORE:
          jj_consume_token(UNDERSCORE);
          break;
        case EQUALS:
          jj_consume_token(EQUALS);
          break;
        case IN:
          jj_consume_token(IN);
          break;
        case TRUE:
          jj_consume_token(TRUE);
          break;
        case FALSE:
          jj_consume_token(FALSE);
          break;
        case STRING_LITERAL:
          jj_consume_token(STRING_LITERAL);
          break;
        case LOGICAL_AND:
          jj_consume_token(LOGICAL_AND);
          break;
        case LOGICAL_OR:
          jj_consume_token(LOGICAL_OR);
          break;
        case LOGICAL_LT:
          jj_consume_token(LOGICAL_LT);
          break;
        case LOGICAL_LE:
          jj_consume_token(LOGICAL_LE);
          break;
        case LOGICAL_GT:
          jj_consume_token(LOGICAL_GT);
          break;
        case LOGICAL_GE:
          jj_consume_token(LOGICAL_GE);
          break;
        case LOGICAL_EQUALS:
          jj_consume_token(LOGICAL_EQUALS);
          break;
        case LOGICAL_NOT_EQUALS:
          jj_consume_token(LOGICAL_NOT_EQUALS);
          break;
        case LOGICAL_NOT:
          jj_consume_token(LOGICAL_NOT);
          break;
        case NUMBER_LITERAL:
          jj_consume_token(NUMBER_LITERAL);
          break;
        default:
          jj_la1[20] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
  /**
   * This method corresponds to an #if directive
   * in a Velocity template. The following are
   * examples if #if constructs that are
   * acceptable in a template:
   *
   * #if ($customer.owesMoney() && $customer.Name == "Fred") (not implemented)
   * {
   *     Pay up, or else!
   * }
   * #else
   * {
   *     Thankyou for your patronage.
   * }
   *
   * #if ($dynanmicContent)
   * {
   *     This is our $dynamicContent
   * }
   *
   * #if ($customer.owesMoney())
   * {
   *     You better pay up!
   * }
   *
   */
    final public void IfStatement() throws ParseException {
                        /*@bgen(jjtree) IfStatement */
    ASTIfStatement jjtn000 = new ASTIfStatement(this, JJTIFSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(IF_DIRECTIVE);
        jj_consume_token(LPAREN);
        Expression();
        jj_consume_token(RPAREN);
        Statement();
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case ELSE_DIRECTIVE:
          ElseStatement();
          break;
        default:
          jj_la1[21] = jj_gen;
          ;
        }
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte000;}
        }
        if (jjte000 instanceof ParseException) {
          {if (true) throw (ParseException)jjte000;}
        }
        {if (true) throw (Error)jjte000;}
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
    final public void ElseStatement() throws ParseException {
                          /*@bgen(jjtree) ElseStatement */
    ASTElseStatement jjtn000 = new ASTElseStatement(this, JJTELSESTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(ELSE_DIRECTIVE);
        Statement();
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte000;}
        }
        if (jjte000 instanceof ParseException) {
          {if (true) throw (ParseException)jjte000;}
        }
        {if (true) throw (Error)jjte000;}
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
    final public void ElseIfStatement() throws ParseException {
                            /*@bgen(jjtree) ElseIfStatement */
    ASTElseIfStatement jjtn000 = new ASTElseIfStatement(this, JJTELSEIFSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(ELSEIF_DIRECTIVE);
        jj_consume_token(LPAREN);
        Expression();
        jj_consume_token(RPAREN);
        Statement();
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case ELSE_DIRECTIVE:
          ElseStatement();
          break;
        default:
          jj_la1[22] = jj_gen;
          ;
        }
      } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
      } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
      }
    }
  
  /**
   * This method corresponds to a #foreach
   * directive in a Velocity template. The
   * following are examples of #foreach
   * constructs that are acceptable in
   * a template:
   *
   * #foreach $element in $list
   * {
   *     This is the fifth $element
   * }
   *
   * #foreach $element in $foo.List
   * {
   *     This is the fifth $element
   * }
   *
   * #foreach $element in $foo.getList()
   * {
   *     This is the fifth $element
   * }
   *
   */
    final public void ForeachStatement() throws ParseException {
                             /*@bgen(jjtree) ForeachStatement */
    ASTForeachStatement jjtn000 = new ASTForeachStatement(this, JJTFOREACHSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(FOREACH_DIRECTIVE);
        Reference();
        jj_consume_token(IN);
        Reference();
        Statement();
      } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
      } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
      }
    }
  
  /**
   * This method corresponds to an #include
   * directive in a Velocity template. The
   * following are examples of #include
   * constructs that are acceptable in
   * a template:
   *
   * #include "foo.inc" 
   */
    final public void IncludeStatement() throws ParseException {
      jj_consume_token(INCLUDE_DIRECTIVE);
      jj_consume_token(STRING_LITERAL);
    }
  
  /**
   * This method corresponds to a #set
   * directive in a Velocity template. The
   * following are examples of #set
   * constructs that are acceptable in
   * a template:
   *
   * #set name = "Fred"
   * #set $Customer.Name = "Sidney"
   * #set $Database.findItem($partNum).Description = $newDescription (not implemented)
   *
   */
    final public void SetStatement() throws ParseException {
                         /*@bgen(jjtree) SetStatement */
    ASTSetStatement jjtn000 = new ASTSetStatement(this, JJTSETSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(SET_DIRECTIVE);
        Reference();
        jj_consume_token(EQUALS);
        Expression();
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte000;}
        }
        if (jjte000 instanceof ParseException) {
          {if (true) throw (ParseException)jjte000;}
        }
        {if (true) throw (Error)jjte000;}
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
  /**
   * This method corresponds to a #parse
   * directive in a Velocity template. The
   * following are examples of #parse
   * constructs that are acceptable in
   * a template:
   *
   * #parse "bar.vt"
   */
    final public void ParseStatement() throws ParseException {
      jj_consume_token(PARSE_DIRECTIVE);
      jj_consume_token(STRING_LITERAL);
    }
  
  /**
   * This method corresponds to a #use
   * directive in a Velocity template. The
   * following are examples of #use
   * constructs that are acceptable in
   * a template:
   *
   * This has not been implemented and may
   * not need to be because the Velocity
   * parser doesn't have any problem with
   * normal text that isn't part of Velocity's
   * grammar.
   *
   */
    final public void UseStatement() throws ParseException {
                         /*@bgen(jjtree) UseStatement */
    ASTUseStatement jjtn000 = new ASTUseStatement(this, JJTUSESTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(USE_DIRECTIVE);
      } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
      }
    }
  
  /**
   * This method corresponds to a #param
   * directive in a Velocity template. The
   * following are examples of #param
   * constructs that are acceptable in
   * a template:
   *
   * #param $language = "en"
   *
   */
    final public void ParamStatement() throws ParseException {
                           /*@bgen(jjtree) ParamStatement */
    ASTParamStatement jjtn000 = new ASTParamStatement(this, JJTPARAMSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(PARAM_DIRECTIVE);
        Reference();
        jj_consume_token(EQUALS);
        jj_consume_token(STRING_LITERAL);
      } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
      } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
      }
    }
  
  /**
   * This method corresponds to the #stop
   * directive which just simulates and EOF
   * so that parsing stops. The #stop directive
   * is really only useful for debugging
   * purposes.
   */
    final public void StopStatement() throws ParseException {
      jj_consume_token(STOP_DIRECTIVE);
    }
  
    final private boolean jj_2_1(int xla) {
      jj_la = xla; jj_lastpos = jj_scanpos = token;
      boolean retval = !jj_3_1();
      jj_save(0, xla);
      return retval;
    }
  
    final private boolean jj_2_2(int xla) {
      jj_la = xla; jj_lastpos = jj_scanpos = token;
      boolean retval = !jj_3_2();
      jj_save(1, xla);
      return retval;
    }
  
    final private boolean jj_3R_19() {
      if (jj_scan_token(STRING_LITERAL)) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3R_18() {
      if (jj_scan_token(DIDENTIFIER)) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3R_17() {
      if (jj_3R_19()) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3R_13() {
      if (jj_scan_token(IDENTIFIER)) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3R_14() {
      if (jj_3R_15()) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3R_12() {
      if (jj_3R_13()) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      if (jj_scan_token(LPAREN)) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      Token xsp;
      xsp = jj_scanpos;
      if (jj_3R_14()) jj_scanpos = xsp;
      else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      if (jj_scan_token(RPAREN)) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3_1() {
      if (jj_scan_token(DOT)) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      Token xsp;
      xsp = jj_scanpos;
      if (jj_3_2()) {
      jj_scanpos = xsp;
      if (jj_3R_11()) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3R_11() {
      if (jj_3R_13()) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3_2() {
      if (jj_3R_12()) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3R_15() {
      Token xsp;
      xsp = jj_scanpos;
      if (jj_3R_16()) {
      jj_scanpos = xsp;
      if (jj_3R_17()) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3R_16() {
      if (jj_3R_18()) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    public ParserTokenManager token_source;
    ASCII_CharStream jj_input_stream;
    public Token token, jj_nt;
    private int jj_ntk;
    private Token jj_scanpos, jj_lastpos;
    private int jj_la;
    public boolean lookingAhead = false;
    private boolean jj_semLA;
    private int jj_gen;
    final private int[] jj_la1 = new int[23];
    final private int[] jj_la1_0 = {0xffffdfc0,0x80004000,0x200000,0x100000,0xc000000,0xc000000,0x3c00000,0x3c00000,0x18000,0x18000,0xe0000,0xe0000,0x10004100,0x4100,0xffffdfc0,0x0,0x400,0x0,0x0,0xffffdfc0,0xffffdfc0,0x0,0x0,};
    final private int[] jj_la1_1 = {0xe7ef7,0x40003,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40002,0x40002,0xe7ef7,0x40002,0x0,0x40002,0x20000,0xe7ef7,0xa4003,0x100,0x100,};
    final private JJCalls[] jj_2_rtns = new JJCalls[2];
    private boolean jj_rescan = false;
    private int jj_gc = 0;
  
    public Parser(java.io.InputStream stream) {
      jj_input_stream = new ASCII_CharStream(stream, 1, 1);
      token_source = new ParserTokenManager(jj_input_stream);
      token = new Token();
      jj_ntk = -1;
      jj_gen = 0;
      for (int i = 0; i < 23; i++) jj_la1[i] = -1;
      for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
    }
  
    public void ReInit(java.io.InputStream stream) {
      jj_input_stream.ReInit(stream, 1, 1);
      token_source.ReInit(jj_input_stream);
      token = new Token();
      jj_ntk = -1;
      jjtree.reset();
      jj_gen = 0;
      for (int i = 0; i < 23; i++) jj_la1[i] = -1;
      for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
    }
  
    public Parser(java.io.Reader stream) {
      jj_input_stream = new ASCII_CharStream(stream, 1, 1);
      token_source = new ParserTokenManager(jj_input_stream);
      token = new Token();
      jj_ntk = -1;
      jj_gen = 0;
      for (int i = 0; i < 23; i++) jj_la1[i] = -1;
      for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
    }
  
    public void ReInit(java.io.Reader stream) {
      jj_input_stream.ReInit(stream, 1, 1);
      token_source.ReInit(jj_input_stream);
      token = new Token();
      jj_ntk = -1;
      jjtree.reset();
      jj_gen = 0;
      for (int i = 0; i < 23; i++) jj_la1[i] = -1;
      for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
    }
  
    public Parser(ParserTokenManager tm) {
      token_source = tm;
      token = new Token();
      jj_ntk = -1;
      jj_gen = 0;
      for (int i = 0; i < 23; i++) jj_la1[i] = -1;
      for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
    }
  
    public void ReInit(ParserTokenManager tm) {
      token_source = tm;
      token = new Token();
      jj_ntk = -1;
      jjtree.reset();
      jj_gen = 0;
      for (int i = 0; i < 23; i++) jj_la1[i] = -1;
      for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
    }
  
    final private Token jj_consume_token(int kind) throws ParseException {
      Token oldToken;
      if ((oldToken = token).next != null) token = token.next;
      else token = token.next = token_source.getNextToken();
      jj_ntk = -1;
      if (token.kind == kind) {
        jj_gen++;
        if (++jj_gc > 100) {
          jj_gc = 0;
          for (int i = 0; i < jj_2_rtns.length; i++) {
            JJCalls c = jj_2_rtns[i];
            while (c != null) {
              if (c.gen < jj_gen) c.first = null;
              c = c.next;
            }
          }
        }
        return token;
      }
      token = oldToken;
      jj_kind = kind;
      throw generateParseException();
    }
  
    final private boolean jj_scan_token(int kind) {
      if (jj_scanpos == jj_lastpos) {
        jj_la--;
        if (jj_scanpos.next == null) {
          jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
        } else {
          jj_lastpos = jj_scanpos = jj_scanpos.next;
        }
      } else {
        jj_scanpos = jj_scanpos.next;
      }
      if (jj_rescan) {
        int i = 0; Token tok = token;
        while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
        if (tok != null) jj_add_error_token(kind, i);
      }
      return (jj_scanpos.kind != kind);
    }
  
    final public Token getNextToken() {
      if (token.next != null) token = token.next;
      else token = token.next = token_source.getNextToken();
      jj_ntk = -1;
      jj_gen++;
      return token;
    }
  
    final public Token getToken(int index) {
      Token t = lookingAhead ? jj_scanpos : token;
      for (int i = 0; i < index; i++) {
        if (t.next != null) t = t.next;
        else t = t.next = token_source.getNextToken();
      }
      return t;
    }
  
    final private int jj_ntk() {
      if ((jj_nt=token.next) == null)
        return (jj_ntk = (token.next=token_source.getNextToken()).kind);
      else
        return (jj_ntk = jj_nt.kind);
    }
  
    private java.util.Vector jj_expentries = new java.util.Vector();
    private int[] jj_expentry;
    private int jj_kind = -1;
    private int[] jj_lasttokens = new int[100];
    private int jj_endpos;
  
    private void jj_add_error_token(int kind, int pos) {
      if (pos >= 100) return;
      if (pos == jj_endpos + 1) {
        jj_lasttokens[jj_endpos++] = kind;
      } else if (jj_endpos != 0) {
        jj_expentry = new int[jj_endpos];
        for (int i = 0; i < jj_endpos; i++) {
          jj_expentry[i] = jj_lasttokens[i];
        }
        boolean exists = false;
        for (java.util.Enumeration enum = jj_expentries.elements(); enum.hasMoreElements();) {
          int[] oldentry = (int[])(enum.nextElement());
          if (oldentry.length == jj_expentry.length) {
            exists = true;
            for (int i = 0; i < jj_expentry.length; i++) {
              if (oldentry[i] != jj_expentry[i]) {
                exists = false;
                break;
              }
            }
            if (exists) break;
          }
        }
        if (!exists) jj_expentries.addElement(jj_expentry);
        if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
      }
    }
  
    final public ParseException generateParseException() {
      jj_expentries.removeAllElements();
      boolean[] la1tokens = new boolean[53];
      for (int i = 0; i < 53; i++) {
        la1tokens[i] = false;
      }
      if (jj_kind >= 0) {
        la1tokens[jj_kind] = true;
        jj_kind = -1;
      }
      for (int i = 0; i < 23; i++) {
        if (jj_la1[i] == jj_gen) {
          for (int j = 0; j < 32; j++) {
            if ((jj_la1_0[i] & (1<<j)) != 0) {
              la1tokens[j] = true;
            }
            if ((jj_la1_1[i] & (1<<j)) != 0) {
              la1tokens[32+j] = true;
            }
          }
        }
      }
      for (int i = 0; i < 53; i++) {
        if (la1tokens[i]) {
          jj_expentry = new int[1];
          jj_expentry[0] = i;
          jj_expentries.addElement(jj_expentry);
        }
      }
      jj_endpos = 0;
      jj_rescan_token();
      jj_add_error_token(0, 0);
      int[][] exptokseq = new int[jj_expentries.size()][];
      for (int i = 0; i < jj_expentries.size(); i++) {
        exptokseq[i] = (int[])jj_expentries.elementAt(i);
      }
      return new ParseException(token, exptokseq, tokenImage);
    }
  
    final public void enable_tracing() {
    }
  
    final public void disable_tracing() {
    }
  
    final private void jj_rescan_token() {
      jj_rescan = true;
      for (int i = 0; i < 2; i++) {
        JJCalls p = jj_2_rtns[i];
        do {
          if (p.gen > jj_gen) {
            jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
            switch (i) {
              case 0: jj_3_1(); break;
              case 1: jj_3_2(); break;
            }
          }
          p = p.next;
        } while (p != null);
      }
      jj_rescan = false;
    }
  
    final private void jj_save(int index, int xla) {
      JJCalls p = jj_2_rtns[index];
      while (p.gen > jj_gen) {
        if (p.next == null) { p = p.next = new JJCalls(); break; }
        p = p.next;
      }
      p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
    }
  
    static final class JJCalls {
      int gen;
      Token first;
      int arg;
      JJCalls next;
    }
  
  }
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/velocity/Parser.jj
  
  Index: Parser.jj
  ===================================================================
  /*@bgen(jjtree) Generated By:JJTree: Do not edit this line. Parser.jj */
  /*@egen*//*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  options
  {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
      
      /**
       * The parser must be non-static in order for the
       * above option to work, otherwise the parser value
       * is passed in as null, which isn't all the useful ;)
       */
      STATIC=false;                                                                                                                                                                                                                                                                                                                  
      
      /**
       * This option is used as one of the steps
       * required to allow the use of an "#include"
       * type behaviour. In this case the directive
       * is "#parse". See the TOKEN_MGR_DECLS section
       * below for details on how the TokenManager is
       * modified to allow this behaviour.
       */
      COMMON_TOKEN_ACTION=true;
      
      /*
      DEBUG_PARSER=true;
      DEBUG_TOKEN_MANAGER=true;
      */
  
  }    
  
  PARSER_BEGIN(Parser)
  
  package org.apache.velocity.processor.javacc.parser.velocity;
  
  import java.io.*;
  import java.util.*;
  
  import org.apache.velocity.processor.javacc.parser.*;
  
  /**
   * This class is responsible for parsing a Velocity
   * template. This class was generated by JavaCC using
   * the JJTree extension to produce an Abstract
   * Syntax Tree (AST) of the template.
   *
   * Please look at the Parser.jjt file which is
   * what controls the generation of this class.
   *
   * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
   * @version $Id: Parser.jj,v 1.1 2000/09/12 01:42:15 jvanzyl Exp $
   */
  public class Parser implements/*@bgen(jjtree)*/ ParserTreeConstants, /*@egen*/ org.apache.velocity.processor.javacc.parser.Parser
  {/*@bgen(jjtree)*/
    protected JJTParserState jjtree = new JJTParserState();
  
  /*@egen*/
      
      
      SimpleNode root;
  
      public Parser()
      {
      }
  
      public void parse(InputStream stream) throws ParseException
      {
          jj_input_stream = new ASCII_CharStream(stream, 1, 1);
          token_source = new ParserTokenManager(jj_input_stream);
          token = new Token();
          jj_ntk = -1;
          jj_gen = 0;
          for (int i = 0; i < 23; i++) jj_la1[i] = -1;
          for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
          
          root = process();
      }        
  
      public SimpleNode getRoot()
      {
          return root;
      }        
  }
  
  PARSER_END(Parser)
  
  /* ------------------------------------------------------------------------
   *
   * Tokens
   *
   * ------------------------------------------------------------------------- */
  
  //<*> 
  SKIP : /* WHITE SPACE */
  {
    " "
  | "\t"
  | "\n"
  | "\r"
  | "\f"
  }
  
  //<*> 
  
  // These are special tokens that appear
  // in references particularly method, these
  // are the characters that we don't allow
  // in the <TEXT> token. Otherwise <TEXT>
  // will get matched before <IDENTIFIER>
  // which we don't want.
  
  TOKEN :
  {
      <DOLLAR: "$">
  |   <DOT: ".">
  |   <LPAREN: "(" >
  |   <RPAREN: ")" >
  |   <COMMA: ",">
  |   <QUOTE: "\"">
  |   <UNDERSCORE: "_">
  }
  
  // Numbers
  
  TOKEN :
  {
      <#DIGIT: [ "0"-"9" ] >
  |   <NUMBER_LITERAL: (<DIGIT>)+ >
  }    
  
  // Arithmetic operators
  
  TOKEN : 
  {
      <MINUS: "-">
  |   <PLUS: "+">
  |   <MULTIPLY: "*">
  |   <DIVIDE: "/">
  |   <MODULUS: "%">
  }
  
  // Logic operators.
  
  TOKEN :
  {
      <LOGICAL_AND: "&&">
  |   <LOGICAL_OR: "||">
  |   <LOGICAL_LT: "<">
  |   <LOGICAL_LE: "<=">
  |   <LOGICAL_GT: ">">
  |   <LOGICAL_GE: ">=">
  |   <LOGICAL_EQUALS: "==">
  |   <LOGICAL_NOT_EQUALS: "!=">
  |   <LOGICAL_NOT: "!">
  |   <EQUALS: "=" >
  }
  
  // These operators must be allowed to
  // show up as text as well.
  
  
  // These are special tokens that appear
  // in directives. The single character
  // tokens must also be remove from
  // <TEXT>.
  
  TOKEN :
  {
      <IN: "in" >
  |   <TRUE: "true">
  |   <FALSE: "false">
  |   <STRING_LITERAL: ( "\"" ( ~["\"","\n","\r"] )* "\"" ) >
      {
          if (incMode)
          {
              matchedToken.image = stripQuotes(image.toString());
              pushFile(matchedToken.image);
          }
          incMode = false;
      }        
  
  //|   <LBRACKET: "{" >
  //|   <RBRACKET: "}" >
  |   <BEGIN: "{">
  |   <END: "}">
  }
  
  //<DEFAULT> 
  TOKEN :
  {
      <INCLUDE_DIRECTIVE: "#include">
      {
          incMode = true;
      }        
  |   <PARSE_DIRECTIVE:   "#parse">
      { 
          incMode = true; 
      }
  |   <IF_DIRECTIVE:      "#if">
  |   <ELSEIF_DIRECTIVE:  "#elseif">
  |   <ELSE_DIRECTIVE:    "#else">
  |   <FOREACH_DIRECTIVE: "#foreach">
  |   <SET_DIRECTIVE:     "#set" >
  |   <PARAM_DIRECTIVE:   "#param" >
  |   <USE_DIRECTIVE:     "#use">
  |   <STOP_DIRECTIVE:    "#stop">
      {
          matchedToken.kind = EOF;
          fileDepth = 0;
      }
  }
  
  //<REFERENCE> 
  TOKEN :
  {
    <ALPHA_CHAR: ["a"-"z", "A"-"Z"] >
  | <ALPHANUM_CHAR: [ "a"-"z", "A"-"Z", "0"-"9" ] >
  | <IDENTIFIER_CHAR: [ "a"-"z", "A"-"Z", "0"-"9", "-", "_", "=" ] >
  | <IDENTIFIER: <ALPHA_CHAR> (<IDENTIFIER_CHAR>)* >
  | <DIDENTIFIER: <DOLLAR> <IDENTIFIER> >
  
    // Remove all the special characters from TEXT that can belong
    // in a reference of the form $variable, $object.Property,
    // $object.method($this, "that", $the-other)
  
  | <TEXT: (~["$", "\n", "\r", "\t", " ", ".", "(", ")", ",", "\"", "-", "_","<",">"])+ >
  }
  
  
  // DIRECTIVES 
  
  
  // I'm probably going to have to add a node type to
  // deal with comments. I need to collapse the space
  // that comments take up so the formatting will be
  // more accurate.
  
  // COMMENTS
  
  //<DEFAULT> 
  SPECIAL_TOKEN : 
  {
    <SINGLE_LINE_COMMENT: "##" (~["\n","\r"])* ("\n"|"\r"|"\r\n")>
  }
  
  
  /**
   * This gets inserted into the ParserMacroTokenManager
   * and is being used here strictly for the #parse
   * directive: an #include type behaviour. We have
   * to save the state the stream currently being
   * parsed and we have to save the state of the
   * lexer (TokenManager class) then we create
   * a new stream from the file named in the
   * #parse directive then we ReInit the lexer. 
   * Whatever it parses will get placed 
   * into the AST.
   *
   * I need a simple way to detect circular
   * inclusions so this thing doesn't go wild
   * and drag down the VM.
   */
  TOKEN_MGR_DECLS: 
  {  
      boolean incMode;
      int fileDepth = 0;
      int documentLine = 0;
      int lastLine = 0;
      
      Stack streams = new Stack();
      Stack states = new Stack();
      
      // remove double quotes in the string
      String stripQuotes(String str) 
      {
          int start = str.indexOf("\"");
          int end = str.indexOf("\"",start+1);    
          return str.substring(start+1,end);
      }    
      
      /**
       * Save the state of the current input stream
       * and the state of the lexer. So we can process
       * the new one.
       */
      void pushFile(String filename)
      {
          fileDepth++;
          
          streams.push(input_stream);
          states.push(new Integer(curLexState));
          documentLine += lastLine;
          
          try
          {
              FileInputStream fs = new FileInputStream(filename);
              ASCII_CharStream new_stream = new ASCII_CharStream(fs,1,1);    
              ReInit(new_stream);
          }
          catch(Exception e)
          {
          }
      }    
    
      /**
       * Retrieve the oldStream and oldState and
       * continue processing the input.
       */
      void popFile()
      {
          ReInit((ASCII_CharStream) streams.pop(), ((Integer) states.pop()).intValue());
          fileDepth--;
      }    
      
      private boolean AtParent()
      {
          if (fileDepth == 0)
              return true;
          else
              return false;
      }
      
      void CommonTokenAction(Token t)
      {
          if (t.kind == EOF && ! AtParent())
          {
              Token new_t;
              popFile();
              new_t = getNextToken();
              t.kind = new_t.kind;
              t.beginLine = new_t.beginLine;
              t.beginColumn = new_t.beginColumn;
              t.endLine = new_t.endLine;
              t.endColumn = new_t.endColumn;
              t.image = new_t.image;
              t.next = new_t.next;
              t.specialToken = new_t.specialToken;
          }
          else
          {
              lastLine = t.endLine;
              t.beginLine += documentLine;
              t.endLine += documentLine;
          }
      } 
  } 
  
  /**
   * This method is what starts the whole parsing
   * process. After the parsing is complete and
   * the template has been turned into an AST,
   * this method returns the root of AST which
   * can subsequently be traversed by a visitor
   * which implements the ParserVisitor interface
   * which is generated automatically by JavaCC
   */
  SimpleNode process() : {/*@bgen(jjtree) process */
    ASTprocess jjtn000 = new ASTprocess(this, JJTPROCESS);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) process */
     try {
  /*@egen*/
     ( Statement() )* <EOF>/*@bgen(jjtree)*/
     {
       jjtree.closeNodeScope(jjtn000, true);
       jjtc000 = false;
     }
  /*@egen*/
     { return jjtn000; }/*@bgen(jjtree)*/
     } catch (Throwable jjte000) {
       if (jjtc000) {
         jjtree.clearNodeScope(jjtn000);
         jjtc000 = false;
       } else {
         jjtree.popNode();
       }
       if (jjte000 instanceof RuntimeException) {
         throw (RuntimeException)jjte000;
       }
       if (jjte000 instanceof ParseException) {
         throw (ParseException)jjte000;
       }
       throw (Error)jjte000;
     } finally {
       if (jjtc000) {
         jjtree.closeNodeScope(jjtn000, true);
       }
     }
  /*@egen*/
  }
  
  /*
   * Expression syntax follows.
   */
  
  /*
  void Expression() : {}
  {
      //Reference()
      True()
  |   False()
  |   LOOKAHEAD( PrimaryExpression() "=" ) Assignment()
  |   ConditionalOrExpression()
  }
  */
  
  void Expression() : {/*@bgen(jjtree) Expression */
    ASTExpression jjtn000 = new ASTExpression(this, JJTEXPRESSION);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) Expression */
      try {
  /*@egen*/
      StringLiteral()
  |   NumberLiteral()    
  |   Reference() 
  |   True() 
  |   False()/*@bgen(jjtree)*/
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          throw (RuntimeException)jjte000;
        }
        if (jjte000 instanceof ParseException) {
          throw (ParseException)jjte000;
        }
        throw (Error)jjte000;
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  
  void Assignment()                : {/*@bgen(jjtree) #Assignment( 2) */
    ASTAssignment jjtn000 = new ASTAssignment(this, JJTASSIGNMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) #Assignment( 2) */
      try {
  /*@egen*/
      PrimaryExpression() <EQUALS> Expression()/*@bgen(jjtree)*/
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          throw (RuntimeException)jjte000;
        }
        if (jjte000 instanceof ParseException) {
          throw (ParseException)jjte000;
        }
        throw (Error)jjte000;
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000,  2);
        }
      }
  /*@egen*/
  }
  
  void ConditionalOrExpression()       : {}
  {
    ConditionalAndExpression()
    ( <LOGICAL_OR>/*@bgen(jjtree) #OrNode( 2) */
                   {
                     ASTOrNode jjtn001 = new ASTOrNode(this, JJTORNODE);
                     boolean jjtc001 = true;
                     jjtree.openNodeScope(jjtn001);
                   }
                   try {
  /*@egen*/ ConditionalAndExpression()/*@bgen(jjtree)*/
                   } catch (Throwable jjte001) {
                     if (jjtc001) {
                       jjtree.clearNodeScope(jjtn001);
                       jjtc001 = false;
                     } else {
                       jjtree.popNode();
                     }
                     if (jjte001 instanceof RuntimeException) {
                       throw (RuntimeException)jjte001;
                     }
                     if (jjte001 instanceof ParseException) {
                       throw (ParseException)jjte001;
                     }
                     throw (Error)jjte001;
                   } finally {
                     if (jjtc001) {
                       jjtree.closeNodeScope(jjtn001,  2);
                     }
                   }
  /*@egen*/ )*
  }
  
  
  void ConditionalAndExpression()       : {}
  {
    EqualityExpression()
    ( <LOGICAL_AND>/*@bgen(jjtree) #AndNode( 2) */
                     {
                       ASTAndNode jjtn001 = new ASTAndNode(this, JJTANDNODE);
                       boolean jjtc001 = true;
                       jjtree.openNodeScope(jjtn001);
                     }
                     try {
  /*@egen*/  EqualityExpression()/*@bgen(jjtree)*/
                     } catch (Throwable jjte001) {
                       if (jjtc001) {
                         jjtree.clearNodeScope(jjtn001);
                         jjtc001 = false;
                       } else {
                         jjtree.popNode();
                       }
                       if (jjte001 instanceof RuntimeException) {
                         throw (RuntimeException)jjte001;
                       }
                       if (jjte001 instanceof ParseException) {
                         throw (ParseException)jjte001;
                       }
                       throw (Error)jjte001;
                     } finally {
                       if (jjtc001) {
                         jjtree.closeNodeScope(jjtn001,  2);
                       }
                     }
  /*@egen*/ )*
  }
  
  /*
  
  void ConditionalAndExpression() #void : {}
  {
    InclusiveOrExpression()
    ( <LOGICAL_AND>  InclusiveOrExpression() #AndNode(2) )*
  }
  
  
  void InclusiveOrExpression() #void : {}
  {
    ExclusiveOrExpression()
    ( "|" ExclusiveOrExpression() #BitwiseOrNode(2) )*
  }
  
  void ExclusiveOrExpression() #void : {}
  {
    AndExpression()
    ( "^" AndExpression() #BitwiseXorNode(2) )*
  }
  
  void AndExpression() #void : {}
  {
    EqualityExpression()
    ( "&" EqualityExpression() #BitwiseAndNode(2) )*
  }
  
  */
  
  void EqualityExpression()       : {}
  {
      RelationalExpression()
      (
            <LOGICAL_EQUALS>/*@bgen(jjtree) #EQNode( 2) */
                             {
                               ASTEQNode jjtn001 = new ASTEQNode(this, JJTEQNODE);
                               boolean jjtc001 = true;
                               jjtree.openNodeScope(jjtn001);
                             }
                             try {
  /*@egen*/ RelationalExpression()/*@bgen(jjtree)*/
                             } catch (Throwable jjte001) {
                               if (jjtc001) {
                                 jjtree.clearNodeScope(jjtn001);
                                 jjtc001 = false;
                               } else {
                                 jjtree.popNode();
                               }
                               if (jjte001 instanceof RuntimeException) {
                                 throw (RuntimeException)jjte001;
                               }
                               if (jjte001 instanceof ParseException) {
                                 throw (ParseException)jjte001;
                               }
                               throw (Error)jjte001;
                             } finally {
                               if (jjtc001) {
                                 jjtree.closeNodeScope(jjtn001,  2);
                               }
                             }
  /*@egen*/
          | <LOGICAL_NOT_EQUALS>/*@bgen(jjtree) #NENode( 2) */
                                 {
                                   ASTNENode jjtn002 = new ASTNENode(this, JJTNENODE);
                                   boolean jjtc002 = true;
                                   jjtree.openNodeScope(jjtn002);
                                 }
                                 try {
  /*@egen*/ RelationalExpression()/*@bgen(jjtree)*/
                                 } catch (Throwable jjte002) {
                                   if (jjtc002) {
                                     jjtree.clearNodeScope(jjtn002);
                                     jjtc002 = false;
                                   } else {
                                     jjtree.popNode();
                                   }
                                   if (jjte002 instanceof RuntimeException) {
                                     throw (RuntimeException)jjte002;
                                   }
                                   if (jjte002 instanceof ParseException) {
                                     throw (ParseException)jjte002;
                                   }
                                   throw (Error)jjte002;
                                 } finally {
                                   if (jjtc002) {
                                     jjtree.closeNodeScope(jjtn002,  2);
                                   }
                                 }
  /*@egen*/
      )*
  }
  
  void RelationalExpression()       : {}
  {
      AdditiveExpression()
      (
            <LOGICAL_LT>/*@bgen(jjtree) #LTNode( 2) */
                         {
                           ASTLTNode jjtn001 = new ASTLTNode(this, JJTLTNODE);
                           boolean jjtc001 = true;
                           jjtree.openNodeScope(jjtn001);
                         }
                         try {
  /*@egen*/ AdditiveExpression()/*@bgen(jjtree)*/
                         } catch (Throwable jjte001) {
                           if (jjtc001) {
                             jjtree.clearNodeScope(jjtn001);
                             jjtc001 = false;
                           } else {
                             jjtree.popNode();
                           }
                           if (jjte001 instanceof RuntimeException) {
                             throw (RuntimeException)jjte001;
                           }
                           if (jjte001 instanceof ParseException) {
                             throw (ParseException)jjte001;
                           }
                           throw (Error)jjte001;
                         } finally {
                           if (jjtc001) {
                             jjtree.closeNodeScope(jjtn001,  2);
                           }
                         }
  /*@egen*/
          | <LOGICAL_GT>/*@bgen(jjtree) #GTNode( 2) */
                         {
                           ASTGTNode jjtn002 = new ASTGTNode(this, JJTGTNODE);
                           boolean jjtc002 = true;
                           jjtree.openNodeScope(jjtn002);
                         }
                         try {
  /*@egen*/ AdditiveExpression()/*@bgen(jjtree)*/
                         } catch (Throwable jjte002) {
                           if (jjtc002) {
                             jjtree.clearNodeScope(jjtn002);
                             jjtc002 = false;
                           } else {
                             jjtree.popNode();
                           }
                           if (jjte002 instanceof RuntimeException) {
                             throw (RuntimeException)jjte002;
                           }
                           if (jjte002 instanceof ParseException) {
                             throw (ParseException)jjte002;
                           }
                           throw (Error)jjte002;
                         } finally {
                           if (jjtc002) {
                             jjtree.closeNodeScope(jjtn002,  2);
                           }
                         }
  /*@egen*/
          | <LOGICAL_LE>/*@bgen(jjtree) #LENode( 2) */
                         {
                           ASTLENode jjtn003 = new ASTLENode(this, JJTLENODE);
                           boolean jjtc003 = true;
                           jjtree.openNodeScope(jjtn003);
                         }
                         try {
  /*@egen*/ AdditiveExpression()/*@bgen(jjtree)*/
                         } catch (Throwable jjte003) {
                           if (jjtc003) {
                             jjtree.clearNodeScope(jjtn003);
                             jjtc003 = false;
                           } else {
                             jjtree.popNode();
                           }
                           if (jjte003 instanceof RuntimeException) {
                             throw (RuntimeException)jjte003;
                           }
                           if (jjte003 instanceof ParseException) {
                             throw (ParseException)jjte003;
                           }
                           throw (Error)jjte003;
                         } finally {
                           if (jjtc003) {
                             jjtree.closeNodeScope(jjtn003,  2);
                           }
                         }
  /*@egen*/
          | <LOGICAL_GE>/*@bgen(jjtree) #GENode( 2) */
                         {
                           ASTGENode jjtn004 = new ASTGENode(this, JJTGENODE);
                           boolean jjtc004 = true;
                           jjtree.openNodeScope(jjtn004);
                         }
                         try {
  /*@egen*/ AdditiveExpression()/*@bgen(jjtree)*/
                         } catch (Throwable jjte004) {
                           if (jjtc004) {
                             jjtree.clearNodeScope(jjtn004);
                             jjtc004 = false;
                           } else {
                             jjtree.popNode();
                           }
                           if (jjte004 instanceof RuntimeException) {
                             throw (RuntimeException)jjte004;
                           }
                           if (jjte004 instanceof ParseException) {
                             throw (ParseException)jjte004;
                           }
                           throw (Error)jjte004;
                         } finally {
                           if (jjtc004) {
                             jjtree.closeNodeScope(jjtn004,  2);
                           }
                         }
  /*@egen*/
      )*
  }
  
  void AdditiveExpression()       : {}
  {
      MultiplicativeExpression()
      (
            <PLUS>/*@bgen(jjtree) #AddNode( 2) */
                    {
                      ASTAddNode jjtn001 = new ASTAddNode(this, JJTADDNODE);
                      boolean jjtc001 = true;
                      jjtree.openNodeScope(jjtn001);
                    }
                    try {
  /*@egen*/  MultiplicativeExpression()/*@bgen(jjtree)*/
                    } catch (Throwable jjte001) {
                      if (jjtc001) {
                        jjtree.clearNodeScope(jjtn001);
                        jjtc001 = false;
                      } else {
                        jjtree.popNode();
                      }
                      if (jjte001 instanceof RuntimeException) {
                        throw (RuntimeException)jjte001;
                      }
                      if (jjte001 instanceof ParseException) {
                        throw (ParseException)jjte001;
                      }
                      throw (Error)jjte001;
                    } finally {
                      if (jjtc001) {
                        jjtree.closeNodeScope(jjtn001,  2);
                      }
                    }
  /*@egen*/
          | <MINUS>/*@bgen(jjtree) #SubtractNode( 2) */
                    {
                      ASTSubtractNode jjtn002 = new ASTSubtractNode(this, JJTSUBTRACTNODE);
                      boolean jjtc002 = true;
                      jjtree.openNodeScope(jjtn002);
                    }
                    try {
  /*@egen*/ MultiplicativeExpression()/*@bgen(jjtree)*/
                    } catch (Throwable jjte002) {
                      if (jjtc002) {
                        jjtree.clearNodeScope(jjtn002);
                        jjtc002 = false;
                      } else {
                        jjtree.popNode();
                      }
                      if (jjte002 instanceof RuntimeException) {
                        throw (RuntimeException)jjte002;
                      }
                      if (jjte002 instanceof ParseException) {
                        throw (ParseException)jjte002;
                      }
                      throw (Error)jjte002;
                    } finally {
                      if (jjtc002) {
                        jjtree.closeNodeScope(jjtn002,  2);
                      }
                    }
  /*@egen*/
      )*
  }
  
  void MultiplicativeExpression()       : {}
  {
    UnaryExpression()
    (
       <MULTIPLY>/*@bgen(jjtree) #MulNode( 2) */
                  {
                    ASTMulNode jjtn001 = new ASTMulNode(this, JJTMULNODE);
                    boolean jjtc001 = true;
                    jjtree.openNodeScope(jjtn001);
                  }
                  try {
  /*@egen*/ UnaryExpression()/*@bgen(jjtree)*/
                  } catch (Throwable jjte001) {
                    if (jjtc001) {
                      jjtree.clearNodeScope(jjtn001);
                      jjtc001 = false;
                    } else {
                      jjtree.popNode();
                    }
                    if (jjte001 instanceof RuntimeException) {
                      throw (RuntimeException)jjte001;
                    }
                    if (jjte001 instanceof ParseException) {
                      throw (ParseException)jjte001;
                    }
                    throw (Error)jjte001;
                  } finally {
                    if (jjtc001) {
                      jjtree.closeNodeScope(jjtn001,  2);
                    }
                  }
  /*@egen*/
     | <DIVIDE>/*@bgen(jjtree) #DivNode( 2) */
                  {
                    ASTDivNode jjtn002 = new ASTDivNode(this, JJTDIVNODE);
                    boolean jjtc002 = true;
                    jjtree.openNodeScope(jjtn002);
                  }
                  try {
  /*@egen*/   UnaryExpression()/*@bgen(jjtree)*/
                  } catch (Throwable jjte002) {
                    if (jjtc002) {
                      jjtree.clearNodeScope(jjtn002);
                      jjtc002 = false;
                    } else {
                      jjtree.popNode();
                    }
                    if (jjte002 instanceof RuntimeException) {
                      throw (RuntimeException)jjte002;
                    }
                    if (jjte002 instanceof ParseException) {
                      throw (ParseException)jjte002;
                    }
                    throw (Error)jjte002;
                  } finally {
                    if (jjtc002) {
                      jjtree.closeNodeScope(jjtn002,  2);
                    }
                  }
  /*@egen*/
     | <MODULUS>/*@bgen(jjtree) #ModNode( 2) */
                  {
                    ASTModNode jjtn003 = new ASTModNode(this, JJTMODNODE);
                    boolean jjtc003 = true;
                    jjtree.openNodeScope(jjtn003);
                  }
                  try {
  /*@egen*/  UnaryExpression()/*@bgen(jjtree)*/
                  } catch (Throwable jjte003) {
                    if (jjtc003) {
                      jjtree.clearNodeScope(jjtn003);
                      jjtc003 = false;
                    } else {
                      jjtree.popNode();
                    }
                    if (jjte003 instanceof RuntimeException) {
                      throw (RuntimeException)jjte003;
                    }
                    if (jjte003 instanceof ParseException) {
                      throw (ParseException)jjte003;
                    }
                    throw (Error)jjte003;
                  } finally {
                    if (jjtc003) {
                      jjtree.closeNodeScope(jjtn003,  2);
                    }
                  }
  /*@egen*/
    )*
  }
  
  void UnaryExpression()       : {}
  {
      //"~" UnaryExpression() #BitwiseComplNode(1)
      <LOGICAL_NOT>/*@bgen(jjtree) #NotNode( 1) */
                    {
                      ASTNotNode jjtn001 = new ASTNotNode(this, JJTNOTNODE);
                      boolean jjtc001 = true;
                      jjtree.openNodeScope(jjtn001);
                    }
                    try {
  /*@egen*/ UnaryExpression()/*@bgen(jjtree)*/
                    } catch (Throwable jjte001) {
                      if (jjtc001) {
                        jjtree.clearNodeScope(jjtn001);
                        jjtc001 = false;
                      } else {
                        jjtree.popNode();
                      }
                      if (jjte001 instanceof RuntimeException) {
                        throw (RuntimeException)jjte001;
                      }
                      if (jjte001 instanceof ParseException) {
                        throw (ParseException)jjte001;
                      }
                      throw (Error)jjte001;
                    } finally {
                      if (jjtc001) {
                        jjtree.closeNodeScope(jjtn001,  1);
                      }
                    }
  /*@egen*/
  |   PrimaryExpression()
  }
  
  void PrimaryExpression()       : {}
  {    
      StringLiteral()
  |   NumberLiteral()    
  |   Reference() //Identifier() 
  |   <LPAREN> Expression() <RPAREN>
  }
  
  /**
   * These are the types of statements that
   * are acceptable in Velocity templates.
   * I have not found that the order here
   * matters much. Someone please correct
   * me here if I'm wrong.
   */
  void Statement()       : {}
  {
      Text()
  |   Block()    
  |   IfStatement()
  |   ElseIfStatement()
  |   ForeachStatement()
  |   IncludeStatement()
  |   SetStatement()
  |   ParseStatement()
  |   UseStatement()
  |   ParamStatement()
  |   StopStatement()
  |   Reference()
  
  }
  
  void NumberLiteral() : {/*@bgen(jjtree) NumberLiteral */
    ASTNumberLiteral jjtn000 = new ASTNumberLiteral(this, JJTNUMBERLITERAL);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) NumberLiteral */
      try {
  /*@egen*/
      <NUMBER_LITERAL>/*@bgen(jjtree)*/
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }    
  
  void StringLiteral() : {/*@bgen(jjtree) StringLiteral */
    ASTStringLiteral jjtn000 = new ASTStringLiteral(this, JJTSTRINGLITERAL);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) StringLiteral */
      try {
  /*@egen*/
      <STRING_LITERAL>/*@bgen(jjtree)*/
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }    
  
  /**
   * This method corresponds to variable
   * references in Velocity templates.
   * The following are examples of variable
   * references that may be found in a
   * template:
   *
   * $foo
   * $bar
   *
   */
  void Identifier() : {/*@bgen(jjtree) Identifier */
    ASTIdentifier jjtn000 = new ASTIdentifier(this, JJTIDENTIFIER);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) Identifier */
      try {
  /*@egen*/    
      <IDENTIFIER>/*@bgen(jjtree)*/
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  /**
   * This method has yet to be fully implemented
   * but will allow arbitrarily nested method
   * calls
   */
  void Parameter()      : {}
  {
      Reference() | StringLiteral()
  }
  
  /**
   * This method has yet to be fully implemented
   * but will allow arbitrarily nested method
   * calls
   */
  void Method() : {/*@bgen(jjtree) Method */
    ASTMethod jjtn000 = new ASTMethod(this, JJTMETHOD);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) Method */
      try {
  /*@egen*/
      Identifier() <LPAREN> [ Parameter() ( <COMMA> Parameter() )* ] <RPAREN>/*@bgen(jjtree)*/
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          throw (RuntimeException)jjte000;
        }
        if (jjte000 instanceof ParseException) {
          throw (ParseException)jjte000;
        }
        throw (Error)jjte000;
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  void Reference() : {/*@bgen(jjtree) Reference */
    ASTReference jjtn000 = new ASTReference(this, JJTREFERENCE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) Reference */
      try {
  /*@egen*/
      <DIDENTIFIER> (LOOKAHEAD(2) <DOT> (LOOKAHEAD(3) Method() | Identifier()) )*/*@bgen(jjtree)*/
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          throw (RuntimeException)jjte000;
        }
        if (jjte000 instanceof ParseException) {
          throw (ParseException)jjte000;
        }
        throw (Error)jjte000;
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  void True() : {/*@bgen(jjtree) True */
    ASTTrue jjtn000 = new ASTTrue(this, JJTTRUE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) True */
      try {
  /*@egen*/
      <TRUE>/*@bgen(jjtree)*/
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  void False() : {/*@bgen(jjtree) False */
    ASTFalse jjtn000 = new ASTFalse(this, JJTFALSE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) False */
      try {
  /*@egen*/
      <FALSE>/*@bgen(jjtree)*/
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  
  /**
   * This method corresponds to a block in
   * a Velocity template. Blocks are
   * currently associated with:
   *
   * #if
   * #foreach
   * #while (not implemented)
   *
   */
  void Block() : {/*@bgen(jjtree) Block */
    ASTBlock jjtn000 = new ASTBlock(this, JJTBLOCK);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) Block */
      try {
  /*@egen*/
      //<LBRACKET> [ ( Statement() )* <RBRACKET> ]
      <BEGIN> ( Statement() )* <END>/*@bgen(jjtree)*/
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          throw (RuntimeException)jjte000;
        }
        if (jjte000 instanceof ParseException) {
          throw (ParseException)jjte000;
        }
        throw (Error)jjte000;
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  /**
   * This method is responsible for allowing
   * all non-grammar text to pass through
   * unscathed.
   */
  void Text() : {/*@bgen(jjtree) Text */
    ASTText jjtn000 = new ASTText(this, JJTTEXT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) Text */
      try {
  /*@egen*/
      <TEXT>
  |   <ALPHA_CHAR>    
  |   <IDENTIFIER>    
  |   <DOLLAR>
  |   <DOT>
  |   <LPAREN>
  |   <RPAREN>
  |   <COMMA>
  |   <QUOTE>
  |   <MINUS>
  |   <PLUS>
  |   <MULTIPLY>
  |   <DIVIDE>
  |   <MODULUS>
  |   <UNDERSCORE>
  |   <EQUALS>
  |   <IN>
  |   <TRUE>
  |   <FALSE>
  |   <STRING_LITERAL>
  |   <LOGICAL_AND>
  |   <LOGICAL_OR>
  |   <LOGICAL_LT>
  |   <LOGICAL_LE>
  |   <LOGICAL_GT>
  |   <LOGICAL_GE>
  |   <LOGICAL_EQUALS>
  |   <LOGICAL_NOT_EQUALS>
  |   <LOGICAL_NOT>
  |   <NUMBER_LITERAL>/*@bgen(jjtree)*/
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  /**
   * This method corresponds to an #if directive
   * in a Velocity template. The following are
   * examples if #if constructs that are
   * acceptable in a template:
   *
   * #if ($customer.owesMoney() && $customer.Name == "Fred") (not implemented)
   * {
   *     Pay up, or else!
   * }
   * #else
   * {
   *     Thankyou for your patronage.
   * }
   *
   * #if ($dynanmicContent)
   * {
   *     This is our $dynamicContent
   * }
   *
   * #if ($customer.owesMoney())
   * {
   *     You better pay up!
   * }
   *
   */
  void IfStatement() : {/*@bgen(jjtree) IfStatement */
    ASTIfStatement jjtn000 = new ASTIfStatement(this, JJTIFSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) IfStatement */
      try {
  /*@egen*/
      <IF_DIRECTIVE> 
      <LPAREN> Expression() <RPAREN>
      Statement()
      [ LOOKAHEAD(1) ElseStatement() ]/*@bgen(jjtree)*/
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          throw (RuntimeException)jjte000;
        }
        if (jjte000 instanceof ParseException) {
          throw (ParseException)jjte000;
        }
        throw (Error)jjte000;
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  void ElseStatement() : {/*@bgen(jjtree) ElseStatement */
    ASTElseStatement jjtn000 = new ASTElseStatement(this, JJTELSESTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) ElseStatement */
      try {
  /*@egen*/
      <ELSE_DIRECTIVE> Statement()/*@bgen(jjtree)*/
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          throw (RuntimeException)jjte000;
        }
        if (jjte000 instanceof ParseException) {
          throw (ParseException)jjte000;
        }
        throw (Error)jjte000;
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  void ElseIfStatement() : {/*@bgen(jjtree) ElseIfStatement */
    ASTElseIfStatement jjtn000 = new ASTElseIfStatement(this, JJTELSEIFSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) ElseIfStatement */
    try {
  /*@egen*/
    <ELSEIF_DIRECTIVE> 
    <LPAREN>
    Expression()
    <RPAREN>
    Statement()
    [ LOOKAHEAD(1) ElseStatement() ]/*@bgen(jjtree)*/
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        throw (RuntimeException)jjte000;
      }
      if (jjte000 instanceof ParseException) {
        throw (ParseException)jjte000;
      }
      throw (Error)jjte000;
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  /*@egen*/
  }
  
  /**
   * This method corresponds to a #foreach
   * directive in a Velocity template. The
   * following are examples of #foreach
   * constructs that are acceptable in
   * a template:
   *
   * #foreach $element in $list
   * {
   *     This is the fifth $element
   * }
   *
   * #foreach $element in $foo.List
   * {
   *     This is the fifth $element
   * }
   *
   * #foreach $element in $foo.getList()
   * {
   *     This is the fifth $element
   * }
   *
   */
  void ForeachStatement() : {/*@bgen(jjtree) ForeachStatement */
    ASTForeachStatement jjtn000 = new ASTForeachStatement(this, JJTFOREACHSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) ForeachStatement */
    try {
  /*@egen*/
    <FOREACH_DIRECTIVE> 
    Reference()
    <IN>
    Reference()
    Statement()/*@bgen(jjtree)*/
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        throw (RuntimeException)jjte000;
      }
      if (jjte000 instanceof ParseException) {
        throw (ParseException)jjte000;
      }
      throw (Error)jjte000;
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  /*@egen*/
  }
  
  /**
   * This method corresponds to an #include
   * directive in a Velocity template. The
   * following are examples of #include
   * constructs that are acceptable in
   * a template:
   *
   * #include "foo.inc" 
   */
  void IncludeStatement()      : {}
  {
    <INCLUDE_DIRECTIVE> 
    <STRING_LITERAL>
  }
  
  /**
   * This method corresponds to a #set
   * directive in a Velocity template. The
   * following are examples of #set
   * constructs that are acceptable in
   * a template:
   *
   * #set name = "Fred"
   * #set $Customer.Name = "Sidney"
   * #set $Database.findItem($partNum).Description = $newDescription (not implemented)
   *
   */
  void SetStatement() : {/*@bgen(jjtree) SetStatement */
    ASTSetStatement jjtn000 = new ASTSetStatement(this, JJTSETSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) SetStatement */
      try {
  /*@egen*/
      <SET_DIRECTIVE> //Expression()
      Reference()
      <EQUALS> 
      Expression()/*@bgen(jjtree)*/
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          throw (RuntimeException)jjte000;
        }
        if (jjte000 instanceof ParseException) {
          throw (ParseException)jjte000;
        }
        throw (Error)jjte000;
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
      
      /*
      ( 
          StringLiteral() 
      | 
          NumberLiteral() 
      | 
          <LPAREN> Expression() <RPAREN>
          //Reference() 
      //| 
          //True() 
      //| 
          //False() 
      )
      */
  }
  
  /**
   * This method corresponds to a #parse
   * directive in a Velocity template. The
   * following are examples of #parse
   * constructs that are acceptable in
   * a template:
   *
   * #parse "bar.vt"
   */
  void ParseStatement()      : {}
  {
    <PARSE_DIRECTIVE> <STRING_LITERAL>
  }
  
  /**
   * This method corresponds to a #use
   * directive in a Velocity template. The
   * following are examples of #use
   * constructs that are acceptable in
   * a template:
   *
   * This has not been implemented and may
   * not need to be because the Velocity
   * parser doesn't have any problem with
   * normal text that isn't part of Velocity's
   * grammar.
   *
   */
  void UseStatement() : {/*@bgen(jjtree) UseStatement */
    ASTUseStatement jjtn000 = new ASTUseStatement(this, JJTUSESTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) UseStatement */
    try {
  /*@egen*/
    <USE_DIRECTIVE>/*@bgen(jjtree)*/
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  /*@egen*/
  }
  
  /**
   * This method corresponds to a #param
   * directive in a Velocity template. The
   * following are examples of #param
   * constructs that are acceptable in
   * a template:
   *
   * #param $language = "en"
   *
   */
  void ParamStatement() : {/*@bgen(jjtree) ParamStatement */
    ASTParamStatement jjtn000 = new ASTParamStatement(this, JJTPARAMSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) ParamStatement */
    try {
  /*@egen*/
    <PARAM_DIRECTIVE> Reference() <EQUALS> <STRING_LITERAL>/*@bgen(jjtree)*/
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        throw (RuntimeException)jjte000;
      }
      if (jjte000 instanceof ParseException) {
        throw (ParseException)jjte000;
      }
      throw (Error)jjte000;
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  /*@egen*/
  }
  
  /**
   * This method corresponds to the #stop
   * directive which just simulates and EOF
   * so that parsing stops. The #stop directive
   * is really only useful for debugging
   * purposes.
   */
  void StopStatement()      : {}
  {    
      <STOP_DIRECTIVE>
  }
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/velocity/Parser.jjt
  
  Index: Parser.jjt
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  options
  {
      /** The default package for this parser kit */
      NODE_PACKAGE="org.apache.velocity.processor.javacc.parser.velocity";
  
      /** A source file will be generated for each non-terminal */
      MULTI=true;
      
      /**
       * Each node will have access to the parser, I did this so
       * some global information can be shared via the parser. I
       * think this will come in handly keeping track of
       * context, and being able to push changes back into
       * the context when nodes make modifications to the
       * context by setting properties, variables and
       * what not.
       */
      NODE_USES_PARSER=true;
      
      /**
       * The parser must be non-static in order for the
       * above option to work, otherwise the parser value
       * is passed in as null, which isn't all the useful ;)
       */
      STATIC=false;
      
      /**
       * Enables the use of a visitor that each of nodes
       * will accept. This way we can separate the logic
       * of node processing in a visitor and out of the
       * nodes themselves. If processing changes then
       * the nothing has to change in the node code.
       */
      VISITOR=true;
      
      /**
       * This option is used as one of the steps
       * required to allow the use of an "#include"
       * type behaviour. In this case the directive
       * is "#parse". See the TOKEN_MGR_DECLS section
       * below for details on how the TokenManager is
       * modified to allow this behaviour.
       */
      COMMON_TOKEN_ACTION=true;
      
      /*
      DEBUG_PARSER=true;
      DEBUG_TOKEN_MANAGER=true;
      */
  
  }    
  
  PARSER_BEGIN(Parser)
  
  package org.apache.velocity.processor.javacc.parser.velocity;
  
  import java.io.*;
  import java.util.*;
  
  import org.apache.velocity.processor.javacc.parser.*;
  
  /**
   * This class is responsible for parsing a Velocity
   * template. This class was generated by JavaCC using
   * the JJTree extension to produce an Abstract
   * Syntax Tree (AST) of the template.
   *
   * Please look at the Parser.jjt file which is
   * what controls the generation of this class.
   *
   * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
   * @version $Id: Parser.jjt,v 1.1 2000/09/12 01:42:15 jvanzyl Exp $
   */
  public class Parser implements org.apache.velocity.processor.javacc.parser.Parser
  {
      
      
      SimpleNode root;
  
      public Parser()
      {
      }
  
      public void parse(InputStream stream) throws ParseException
      {
          jj_input_stream = new ASCII_CharStream(stream, 1, 1);
          token_source = new ParserTokenManager(jj_input_stream);
          token = new Token();
          jj_ntk = -1;
          jj_gen = 0;
          for (int i = 0; i < 23; i++) jj_la1[i] = -1;
          for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
          
          root = process();
      }        
  
      public SimpleNode getRoot()
      {
          return root;
      }        
  }
  
  PARSER_END(Parser)
  
  /* ------------------------------------------------------------------------
   *
   * Tokens
   *
   * ------------------------------------------------------------------------- */
  
  //<*> 
  SKIP : /* WHITE SPACE */
  {
    " "
  | "\t"
  | "\n"
  | "\r"
  | "\f"
  }
  
  //<*> 
  
  // These are special tokens that appear
  // in references particularly method, these
  // are the characters that we don't allow
  // in the <TEXT> token. Otherwise <TEXT>
  // will get matched before <IDENTIFIER>
  // which we don't want.
  
  TOKEN :
  {
      <DOLLAR: "$">
  |   <DOT: ".">
  |   <LPAREN: "(" >
  |   <RPAREN: ")" >
  |   <COMMA: ",">
  |   <QUOTE: "\"">
  |   <UNDERSCORE: "_">
  }
  
  // Numbers
  
  TOKEN :
  {
      <#DIGIT: [ "0"-"9" ] >
  |   <NUMBER_LITERAL: (<DIGIT>)+ >
  }    
  
  // Arithmetic operators
  
  TOKEN : 
  {
      <MINUS: "-">
  |   <PLUS: "+">
  |   <MULTIPLY: "*">
  |   <DIVIDE: "/">
  |   <MODULUS: "%">
  }
  
  // Logic operators.
  
  TOKEN :
  {
      <LOGICAL_AND: "&&">
  |   <LOGICAL_OR: "||">
  |   <LOGICAL_LT: "<">
  |   <LOGICAL_LE: "<=">
  |   <LOGICAL_GT: ">">
  |   <LOGICAL_GE: ">=">
  |   <LOGICAL_EQUALS: "==">
  |   <LOGICAL_NOT_EQUALS: "!=">
  |   <LOGICAL_NOT: "!">
  |   <EQUALS: "=" >
  }
  
  // These operators must be allowed to
  // show up as text as well.
  
  
  // These are special tokens that appear
  // in directives. The single character
  // tokens must also be remove from
  // <TEXT>.
  
  TOKEN :
  {
      <IN: "in" >
  |   <TRUE: "true">
  |   <FALSE: "false">
  |   <STRING_LITERAL: ( "\"" ( ~["\"","\n","\r"] )* "\"" ) >
      {
          if (incMode)
          {
              matchedToken.image = stripQuotes(image.toString());
              pushFile(matchedToken.image);
          }
          incMode = false;
      }        
  
  //|   <LBRACKET: "{" >
  //|   <RBRACKET: "}" >
  |   <BEGIN: "{">
  |   <END: "}">
  }
  
  //<DEFAULT> 
  TOKEN :
  {
      <INCLUDE_DIRECTIVE: "#include">
      {
          incMode = true;
      }        
  |   <PARSE_DIRECTIVE:   "#parse">
      { 
          incMode = true; 
      }
  |   <IF_DIRECTIVE:      "#if">
  |   <ELSEIF_DIRECTIVE:  "#elseif">
  |   <ELSE_DIRECTIVE:    "#else">
  |   <FOREACH_DIRECTIVE: "#foreach">
  |   <SET_DIRECTIVE:     "#set" >
  |   <PARAM_DIRECTIVE:   "#param" >
  |   <USE_DIRECTIVE:     "#use">
  |   <STOP_DIRECTIVE:    "#stop">
      {
          matchedToken.kind = EOF;
          fileDepth = 0;
      }
  }
  
  //<REFERENCE> 
  TOKEN :
  {
    <ALPHA_CHAR: ["a"-"z", "A"-"Z"] >
  | <ALPHANUM_CHAR: [ "a"-"z", "A"-"Z", "0"-"9" ] >
  | <IDENTIFIER_CHAR: [ "a"-"z", "A"-"Z", "0"-"9", "-", "_", "=" ] >
  | <IDENTIFIER: <ALPHA_CHAR> (<IDENTIFIER_CHAR>)* >
  | <DIDENTIFIER: <DOLLAR> <IDENTIFIER> >
  
    // Remove all the special characters from TEXT that can belong
    // in a reference of the form $variable, $object.Property,
    // $object.method($this, "that", $the-other)
  
  | <TEXT: (~["$", "\n", "\r", "\t", " ", ".", "(", ")", ",", "\"", "-", "_","<",">"])+ >
  }
  
  
  // DIRECTIVES 
  
  
  // I'm probably going to have to add a node type to
  // deal with comments. I need to collapse the space
  // that comments take up so the formatting will be
  // more accurate.
  
  // COMMENTS
  
  //<DEFAULT> 
  SPECIAL_TOKEN : 
  {
    <SINGLE_LINE_COMMENT: "##" (~["\n","\r"])* ("\n"|"\r"|"\r\n")>
  }
  
  
  /**
   * This gets inserted into the ParserMacroTokenManager
   * and is being used here strictly for the #parse
   * directive: an #include type behaviour. We have
   * to save the state the stream currently being
   * parsed and we have to save the state of the
   * lexer (TokenManager class) then we create
   * a new stream from the file named in the
   * #parse directive then we ReInit the lexer. 
   * Whatever it parses will get placed 
   * into the AST.
   *
   * I need a simple way to detect circular
   * inclusions so this thing doesn't go wild
   * and drag down the VM.
   */
  TOKEN_MGR_DECLS: 
  {  
      boolean incMode;
      int fileDepth = 0;
      int documentLine = 0;
      int lastLine = 0;
      
      Stack streams = new Stack();
      Stack states = new Stack();
      
      // remove double quotes in the string
      String stripQuotes(String str) 
      {
          int start = str.indexOf("\"");
          int end = str.indexOf("\"",start+1);    
          return str.substring(start+1,end);
      }    
      
      /**
       * Save the state of the current input stream
       * and the state of the lexer. So we can process
       * the new one.
       */
      void pushFile(String filename)
      {
          fileDepth++;
          
          streams.push(input_stream);
          states.push(new Integer(curLexState));
          documentLine += lastLine;
          
          try
          {
              FileInputStream fs = new FileInputStream(filename);
              ASCII_CharStream new_stream = new ASCII_CharStream(fs,1,1);    
              ReInit(new_stream);
          }
          catch(Exception e)
          {
          }
      }    
    
      /**
       * Retrieve the oldStream and oldState and
       * continue processing the input.
       */
      void popFile()
      {
          ReInit((ASCII_CharStream) streams.pop(), ((Integer) states.pop()).intValue());
          fileDepth--;
      }    
      
      private boolean AtParent()
      {
          if (fileDepth == 0)
              return true;
          else
              return false;
      }
      
      void CommonTokenAction(Token t)
      {
          if (t.kind == EOF && ! AtParent())
          {
              Token new_t;
              popFile();
              new_t = getNextToken();
              t.kind = new_t.kind;
              t.beginLine = new_t.beginLine;
              t.beginColumn = new_t.beginColumn;
              t.endLine = new_t.endLine;
              t.endColumn = new_t.endColumn;
              t.image = new_t.image;
              t.next = new_t.next;
              t.specialToken = new_t.specialToken;
          }
          else
          {
              lastLine = t.endLine;
              t.beginLine += documentLine;
              t.endLine += documentLine;
          }
      } 
  } 
  
  /**
   * This method is what starts the whole parsing
   * process. After the parsing is complete and
   * the template has been turned into an AST,
   * this method returns the root of AST which
   * can subsequently be traversed by a visitor
   * which implements the ParserVisitor interface
   * which is generated automatically by JavaCC
   */
  SimpleNode process() : {}
  {
     ( Statement() )* <EOF>
     { return jjtThis; }
  }
  
  /*
   * Expression syntax follows.
   */
  
  /*
  void Expression() : {}
  {
      //Reference()
      True()
  |   False()
  |   LOOKAHEAD( PrimaryExpression() "=" ) Assignment()
  |   ConditionalOrExpression()
  }
  */
  
  void Expression() : {}
  {
      StringLiteral()
  |   NumberLiteral()    
  |   Reference() 
  |   True() 
  |   False()
  }
  
  
  void Assignment() #Assignment(2) : {}
  {
      PrimaryExpression() <EQUALS> Expression()
  }
  
  void ConditionalOrExpression() #void : {}
  {
    ConditionalAndExpression()
    ( <LOGICAL_OR> ConditionalAndExpression() #OrNode(2) )*
  }
  
  
  void ConditionalAndExpression() #void : {}
  {
    EqualityExpression()
    ( <LOGICAL_AND>  EqualityExpression() #AndNode(2) )*
  }
  
  /*
  
  void ConditionalAndExpression() #void : {}
  {
    InclusiveOrExpression()
    ( <LOGICAL_AND>  InclusiveOrExpression() #AndNode(2) )*
  }
  
  
  void InclusiveOrExpression() #void : {}
  {
    ExclusiveOrExpression()
    ( "|" ExclusiveOrExpression() #BitwiseOrNode(2) )*
  }
  
  void ExclusiveOrExpression() #void : {}
  {
    AndExpression()
    ( "^" AndExpression() #BitwiseXorNode(2) )*
  }
  
  void AndExpression() #void : {}
  {
    EqualityExpression()
    ( "&" EqualityExpression() #BitwiseAndNode(2) )*
  }
  
  */
  
  void EqualityExpression() #void : {}
  {
      RelationalExpression()
      (
            <LOGICAL_EQUALS> RelationalExpression()     #EQNode(2)
          | <LOGICAL_NOT_EQUALS> RelationalExpression() #NENode(2)
      )*
  }
  
  void RelationalExpression() #void : {}
  {
      AdditiveExpression()
      (
            <LOGICAL_LT> AdditiveExpression() #LTNode(2)
          | <LOGICAL_GT> AdditiveExpression() #GTNode(2)
          | <LOGICAL_LE> AdditiveExpression() #LENode(2)
          | <LOGICAL_GE> AdditiveExpression() #GENode(2)
      )*
  }
  
  void AdditiveExpression() #void : {}
  {
      MultiplicativeExpression()
      (
            <PLUS>  MultiplicativeExpression() #AddNode(2)
          | <MINUS> MultiplicativeExpression() #SubtractNode(2)
      )*
  }
  
  void MultiplicativeExpression() #void : {}
  {
    UnaryExpression()
    (
       <MULTIPLY> UnaryExpression() #MulNode(2)
     | <DIVIDE>   UnaryExpression() #DivNode(2)
     | <MODULUS>  UnaryExpression() #ModNode(2)
    )*
  }
  
  void UnaryExpression() #void : {}
  {
      //"~" UnaryExpression() #BitwiseComplNode(1)
      <LOGICAL_NOT> UnaryExpression() #NotNode(1)
  |   PrimaryExpression()
  }
  
  void PrimaryExpression() #void : {}
  {    
      StringLiteral()
  |   NumberLiteral()    
  |   Reference() //Identifier() 
  |   <LPAREN> Expression() <RPAREN>
  }
  
  /**
   * These are the types of statements that
   * are acceptable in Velocity templates.
   * I have not found that the order here
   * matters much. Someone please correct
   * me here if I'm wrong.
   */
  void Statement() #void : {}
  {
      Text()
  |   Block()    
  |   IfStatement()
  |   ElseIfStatement()
  |   ForeachStatement()
  |   IncludeStatement()
  |   SetStatement()
  |   ParseStatement()
  |   UseStatement()
  |   ParamStatement()
  |   StopStatement()
  |   Reference()
  
  }
  
  void NumberLiteral() : {}
  {
      <NUMBER_LITERAL>
  }    
  
  void StringLiteral() : {}
  {
      <STRING_LITERAL>
  }    
  
  /**
   * This method corresponds to variable
   * references in Velocity templates.
   * The following are examples of variable
   * references that may be found in a
   * template:
   *
   * $foo
   * $bar
   *
   */
  void Identifier() : {}
  {    
      <IDENTIFIER>
  }
  
  /**
   * This method has yet to be fully implemented
   * but will allow arbitrarily nested method
   * calls
   */
  void Parameter() #void: {}
  {
      Reference() | StringLiteral()
  }
  
  /**
   * This method has yet to be fully implemented
   * but will allow arbitrarily nested method
   * calls
   */
  void Method() : {}
  {
      Identifier() <LPAREN> [ Parameter() ( <COMMA> Parameter() )* ] <RPAREN>
  }
  
  void Reference() : {}
  {
      <DIDENTIFIER> (LOOKAHEAD(2) <DOT> (LOOKAHEAD(3) Method() | Identifier()) )*
  }
  
  void True() : {}
  {
      <TRUE>
  }
  
  void False() : {}
  {
      <FALSE>
  }
  
  
  /**
   * This method corresponds to a block in
   * a Velocity template. Blocks are
   * currently associated with:
   *
   * #if
   * #foreach
   * #while (not implemented)
   *
   */
  void Block() : {}
  {
      //<LBRACKET> [ ( Statement() )* <RBRACKET> ]
      <BEGIN> ( Statement() )* <END>
  }
  
  /**
   * This method is responsible for allowing
   * all non-grammar text to pass through
   * unscathed.
   */
  void Text() : {}
  {
      <TEXT>
  |   <ALPHA_CHAR>    
  |   <IDENTIFIER>    
  |   <DOLLAR>
  |   <DOT>
  |   <LPAREN>
  |   <RPAREN>
  |   <COMMA>
  |   <QUOTE>
  |   <MINUS>
  |   <PLUS>
  |   <MULTIPLY>
  |   <DIVIDE>
  |   <MODULUS>
  |   <UNDERSCORE>
  |   <EQUALS>
  |   <IN>
  |   <TRUE>
  |   <FALSE>
  |   <STRING_LITERAL>
  |   <LOGICAL_AND>
  |   <LOGICAL_OR>
  |   <LOGICAL_LT>
  |   <LOGICAL_LE>
  |   <LOGICAL_GT>
  |   <LOGICAL_GE>
  |   <LOGICAL_EQUALS>
  |   <LOGICAL_NOT_EQUALS>
  |   <LOGICAL_NOT>
  |   <NUMBER_LITERAL>
  }
  
  /**
   * This method corresponds to an #if directive
   * in a Velocity template. The following are
   * examples if #if constructs that are
   * acceptable in a template:
   *
   * #if ($customer.owesMoney() && $customer.Name == "Fred") (not implemented)
   * {
   *     Pay up, or else!
   * }
   * #else
   * {
   *     Thankyou for your patronage.
   * }
   *
   * #if ($dynanmicContent)
   * {
   *     This is our $dynamicContent
   * }
   *
   * #if ($customer.owesMoney())
   * {
   *     You better pay up!
   * }
   *
   */
  void IfStatement() : {}
  {
      <IF_DIRECTIVE> 
      <LPAREN> Expression() <RPAREN>
      Statement()
      [ LOOKAHEAD(1) ElseStatement() ]
  }
  
  void ElseStatement() : {}
  {
      <ELSE_DIRECTIVE> Statement()
  }
  
  void ElseIfStatement() : {}
  {
    <ELSEIF_DIRECTIVE> 
    <LPAREN>
    Expression()
    <RPAREN>
    Statement()
    [ LOOKAHEAD(1) ElseStatement() ]
  }
  
  /**
   * This method corresponds to a #foreach
   * directive in a Velocity template. The
   * following are examples of #foreach
   * constructs that are acceptable in
   * a template:
   *
   * #foreach $element in $list
   * {
   *     This is the fifth $element
   * }
   *
   * #foreach $element in $foo.List
   * {
   *     This is the fifth $element
   * }
   *
   * #foreach $element in $foo.getList()
   * {
   *     This is the fifth $element
   * }
   *
   */
  void ForeachStatement() : {}
  {
    <FOREACH_DIRECTIVE> 
    Reference()
    <IN>
    Reference()
    Statement()
  }
  
  /**
   * This method corresponds to an #include
   * directive in a Velocity template. The
   * following are examples of #include
   * constructs that are acceptable in
   * a template:
   *
   * #include "foo.inc" 
   */
  void IncludeStatement() #void: {}
  {
    <INCLUDE_DIRECTIVE> 
    <STRING_LITERAL>
  }
  
  /**
   * This method corresponds to a #set
   * directive in a Velocity template. The
   * following are examples of #set
   * constructs that are acceptable in
   * a template:
   *
   * #set name = "Fred"
   * #set $Customer.Name = "Sidney"
   * #set $Database.findItem($partNum).Description = $newDescription (not implemented)
   *
   */
  void SetStatement() : {}
  {
      <SET_DIRECTIVE> //Expression()
      Reference()
      <EQUALS> 
      Expression()
      
      /*
      ( 
          StringLiteral() 
      | 
          NumberLiteral() 
      | 
          <LPAREN> Expression() <RPAREN>
          //Reference() 
      //| 
          //True() 
      //| 
          //False() 
      )
      */
  }
  
  /**
   * This method corresponds to a #parse
   * directive in a Velocity template. The
   * following are examples of #parse
   * constructs that are acceptable in
   * a template:
   *
   * #parse "bar.vt"
   */
  void ParseStatement() #void: {}
  {
    <PARSE_DIRECTIVE> <STRING_LITERAL>
  }
  
  /**
   * This method corresponds to a #use
   * directive in a Velocity template. The
   * following are examples of #use
   * constructs that are acceptable in
   * a template:
   *
   * This has not been implemented and may
   * not need to be because the Velocity
   * parser doesn't have any problem with
   * normal text that isn't part of Velocity's
   * grammar.
   *
   */
  void UseStatement() : {}
  {
    <USE_DIRECTIVE>
  }
  
  /**
   * This method corresponds to a #param
   * directive in a Velocity template. The
   * following are examples of #param
   * constructs that are acceptable in
   * a template:
   *
   * #param $language = "en"
   *
   */
  void ParamStatement() : {}
  {
    <PARAM_DIRECTIVE> Reference() <EQUALS> <STRING_LITERAL>
  }
  
  /**
   * This method corresponds to the #stop
   * directive which just simulates and EOF
   * so that parsing stops. The #stop directive
   * is really only useful for debugging
   * purposes.
   */
  void StopStatement() #void: {}
  {    
      <STOP_DIRECTIVE>
  }
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/velocity/ParserConstants.java
  
  Index: ParserConstants.java
  ===================================================================
  /* Generated By:JJTree&JavaCC: Do not edit this line. ParserConstants.java */
  package org.apache.velocity.processor.javacc.parser.velocity;
  
  public interface ParserConstants {
  
    int EOF = 0;
    int DOLLAR = 6;
    int DOT = 7;
    int LPAREN = 8;
    int RPAREN = 9;
    int COMMA = 10;
    int QUOTE = 11;
    int UNDERSCORE = 12;
    int DIGIT = 13;
    int NUMBER_LITERAL = 14;
    int MINUS = 15;
    int PLUS = 16;
    int MULTIPLY = 17;
    int DIVIDE = 18;
    int MODULUS = 19;
    int LOGICAL_AND = 20;
    int LOGICAL_OR = 21;
    int LOGICAL_LT = 22;
    int LOGICAL_LE = 23;
    int LOGICAL_GT = 24;
    int LOGICAL_GE = 25;
    int LOGICAL_EQUALS = 26;
    int LOGICAL_NOT_EQUALS = 27;
    int LOGICAL_NOT = 28;
    int EQUALS = 29;
    int IN = 30;
    int TRUE = 31;
    int FALSE = 32;
    int STRING_LITERAL = 33;
    int BEGIN = 34;
    int END = 35;
    int INCLUDE_DIRECTIVE = 36;
    int PARSE_DIRECTIVE = 37;
    int IF_DIRECTIVE = 38;
    int ELSEIF_DIRECTIVE = 39;
    int ELSE_DIRECTIVE = 40;
    int FOREACH_DIRECTIVE = 41;
    int SET_DIRECTIVE = 42;
    int PARAM_DIRECTIVE = 43;
    int USE_DIRECTIVE = 44;
    int STOP_DIRECTIVE = 45;
    int ALPHA_CHAR = 46;
    int ALPHANUM_CHAR = 47;
    int IDENTIFIER_CHAR = 48;
    int IDENTIFIER = 49;
    int DIDENTIFIER = 50;
    int TEXT = 51;
    int SINGLE_LINE_COMMENT = 52;
  
    int DEFAULT = 0;
  
    String[] tokenImage = {
      "<EOF>",
      "\" \"",
      "\"\\t\"",
      "\"\\n\"",
      "\"\\r\"",
      "\"\\f\"",
      "\"$\"",
      "\".\"",
      "\"(\"",
      "\")\"",
      "\",\"",
      "\"\\\"\"",
      "\"_\"",
      "<DIGIT>",
      "<NUMBER_LITERAL>",
      "\"-\"",
      "\"+\"",
      "\"*\"",
      "\"/\"",
      "\"%\"",
      "\"&&\"",
      "\"||\"",
      "\"<\"",
      "\"<=\"",
      "\">\"",
      "\">=\"",
      "\"==\"",
      "\"!=\"",
      "\"!\"",
      "\"=\"",
      "\"in\"",
      "\"true\"",
      "\"false\"",
      "<STRING_LITERAL>",
      "\"{\"",
      "\"}\"",
      "\"#include\"",
      "\"#parse\"",
      "\"#if\"",
      "\"#elseif\"",
      "\"#else\"",
      "\"#foreach\"",
      "\"#set\"",
      "\"#param\"",
      "\"#use\"",
      "\"#stop\"",
      "<ALPHA_CHAR>",
      "<ALPHANUM_CHAR>",
      "<IDENTIFIER_CHAR>",
      "<IDENTIFIER>",
      "<DIDENTIFIER>",
      "<TEXT>",
      "<SINGLE_LINE_COMMENT>",
    };
  
  }
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/velocity/ParserTokenManager.java
  
  Index: ParserTokenManager.java
  ===================================================================
  /* Generated By:JJTree&JavaCC: Do not edit this line. ParserTokenManager.java */
  package org.apache.velocity.processor.javacc.parser.velocity;
  import java.io.*;
  import java.util.*;
  import org.apache.velocity.processor.javacc.parser.*;
  
  public class ParserTokenManager implements ParserConstants
  {
      boolean incMode;
      int fileDepth = 0;
      int documentLine = 0;
      int lastLine = 0;
  
      Stack streams = new Stack();
      Stack states = new Stack();
  
      // remove double quotes in the string
      String stripQuotes(String str)
      {
          int start = str.indexOf("\"");
          int end = str.indexOf("\"",start+1);
          return str.substring(start+1,end);
      }
  
      /**
       * Save the state of the current input stream
       * and the state of the lexer. So we can process
       * the new one.
       */
      void pushFile(String filename)
      {
          fileDepth++;
  
          streams.push(input_stream);
          states.push(new Integer(curLexState));
          documentLine += lastLine;
  
          try
          {
              FileInputStream fs = new FileInputStream(filename);
              ASCII_CharStream new_stream = new ASCII_CharStream(fs,1,1);
              ReInit(new_stream);
          }
          catch(Exception e)
          {
          }
      }
  
      /**
       * Retrieve the oldStream and oldState and
       * continue processing the input.
       */
      void popFile()
      {
          ReInit((ASCII_CharStream) streams.pop(), ((Integer) states.pop()).intValue());
          fileDepth--;
      }
  
      private boolean AtParent()
      {
          if (fileDepth == 0)
              return true;
          else
              return false;
      }
  
      void CommonTokenAction(Token t)
      {
          if (t.kind == EOF && ! AtParent())
          {
              Token new_t;
              popFile();
              new_t = getNextToken();
              t.kind = new_t.kind;
              t.beginLine = new_t.beginLine;
              t.beginColumn = new_t.beginColumn;
              t.endLine = new_t.endLine;
              t.endColumn = new_t.endColumn;
              t.image = new_t.image;
              t.next = new_t.next;
              t.specialToken = new_t.specialToken;
          }
          else
          {
              lastLine = t.endLine;
              t.beginLine += documentLine;
              t.endLine += documentLine;
          }
      }
  private final int jjStopStringLiteralDfa_0(int pos, long active0)
  {
     switch (pos)
     {
        case 0:
           if ((active0 & 0x3ff000000000L) != 0L)
           {
              jjmatchedKind = 51;
              return 10;
           }
           if ((active0 & 0x300000L) != 0L)
           {
              jjmatchedKind = 51;
              return 9;
           }
           if ((active0 & 0x800L) != 0L)
              return 18;
           if ((active0 & 0x1c0000000L) != 0L)
           {
              jjmatchedKind = 46;
              return 19;
           }
           if ((active0 & 0x40L) != 0L)
              return 7;
           if ((active0 & 0xc3c0f0020L) != 0L)
              return 9;
           return -1;
        case 1:
           if ((active0 & 0x40000000L) != 0L)
              return 19;
           if ((active0 & 0x3ff000000000L) != 0L)
           {
              jjmatchedKind = 51;
              jjmatchedPos = 1;
              return 9;
           }
           if ((active0 & 0x180000000L) != 0L)
           {
              jjmatchedKind = 49;
              jjmatchedPos = 1;
              return 19;
           }
           if ((active0 & 0xc300000L) != 0L)
              return 9;
           return -1;
        case 2:
           if ((active0 & 0x3fb000000000L) != 0L)
           {
              jjmatchedKind = 51;
              jjmatchedPos = 2;
              return 9;
           }
           if ((active0 & 0x180000000L) != 0L)
           {
              jjmatchedKind = 49;
              jjmatchedPos = 2;
              return 19;
           }
           if ((active0 & 0x4000000000L) != 0L)
              return 9;
           return -1;
        case 3:
           if ((active0 & 0x80000000L) != 0L)
              return 19;
           if ((active0 & 0x100000000L) != 0L)
           {
              jjmatchedKind = 49;
              jjmatchedPos = 3;
              return 19;
           }
           if ((active0 & 0x2bb000000000L) != 0L)
           {
              jjmatchedKind = 51;
              jjmatchedPos = 3;
              return 9;
           }
           if ((active0 & 0x140000000000L) != 0L)
              return 9;
           return -1;
        case 4:
           if ((active0 & 0x100000000L) != 0L)
              return 19;
           if ((active0 & 0xa3000000000L) != 0L)
           {
              if (jjmatchedPos != 4)
              {
                 jjmatchedKind = 51;
                 jjmatchedPos = 4;
              }
              return 9;
           }
           if ((active0 & 0x218000000000L) != 0L)
              return 9;
           return -1;
        case 5:
           if ((active0 & 0x29000000000L) != 0L)
           {
              jjmatchedKind = 51;
              jjmatchedPos = 5;
              return 9;
           }
           if ((active0 & 0x82000000000L) != 0L)
              return 9;
           return -1;
        case 6:
           if ((active0 & 0x21000000000L) != 0L)
           {
              jjmatchedKind = 51;
              jjmatchedPos = 6;
              return 9;
           }
           if ((active0 & 0x8000000000L) != 0L)
              return 9;
           return -1;
        default :
           return -1;
     }
  }
  private final int jjStartNfa_0(int pos, long active0)
  {
     return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
  }
  private final int jjStopAtPos(int pos, int kind)
  {
     jjmatchedKind = kind;
     jjmatchedPos = pos;
     return pos + 1;
  }
  private final int jjStartNfaWithStates_0(int pos, int kind, int state)
  {
     jjmatchedKind = kind;
     jjmatchedPos = pos;
     try { curChar = input_stream.readChar(); }
     catch(java.io.IOException e) { return pos + 1; }
     return jjMoveNfa_0(state, pos + 1);
  }
  private final int jjMoveStringLiteralDfa0_0()
  {
     switch(curChar)
     {
        case 12:
           return jjStartNfaWithStates_0(0, 5, 9);
        case 33:
           jjmatchedKind = 28;
           return jjMoveStringLiteralDfa1_0(0x8000000L);
        case 34:
           return jjStartNfaWithStates_0(0, 11, 18);
        case 35:
           return jjMoveStringLiteralDfa1_0(0x3ff000000000L);
        case 36:
           return jjStartNfaWithStates_0(0, 6, 7);
        case 37:
           return jjStartNfaWithStates_0(0, 19, 9);
        case 38:
           return jjMoveStringLiteralDfa1_0(0x100000L);
        case 40:
           return jjStopAtPos(0, 8);
        case 41:
           return jjStopAtPos(0, 9);
        case 42:
           return jjStartNfaWithStates_0(0, 17, 9);
        case 43:
           return jjStartNfaWithStates_0(0, 16, 9);
        case 44:
           return jjStopAtPos(0, 10);
        case 45:
           return jjStopAtPos(0, 15);
        case 46:
           return jjStopAtPos(0, 7);
        case 47:
           return jjStartNfaWithStates_0(0, 18, 9);
        case 60:
           jjmatchedKind = 22;
           return jjMoveStringLiteralDfa1_0(0x800000L);
        case 61:
           jjmatchedKind = 29;
           return jjMoveStringLiteralDfa1_0(0x4000000L);
        case 62:
           jjmatchedKind = 24;
           return jjMoveStringLiteralDfa1_0(0x2000000L);
        case 95:
           return jjStopAtPos(0, 12);
        case 102:
           return jjMoveStringLiteralDfa1_0(0x100000000L);
        case 105:
           return jjMoveStringLiteralDfa1_0(0x40000000L);
        case 116:
           return jjMoveStringLiteralDfa1_0(0x80000000L);
        case 123:
           return jjStartNfaWithStates_0(0, 34, 9);
        case 124:
           return jjMoveStringLiteralDfa1_0(0x200000L);
        case 125:
           return jjStartNfaWithStates_0(0, 35, 9);
        default :
           return jjMoveNfa_0(1, 0);
     }
  }
  private final int jjMoveStringLiteralDfa1_0(long active0)
  {
     try { curChar = input_stream.readChar(); }
     catch(java.io.IOException e) {
        jjStopStringLiteralDfa_0(0, active0);
        return 1;
     }
     switch(curChar)
     {
        case 38:
           if ((active0 & 0x100000L) != 0L)
              return jjStartNfaWithStates_0(1, 20, 9);
           break;
        case 61:
           if ((active0 & 0x800000L) != 0L)
              return jjStopAtPos(1, 23);
           else if ((active0 & 0x2000000L) != 0L)
              return jjStopAtPos(1, 25);
           else if ((active0 & 0x4000000L) != 0L)
              return jjStartNfaWithStates_0(1, 26, 9);
           else if ((active0 & 0x8000000L) != 0L)
              return jjStartNfaWithStates_0(1, 27, 9);
           break;
        case 97:
           return jjMoveStringLiteralDfa2_0(active0, 0x100000000L);
        case 101:
           return jjMoveStringLiteralDfa2_0(active0, 0x18000000000L);
        case 102:
           return jjMoveStringLiteralDfa2_0(active0, 0x20000000000L);
        case 105:
           return jjMoveStringLiteralDfa2_0(active0, 0x5000000000L);
        case 110:
           if ((active0 & 0x40000000L) != 0L)
              return jjStartNfaWithStates_0(1, 30, 19);
           break;
        case 112:
           return jjMoveStringLiteralDfa2_0(active0, 0x82000000000L);
        case 114:
           return jjMoveStringLiteralDfa2_0(active0, 0x80000000L);
        case 115:
           return jjMoveStringLiteralDfa2_0(active0, 0x240000000000L);
        case 117:
           return jjMoveStringLiteralDfa2_0(active0, 0x100000000000L);
        case 124:
           if ((active0 & 0x200000L) != 0L)
              return jjStartNfaWithStates_0(1, 21, 9);
           break;
        default :
           break;
     }
     return jjStartNfa_0(0, active0);
  }
  private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
  {
     if (((active0 &= old0)) == 0L)
        return jjStartNfa_0(0, old0); 
     try { curChar = input_stream.readChar(); }
     catch(java.io.IOException e) {
        jjStopStringLiteralDfa_0(1, active0);
        return 2;
     }
     switch(curChar)
     {
        case 97:
           return jjMoveStringLiteralDfa3_0(active0, 0x82000000000L);
        case 101:
           return jjMoveStringLiteralDfa3_0(active0, 0x40000000000L);
        case 102:
           if ((active0 & 0x4000000000L) != 0L)
              return jjStartNfaWithStates_0(2, 38, 9);
           break;
        case 108:
           return jjMoveStringLiteralDfa3_0(active0, 0x18100000000L);
        case 110:
           return jjMoveStringLiteralDfa3_0(active0, 0x1000000000L);
        case 111:
           return jjMoveStringLiteralDfa3_0(active0, 0x20000000000L);
        case 115:
           return jjMoveStringLiteralDfa3_0(active0, 0x100000000000L);
        case 116:
           return jjMoveStringLiteralDfa3_0(active0, 0x200000000000L);
        case 117:
           return jjMoveStringLiteralDfa3_0(active0, 0x80000000L);
        default :
           break;
     }
     return jjStartNfa_0(1, active0);
  }
  private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
  {
     if (((active0 &= old0)) == 0L)
        return jjStartNfa_0(1, old0); 
     try { curChar = input_stream.readChar(); }
     catch(java.io.IOException e) {
        jjStopStringLiteralDfa_0(2, active0);
        return 3;
     }
     switch(curChar)
     {
        case 99:
           return jjMoveStringLiteralDfa4_0(active0, 0x1000000000L);
        case 101:
           if ((active0 & 0x80000000L) != 0L)
              return jjStartNfaWithStates_0(3, 31, 19);
           else if ((active0 & 0x100000000000L) != 0L)
              return jjStartNfaWithStates_0(3, 44, 9);
           break;
        case 111:
           return jjMoveStringLiteralDfa4_0(active0, 0x200000000000L);
        case 114:
           return jjMoveStringLiteralDfa4_0(active0, 0xa2000000000L);
        case 115:
           return jjMoveStringLiteralDfa4_0(active0, 0x18100000000L);
        case 116:
           if ((active0 & 0x40000000000L) != 0L)
              return jjStartNfaWithStates_0(3, 42, 9);
           break;
        default :
           break;
     }
     return jjStartNfa_0(2, active0);
  }
  private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
  {
     if (((active0 &= old0)) == 0L)
        return jjStartNfa_0(2, old0); 
     try { curChar = input_stream.readChar(); }
     catch(java.io.IOException e) {
        jjStopStringLiteralDfa_0(3, active0);
        return 4;
     }
     switch(curChar)
     {
        case 97:
           return jjMoveStringLiteralDfa5_0(active0, 0x80000000000L);
        case 101:
           if ((active0 & 0x100000000L) != 0L)
              return jjStartNfaWithStates_0(4, 32, 19);
           else if ((active0 & 0x10000000000L) != 0L)
           {
              jjmatchedKind = 40;
              jjmatchedPos = 4;
           }
           return jjMoveStringLiteralDfa5_0(active0, 0x28000000000L);
        case 108:
           return jjMoveStringLiteralDfa5_0(active0, 0x1000000000L);
        case 112:
           if ((active0 & 0x200000000000L) != 0L)
              return jjStartNfaWithStates_0(4, 45, 9);
           break;
        case 115:
           return jjMoveStringLiteralDfa5_0(active0, 0x2000000000L);
        default :
           break;
     }
     return jjStartNfa_0(3, active0);
  }
  private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
  {
     if (((active0 &= old0)) == 0L)
        return jjStartNfa_0(3, old0); 
     try { curChar = input_stream.readChar(); }
     catch(java.io.IOException e) {
        jjStopStringLiteralDfa_0(4, active0);
        return 5;
     }
     switch(curChar)
     {
        case 97:
           return jjMoveStringLiteralDfa6_0(active0, 0x20000000000L);
        case 101:
           if ((active0 & 0x2000000000L) != 0L)
              return jjStartNfaWithStates_0(5, 37, 9);
           break;
        case 105:
           return jjMoveStringLiteralDfa6_0(active0, 0x8000000000L);
        case 109:
           if ((active0 & 0x80000000000L) != 0L)
              return jjStartNfaWithStates_0(5, 43, 9);
           break;
        case 117:
           return jjMoveStringLiteralDfa6_0(active0, 0x1000000000L);
        default :
           break;
     }
     return jjStartNfa_0(4, active0);
  }
  private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
  {
     if (((active0 &= old0)) == 0L)
        return jjStartNfa_0(4, old0); 
     try { curChar = input_stream.readChar(); }
     catch(java.io.IOException e) {
        jjStopStringLiteralDfa_0(5, active0);
        return 6;
     }
     switch(curChar)
     {
        case 99:
           return jjMoveStringLiteralDfa7_0(active0, 0x20000000000L);
        case 100:
           return jjMoveStringLiteralDfa7_0(active0, 0x1000000000L);
        case 102:
           if ((active0 & 0x8000000000L) != 0L)
              return jjStartNfaWithStates_0(6, 39, 9);
           break;
        default :
           break;
     }
     return jjStartNfa_0(5, active0);
  }
  private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
  {
     if (((active0 &= old0)) == 0L)
        return jjStartNfa_0(5, old0); 
     try { curChar = input_stream.readChar(); }
     catch(java.io.IOException e) {
        jjStopStringLiteralDfa_0(6, active0);
        return 7;
     }
     switch(curChar)
     {
        case 101:
           if ((active0 & 0x1000000000L) != 0L)
              return jjStartNfaWithStates_0(7, 36, 9);
           break;
        case 104:
           if ((active0 & 0x20000000000L) != 0L)
              return jjStartNfaWithStates_0(7, 41, 9);
           break;
        default :
           break;
     }
     return jjStartNfa_0(6, active0);
  }
  private final void jjCheckNAdd(int state)
  {
     if (jjrounds[state] != jjround)
     {
        jjstateSet[jjnewStateCnt++] = state;
        jjrounds[state] = jjround;
     }
  }
  private final void jjAddStates(int start, int end)
  {
     do {
        jjstateSet[jjnewStateCnt++] = jjnextStates[start];
     } while (start++ != end);
  }
  private final void jjCheckNAddTwoStates(int state1, int state2)
  {
     jjCheckNAdd(state1);
     jjCheckNAdd(state2);
  }
  private final void jjCheckNAddStates(int start, int end)
  {
     do {
        jjCheckNAdd(jjnextStates[start]);
     } while (start++ != end);
  }
  private final void jjCheckNAddStates(int start)
  {
     jjCheckNAdd(jjnextStates[start]);
     jjCheckNAdd(jjnextStates[start + 1]);
  }
  static final long[] jjbitVec0 = {
     0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
  };
  private final int jjMoveNfa_0(int startState, int curPos)
  {
     int[] nextStates;
     int startsAt = 0;
     jjnewStateCnt = 18;
     int i = 1;
     jjstateSet[0] = startState;
     int j, kind = 0x7fffffff;
     for (;;)
     {
        if (++jjround == 0x7fffffff)
           ReInitRounds();
        if (curChar < 64)
        {
           long l = 1L << curChar;
           MatchLoop: do
           {
              switch(jjstateSet[--i])
              {
                 case 10:
                    if ((0xafff8ceaffffd9ffL & l) != 0L)
                    {
                       if (kind > 51)
                          kind = 51;
                       jjCheckNAdd(9);
                    }
                    if (curChar == 35)
                       jjCheckNAddStates(0, 2);
                    break;
                 case 1:
                    if ((0xafff8ceaffffd9ffL & l) != 0L)
                    {
                       if (kind > 51)
                          kind = 51;
                       jjCheckNAdd(9);
                    }
                    else if (curChar == 36)
                       jjstateSet[jjnewStateCnt++] = 7;
                    else if (curChar == 34)
                       jjCheckNAddTwoStates(2, 3);
                    if ((0x23ff200000000000L & l) != 0L)
                    {
                       if (kind > 48)
                          kind = 48;
                    }
                    else if (curChar == 35)
                       jjstateSet[jjnewStateCnt++] = 10;
                    if ((0x3ff000000000000L & l) != 0L)
                    {
                       if (kind > 47)
                          kind = 47;
                    }
                    if ((0x3ff000000000000L & l) != 0L)
                    {
                       if (kind > 14)
                          kind = 14;
                       jjCheckNAdd(0);
                    }
                    break;
                 case 18:
                    if ((0xfffffffbffffdbffL & l) != 0L)
                       jjCheckNAddTwoStates(2, 3);
                    else if (curChar == 34)
                    {
                       if (kind > 33)
                          kind = 33;
                    }
                    break;
                 case 19:
                    if ((0xafff8ceaffffd9ffL & l) != 0L)
                    {
                       if (kind > 51)
                          kind = 51;
                       jjCheckNAdd(9);
                    }
                    if ((0x23ff200000000000L & l) != 0L)
                    {
                       if (kind > 49)
                          kind = 49;
                       jjCheckNAdd(17);
                    }
                    break;
                 case 0:
                    if ((0x3ff000000000000L & l) == 0L)
                       break;
                    if (kind > 14)
                       kind = 14;
                    jjCheckNAdd(0);
                    break;
                 case 2:
                    if ((0xfffffffbffffdbffL & l) != 0L)
                       jjCheckNAddTwoStates(2, 3);
                    break;
                 case 3:
                    if (curChar == 34 && kind > 33)
                       kind = 33;
                    break;
                 case 4:
                    if ((0x3ff000000000000L & l) != 0L && kind > 47)
                       kind = 47;
                    break;
                 case 5:
                    if ((0x23ff200000000000L & l) != 0L && kind > 48)
                       kind = 48;
                    break;
                 case 6:
                    if (curChar == 36)
                       jjstateSet[jjnewStateCnt++] = 7;
                    break;
                 case 8:
                    if ((0x23ff200000000000L & l) == 0L)
                       break;
                    if (kind > 50)
                       kind = 50;
                    jjstateSet[jjnewStateCnt++] = 8;
                    break;
                 case 9:
                    if ((0xafff8ceaffffd9ffL & l) == 0L)
                       break;
                    if (kind > 51)
                       kind = 51;
                    jjCheckNAdd(9);
                    break;
                 case 11:
                    if ((0xffffffffffffdbffL & l) != 0L)
                       jjCheckNAddStates(0, 2);
                    break;
                 case 12:
                    if ((0x2400L & l) != 0L && kind > 52)
                       kind = 52;
                    break;
                 case 13:
                    if (curChar == 10 && kind > 52)
                       kind = 52;
                    break;
                 case 14:
                    if (curChar == 13)
                       jjstateSet[jjnewStateCnt++] = 13;
                    break;
                 case 15:
                    if (curChar == 35)
                       jjstateSet[jjnewStateCnt++] = 10;
                    break;
                 case 17:
                    if ((0x23ff200000000000L & l) == 0L)
                       break;
                    if (kind > 49)
                       kind = 49;
                    jjCheckNAdd(17);
                    break;
                 default : break;
              }
           } while(i != startsAt);
        }
        else if (curChar < 128)
        {
           long l = 1L << (curChar & 077);
           MatchLoop: do
           {
              switch(jjstateSet[--i])
              {
                 case 10:
                 case 9:
                    if ((0xffffffff7fffffffL & l) == 0L)
                       break;
                    if (kind > 51)
                       kind = 51;
                    jjCheckNAdd(9);
                    break;
                 case 1:
                    if ((0xffffffff7fffffffL & l) != 0L)
                    {
                       if (kind > 51)
                          kind = 51;
                       jjCheckNAdd(9);
                    }
                    if ((0x7fffffe87fffffeL & l) != 0L)
                    {
                       if (kind > 48)
                          kind = 48;
                    }
                    if ((0x7fffffe07fffffeL & l) != 0L)
                    {
                       if (kind > 46)
                          kind = 46;
                       jjCheckNAdd(17);
                    }
                    if ((0x7fffffe07fffffeL & l) != 0L)
                    {
                       if (kind > 47)
                          kind = 47;
                    }
                    break;
                 case 18:
                 case 2:
                    jjCheckNAddTwoStates(2, 3);
                    break;
                 case 19:
                    if ((0xffffffff7fffffffL & l) != 0L)
                    {
                       if (kind > 51)
                          kind = 51;
                       jjCheckNAdd(9);
                    }
                    if ((0x7fffffe87fffffeL & l) != 0L)
                    {
                       if (kind > 49)
                          kind = 49;
                       jjCheckNAdd(17);
                    }
                    break;
                 case 4:
                    if ((0x7fffffe07fffffeL & l) != 0L && kind > 47)
                       kind = 47;
                    break;
                 case 5:
                    if ((0x7fffffe87fffffeL & l) != 0L && kind > 48)
                       kind = 48;
                    break;
                 case 7:
                    if ((0x7fffffe07fffffeL & l) == 0L)
                       break;
                    if (kind > 50)
                       kind = 50;
                    jjCheckNAdd(8);
                    break;
                 case 8:
                    if ((0x7fffffe87fffffeL & l) == 0L)
                       break;
                    if (kind > 50)
                       kind = 50;
                    jjCheckNAdd(8);
                    break;
                 case 11:
                    jjAddStates(0, 2);
                    break;
                 case 16:
                    if ((0x7fffffe07fffffeL & l) == 0L)
                       break;
                    if (kind > 46)
                       kind = 46;
                    jjCheckNAdd(17);
                    break;
                 case 17:
                    if ((0x7fffffe87fffffeL & l) == 0L)
                       break;
                    if (kind > 49)
                       kind = 49;
                    jjCheckNAdd(17);
                    break;
                 default : break;
              }
           } while(i != startsAt);
        }
        else
        {
           int i2 = (curChar & 0xff) >> 6;
           long l2 = 1L << (curChar & 077);
           MatchLoop: do
           {
              switch(jjstateSet[--i])
              {
                 case 10:
                 case 9:
                    if ((jjbitVec0[i2] & l2) == 0L)
                       break;
                    if (kind > 51)
                       kind = 51;
                    jjCheckNAdd(9);
                    break;
                 case 1:
                    if ((jjbitVec0[i2] & l2) == 0L)
                       break;
                    if (kind > 51)
                       kind = 51;
                    jjCheckNAdd(9);
                    break;
                 case 18:
                 case 2:
                    if ((jjbitVec0[i2] & l2) != 0L)
                       jjCheckNAddTwoStates(2, 3);
                    break;
                 case 19:
                    if ((jjbitVec0[i2] & l2) == 0L)
                       break;
                    if (kind > 51)
                       kind = 51;
                    jjCheckNAdd(9);
                    break;
                 case 11:
                    if ((jjbitVec0[i2] & l2) != 0L)
                       jjAddStates(0, 2);
                    break;
                 default : break;
              }
           } while(i != startsAt);
        }
        if (kind != 0x7fffffff)
        {
           jjmatchedKind = kind;
           jjmatchedPos = curPos;
           kind = 0x7fffffff;
        }
        ++curPos;
        if ((i = jjnewStateCnt) == (startsAt = 18 - (jjnewStateCnt = startsAt)))
           return curPos;
        try { curChar = input_stream.readChar(); }
        catch(java.io.IOException e) { return curPos; }
     }
  }
  static final int[] jjnextStates = {
     11, 12, 14, 
  };
  public static final String[] jjstrLiteralImages = {
  "", null, null, null, null, null, "\44", "\56", "\50", "\51", "\54", "\42", 
  "\137", null, null, "\55", "\53", "\52", "\57", "\45", "\46\46", "\174\174", "\74", 
  "\74\75", "\76", "\76\75", "\75\75", "\41\75", "\41", "\75", "\151\156", 
  "\164\162\165\145", "\146\141\154\163\145", null, "\173", "\175", 
  "\43\151\156\143\154\165\144\145", "\43\160\141\162\163\145", "\43\151\146", "\43\145\154\163\145\151\146", 
  "\43\145\154\163\145", "\43\146\157\162\145\141\143\150", "\43\163\145\164", 
  "\43\160\141\162\141\155", "\43\165\163\145", "\43\163\164\157\160", null, null, null, null, null, null, 
  null, };
  public static final String[] lexStateNames = {
     "DEFAULT", 
  };
  static final long[] jjtoToken = {
     0xfffffffffdfc1L, 
  };
  static final long[] jjtoSkip = {
     0x1000000000003eL, 
  };
  static final long[] jjtoSpecial = {
     0x10000000000000L, 
  };
  private ASCII_CharStream input_stream;
  private final int[] jjrounds = new int[18];
  private final int[] jjstateSet = new int[36];
  StringBuffer image;
  int jjimageLen;
  int lengthOfMatch;
  protected char curChar;
  public ParserTokenManager(ASCII_CharStream stream)
  {
     if (ASCII_CharStream.staticFlag)
        throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
     input_stream = stream;
  }
  public ParserTokenManager(ASCII_CharStream stream, int lexState)
  {
     this(stream);
     SwitchTo(lexState);
  }
  public void ReInit(ASCII_CharStream stream)
  {
     jjmatchedPos = jjnewStateCnt = 0;
     curLexState = defaultLexState;
     input_stream = stream;
     ReInitRounds();
  }
  private final void ReInitRounds()
  {
     int i;
     jjround = 0x80000001;
     for (i = 18; i-- > 0;)
        jjrounds[i] = 0x80000000;
  }
  public void ReInit(ASCII_CharStream stream, int lexState)
  {
     ReInit(stream);
     SwitchTo(lexState);
  }
  public void SwitchTo(int lexState)
  {
     if (lexState >= 1 || lexState < 0)
        throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
     else
        curLexState = lexState;
  }
  
  private final Token jjFillToken()
  {
     Token t = Token.newToken(jjmatchedKind);
     t.kind = jjmatchedKind;
     String im = jjstrLiteralImages[jjmatchedKind];
     t.image = (im == null) ? input_stream.GetImage() : im;
     t.beginLine = input_stream.getBeginLine();
     t.beginColumn = input_stream.getBeginColumn();
     t.endLine = input_stream.getEndLine();
     t.endColumn = input_stream.getEndColumn();
     return t;
  }
  
  int curLexState = 0;
  int defaultLexState = 0;
  int jjnewStateCnt;
  int jjround;
  int jjmatchedPos;
  int jjmatchedKind;
  
  public final Token getNextToken() 
  {
    int kind;
    Token specialToken = null;
    Token matchedToken;
    int curPos = 0;
  
    EOFLoop :
    for (;;)
    {   
     try   
     {     
        curChar = input_stream.BeginToken();
     }     
     catch(java.io.IOException e)
     {        
        jjmatchedKind = 0;
        matchedToken = jjFillToken();
        matchedToken.specialToken = specialToken;
        CommonTokenAction(matchedToken);
        return matchedToken;
     }
     image = null;
     jjimageLen = 0;
  
     try { input_stream.backup(0);
        while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
           curChar = input_stream.BeginToken();
     }
     catch (java.io.IOException e1) { continue EOFLoop; }
     jjmatchedKind = 0x7fffffff;
     jjmatchedPos = 0;
     curPos = jjMoveStringLiteralDfa0_0();
     if (jjmatchedKind != 0x7fffffff)
     {
        if (jjmatchedPos + 1 < curPos)
           input_stream.backup(curPos - jjmatchedPos - 1);
        if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
        {
           matchedToken = jjFillToken();
           matchedToken.specialToken = specialToken;
           TokenLexicalActions(matchedToken);
           CommonTokenAction(matchedToken);
           return matchedToken;
        }
        else
        {
           if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
           {
              matchedToken = jjFillToken();
              if (specialToken == null)
                 specialToken = matchedToken;
              else
              {
                 matchedToken.specialToken = specialToken;
                 specialToken = (specialToken.next = matchedToken);
              }
           }
           continue EOFLoop;
        }
     }
     int error_line = input_stream.getEndLine();
     int error_column = input_stream.getEndColumn();
     String error_after = null;
     boolean EOFSeen = false;
     try { input_stream.readChar(); input_stream.backup(1); }
     catch (java.io.IOException e1) {
        EOFSeen = true;
        error_after = curPos <= 1 ? "" : input_stream.GetImage();
        if (curChar == '\n' || curChar == '\r') {
           error_line++;
           error_column = 0;
        }
        else
           error_column++;
     }
     if (!EOFSeen) {
        input_stream.backup(1);
        error_after = curPos <= 1 ? "" : input_stream.GetImage();
     }
     throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
    }
  }
  
  final void TokenLexicalActions(Token matchedToken)
  {
     switch(jjmatchedKind)
     {
        case 33 :
          if (image == null)
              image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))));
           else
              image.append(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))));
          if (incMode)
          {
              matchedToken.image = stripQuotes(image.toString());
              pushFile(matchedToken.image);
          }
          incMode = false;
           break;
        case 36 :
          if (image == null)
              image = new StringBuffer(jjstrLiteralImages[36]);
           else
              image.append(jjstrLiteralImages[36]);
          incMode = true;
           break;
        case 37 :
          if (image == null)
              image = new StringBuffer(jjstrLiteralImages[37]);
           else
              image.append(jjstrLiteralImages[37]);
          incMode = true;
           break;
        case 45 :
          if (image == null)
              image = new StringBuffer(jjstrLiteralImages[45]);
           else
              image.append(jjstrLiteralImages[45]);
          matchedToken.kind = EOF;
          fileDepth = 0;
           break;
        default : 
           break;
     }
  }
  }
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/velocity/build
  
  Index: build
  ===================================================================
  #!/bin/sh
  
  jjtree Parser.jjt
  javacc Parser.jj
  ./remove.sh
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/velocity/remove.list
  
  Index: remove.list
  ===================================================================
  ASCII_CharStream.java
  ASTAddNode.java
  ASTAndNode.java
  ASTAssignment.java
  ASTBlock.java
  ASTDivNode.java
  ASTEQNode.java
  ASTElseIfStatement.java
  ASTElseStatement.java
  ASTExpression.java
  ASTFalse.java
  ASTForeachStatement.java
  ASTGENode.java
  ASTGTNode.java
  ASTIdentifier.java
  ASTIfStatement.java
  ASTIncludeStatement.java
  ASTLENode.java
  ASTLTNode.java
  ASTMethod.java
  ASTModNode.java
  ASTMulNode.java
  ASTNENode.java
  ASTNotNode.java
  ASTNumberLiteral.java
  ASTOrNode.java
  ASTParamStatement.java
  ASTParameter.java
  ASTParameters.java
  ASTProperty.java
  ASTPropertyMethod.java
  ASTReference.java
  ASTSetStatement.java
  ASTStringLiteral.java
  ASTSubtractNode.java
  ASTText.java
  ASTTrue.java
  ASTUseStatement.java
  ASTVariable.java
  ASTprocess.java
  Node.java
  ParseException.java
  ParserTreeConstants.java
  ParserVisitor.java
  SimpleNode.java
  Token.java
  TokenMgrError.java
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/velocity/remove.sh
  
  Index: remove.sh
  ===================================================================
  #!/bin/sh
  
  for i in `cat remove.list`
  do
      rm -f $i
  done    
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/webmacro/JJTParserState.java
  
  Index: JJTParserState.java
  ===================================================================
  /* Generated By:JJTree: Do not edit this line. JJTParserState.java */
  
  package org.apache.velocity.processor.javacc.parser.webmacro;
  
  import org.apache.velocity.processor.javacc.parser.*;
  
  class JJTParserState {
    private java.util.Stack nodes;
    private java.util.Stack marks;
  
    private int sp;		// number of nodes on stack
    private int mk;		// current mark
    private boolean node_created;
  
    JJTParserState() {
      nodes = new java.util.Stack();
      marks = new java.util.Stack();
      sp = 0;
      mk = 0;
    }
  
    /* Determines whether the current node was actually closed and
       pushed.  This should only be called in the final user action of a
       node scope.  */
    boolean nodeCreated() {
      return node_created;
    }
  
    /* Call this to reinitialize the node stack.  It is called
       automatically by the parser's ReInit() method. */
    void reset() {
      nodes.removeAllElements();
      marks.removeAllElements();
      sp = 0;
      mk = 0;
    }
  
    /* Returns the root node of the AST.  It only makes sense to call
       this after a successful parse. */
    Node rootNode() {
      return (Node)nodes.elementAt(0);
    }
  
    /* Pushes a node on to the stack. */
    void pushNode(Node n) {
      nodes.push(n);
      ++sp;
    }
  
    /* Returns the node on the top of the stack, and remove it from the
       stack.  */
    Node popNode() {
      if (--sp < mk) {
        mk = ((Integer)marks.pop()).intValue();
      }
      return (Node)nodes.pop();
    }
  
    /* Returns the node currently on the top of the stack. */
    Node peekNode() {
      return (Node)nodes.peek();
    }
  
    /* Returns the number of children on the stack in the current node
       scope. */
    int nodeArity() {
      return sp - mk;
    }
  
  
    void clearNodeScope(Node n) {
      while (sp > mk) {
        popNode();
      }
      mk = ((Integer)marks.pop()).intValue();
    }
  
  
    void openNodeScope(Node n) {
      marks.push(new Integer(mk));
      mk = sp;
      n.jjtOpen();
    }
  
  
    /* A definite node is constructed from a specified number of
       children.  That number of nodes are popped from the stack and
       made the children of the definite node.  Then the definite node
       is pushed on to the stack. */
    void closeNodeScope(Node n, int num) {
      mk = ((Integer)marks.pop()).intValue();
      while (num-- > 0) {
        Node c = popNode();
        c.jjtSetParent(n);
        n.jjtAddChild(c, num);
      }
      n.jjtClose();
      pushNode(n);
      node_created = true;
    }
  
  
    /* A conditional node is constructed if its condition is true.  All
       the nodes that have been pushed since the node was opened are
       made children of the the conditional node, which is then pushed
       on to the stack.  If the condition is false the node is not
       constructed and they are left on the stack. */
    void closeNodeScope(Node n, boolean condition) {
      if (condition) {
        int a = nodeArity();
        mk = ((Integer)marks.pop()).intValue();
        while (a-- > 0) {
  	Node c = popNode();
  	c.jjtSetParent(n);
  	n.jjtAddChild(c, a);
        }
        n.jjtClose();
        pushNode(n);
        node_created = true;
      } else {
        mk = ((Integer)marks.pop()).intValue();
        node_created = false;
      }
    }
  }
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/webmacro/Parser.java
  
  Index: Parser.java
  ===================================================================
  /* Generated By:JJTree&JavaCC: Do not edit this line. Parser.java */
  package org.apache.velocity.processor.javacc.parser.webmacro;
  
  import java.io.*;
  import java.util.*;
  
  import org.apache.velocity.processor.javacc.parser.*;
  
  /**
   * This class is responsible for parsing a Velocity
   * template. This class was generated by JavaCC using
   * the JJTree extension to produce an Abstract
   * Syntax Tree (AST) of the template.
   *
   * Please look at the Parser.jjt file which is
   * what controls the generation of this class.
   *
   * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
   * @version $Id: Parser.java,v 1.1 2000/09/12 01:42:16 jvanzyl Exp $
   */
  public class Parser implements/*@bgen(jjtree)*/ ParserTreeConstants,org.apache.velocity.processor.javacc.parser.Parser, ParserConstants {/*@bgen(jjtree)*/
    protected JJTParserState jjtree = new JJTParserState();
  
      SimpleNode root;
  
      public Parser()
      {
      }
  
      public void parse(InputStream stream) throws ParseException
      {
          jj_input_stream = new ASCII_CharStream(stream, 1, 1);
          token_source = new ParserTokenManager(jj_input_stream);
          token = new Token();
          jj_ntk = -1;
          jj_gen = 0;
          for (int i = 0; i < 23; i++) jj_la1[i] = -1;
          for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  
          root = process();
      }
  
      public SimpleNode getRoot()
      {
          return root;
      }
  
  /**
   * This method is what starts the whole parsing
   * process. After the parsing is complete and
   * the template has been turned into an AST,
   * this method returns the root of AST which
   * can subsequently be traversed by a visitor
   * which implements the ParserVisitor interface
   * which is generated automatically by JavaCC
   */
    final public SimpleNode process() throws ParseException {
                          /*@bgen(jjtree) process */
    ASTprocess jjtn000 = new ASTprocess(this, JJTPROCESS);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        label_1:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case DOLLAR:
          case DOT:
          case LPAREN:
          case RPAREN:
          case COMMA:
          case QUOTE:
          case UNDERSCORE:
          case NUMBER_LITERAL:
          case MINUS:
          case PLUS:
          case MULTIPLY:
          case DIVIDE:
          case MODULUS:
          case LOGICAL_AND:
          case LOGICAL_OR:
          case LOGICAL_LT:
          case LOGICAL_LE:
          case LOGICAL_GT:
          case LOGICAL_GE:
          case LOGICAL_EQUALS:
          case LOGICAL_NOT_EQUALS:
          case LOGICAL_NOT:
          case EQUALS:
          case IN:
          case TRUE:
          case FALSE:
          case STRING_LITERAL:
          case BEGIN:
          case INCLUDE_DIRECTIVE:
          case PARSE_DIRECTIVE:
          case IF_DIRECTIVE:
          case ELSEIF_DIRECTIVE:
          case FOREACH_DIRECTIVE:
          case SET_DIRECTIVE:
          case PARAM_DIRECTIVE:
          case USE_DIRECTIVE:
          case STOP_DIRECTIVE:
          case ALPHA_CHAR:
          case IDENTIFIER:
          case DIDENTIFIER:
          case TEXT:
            ;
            break;
          default:
            jj_la1[0] = jj_gen;
            break label_1;
          }
          Statement();
        }
        jj_consume_token(0);
       jjtree.closeNodeScope(jjtn000, true);
       jjtc000 = false;
       {if (true) return jjtn000;}
      } catch (Throwable jjte000) {
       if (jjtc000) {
         jjtree.clearNodeScope(jjtn000);
         jjtc000 = false;
       } else {
         jjtree.popNode();
       }
       if (jjte000 instanceof RuntimeException) {
         {if (true) throw (RuntimeException)jjte000;}
       }
       if (jjte000 instanceof ParseException) {
         {if (true) throw (ParseException)jjte000;}
       }
       {if (true) throw (Error)jjte000;}
      } finally {
       if (jjtc000) {
         jjtree.closeNodeScope(jjtn000, true);
       }
      }
      throw new Error("Missing return statement in function");
    }
  
  /*
   * Expression syntax follows.
   */
  
  /*
  void Expression() : {}
  {
      //Reference()
      True()
  |   False()
  |   LOOKAHEAD( PrimaryExpression() "=" ) Assignment()
  |   ConditionalOrExpression()
  }
  */
    final public void Expression() throws ParseException {
                       /*@bgen(jjtree) Expression */
    ASTExpression jjtn000 = new ASTExpression(this, JJTEXPRESSION);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case STRING_LITERAL:
          StringLiteral();
          break;
        case NUMBER_LITERAL:
          NumberLiteral();
          break;
        case DIDENTIFIER:
          Reference();
          break;
        case TRUE:
          True();
          break;
        case FALSE:
          False();
          break;
        default:
          jj_la1[1] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte000;}
        }
        if (jjte000 instanceof ParseException) {
          {if (true) throw (ParseException)jjte000;}
        }
        {if (true) throw (Error)jjte000;}
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
    final public void Assignment() throws ParseException {
                                      /*@bgen(jjtree) #Assignment( 2) */
    ASTAssignment jjtn000 = new ASTAssignment(this, JJTASSIGNMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        PrimaryExpression();
        jj_consume_token(EQUALS);
        Expression();
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte000;}
        }
        if (jjte000 instanceof ParseException) {
          {if (true) throw (ParseException)jjte000;}
        }
        {if (true) throw (Error)jjte000;}
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000,  2);
        }
      }
    }
  
    final public void ConditionalOrExpression() throws ParseException {
      ConditionalAndExpression();
      label_2:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case LOGICAL_OR:
          ;
          break;
        default:
          jj_la1[2] = jj_gen;
          break label_2;
        }
        jj_consume_token(LOGICAL_OR);
                     ASTOrNode jjtn001 = new ASTOrNode(this, JJTORNODE);
                     boolean jjtc001 = true;
                     jjtree.openNodeScope(jjtn001);
        try {
          ConditionalAndExpression();
        } catch (Throwable jjte001) {
                     if (jjtc001) {
                       jjtree.clearNodeScope(jjtn001);
                       jjtc001 = false;
                     } else {
                       jjtree.popNode();
                     }
                     if (jjte001 instanceof RuntimeException) {
                       {if (true) throw (RuntimeException)jjte001;}
                     }
                     if (jjte001 instanceof ParseException) {
                       {if (true) throw (ParseException)jjte001;}
                     }
                     {if (true) throw (Error)jjte001;}
        } finally {
                     if (jjtc001) {
                       jjtree.closeNodeScope(jjtn001,  2);
                     }
        }
      }
    }
  
    final public void ConditionalAndExpression() throws ParseException {
      EqualityExpression();
      label_3:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case LOGICAL_AND:
          ;
          break;
        default:
          jj_la1[3] = jj_gen;
          break label_3;
        }
        jj_consume_token(LOGICAL_AND);
                       ASTAndNode jjtn001 = new ASTAndNode(this, JJTANDNODE);
                       boolean jjtc001 = true;
                       jjtree.openNodeScope(jjtn001);
        try {
          EqualityExpression();
        } catch (Throwable jjte001) {
                       if (jjtc001) {
                         jjtree.clearNodeScope(jjtn001);
                         jjtc001 = false;
                       } else {
                         jjtree.popNode();
                       }
                       if (jjte001 instanceof RuntimeException) {
                         {if (true) throw (RuntimeException)jjte001;}
                       }
                       if (jjte001 instanceof ParseException) {
                         {if (true) throw (ParseException)jjte001;}
                       }
                       {if (true) throw (Error)jjte001;}
        } finally {
                       if (jjtc001) {
                         jjtree.closeNodeScope(jjtn001,  2);
                       }
        }
      }
    }
  
  /*
  
  void ConditionalAndExpression() #void : {}
  {
    InclusiveOrExpression()
    ( <LOGICAL_AND>  InclusiveOrExpression() #AndNode(2) )*
  }
  
  
  void InclusiveOrExpression() #void : {}
  {
    ExclusiveOrExpression()
    ( "|" ExclusiveOrExpression() #BitwiseOrNode(2) )*
  }
  
  void ExclusiveOrExpression() #void : {}
  {
    AndExpression()
    ( "^" AndExpression() #BitwiseXorNode(2) )*
  }
  
  void AndExpression() #void : {}
  {
    EqualityExpression()
    ( "&" EqualityExpression() #BitwiseAndNode(2) )*
  }
  
  */
    final public void EqualityExpression() throws ParseException {
      RelationalExpression();
      label_4:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case LOGICAL_EQUALS:
        case LOGICAL_NOT_EQUALS:
          ;
          break;
        default:
          jj_la1[4] = jj_gen;
          break label_4;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case LOGICAL_EQUALS:
          jj_consume_token(LOGICAL_EQUALS);
                               ASTEQNode jjtn001 = new ASTEQNode(this, JJTEQNODE);
                               boolean jjtc001 = true;
                               jjtree.openNodeScope(jjtn001);
          try {
            RelationalExpression();
          } catch (Throwable jjte001) {
                               if (jjtc001) {
                                 jjtree.clearNodeScope(jjtn001);
                                 jjtc001 = false;
                               } else {
                                 jjtree.popNode();
                               }
                               if (jjte001 instanceof RuntimeException) {
                                 {if (true) throw (RuntimeException)jjte001;}
                               }
                               if (jjte001 instanceof ParseException) {
                                 {if (true) throw (ParseException)jjte001;}
                               }
                               {if (true) throw (Error)jjte001;}
          } finally {
                               if (jjtc001) {
                                 jjtree.closeNodeScope(jjtn001,  2);
                               }
          }
          break;
        case LOGICAL_NOT_EQUALS:
          jj_consume_token(LOGICAL_NOT_EQUALS);
                                   ASTNENode jjtn002 = new ASTNENode(this, JJTNENODE);
                                   boolean jjtc002 = true;
                                   jjtree.openNodeScope(jjtn002);
          try {
            RelationalExpression();
          } catch (Throwable jjte002) {
                                   if (jjtc002) {
                                     jjtree.clearNodeScope(jjtn002);
                                     jjtc002 = false;
                                   } else {
                                     jjtree.popNode();
                                   }
                                   if (jjte002 instanceof RuntimeException) {
                                     {if (true) throw (RuntimeException)jjte002;}
                                   }
                                   if (jjte002 instanceof ParseException) {
                                     {if (true) throw (ParseException)jjte002;}
                                   }
                                   {if (true) throw (Error)jjte002;}
          } finally {
                                   if (jjtc002) {
                                     jjtree.closeNodeScope(jjtn002,  2);
                                   }
          }
          break;
        default:
          jj_la1[5] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
    }
  
    final public void RelationalExpression() throws ParseException {
      AdditiveExpression();
      label_5:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case LOGICAL_LT:
        case LOGICAL_LE:
        case LOGICAL_GT:
        case LOGICAL_GE:
          ;
          break;
        default:
          jj_la1[6] = jj_gen;
          break label_5;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case LOGICAL_LT:
          jj_consume_token(LOGICAL_LT);
                           ASTLTNode jjtn001 = new ASTLTNode(this, JJTLTNODE);
                           boolean jjtc001 = true;
                           jjtree.openNodeScope(jjtn001);
          try {
            AdditiveExpression();
          } catch (Throwable jjte001) {
                           if (jjtc001) {
                             jjtree.clearNodeScope(jjtn001);
                             jjtc001 = false;
                           } else {
                             jjtree.popNode();
                           }
                           if (jjte001 instanceof RuntimeException) {
                             {if (true) throw (RuntimeException)jjte001;}
                           }
                           if (jjte001 instanceof ParseException) {
                             {if (true) throw (ParseException)jjte001;}
                           }
                           {if (true) throw (Error)jjte001;}
          } finally {
                           if (jjtc001) {
                             jjtree.closeNodeScope(jjtn001,  2);
                           }
          }
          break;
        case LOGICAL_GT:
          jj_consume_token(LOGICAL_GT);
                           ASTGTNode jjtn002 = new ASTGTNode(this, JJTGTNODE);
                           boolean jjtc002 = true;
                           jjtree.openNodeScope(jjtn002);
          try {
            AdditiveExpression();
          } catch (Throwable jjte002) {
                           if (jjtc002) {
                             jjtree.clearNodeScope(jjtn002);
                             jjtc002 = false;
                           } else {
                             jjtree.popNode();
                           }
                           if (jjte002 instanceof RuntimeException) {
                             {if (true) throw (RuntimeException)jjte002;}
                           }
                           if (jjte002 instanceof ParseException) {
                             {if (true) throw (ParseException)jjte002;}
                           }
                           {if (true) throw (Error)jjte002;}
          } finally {
                           if (jjtc002) {
                             jjtree.closeNodeScope(jjtn002,  2);
                           }
          }
          break;
        case LOGICAL_LE:
          jj_consume_token(LOGICAL_LE);
                           ASTLENode jjtn003 = new ASTLENode(this, JJTLENODE);
                           boolean jjtc003 = true;
                           jjtree.openNodeScope(jjtn003);
          try {
            AdditiveExpression();
          } catch (Throwable jjte003) {
                           if (jjtc003) {
                             jjtree.clearNodeScope(jjtn003);
                             jjtc003 = false;
                           } else {
                             jjtree.popNode();
                           }
                           if (jjte003 instanceof RuntimeException) {
                             {if (true) throw (RuntimeException)jjte003;}
                           }
                           if (jjte003 instanceof ParseException) {
                             {if (true) throw (ParseException)jjte003;}
                           }
                           {if (true) throw (Error)jjte003;}
          } finally {
                           if (jjtc003) {
                             jjtree.closeNodeScope(jjtn003,  2);
                           }
          }
          break;
        case LOGICAL_GE:
          jj_consume_token(LOGICAL_GE);
                           ASTGENode jjtn004 = new ASTGENode(this, JJTGENODE);
                           boolean jjtc004 = true;
                           jjtree.openNodeScope(jjtn004);
          try {
            AdditiveExpression();
          } catch (Throwable jjte004) {
                           if (jjtc004) {
                             jjtree.clearNodeScope(jjtn004);
                             jjtc004 = false;
                           } else {
                             jjtree.popNode();
                           }
                           if (jjte004 instanceof RuntimeException) {
                             {if (true) throw (RuntimeException)jjte004;}
                           }
                           if (jjte004 instanceof ParseException) {
                             {if (true) throw (ParseException)jjte004;}
                           }
                           {if (true) throw (Error)jjte004;}
          } finally {
                           if (jjtc004) {
                             jjtree.closeNodeScope(jjtn004,  2);
                           }
          }
          break;
        default:
          jj_la1[7] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
    }
  
    final public void AdditiveExpression() throws ParseException {
      MultiplicativeExpression();
      label_6:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case MINUS:
        case PLUS:
          ;
          break;
        default:
          jj_la1[8] = jj_gen;
          break label_6;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case PLUS:
          jj_consume_token(PLUS);
                      ASTAddNode jjtn001 = new ASTAddNode(this, JJTADDNODE);
                      boolean jjtc001 = true;
                      jjtree.openNodeScope(jjtn001);
          try {
            MultiplicativeExpression();
          } catch (Throwable jjte001) {
                      if (jjtc001) {
                        jjtree.clearNodeScope(jjtn001);
                        jjtc001 = false;
                      } else {
                        jjtree.popNode();
                      }
                      if (jjte001 instanceof RuntimeException) {
                        {if (true) throw (RuntimeException)jjte001;}
                      }
                      if (jjte001 instanceof ParseException) {
                        {if (true) throw (ParseException)jjte001;}
                      }
                      {if (true) throw (Error)jjte001;}
          } finally {
                      if (jjtc001) {
                        jjtree.closeNodeScope(jjtn001,  2);
                      }
          }
          break;
        case MINUS:
          jj_consume_token(MINUS);
                      ASTSubtractNode jjtn002 = new ASTSubtractNode(this, JJTSUBTRACTNODE);
                      boolean jjtc002 = true;
                      jjtree.openNodeScope(jjtn002);
          try {
            MultiplicativeExpression();
          } catch (Throwable jjte002) {
                      if (jjtc002) {
                        jjtree.clearNodeScope(jjtn002);
                        jjtc002 = false;
                      } else {
                        jjtree.popNode();
                      }
                      if (jjte002 instanceof RuntimeException) {
                        {if (true) throw (RuntimeException)jjte002;}
                      }
                      if (jjte002 instanceof ParseException) {
                        {if (true) throw (ParseException)jjte002;}
                      }
                      {if (true) throw (Error)jjte002;}
          } finally {
                      if (jjtc002) {
                        jjtree.closeNodeScope(jjtn002,  2);
                      }
          }
          break;
        default:
          jj_la1[9] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
    }
  
    final public void MultiplicativeExpression() throws ParseException {
      UnaryExpression();
      label_7:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case MULTIPLY:
        case DIVIDE:
        case MODULUS:
          ;
          break;
        default:
          jj_la1[10] = jj_gen;
          break label_7;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case MULTIPLY:
          jj_consume_token(MULTIPLY);
                    ASTMulNode jjtn001 = new ASTMulNode(this, JJTMULNODE);
                    boolean jjtc001 = true;
                    jjtree.openNodeScope(jjtn001);
          try {
            UnaryExpression();
          } catch (Throwable jjte001) {
                    if (jjtc001) {
                      jjtree.clearNodeScope(jjtn001);
                      jjtc001 = false;
                    } else {
                      jjtree.popNode();
                    }
                    if (jjte001 instanceof RuntimeException) {
                      {if (true) throw (RuntimeException)jjte001;}
                    }
                    if (jjte001 instanceof ParseException) {
                      {if (true) throw (ParseException)jjte001;}
                    }
                    {if (true) throw (Error)jjte001;}
          } finally {
                    if (jjtc001) {
                      jjtree.closeNodeScope(jjtn001,  2);
                    }
          }
          break;
        case DIVIDE:
          jj_consume_token(DIVIDE);
                    ASTDivNode jjtn002 = new ASTDivNode(this, JJTDIVNODE);
                    boolean jjtc002 = true;
                    jjtree.openNodeScope(jjtn002);
          try {
            UnaryExpression();
          } catch (Throwable jjte002) {
                    if (jjtc002) {
                      jjtree.clearNodeScope(jjtn002);
                      jjtc002 = false;
                    } else {
                      jjtree.popNode();
                    }
                    if (jjte002 instanceof RuntimeException) {
                      {if (true) throw (RuntimeException)jjte002;}
                    }
                    if (jjte002 instanceof ParseException) {
                      {if (true) throw (ParseException)jjte002;}
                    }
                    {if (true) throw (Error)jjte002;}
          } finally {
                    if (jjtc002) {
                      jjtree.closeNodeScope(jjtn002,  2);
                    }
          }
          break;
        case MODULUS:
          jj_consume_token(MODULUS);
                    ASTModNode jjtn003 = new ASTModNode(this, JJTMODNODE);
                    boolean jjtc003 = true;
                    jjtree.openNodeScope(jjtn003);
          try {
            UnaryExpression();
          } catch (Throwable jjte003) {
                    if (jjtc003) {
                      jjtree.clearNodeScope(jjtn003);
                      jjtc003 = false;
                    } else {
                      jjtree.popNode();
                    }
                    if (jjte003 instanceof RuntimeException) {
                      {if (true) throw (RuntimeException)jjte003;}
                    }
                    if (jjte003 instanceof ParseException) {
                      {if (true) throw (ParseException)jjte003;}
                    }
                    {if (true) throw (Error)jjte003;}
          } finally {
                    if (jjtc003) {
                      jjtree.closeNodeScope(jjtn003,  2);
                    }
          }
          break;
        default:
          jj_la1[11] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
    }
  
    final public void UnaryExpression() throws ParseException {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case LOGICAL_NOT:
        jj_consume_token(LOGICAL_NOT);
                      ASTNotNode jjtn001 = new ASTNotNode(this, JJTNOTNODE);
                      boolean jjtc001 = true;
                      jjtree.openNodeScope(jjtn001);
        try {
          UnaryExpression();
        } catch (Throwable jjte001) {
                      if (jjtc001) {
                        jjtree.clearNodeScope(jjtn001);
                        jjtc001 = false;
                      } else {
                        jjtree.popNode();
                      }
                      if (jjte001 instanceof RuntimeException) {
                        {if (true) throw (RuntimeException)jjte001;}
                      }
                      if (jjte001 instanceof ParseException) {
                        {if (true) throw (ParseException)jjte001;}
                      }
                      {if (true) throw (Error)jjte001;}
        } finally {
                      if (jjtc001) {
                        jjtree.closeNodeScope(jjtn001,  1);
                      }
        }
        break;
      case LPAREN:
      case NUMBER_LITERAL:
      case STRING_LITERAL:
      case DIDENTIFIER:
        PrimaryExpression();
        break;
      default:
        jj_la1[12] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    }
  
    final public void PrimaryExpression() throws ParseException {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case STRING_LITERAL:
        StringLiteral();
        break;
      case NUMBER_LITERAL:
        NumberLiteral();
        break;
      case DIDENTIFIER:
        Reference();
        break;
      case LPAREN:
        jj_consume_token(LPAREN);
        Expression();
        jj_consume_token(RPAREN);
        break;
      default:
        jj_la1[13] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    }
  
  /**
   * These are the types of statements that
   * are acceptable in Velocity templates.
   * I have not found that the order here
   * matters much. Someone please correct
   * me here if I'm wrong.
   */
    final public void Statement() throws ParseException {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case DOLLAR:
      case DOT:
      case LPAREN:
      case RPAREN:
      case COMMA:
      case QUOTE:
      case UNDERSCORE:
      case NUMBER_LITERAL:
      case MINUS:
      case PLUS:
      case MULTIPLY:
      case DIVIDE:
      case MODULUS:
      case LOGICAL_AND:
      case LOGICAL_OR:
      case LOGICAL_LT:
      case LOGICAL_LE:
      case LOGICAL_GT:
      case LOGICAL_GE:
      case LOGICAL_EQUALS:
      case LOGICAL_NOT_EQUALS:
      case LOGICAL_NOT:
      case EQUALS:
      case IN:
      case TRUE:
      case FALSE:
      case STRING_LITERAL:
      case ALPHA_CHAR:
      case IDENTIFIER:
      case TEXT:
        Text();
        break;
      case BEGIN:
        Block();
        break;
      case IF_DIRECTIVE:
        IfStatement();
        break;
      case ELSEIF_DIRECTIVE:
        ElseIfStatement();
        break;
      case FOREACH_DIRECTIVE:
        ForeachStatement();
        break;
      case INCLUDE_DIRECTIVE:
        IncludeStatement();
        break;
      case SET_DIRECTIVE:
        SetStatement();
        break;
      case PARSE_DIRECTIVE:
        ParseStatement();
        break;
      case USE_DIRECTIVE:
        UseStatement();
        break;
      case PARAM_DIRECTIVE:
        ParamStatement();
        break;
      case STOP_DIRECTIVE:
        StopStatement();
        break;
      case DIDENTIFIER:
        Reference();
        break;
      default:
        jj_la1[14] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    }
  
    final public void NumberLiteral() throws ParseException {
                          /*@bgen(jjtree) NumberLiteral */
    ASTNumberLiteral jjtn000 = new ASTNumberLiteral(this, JJTNUMBERLITERAL);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(NUMBER_LITERAL);
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
    final public void StringLiteral() throws ParseException {
                          /*@bgen(jjtree) StringLiteral */
    ASTStringLiteral jjtn000 = new ASTStringLiteral(this, JJTSTRINGLITERAL);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(STRING_LITERAL);
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
  /**
   * This method corresponds to variable
   * references in Velocity templates.
   * The following are examples of variable
   * references that may be found in a
   * template:
   *
   * $foo
   * $bar
   *
   */
    final public void Identifier() throws ParseException {
                       /*@bgen(jjtree) Identifier */
    ASTIdentifier jjtn000 = new ASTIdentifier(this, JJTIDENTIFIER);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(IDENTIFIER);
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
  /**
   * This method has yet to be fully implemented
   * but will allow arbitrarily nested method
   * calls
   */
    final public void Parameter() throws ParseException {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case DIDENTIFIER:
        Reference();
        break;
      case STRING_LITERAL:
        StringLiteral();
        break;
      default:
        jj_la1[15] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    }
  
  /**
   * This method has yet to be fully implemented
   * but will allow arbitrarily nested method
   * calls
   */
    final public void Method() throws ParseException {
                   /*@bgen(jjtree) Method */
    ASTMethod jjtn000 = new ASTMethod(this, JJTMETHOD);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        Identifier();
        jj_consume_token(LPAREN);
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case STRING_LITERAL:
        case DIDENTIFIER:
          Parameter();
          label_8:
          while (true) {
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case COMMA:
              ;
              break;
            default:
              jj_la1[16] = jj_gen;
              break label_8;
            }
            jj_consume_token(COMMA);
            Parameter();
          }
          break;
        default:
          jj_la1[17] = jj_gen;
          ;
        }
        jj_consume_token(RPAREN);
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte000;}
        }
        if (jjte000 instanceof ParseException) {
          {if (true) throw (ParseException)jjte000;}
        }
        {if (true) throw (Error)jjte000;}
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
    final public void Reference() throws ParseException {
                      /*@bgen(jjtree) Reference */
    ASTReference jjtn000 = new ASTReference(this, JJTREFERENCE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(DIDENTIFIER);
        label_9:
        while (true) {
          if (jj_2_1(2)) {
            ;
          } else {
            break label_9;
          }
          jj_consume_token(DOT);
          if (jj_2_2(3)) {
            Method();
          } else {
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case IDENTIFIER:
              Identifier();
              break;
            default:
              jj_la1[18] = jj_gen;
              jj_consume_token(-1);
              throw new ParseException();
            }
          }
        }
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte000;}
        }
        if (jjte000 instanceof ParseException) {
          {if (true) throw (ParseException)jjte000;}
        }
        {if (true) throw (Error)jjte000;}
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
    final public void True() throws ParseException {
                 /*@bgen(jjtree) True */
    ASTTrue jjtn000 = new ASTTrue(this, JJTTRUE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(TRUE);
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
    final public void False() throws ParseException {
                  /*@bgen(jjtree) False */
    ASTFalse jjtn000 = new ASTFalse(this, JJTFALSE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(FALSE);
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
  /**
   * This method corresponds to a block in
   * a Velocity template. Blocks are
   * currently associated with:
   *
   * #if
   * #foreach
   * #while (not implemented)
   *
   */
    final public void Block() throws ParseException {
                  /*@bgen(jjtree) Block */
    ASTBlock jjtn000 = new ASTBlock(this, JJTBLOCK);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(BEGIN);
        label_10:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case DOLLAR:
          case DOT:
          case LPAREN:
          case RPAREN:
          case COMMA:
          case QUOTE:
          case UNDERSCORE:
          case NUMBER_LITERAL:
          case MINUS:
          case PLUS:
          case MULTIPLY:
          case DIVIDE:
          case MODULUS:
          case LOGICAL_AND:
          case LOGICAL_OR:
          case LOGICAL_LT:
          case LOGICAL_LE:
          case LOGICAL_GT:
          case LOGICAL_GE:
          case LOGICAL_EQUALS:
          case LOGICAL_NOT_EQUALS:
          case LOGICAL_NOT:
          case EQUALS:
          case IN:
          case TRUE:
          case FALSE:
          case STRING_LITERAL:
          case BEGIN:
          case INCLUDE_DIRECTIVE:
          case PARSE_DIRECTIVE:
          case IF_DIRECTIVE:
          case ELSEIF_DIRECTIVE:
          case FOREACH_DIRECTIVE:
          case SET_DIRECTIVE:
          case PARAM_DIRECTIVE:
          case USE_DIRECTIVE:
          case STOP_DIRECTIVE:
          case ALPHA_CHAR:
          case IDENTIFIER:
          case DIDENTIFIER:
          case TEXT:
            ;
            break;
          default:
            jj_la1[19] = jj_gen;
            break label_10;
          }
          Statement();
        }
        jj_consume_token(END);
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte000;}
        }
        if (jjte000 instanceof ParseException) {
          {if (true) throw (ParseException)jjte000;}
        }
        {if (true) throw (Error)jjte000;}
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
  /**
   * This method is responsible for allowing
   * all non-grammar text to pass through
   * unscathed.
   */
    final public void Text() throws ParseException {
                 /*@bgen(jjtree) Text */
    ASTText jjtn000 = new ASTText(this, JJTTEXT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case TEXT:
          jj_consume_token(TEXT);
          break;
        case ALPHA_CHAR:
          jj_consume_token(ALPHA_CHAR);
          break;
        case IDENTIFIER:
          jj_consume_token(IDENTIFIER);
          break;
        case DOLLAR:
          jj_consume_token(DOLLAR);
          break;
        case DOT:
          jj_consume_token(DOT);
          break;
        case LPAREN:
          jj_consume_token(LPAREN);
          break;
        case RPAREN:
          jj_consume_token(RPAREN);
          break;
        case COMMA:
          jj_consume_token(COMMA);
          break;
        case QUOTE:
          jj_consume_token(QUOTE);
          break;
        case MINUS:
          jj_consume_token(MINUS);
          break;
        case PLUS:
          jj_consume_token(PLUS);
          break;
        case MULTIPLY:
          jj_consume_token(MULTIPLY);
          break;
        case DIVIDE:
          jj_consume_token(DIVIDE);
          break;
        case MODULUS:
          jj_consume_token(MODULUS);
          break;
        case UNDERSCORE:
          jj_consume_token(UNDERSCORE);
          break;
        case EQUALS:
          jj_consume_token(EQUALS);
          break;
        case IN:
          jj_consume_token(IN);
          break;
        case TRUE:
          jj_consume_token(TRUE);
          break;
        case FALSE:
          jj_consume_token(FALSE);
          break;
        case STRING_LITERAL:
          jj_consume_token(STRING_LITERAL);
          break;
        case LOGICAL_AND:
          jj_consume_token(LOGICAL_AND);
          break;
        case LOGICAL_OR:
          jj_consume_token(LOGICAL_OR);
          break;
        case LOGICAL_LT:
          jj_consume_token(LOGICAL_LT);
          break;
        case LOGICAL_LE:
          jj_consume_token(LOGICAL_LE);
          break;
        case LOGICAL_GT:
          jj_consume_token(LOGICAL_GT);
          break;
        case LOGICAL_GE:
          jj_consume_token(LOGICAL_GE);
          break;
        case LOGICAL_EQUALS:
          jj_consume_token(LOGICAL_EQUALS);
          break;
        case LOGICAL_NOT_EQUALS:
          jj_consume_token(LOGICAL_NOT_EQUALS);
          break;
        case LOGICAL_NOT:
          jj_consume_token(LOGICAL_NOT);
          break;
        case NUMBER_LITERAL:
          jj_consume_token(NUMBER_LITERAL);
          break;
        default:
          jj_la1[20] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
  /**
   * This method corresponds to an #if directive
   * in a Velocity template. The following are
   * examples if #if constructs that are
   * acceptable in a template:
   *
   * #if ($customer.owesMoney() && $customer.Name == "Fred") (not implemented)
   * {
   *     Pay up, or else!
   * }
   * #else
   * {
   *     Thankyou for your patronage.
   * }
   *
   * #if ($dynanmicContent)
   * {
   *     This is our $dynamicContent
   * }
   *
   * #if ($customer.owesMoney())
   * {
   *     You better pay up!
   * }
   *
   */
    final public void IfStatement() throws ParseException {
                        /*@bgen(jjtree) IfStatement */
    ASTIfStatement jjtn000 = new ASTIfStatement(this, JJTIFSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(IF_DIRECTIVE);
        jj_consume_token(LPAREN);
        Expression();
        jj_consume_token(RPAREN);
        Statement();
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case ELSE_DIRECTIVE:
          ElseStatement();
          break;
        default:
          jj_la1[21] = jj_gen;
          ;
        }
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte000;}
        }
        if (jjte000 instanceof ParseException) {
          {if (true) throw (ParseException)jjte000;}
        }
        {if (true) throw (Error)jjte000;}
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
    final public void ElseStatement() throws ParseException {
                          /*@bgen(jjtree) ElseStatement */
    ASTElseStatement jjtn000 = new ASTElseStatement(this, JJTELSESTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(ELSE_DIRECTIVE);
        Statement();
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte000;}
        }
        if (jjte000 instanceof ParseException) {
          {if (true) throw (ParseException)jjte000;}
        }
        {if (true) throw (Error)jjte000;}
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
    final public void ElseIfStatement() throws ParseException {
                            /*@bgen(jjtree) ElseIfStatement */
    ASTElseIfStatement jjtn000 = new ASTElseIfStatement(this, JJTELSEIFSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(ELSEIF_DIRECTIVE);
        jj_consume_token(LPAREN);
        Expression();
        jj_consume_token(RPAREN);
        Statement();
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case ELSE_DIRECTIVE:
          ElseStatement();
          break;
        default:
          jj_la1[22] = jj_gen;
          ;
        }
      } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
      } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
      }
    }
  
  /**
   * This method corresponds to a #foreach
   * directive in a Velocity template. The
   * following are examples of #foreach
   * constructs that are acceptable in
   * a template:
   *
   * #foreach $element in $list
   * {
   *     This is the fifth $element
   * }
   *
   * #foreach $element in $foo.List
   * {
   *     This is the fifth $element
   * }
   *
   * #foreach $element in $foo.getList()
   * {
   *     This is the fifth $element
   * }
   *
   */
    final public void ForeachStatement() throws ParseException {
                             /*@bgen(jjtree) ForeachStatement */
    ASTForeachStatement jjtn000 = new ASTForeachStatement(this, JJTFOREACHSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(FOREACH_DIRECTIVE);
        Reference();
        jj_consume_token(IN);
        Reference();
        Statement();
      } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
      } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
      }
    }
  
  /**
   * This method corresponds to an #include
   * directive in a Velocity template. The
   * following are examples of #include
   * constructs that are acceptable in
   * a template:
   *
   * #include "foo.inc" 
   */
    final public void IncludeStatement() throws ParseException {
      jj_consume_token(INCLUDE_DIRECTIVE);
      jj_consume_token(STRING_LITERAL);
    }
  
  /**
   * This method corresponds to a #set
   * directive in a Velocity template. The
   * following are examples of #set
   * constructs that are acceptable in
   * a template:
   *
   * #set name = "Fred"
   * #set $Customer.Name = "Sidney"
   * #set $Database.findItem($partNum).Description = $newDescription (not implemented)
   *
   */
    final public void SetStatement() throws ParseException {
                         /*@bgen(jjtree) SetStatement */
    ASTSetStatement jjtn000 = new ASTSetStatement(this, JJTSETSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(SET_DIRECTIVE);
        Reference();
        jj_consume_token(EQUALS);
        Expression();
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte000;}
        }
        if (jjte000 instanceof ParseException) {
          {if (true) throw (ParseException)jjte000;}
        }
        {if (true) throw (Error)jjte000;}
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
    }
  
  /**
   * This method corresponds to a #parse
   * directive in a Velocity template. The
   * following are examples of #parse
   * constructs that are acceptable in
   * a template:
   *
   * #parse "bar.vt"
   */
    final public void ParseStatement() throws ParseException {
      jj_consume_token(PARSE_DIRECTIVE);
      jj_consume_token(STRING_LITERAL);
    }
  
  /**
   * This method corresponds to a #use
   * directive in a Velocity template. The
   * following are examples of #use
   * constructs that are acceptable in
   * a template:
   *
   * This has not been implemented and may
   * not need to be because the Velocity
   * parser doesn't have any problem with
   * normal text that isn't part of Velocity's
   * grammar.
   *
   */
    final public void UseStatement() throws ParseException {
                         /*@bgen(jjtree) UseStatement */
    ASTUseStatement jjtn000 = new ASTUseStatement(this, JJTUSESTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(USE_DIRECTIVE);
      } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
      }
    }
  
  /**
   * This method corresponds to a #param
   * directive in a Velocity template. The
   * following are examples of #param
   * constructs that are acceptable in
   * a template:
   *
   * #param $language = "en"
   *
   */
    final public void ParamStatement() throws ParseException {
                           /*@bgen(jjtree) ParamStatement */
    ASTParamStatement jjtn000 = new ASTParamStatement(this, JJTPARAMSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
      try {
        jj_consume_token(PARAM_DIRECTIVE);
        Reference();
        jj_consume_token(EQUALS);
        jj_consume_token(STRING_LITERAL);
      } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
      } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
      }
    }
  
  /**
   * This method corresponds to the #stop
   * directive which just simulates and EOF
   * so that parsing stops. The #stop directive
   * is really only useful for debugging
   * purposes.
   */
    final public void StopStatement() throws ParseException {
      jj_consume_token(STOP_DIRECTIVE);
    }
  
    final private boolean jj_2_1(int xla) {
      jj_la = xla; jj_lastpos = jj_scanpos = token;
      boolean retval = !jj_3_1();
      jj_save(0, xla);
      return retval;
    }
  
    final private boolean jj_2_2(int xla) {
      jj_la = xla; jj_lastpos = jj_scanpos = token;
      boolean retval = !jj_3_2();
      jj_save(1, xla);
      return retval;
    }
  
    final private boolean jj_3R_19() {
      if (jj_scan_token(STRING_LITERAL)) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3R_18() {
      if (jj_scan_token(DIDENTIFIER)) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3R_17() {
      if (jj_3R_19()) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3R_13() {
      if (jj_scan_token(IDENTIFIER)) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3R_14() {
      if (jj_3R_15()) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3R_12() {
      if (jj_3R_13()) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      if (jj_scan_token(LPAREN)) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      Token xsp;
      xsp = jj_scanpos;
      if (jj_3R_14()) jj_scanpos = xsp;
      else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      if (jj_scan_token(RPAREN)) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3_1() {
      if (jj_scan_token(DOT)) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      Token xsp;
      xsp = jj_scanpos;
      if (jj_3_2()) {
      jj_scanpos = xsp;
      if (jj_3R_11()) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3R_11() {
      if (jj_3R_13()) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3_2() {
      if (jj_3R_12()) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3R_15() {
      Token xsp;
      xsp = jj_scanpos;
      if (jj_3R_16()) {
      jj_scanpos = xsp;
      if (jj_3R_17()) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    final private boolean jj_3R_16() {
      if (jj_3R_18()) return true;
      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
      return false;
    }
  
    public ParserTokenManager token_source;
    ASCII_CharStream jj_input_stream;
    public Token token, jj_nt;
    private int jj_ntk;
    private Token jj_scanpos, jj_lastpos;
    private int jj_la;
    public boolean lookingAhead = false;
    private boolean jj_semLA;
    private int jj_gen;
    final private int[] jj_la1 = new int[23];
    final private int[] jj_la1_0 = {0xffffdfc0,0x80004000,0x200000,0x100000,0xc000000,0xc000000,0x3c00000,0x3c00000,0x18000,0x18000,0xe0000,0xe0000,0x10004100,0x4100,0xffffdfc0,0x0,0x400,0x0,0x0,0xffffdfc0,0xffffdfc0,0x0,0x0,};
    final private int[] jj_la1_1 = {0xe7ef7,0x40003,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40002,0x40002,0xe7ef7,0x40002,0x0,0x40002,0x20000,0xe7ef7,0xa4003,0x100,0x100,};
    final private JJCalls[] jj_2_rtns = new JJCalls[2];
    private boolean jj_rescan = false;
    private int jj_gc = 0;
  
    public Parser(java.io.InputStream stream) {
      jj_input_stream = new ASCII_CharStream(stream, 1, 1);
      token_source = new ParserTokenManager(jj_input_stream);
      token = new Token();
      jj_ntk = -1;
      jj_gen = 0;
      for (int i = 0; i < 23; i++) jj_la1[i] = -1;
      for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
    }
  
    public void ReInit(java.io.InputStream stream) {
      jj_input_stream.ReInit(stream, 1, 1);
      token_source.ReInit(jj_input_stream);
      token = new Token();
      jj_ntk = -1;
      jjtree.reset();
      jj_gen = 0;
      for (int i = 0; i < 23; i++) jj_la1[i] = -1;
      for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
    }
  
    public Parser(java.io.Reader stream) {
      jj_input_stream = new ASCII_CharStream(stream, 1, 1);
      token_source = new ParserTokenManager(jj_input_stream);
      token = new Token();
      jj_ntk = -1;
      jj_gen = 0;
      for (int i = 0; i < 23; i++) jj_la1[i] = -1;
      for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
    }
  
    public void ReInit(java.io.Reader stream) {
      jj_input_stream.ReInit(stream, 1, 1);
      token_source.ReInit(jj_input_stream);
      token = new Token();
      jj_ntk = -1;
      jjtree.reset();
      jj_gen = 0;
      for (int i = 0; i < 23; i++) jj_la1[i] = -1;
      for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
    }
  
    public Parser(ParserTokenManager tm) {
      token_source = tm;
      token = new Token();
      jj_ntk = -1;
      jj_gen = 0;
      for (int i = 0; i < 23; i++) jj_la1[i] = -1;
      for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
    }
  
    public void ReInit(ParserTokenManager tm) {
      token_source = tm;
      token = new Token();
      jj_ntk = -1;
      jjtree.reset();
      jj_gen = 0;
      for (int i = 0; i < 23; i++) jj_la1[i] = -1;
      for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
    }
  
    final private Token jj_consume_token(int kind) throws ParseException {
      Token oldToken;
      if ((oldToken = token).next != null) token = token.next;
      else token = token.next = token_source.getNextToken();
      jj_ntk = -1;
      if (token.kind == kind) {
        jj_gen++;
        if (++jj_gc > 100) {
          jj_gc = 0;
          for (int i = 0; i < jj_2_rtns.length; i++) {
            JJCalls c = jj_2_rtns[i];
            while (c != null) {
              if (c.gen < jj_gen) c.first = null;
              c = c.next;
            }
          }
        }
        return token;
      }
      token = oldToken;
      jj_kind = kind;
      throw generateParseException();
    }
  
    final private boolean jj_scan_token(int kind) {
      if (jj_scanpos == jj_lastpos) {
        jj_la--;
        if (jj_scanpos.next == null) {
          jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
        } else {
          jj_lastpos = jj_scanpos = jj_scanpos.next;
        }
      } else {
        jj_scanpos = jj_scanpos.next;
      }
      if (jj_rescan) {
        int i = 0; Token tok = token;
        while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
        if (tok != null) jj_add_error_token(kind, i);
      }
      return (jj_scanpos.kind != kind);
    }
  
    final public Token getNextToken() {
      if (token.next != null) token = token.next;
      else token = token.next = token_source.getNextToken();
      jj_ntk = -1;
      jj_gen++;
      return token;
    }
  
    final public Token getToken(int index) {
      Token t = lookingAhead ? jj_scanpos : token;
      for (int i = 0; i < index; i++) {
        if (t.next != null) t = t.next;
        else t = t.next = token_source.getNextToken();
      }
      return t;
    }
  
    final private int jj_ntk() {
      if ((jj_nt=token.next) == null)
        return (jj_ntk = (token.next=token_source.getNextToken()).kind);
      else
        return (jj_ntk = jj_nt.kind);
    }
  
    private java.util.Vector jj_expentries = new java.util.Vector();
    private int[] jj_expentry;
    private int jj_kind = -1;
    private int[] jj_lasttokens = new int[100];
    private int jj_endpos;
  
    private void jj_add_error_token(int kind, int pos) {
      if (pos >= 100) return;
      if (pos == jj_endpos + 1) {
        jj_lasttokens[jj_endpos++] = kind;
      } else if (jj_endpos != 0) {
        jj_expentry = new int[jj_endpos];
        for (int i = 0; i < jj_endpos; i++) {
          jj_expentry[i] = jj_lasttokens[i];
        }
        boolean exists = false;
        for (java.util.Enumeration enum = jj_expentries.elements(); enum.hasMoreElements();) {
          int[] oldentry = (int[])(enum.nextElement());
          if (oldentry.length == jj_expentry.length) {
            exists = true;
            for (int i = 0; i < jj_expentry.length; i++) {
              if (oldentry[i] != jj_expentry[i]) {
                exists = false;
                break;
              }
            }
            if (exists) break;
          }
        }
        if (!exists) jj_expentries.addElement(jj_expentry);
        if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
      }
    }
  
    final public ParseException generateParseException() {
      jj_expentries.removeAllElements();
      boolean[] la1tokens = new boolean[53];
      for (int i = 0; i < 53; i++) {
        la1tokens[i] = false;
      }
      if (jj_kind >= 0) {
        la1tokens[jj_kind] = true;
        jj_kind = -1;
      }
      for (int i = 0; i < 23; i++) {
        if (jj_la1[i] == jj_gen) {
          for (int j = 0; j < 32; j++) {
            if ((jj_la1_0[i] & (1<<j)) != 0) {
              la1tokens[j] = true;
            }
            if ((jj_la1_1[i] & (1<<j)) != 0) {
              la1tokens[32+j] = true;
            }
          }
        }
      }
      for (int i = 0; i < 53; i++) {
        if (la1tokens[i]) {
          jj_expentry = new int[1];
          jj_expentry[0] = i;
          jj_expentries.addElement(jj_expentry);
        }
      }
      jj_endpos = 0;
      jj_rescan_token();
      jj_add_error_token(0, 0);
      int[][] exptokseq = new int[jj_expentries.size()][];
      for (int i = 0; i < jj_expentries.size(); i++) {
        exptokseq[i] = (int[])jj_expentries.elementAt(i);
      }
      return new ParseException(token, exptokseq, tokenImage);
    }
  
    final public void enable_tracing() {
    }
  
    final public void disable_tracing() {
    }
  
    final private void jj_rescan_token() {
      jj_rescan = true;
      for (int i = 0; i < 2; i++) {
        JJCalls p = jj_2_rtns[i];
        do {
          if (p.gen > jj_gen) {
            jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
            switch (i) {
              case 0: jj_3_1(); break;
              case 1: jj_3_2(); break;
            }
          }
          p = p.next;
        } while (p != null);
      }
      jj_rescan = false;
    }
  
    final private void jj_save(int index, int xla) {
      JJCalls p = jj_2_rtns[index];
      while (p.gen > jj_gen) {
        if (p.next == null) { p = p.next = new JJCalls(); break; }
        p = p.next;
      }
      p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
    }
  
    static final class JJCalls {
      int gen;
      Token first;
      int arg;
      JJCalls next;
    }
  
  }
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/webmacro/Parser.jj
  
  Index: Parser.jj
  ===================================================================
  /*@bgen(jjtree) Generated By:JJTree: Do not edit this line. Parser.jj */
  /*@egen*//*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  options
  {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
      
      /**
       * The parser must be non-static in order for the
       * above option to work, otherwise the parser value
       * is passed in as null, which isn't all the useful ;)
       */
      STATIC=false;                                                                                                                                                                                                                                                                                                                  
      
      /**
       * This option is used as one of the steps
       * required to allow the use of an "#include"
       * type behaviour. In this case the directive
       * is "#parse". See the TOKEN_MGR_DECLS section
       * below for details on how the TokenManager is
       * modified to allow this behaviour.
       */
      COMMON_TOKEN_ACTION=true;
      
      /*
      DEBUG_PARSER=true;
      DEBUG_TOKEN_MANAGER=true;
      */
  
  }    
  
  PARSER_BEGIN(Parser)
  
  package org.apache.velocity.processor.javacc.parser.webmacro;
  
  import java.io.*;
  import java.util.*;
  
  import org.apache.velocity.processor.javacc.parser.*;
  
  /**
   * This class is responsible for parsing a Velocity
   * template. This class was generated by JavaCC using
   * the JJTree extension to produce an Abstract
   * Syntax Tree (AST) of the template.
   *
   * Please look at the Parser.jjt file which is
   * what controls the generation of this class.
   *
   * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
   * @version $Id: Parser.jj,v 1.1 2000/09/12 01:42:16 jvanzyl Exp $
   */
  public class Parser implements/*@bgen(jjtree)*/ ParserTreeConstants, /*@egen*/ org.apache.velocity.processor.javacc.parser.Parser
  {/*@bgen(jjtree)*/
    protected JJTParserState jjtree = new JJTParserState();
  
  /*@egen*/
      
      
      SimpleNode root;
  
      public Parser()
      {
      }
  
      public void parse(InputStream stream) throws ParseException
      {
          jj_input_stream = new ASCII_CharStream(stream, 1, 1);
          token_source = new ParserTokenManager(jj_input_stream);
          token = new Token();
          jj_ntk = -1;
          jj_gen = 0;
          for (int i = 0; i < 23; i++) jj_la1[i] = -1;
          for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
          
          root = process();
      }        
  
      public SimpleNode getRoot()
      {
          return root;
      }        
  }
  
  PARSER_END(Parser)
  
  /* ------------------------------------------------------------------------
   *
   * Tokens
   *
   * ------------------------------------------------------------------------- */
  
  //<*> 
  SKIP : /* WHITE SPACE */
  {
    " "
  | "\t"
  | "\n"
  | "\r"
  | "\f"
  }
  
  //<*> 
  
  // These are special tokens that appear
  // in references particularly method, these
  // are the characters that we don't allow
  // in the <TEXT> token. Otherwise <TEXT>
  // will get matched before <IDENTIFIER>
  // which we don't want.
  
  TOKEN :
  {
      <DOLLAR: "$">
  |   <DOT: ".">
  |   <LPAREN: "(" >
  |   <RPAREN: ")" >
  |   <COMMA: ",">
  |   <QUOTE: "\"">
  |   <UNDERSCORE: "_">
  }
  
  // Numbers
  
  TOKEN :
  {
      <#DIGIT: [ "0"-"9" ] >
  |   <NUMBER_LITERAL: (<DIGIT>)+ >
  }    
  
  // Arithmetic operators
  
  TOKEN : 
  {
      <MINUS: "-">
  |   <PLUS: "+">
  |   <MULTIPLY: "*">
  |   <DIVIDE: "/">
  |   <MODULUS: "%">
  }
  
  // Logic operators.
  
  TOKEN :
  {
      <LOGICAL_AND: "&&">
  |   <LOGICAL_OR: "||">
  |   <LOGICAL_LT: "<">
  |   <LOGICAL_LE: "<=">
  |   <LOGICAL_GT: ">">
  |   <LOGICAL_GE: ">=">
  |   <LOGICAL_EQUALS: "==">
  |   <LOGICAL_NOT_EQUALS: "!=">
  |   <LOGICAL_NOT: "!">
  |   <EQUALS: "=" >
  }
  
  // These operators must be allowed to
  // show up as text as well.
  
  
  // These are special tokens that appear
  // in directives. The single character
  // tokens must also be remove from
  // <TEXT>.
  
  TOKEN :
  {
      <IN: "in" >
  |   <TRUE: "true">
  |   <FALSE: "false">
  |   <STRING_LITERAL: ( "\"" ( ~["\"","\n","\r"] )* "\"" ) >
      {
          if (incMode)
          {
              matchedToken.image = stripQuotes(image.toString());
              pushFile(matchedToken.image);
          }
          incMode = false;
      }        
  
  //|   <LBRACKET: "{" >
  //|   <RBRACKET: "}" >
  |   <BEGIN: "#begin">
  |   <END: "#end">
  }
  
  //<DEFAULT> 
  TOKEN :
  {
      <INCLUDE_DIRECTIVE: "#include">
      {
          incMode = true;
      }        
  |   <PARSE_DIRECTIVE:   "#parse">
      { 
          incMode = true; 
      }
  |   <IF_DIRECTIVE:      "#if">
  |   <ELSEIF_DIRECTIVE:  "#elseif">
  |   <ELSE_DIRECTIVE:    "#else">
  |   <FOREACH_DIRECTIVE: "#foreach">
  |   <SET_DIRECTIVE:     "#set" >
  |   <PARAM_DIRECTIVE:   "#param" >
  |   <USE_DIRECTIVE:     "#use">
  |   <STOP_DIRECTIVE:    "#stop">
      {
          matchedToken.kind = EOF;
          fileDepth = 0;
      }
  }
  
  //<REFERENCE> 
  TOKEN :
  {
    <ALPHA_CHAR: ["a"-"z", "A"-"Z"] >
  | <ALPHANUM_CHAR: [ "a"-"z", "A"-"Z", "0"-"9" ] >
  | <IDENTIFIER_CHAR: [ "a"-"z", "A"-"Z", "0"-"9", "-", "_", "=" ] >
  | <IDENTIFIER: <ALPHA_CHAR> (<IDENTIFIER_CHAR>)* >
  | <DIDENTIFIER: <DOLLAR> <IDENTIFIER> >
  
    // Remove all the special characters from TEXT that can belong
    // in a reference of the form $variable, $object.Property,
    // $object.method($this, "that", $the-other)
  
  | <TEXT: (~["$", "\n", "\r", "\t", " ", ".", "(", ")", ",", "\"", "-", "_","<",">"])+ >
  }
  
  
  // DIRECTIVES 
  
  
  // I'm probably going to have to add a node type to
  // deal with comments. I need to collapse the space
  // that comments take up so the formatting will be
  // more accurate.
  
  // COMMENTS
  
  //<DEFAULT> 
  SPECIAL_TOKEN : 
  {
    <SINGLE_LINE_COMMENT: "##" (~["\n","\r"])* ("\n"|"\r"|"\r\n")>
  }
  
  
  /**
   * This gets inserted into the ParserMacroTokenManager
   * and is being used here strictly for the #parse
   * directive: an #include type behaviour. We have
   * to save the state the stream currently being
   * parsed and we have to save the state of the
   * lexer (TokenManager class) then we create
   * a new stream from the file named in the
   * #parse directive then we ReInit the lexer. 
   * Whatever it parses will get placed 
   * into the AST.
   *
   * I need a simple way to detect circular
   * inclusions so this thing doesn't go wild
   * and drag down the VM.
   */
  TOKEN_MGR_DECLS: 
  {  
      boolean incMode;
      int fileDepth = 0;
      int documentLine = 0;
      int lastLine = 0;
      
      Stack streams = new Stack();
      Stack states = new Stack();
      
      // remove double quotes in the string
      String stripQuotes(String str) 
      {
          int start = str.indexOf("\"");
          int end = str.indexOf("\"",start+1);    
          return str.substring(start+1,end);
      }    
      
      /**
       * Save the state of the current input stream
       * and the state of the lexer. So we can process
       * the new one.
       */
      void pushFile(String filename)
      {
          fileDepth++;
          
          streams.push(input_stream);
          states.push(new Integer(curLexState));
          documentLine += lastLine;
          
          try
          {
              FileInputStream fs = new FileInputStream(filename);
              ASCII_CharStream new_stream = new ASCII_CharStream(fs,1,1);    
              ReInit(new_stream);
          }
          catch(Exception e)
          {
          }
      }    
    
      /**
       * Retrieve the oldStream and oldState and
       * continue processing the input.
       */
      void popFile()
      {
          ReInit((ASCII_CharStream) streams.pop(), ((Integer) states.pop()).intValue());
          fileDepth--;
      }    
      
      private boolean AtParent()
      {
          if (fileDepth == 0)
              return true;
          else
              return false;
      }
      
      void CommonTokenAction(Token t)
      {
          if (t.kind == EOF && ! AtParent())
          {
              Token new_t;
              popFile();
              new_t = getNextToken();
              t.kind = new_t.kind;
              t.beginLine = new_t.beginLine;
              t.beginColumn = new_t.beginColumn;
              t.endLine = new_t.endLine;
              t.endColumn = new_t.endColumn;
              t.image = new_t.image;
              t.next = new_t.next;
              t.specialToken = new_t.specialToken;
          }
          else
          {
              lastLine = t.endLine;
              t.beginLine += documentLine;
              t.endLine += documentLine;
          }
      } 
  } 
  
  /**
   * This method is what starts the whole parsing
   * process. After the parsing is complete and
   * the template has been turned into an AST,
   * this method returns the root of AST which
   * can subsequently be traversed by a visitor
   * which implements the ParserVisitor interface
   * which is generated automatically by JavaCC
   */
  SimpleNode process() : {/*@bgen(jjtree) process */
    ASTprocess jjtn000 = new ASTprocess(this, JJTPROCESS);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) process */
     try {
  /*@egen*/
     ( Statement() )* <EOF>/*@bgen(jjtree)*/
     {
       jjtree.closeNodeScope(jjtn000, true);
       jjtc000 = false;
     }
  /*@egen*/
     { return jjtn000; }/*@bgen(jjtree)*/
     } catch (Throwable jjte000) {
       if (jjtc000) {
         jjtree.clearNodeScope(jjtn000);
         jjtc000 = false;
       } else {
         jjtree.popNode();
       }
       if (jjte000 instanceof RuntimeException) {
         throw (RuntimeException)jjte000;
       }
       if (jjte000 instanceof ParseException) {
         throw (ParseException)jjte000;
       }
       throw (Error)jjte000;
     } finally {
       if (jjtc000) {
         jjtree.closeNodeScope(jjtn000, true);
       }
     }
  /*@egen*/
  }
  
  /*
   * Expression syntax follows.
   */
  
  /*
  void Expression() : {}
  {
      //Reference()
      True()
  |   False()
  |   LOOKAHEAD( PrimaryExpression() "=" ) Assignment()
  |   ConditionalOrExpression()
  }
  */
  
  void Expression() : {/*@bgen(jjtree) Expression */
    ASTExpression jjtn000 = new ASTExpression(this, JJTEXPRESSION);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) Expression */
      try {
  /*@egen*/
      StringLiteral()
  |   NumberLiteral()    
  |   Reference() 
  |   True() 
  |   False()/*@bgen(jjtree)*/
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          throw (RuntimeException)jjte000;
        }
        if (jjte000 instanceof ParseException) {
          throw (ParseException)jjte000;
        }
        throw (Error)jjte000;
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  
  void Assignment()                : {/*@bgen(jjtree) #Assignment( 2) */
    ASTAssignment jjtn000 = new ASTAssignment(this, JJTASSIGNMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) #Assignment( 2) */
      try {
  /*@egen*/
      PrimaryExpression() <EQUALS> Expression()/*@bgen(jjtree)*/
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          throw (RuntimeException)jjte000;
        }
        if (jjte000 instanceof ParseException) {
          throw (ParseException)jjte000;
        }
        throw (Error)jjte000;
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000,  2);
        }
      }
  /*@egen*/
  }
  
  void ConditionalOrExpression()       : {}
  {
    ConditionalAndExpression()
    ( <LOGICAL_OR>/*@bgen(jjtree) #OrNode( 2) */
                   {
                     ASTOrNode jjtn001 = new ASTOrNode(this, JJTORNODE);
                     boolean jjtc001 = true;
                     jjtree.openNodeScope(jjtn001);
                   }
                   try {
  /*@egen*/ ConditionalAndExpression()/*@bgen(jjtree)*/
                   } catch (Throwable jjte001) {
                     if (jjtc001) {
                       jjtree.clearNodeScope(jjtn001);
                       jjtc001 = false;
                     } else {
                       jjtree.popNode();
                     }
                     if (jjte001 instanceof RuntimeException) {
                       throw (RuntimeException)jjte001;
                     }
                     if (jjte001 instanceof ParseException) {
                       throw (ParseException)jjte001;
                     }
                     throw (Error)jjte001;
                   } finally {
                     if (jjtc001) {
                       jjtree.closeNodeScope(jjtn001,  2);
                     }
                   }
  /*@egen*/ )*
  }
  
  
  void ConditionalAndExpression()       : {}
  {
    EqualityExpression()
    ( <LOGICAL_AND>/*@bgen(jjtree) #AndNode( 2) */
                     {
                       ASTAndNode jjtn001 = new ASTAndNode(this, JJTANDNODE);
                       boolean jjtc001 = true;
                       jjtree.openNodeScope(jjtn001);
                     }
                     try {
  /*@egen*/  EqualityExpression()/*@bgen(jjtree)*/
                     } catch (Throwable jjte001) {
                       if (jjtc001) {
                         jjtree.clearNodeScope(jjtn001);
                         jjtc001 = false;
                       } else {
                         jjtree.popNode();
                       }
                       if (jjte001 instanceof RuntimeException) {
                         throw (RuntimeException)jjte001;
                       }
                       if (jjte001 instanceof ParseException) {
                         throw (ParseException)jjte001;
                       }
                       throw (Error)jjte001;
                     } finally {
                       if (jjtc001) {
                         jjtree.closeNodeScope(jjtn001,  2);
                       }
                     }
  /*@egen*/ )*
  }
  
  /*
  
  void ConditionalAndExpression() #void : {}
  {
    InclusiveOrExpression()
    ( <LOGICAL_AND>  InclusiveOrExpression() #AndNode(2) )*
  }
  
  
  void InclusiveOrExpression() #void : {}
  {
    ExclusiveOrExpression()
    ( "|" ExclusiveOrExpression() #BitwiseOrNode(2) )*
  }
  
  void ExclusiveOrExpression() #void : {}
  {
    AndExpression()
    ( "^" AndExpression() #BitwiseXorNode(2) )*
  }
  
  void AndExpression() #void : {}
  {
    EqualityExpression()
    ( "&" EqualityExpression() #BitwiseAndNode(2) )*
  }
  
  */
  
  void EqualityExpression()       : {}
  {
      RelationalExpression()
      (
            <LOGICAL_EQUALS>/*@bgen(jjtree) #EQNode( 2) */
                             {
                               ASTEQNode jjtn001 = new ASTEQNode(this, JJTEQNODE);
                               boolean jjtc001 = true;
                               jjtree.openNodeScope(jjtn001);
                             }
                             try {
  /*@egen*/ RelationalExpression()/*@bgen(jjtree)*/
                             } catch (Throwable jjte001) {
                               if (jjtc001) {
                                 jjtree.clearNodeScope(jjtn001);
                                 jjtc001 = false;
                               } else {
                                 jjtree.popNode();
                               }
                               if (jjte001 instanceof RuntimeException) {
                                 throw (RuntimeException)jjte001;
                               }
                               if (jjte001 instanceof ParseException) {
                                 throw (ParseException)jjte001;
                               }
                               throw (Error)jjte001;
                             } finally {
                               if (jjtc001) {
                                 jjtree.closeNodeScope(jjtn001,  2);
                               }
                             }
  /*@egen*/
          | <LOGICAL_NOT_EQUALS>/*@bgen(jjtree) #NENode( 2) */
                                 {
                                   ASTNENode jjtn002 = new ASTNENode(this, JJTNENODE);
                                   boolean jjtc002 = true;
                                   jjtree.openNodeScope(jjtn002);
                                 }
                                 try {
  /*@egen*/ RelationalExpression()/*@bgen(jjtree)*/
                                 } catch (Throwable jjte002) {
                                   if (jjtc002) {
                                     jjtree.clearNodeScope(jjtn002);
                                     jjtc002 = false;
                                   } else {
                                     jjtree.popNode();
                                   }
                                   if (jjte002 instanceof RuntimeException) {
                                     throw (RuntimeException)jjte002;
                                   }
                                   if (jjte002 instanceof ParseException) {
                                     throw (ParseException)jjte002;
                                   }
                                   throw (Error)jjte002;
                                 } finally {
                                   if (jjtc002) {
                                     jjtree.closeNodeScope(jjtn002,  2);
                                   }
                                 }
  /*@egen*/
      )*
  }
  
  void RelationalExpression()       : {}
  {
      AdditiveExpression()
      (
            <LOGICAL_LT>/*@bgen(jjtree) #LTNode( 2) */
                         {
                           ASTLTNode jjtn001 = new ASTLTNode(this, JJTLTNODE);
                           boolean jjtc001 = true;
                           jjtree.openNodeScope(jjtn001);
                         }
                         try {
  /*@egen*/ AdditiveExpression()/*@bgen(jjtree)*/
                         } catch (Throwable jjte001) {
                           if (jjtc001) {
                             jjtree.clearNodeScope(jjtn001);
                             jjtc001 = false;
                           } else {
                             jjtree.popNode();
                           }
                           if (jjte001 instanceof RuntimeException) {
                             throw (RuntimeException)jjte001;
                           }
                           if (jjte001 instanceof ParseException) {
                             throw (ParseException)jjte001;
                           }
                           throw (Error)jjte001;
                         } finally {
                           if (jjtc001) {
                             jjtree.closeNodeScope(jjtn001,  2);
                           }
                         }
  /*@egen*/
          | <LOGICAL_GT>/*@bgen(jjtree) #GTNode( 2) */
                         {
                           ASTGTNode jjtn002 = new ASTGTNode(this, JJTGTNODE);
                           boolean jjtc002 = true;
                           jjtree.openNodeScope(jjtn002);
                         }
                         try {
  /*@egen*/ AdditiveExpression()/*@bgen(jjtree)*/
                         } catch (Throwable jjte002) {
                           if (jjtc002) {
                             jjtree.clearNodeScope(jjtn002);
                             jjtc002 = false;
                           } else {
                             jjtree.popNode();
                           }
                           if (jjte002 instanceof RuntimeException) {
                             throw (RuntimeException)jjte002;
                           }
                           if (jjte002 instanceof ParseException) {
                             throw (ParseException)jjte002;
                           }
                           throw (Error)jjte002;
                         } finally {
                           if (jjtc002) {
                             jjtree.closeNodeScope(jjtn002,  2);
                           }
                         }
  /*@egen*/
          | <LOGICAL_LE>/*@bgen(jjtree) #LENode( 2) */
                         {
                           ASTLENode jjtn003 = new ASTLENode(this, JJTLENODE);
                           boolean jjtc003 = true;
                           jjtree.openNodeScope(jjtn003);
                         }
                         try {
  /*@egen*/ AdditiveExpression()/*@bgen(jjtree)*/
                         } catch (Throwable jjte003) {
                           if (jjtc003) {
                             jjtree.clearNodeScope(jjtn003);
                             jjtc003 = false;
                           } else {
                             jjtree.popNode();
                           }
                           if (jjte003 instanceof RuntimeException) {
                             throw (RuntimeException)jjte003;
                           }
                           if (jjte003 instanceof ParseException) {
                             throw (ParseException)jjte003;
                           }
                           throw (Error)jjte003;
                         } finally {
                           if (jjtc003) {
                             jjtree.closeNodeScope(jjtn003,  2);
                           }
                         }
  /*@egen*/
          | <LOGICAL_GE>/*@bgen(jjtree) #GENode( 2) */
                         {
                           ASTGENode jjtn004 = new ASTGENode(this, JJTGENODE);
                           boolean jjtc004 = true;
                           jjtree.openNodeScope(jjtn004);
                         }
                         try {
  /*@egen*/ AdditiveExpression()/*@bgen(jjtree)*/
                         } catch (Throwable jjte004) {
                           if (jjtc004) {
                             jjtree.clearNodeScope(jjtn004);
                             jjtc004 = false;
                           } else {
                             jjtree.popNode();
                           }
                           if (jjte004 instanceof RuntimeException) {
                             throw (RuntimeException)jjte004;
                           }
                           if (jjte004 instanceof ParseException) {
                             throw (ParseException)jjte004;
                           }
                           throw (Error)jjte004;
                         } finally {
                           if (jjtc004) {
                             jjtree.closeNodeScope(jjtn004,  2);
                           }
                         }
  /*@egen*/
      )*
  }
  
  void AdditiveExpression()       : {}
  {
      MultiplicativeExpression()
      (
            <PLUS>/*@bgen(jjtree) #AddNode( 2) */
                    {
                      ASTAddNode jjtn001 = new ASTAddNode(this, JJTADDNODE);
                      boolean jjtc001 = true;
                      jjtree.openNodeScope(jjtn001);
                    }
                    try {
  /*@egen*/  MultiplicativeExpression()/*@bgen(jjtree)*/
                    } catch (Throwable jjte001) {
                      if (jjtc001) {
                        jjtree.clearNodeScope(jjtn001);
                        jjtc001 = false;
                      } else {
                        jjtree.popNode();
                      }
                      if (jjte001 instanceof RuntimeException) {
                        throw (RuntimeException)jjte001;
                      }
                      if (jjte001 instanceof ParseException) {
                        throw (ParseException)jjte001;
                      }
                      throw (Error)jjte001;
                    } finally {
                      if (jjtc001) {
                        jjtree.closeNodeScope(jjtn001,  2);
                      }
                    }
  /*@egen*/
          | <MINUS>/*@bgen(jjtree) #SubtractNode( 2) */
                    {
                      ASTSubtractNode jjtn002 = new ASTSubtractNode(this, JJTSUBTRACTNODE);
                      boolean jjtc002 = true;
                      jjtree.openNodeScope(jjtn002);
                    }
                    try {
  /*@egen*/ MultiplicativeExpression()/*@bgen(jjtree)*/
                    } catch (Throwable jjte002) {
                      if (jjtc002) {
                        jjtree.clearNodeScope(jjtn002);
                        jjtc002 = false;
                      } else {
                        jjtree.popNode();
                      }
                      if (jjte002 instanceof RuntimeException) {
                        throw (RuntimeException)jjte002;
                      }
                      if (jjte002 instanceof ParseException) {
                        throw (ParseException)jjte002;
                      }
                      throw (Error)jjte002;
                    } finally {
                      if (jjtc002) {
                        jjtree.closeNodeScope(jjtn002,  2);
                      }
                    }
  /*@egen*/
      )*
  }
  
  void MultiplicativeExpression()       : {}
  {
    UnaryExpression()
    (
       <MULTIPLY>/*@bgen(jjtree) #MulNode( 2) */
                  {
                    ASTMulNode jjtn001 = new ASTMulNode(this, JJTMULNODE);
                    boolean jjtc001 = true;
                    jjtree.openNodeScope(jjtn001);
                  }
                  try {
  /*@egen*/ UnaryExpression()/*@bgen(jjtree)*/
                  } catch (Throwable jjte001) {
                    if (jjtc001) {
                      jjtree.clearNodeScope(jjtn001);
                      jjtc001 = false;
                    } else {
                      jjtree.popNode();
                    }
                    if (jjte001 instanceof RuntimeException) {
                      throw (RuntimeException)jjte001;
                    }
                    if (jjte001 instanceof ParseException) {
                      throw (ParseException)jjte001;
                    }
                    throw (Error)jjte001;
                  } finally {
                    if (jjtc001) {
                      jjtree.closeNodeScope(jjtn001,  2);
                    }
                  }
  /*@egen*/
     | <DIVIDE>/*@bgen(jjtree) #DivNode( 2) */
                  {
                    ASTDivNode jjtn002 = new ASTDivNode(this, JJTDIVNODE);
                    boolean jjtc002 = true;
                    jjtree.openNodeScope(jjtn002);
                  }
                  try {
  /*@egen*/   UnaryExpression()/*@bgen(jjtree)*/
                  } catch (Throwable jjte002) {
                    if (jjtc002) {
                      jjtree.clearNodeScope(jjtn002);
                      jjtc002 = false;
                    } else {
                      jjtree.popNode();
                    }
                    if (jjte002 instanceof RuntimeException) {
                      throw (RuntimeException)jjte002;
                    }
                    if (jjte002 instanceof ParseException) {
                      throw (ParseException)jjte002;
                    }
                    throw (Error)jjte002;
                  } finally {
                    if (jjtc002) {
                      jjtree.closeNodeScope(jjtn002,  2);
                    }
                  }
  /*@egen*/
     | <MODULUS>/*@bgen(jjtree) #ModNode( 2) */
                  {
                    ASTModNode jjtn003 = new ASTModNode(this, JJTMODNODE);
                    boolean jjtc003 = true;
                    jjtree.openNodeScope(jjtn003);
                  }
                  try {
  /*@egen*/  UnaryExpression()/*@bgen(jjtree)*/
                  } catch (Throwable jjte003) {
                    if (jjtc003) {
                      jjtree.clearNodeScope(jjtn003);
                      jjtc003 = false;
                    } else {
                      jjtree.popNode();
                    }
                    if (jjte003 instanceof RuntimeException) {
                      throw (RuntimeException)jjte003;
                    }
                    if (jjte003 instanceof ParseException) {
                      throw (ParseException)jjte003;
                    }
                    throw (Error)jjte003;
                  } finally {
                    if (jjtc003) {
                      jjtree.closeNodeScope(jjtn003,  2);
                    }
                  }
  /*@egen*/
    )*
  }
  
  void UnaryExpression()       : {}
  {
      //"~" UnaryExpression() #BitwiseComplNode(1)
      <LOGICAL_NOT>/*@bgen(jjtree) #NotNode( 1) */
                    {
                      ASTNotNode jjtn001 = new ASTNotNode(this, JJTNOTNODE);
                      boolean jjtc001 = true;
                      jjtree.openNodeScope(jjtn001);
                    }
                    try {
  /*@egen*/ UnaryExpression()/*@bgen(jjtree)*/
                    } catch (Throwable jjte001) {
                      if (jjtc001) {
                        jjtree.clearNodeScope(jjtn001);
                        jjtc001 = false;
                      } else {
                        jjtree.popNode();
                      }
                      if (jjte001 instanceof RuntimeException) {
                        throw (RuntimeException)jjte001;
                      }
                      if (jjte001 instanceof ParseException) {
                        throw (ParseException)jjte001;
                      }
                      throw (Error)jjte001;
                    } finally {
                      if (jjtc001) {
                        jjtree.closeNodeScope(jjtn001,  1);
                      }
                    }
  /*@egen*/
  |   PrimaryExpression()
  }
  
  void PrimaryExpression()       : {}
  {    
      StringLiteral()
  |   NumberLiteral()    
  |   Reference() //Identifier() 
  |   <LPAREN> Expression() <RPAREN>
  }
  
  /**
   * These are the types of statements that
   * are acceptable in Velocity templates.
   * I have not found that the order here
   * matters much. Someone please correct
   * me here if I'm wrong.
   */
  void Statement()       : {}
  {
      Text()
  |   Block()    
  |   IfStatement()
  |   ElseIfStatement()
  |   ForeachStatement()
  |   IncludeStatement()
  |   SetStatement()
  |   ParseStatement()
  |   UseStatement()
  |   ParamStatement()
  |   StopStatement()
  |   Reference()
  
  }
  
  void NumberLiteral() : {/*@bgen(jjtree) NumberLiteral */
    ASTNumberLiteral jjtn000 = new ASTNumberLiteral(this, JJTNUMBERLITERAL);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) NumberLiteral */
      try {
  /*@egen*/
      <NUMBER_LITERAL>/*@bgen(jjtree)*/
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }    
  
  void StringLiteral() : {/*@bgen(jjtree) StringLiteral */
    ASTStringLiteral jjtn000 = new ASTStringLiteral(this, JJTSTRINGLITERAL);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) StringLiteral */
      try {
  /*@egen*/
      <STRING_LITERAL>/*@bgen(jjtree)*/
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }    
  
  /**
   * This method corresponds to variable
   * references in Velocity templates.
   * The following are examples of variable
   * references that may be found in a
   * template:
   *
   * $foo
   * $bar
   *
   */
  void Identifier() : {/*@bgen(jjtree) Identifier */
    ASTIdentifier jjtn000 = new ASTIdentifier(this, JJTIDENTIFIER);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) Identifier */
      try {
  /*@egen*/    
      <IDENTIFIER>/*@bgen(jjtree)*/
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  /**
   * This method has yet to be fully implemented
   * but will allow arbitrarily nested method
   * calls
   */
  void Parameter()      : {}
  {
      Reference() | StringLiteral()
  }
  
  /**
   * This method has yet to be fully implemented
   * but will allow arbitrarily nested method
   * calls
   */
  void Method() : {/*@bgen(jjtree) Method */
    ASTMethod jjtn000 = new ASTMethod(this, JJTMETHOD);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) Method */
      try {
  /*@egen*/
      Identifier() <LPAREN> [ Parameter() ( <COMMA> Parameter() )* ] <RPAREN>/*@bgen(jjtree)*/
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          throw (RuntimeException)jjte000;
        }
        if (jjte000 instanceof ParseException) {
          throw (ParseException)jjte000;
        }
        throw (Error)jjte000;
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  void Reference() : {/*@bgen(jjtree) Reference */
    ASTReference jjtn000 = new ASTReference(this, JJTREFERENCE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) Reference */
      try {
  /*@egen*/
      <DIDENTIFIER> (LOOKAHEAD(2) <DOT> (LOOKAHEAD(3) Method() | Identifier()) )*/*@bgen(jjtree)*/
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          throw (RuntimeException)jjte000;
        }
        if (jjte000 instanceof ParseException) {
          throw (ParseException)jjte000;
        }
        throw (Error)jjte000;
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  void True() : {/*@bgen(jjtree) True */
    ASTTrue jjtn000 = new ASTTrue(this, JJTTRUE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) True */
      try {
  /*@egen*/
      <TRUE>/*@bgen(jjtree)*/
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  void False() : {/*@bgen(jjtree) False */
    ASTFalse jjtn000 = new ASTFalse(this, JJTFALSE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) False */
      try {
  /*@egen*/
      <FALSE>/*@bgen(jjtree)*/
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  
  /**
   * This method corresponds to a block in
   * a Velocity template. Blocks are
   * currently associated with:
   *
   * #if
   * #foreach
   * #while (not implemented)
   *
   */
  void Block() : {/*@bgen(jjtree) Block */
    ASTBlock jjtn000 = new ASTBlock(this, JJTBLOCK);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) Block */
      try {
  /*@egen*/
      //<LBRACKET> [ ( Statement() )* <RBRACKET> ]
      <BEGIN> ( Statement() )* <END>/*@bgen(jjtree)*/
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          throw (RuntimeException)jjte000;
        }
        if (jjte000 instanceof ParseException) {
          throw (ParseException)jjte000;
        }
        throw (Error)jjte000;
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  /**
   * This method is responsible for allowing
   * all non-grammar text to pass through
   * unscathed.
   */
  void Text() : {/*@bgen(jjtree) Text */
    ASTText jjtn000 = new ASTText(this, JJTTEXT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) Text */
      try {
  /*@egen*/
      <TEXT>
  |   <ALPHA_CHAR>    
  |   <IDENTIFIER>    
  |   <DOLLAR>
  |   <DOT>
  |   <LPAREN>
  |   <RPAREN>
  |   <COMMA>
  |   <QUOTE>
  |   <MINUS>
  |   <PLUS>
  |   <MULTIPLY>
  |   <DIVIDE>
  |   <MODULUS>
  |   <UNDERSCORE>
  |   <EQUALS>
  |   <IN>
  |   <TRUE>
  |   <FALSE>
  |   <STRING_LITERAL>
  |   <LOGICAL_AND>
  |   <LOGICAL_OR>
  |   <LOGICAL_LT>
  |   <LOGICAL_LE>
  |   <LOGICAL_GT>
  |   <LOGICAL_GE>
  |   <LOGICAL_EQUALS>
  |   <LOGICAL_NOT_EQUALS>
  |   <LOGICAL_NOT>
  |   <NUMBER_LITERAL>/*@bgen(jjtree)*/
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  /**
   * This method corresponds to an #if directive
   * in a Velocity template. The following are
   * examples if #if constructs that are
   * acceptable in a template:
   *
   * #if ($customer.owesMoney() && $customer.Name == "Fred") (not implemented)
   * {
   *     Pay up, or else!
   * }
   * #else
   * {
   *     Thankyou for your patronage.
   * }
   *
   * #if ($dynanmicContent)
   * {
   *     This is our $dynamicContent
   * }
   *
   * #if ($customer.owesMoney())
   * {
   *     You better pay up!
   * }
   *
   */
  void IfStatement() : {/*@bgen(jjtree) IfStatement */
    ASTIfStatement jjtn000 = new ASTIfStatement(this, JJTIFSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) IfStatement */
      try {
  /*@egen*/
      <IF_DIRECTIVE> 
      <LPAREN> Expression() <RPAREN>
      Statement()
      [ LOOKAHEAD(1) ElseStatement() ]/*@bgen(jjtree)*/
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          throw (RuntimeException)jjte000;
        }
        if (jjte000 instanceof ParseException) {
          throw (ParseException)jjte000;
        }
        throw (Error)jjte000;
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  void ElseStatement() : {/*@bgen(jjtree) ElseStatement */
    ASTElseStatement jjtn000 = new ASTElseStatement(this, JJTELSESTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) ElseStatement */
      try {
  /*@egen*/
      <ELSE_DIRECTIVE> Statement()/*@bgen(jjtree)*/
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          throw (RuntimeException)jjte000;
        }
        if (jjte000 instanceof ParseException) {
          throw (ParseException)jjte000;
        }
        throw (Error)jjte000;
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
  }
  
  void ElseIfStatement() : {/*@bgen(jjtree) ElseIfStatement */
    ASTElseIfStatement jjtn000 = new ASTElseIfStatement(this, JJTELSEIFSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) ElseIfStatement */
    try {
  /*@egen*/
    <ELSEIF_DIRECTIVE> 
    <LPAREN>
    Expression()
    <RPAREN>
    Statement()
    [ LOOKAHEAD(1) ElseStatement() ]/*@bgen(jjtree)*/
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        throw (RuntimeException)jjte000;
      }
      if (jjte000 instanceof ParseException) {
        throw (ParseException)jjte000;
      }
      throw (Error)jjte000;
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  /*@egen*/
  }
  
  /**
   * This method corresponds to a #foreach
   * directive in a Velocity template. The
   * following are examples of #foreach
   * constructs that are acceptable in
   * a template:
   *
   * #foreach $element in $list
   * {
   *     This is the fifth $element
   * }
   *
   * #foreach $element in $foo.List
   * {
   *     This is the fifth $element
   * }
   *
   * #foreach $element in $foo.getList()
   * {
   *     This is the fifth $element
   * }
   *
   */
  void ForeachStatement() : {/*@bgen(jjtree) ForeachStatement */
    ASTForeachStatement jjtn000 = new ASTForeachStatement(this, JJTFOREACHSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) ForeachStatement */
    try {
  /*@egen*/
    <FOREACH_DIRECTIVE> 
    Reference()
    <IN>
    Reference()
    Statement()/*@bgen(jjtree)*/
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        throw (RuntimeException)jjte000;
      }
      if (jjte000 instanceof ParseException) {
        throw (ParseException)jjte000;
      }
      throw (Error)jjte000;
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  /*@egen*/
  }
  
  /**
   * This method corresponds to an #include
   * directive in a Velocity template. The
   * following are examples of #include
   * constructs that are acceptable in
   * a template:
   *
   * #include "foo.inc" 
   */
  void IncludeStatement()      : {}
  {
    <INCLUDE_DIRECTIVE> 
    <STRING_LITERAL>
  }
  
  /**
   * This method corresponds to a #set
   * directive in a Velocity template. The
   * following are examples of #set
   * constructs that are acceptable in
   * a template:
   *
   * #set name = "Fred"
   * #set $Customer.Name = "Sidney"
   * #set $Database.findItem($partNum).Description = $newDescription (not implemented)
   *
   */
  void SetStatement() : {/*@bgen(jjtree) SetStatement */
    ASTSetStatement jjtn000 = new ASTSetStatement(this, JJTSETSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) SetStatement */
      try {
  /*@egen*/
      <SET_DIRECTIVE> //Expression()
      Reference()
      <EQUALS> 
      Expression()/*@bgen(jjtree)*/
      } catch (Throwable jjte000) {
        if (jjtc000) {
          jjtree.clearNodeScope(jjtn000);
          jjtc000 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
          throw (RuntimeException)jjte000;
        }
        if (jjte000 instanceof ParseException) {
          throw (ParseException)jjte000;
        }
        throw (Error)jjte000;
      } finally {
        if (jjtc000) {
          jjtree.closeNodeScope(jjtn000, true);
        }
      }
  /*@egen*/
      
      /*
      ( 
          StringLiteral() 
      | 
          NumberLiteral() 
      | 
          <LPAREN> Expression() <RPAREN>
          //Reference() 
      //| 
          //True() 
      //| 
          //False() 
      )
      */
  }
  
  /**
   * This method corresponds to a #parse
   * directive in a Velocity template. The
   * following are examples of #parse
   * constructs that are acceptable in
   * a template:
   *
   * #parse "bar.vt"
   */
  void ParseStatement()      : {}
  {
    <PARSE_DIRECTIVE> <STRING_LITERAL>
  }
  
  /**
   * This method corresponds to a #use
   * directive in a Velocity template. The
   * following are examples of #use
   * constructs that are acceptable in
   * a template:
   *
   * This has not been implemented and may
   * not need to be because the Velocity
   * parser doesn't have any problem with
   * normal text that isn't part of Velocity's
   * grammar.
   *
   */
  void UseStatement() : {/*@bgen(jjtree) UseStatement */
    ASTUseStatement jjtn000 = new ASTUseStatement(this, JJTUSESTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) UseStatement */
    try {
  /*@egen*/
    <USE_DIRECTIVE>/*@bgen(jjtree)*/
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  /*@egen*/
  }
  
  /**
   * This method corresponds to a #param
   * directive in a Velocity template. The
   * following are examples of #param
   * constructs that are acceptable in
   * a template:
   *
   * #param $language = "en"
   *
   */
  void ParamStatement() : {/*@bgen(jjtree) ParamStatement */
    ASTParamStatement jjtn000 = new ASTParamStatement(this, JJTPARAMSTATEMENT);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
  /*@egen*/}
  {/*@bgen(jjtree) ParamStatement */
    try {
  /*@egen*/
    <PARAM_DIRECTIVE> Reference() <EQUALS> <STRING_LITERAL>/*@bgen(jjtree)*/
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        throw (RuntimeException)jjte000;
      }
      if (jjte000 instanceof ParseException) {
        throw (ParseException)jjte000;
      }
      throw (Error)jjte000;
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  /*@egen*/
  }
  
  /**
   * This method corresponds to the #stop
   * directive which just simulates and EOF
   * so that parsing stops. The #stop directive
   * is really only useful for debugging
   * purposes.
   */
  void StopStatement()      : {}
  {    
      <STOP_DIRECTIVE>
  }
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/webmacro/Parser.jjt
  
  Index: Parser.jjt
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  options
  {
      /** The default package for this parser kit */
      NODE_PACKAGE="org.apache.velocity.processor.javacc.parser.webmacro";
  
      /** A source file will be generated for each non-terminal */
      MULTI=true;
      
      /**
       * Each node will have access to the parser, I did this so
       * some global information can be shared via the parser. I
       * think this will come in handly keeping track of
       * context, and being able to push changes back into
       * the context when nodes make modifications to the
       * context by setting properties, variables and
       * what not.
       */
      NODE_USES_PARSER=true;
      
      /**
       * The parser must be non-static in order for the
       * above option to work, otherwise the parser value
       * is passed in as null, which isn't all the useful ;)
       */
      STATIC=false;
      
      /**
       * Enables the use of a visitor that each of nodes
       * will accept. This way we can separate the logic
       * of node processing in a visitor and out of the
       * nodes themselves. If processing changes then
       * the nothing has to change in the node code.
       */
      VISITOR=true;
      
      /**
       * This option is used as one of the steps
       * required to allow the use of an "#include"
       * type behaviour. In this case the directive
       * is "#parse". See the TOKEN_MGR_DECLS section
       * below for details on how the TokenManager is
       * modified to allow this behaviour.
       */
      COMMON_TOKEN_ACTION=true;
      
      /*
      DEBUG_PARSER=true;
      DEBUG_TOKEN_MANAGER=true;
      */
  
  }    
  
  PARSER_BEGIN(Parser)
  
  package org.apache.velocity.processor.javacc.parser.webmacro;
  
  import java.io.*;
  import java.util.*;
  
  import org.apache.velocity.processor.javacc.parser.*;
  
  /**
   * This class is responsible for parsing a Velocity
   * template. This class was generated by JavaCC using
   * the JJTree extension to produce an Abstract
   * Syntax Tree (AST) of the template.
   *
   * Please look at the Parser.jjt file which is
   * what controls the generation of this class.
   *
   * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
   * @version $Id: Parser.jjt,v 1.1 2000/09/12 01:42:16 jvanzyl Exp $
   */
  public class Parser implements org.apache.velocity.processor.javacc.parser.Parser
  {
      
      
      SimpleNode root;
  
      public Parser()
      {
      }
  
      public void parse(InputStream stream) throws ParseException
      {
          jj_input_stream = new ASCII_CharStream(stream, 1, 1);
          token_source = new ParserTokenManager(jj_input_stream);
          token = new Token();
          jj_ntk = -1;
          jj_gen = 0;
          for (int i = 0; i < 23; i++) jj_la1[i] = -1;
          for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
          
          root = process();
      }        
  
      public SimpleNode getRoot()
      {
          return root;
      }        
  }
  
  PARSER_END(Parser)
  
  /* ------------------------------------------------------------------------
   *
   * Tokens
   *
   * ------------------------------------------------------------------------- */
  
  //<*> 
  SKIP : /* WHITE SPACE */
  {
    " "
  | "\t"
  | "\n"
  | "\r"
  | "\f"
  }
  
  //<*> 
  
  // These are special tokens that appear
  // in references particularly method, these
  // are the characters that we don't allow
  // in the <TEXT> token. Otherwise <TEXT>
  // will get matched before <IDENTIFIER>
  // which we don't want.
  
  TOKEN :
  {
      <DOLLAR: "$">
  |   <DOT: ".">
  |   <LPAREN: "(" >
  |   <RPAREN: ")" >
  |   <COMMA: ",">
  |   <QUOTE: "\"">
  |   <UNDERSCORE: "_">
  }
  
  // Numbers
  
  TOKEN :
  {
      <#DIGIT: [ "0"-"9" ] >
  |   <NUMBER_LITERAL: (<DIGIT>)+ >
  }    
  
  // Arithmetic operators
  
  TOKEN : 
  {
      <MINUS: "-">
  |   <PLUS: "+">
  |   <MULTIPLY: "*">
  |   <DIVIDE: "/">
  |   <MODULUS: "%">
  }
  
  // Logic operators.
  
  TOKEN :
  {
      <LOGICAL_AND: "&&">
  |   <LOGICAL_OR: "||">
  |   <LOGICAL_LT: "<">
  |   <LOGICAL_LE: "<=">
  |   <LOGICAL_GT: ">">
  |   <LOGICAL_GE: ">=">
  |   <LOGICAL_EQUALS: "==">
  |   <LOGICAL_NOT_EQUALS: "!=">
  |   <LOGICAL_NOT: "!">
  |   <EQUALS: "=" >
  }
  
  // These operators must be allowed to
  // show up as text as well.
  
  
  // These are special tokens that appear
  // in directives. The single character
  // tokens must also be remove from
  // <TEXT>.
  
  TOKEN :
  {
      <IN: "in" >
  |   <TRUE: "true">
  |   <FALSE: "false">
  |   <STRING_LITERAL: ( "\"" ( ~["\"","\n","\r"] )* "\"" ) >
      {
          if (incMode)
          {
              matchedToken.image = stripQuotes(image.toString());
              pushFile(matchedToken.image);
          }
          incMode = false;
      }        
  
  //|   <LBRACKET: "{" >
  //|   <RBRACKET: "}" >
  |   <BEGIN: "#begin">
  |   <END: "#end">
  }
  
  //<DEFAULT> 
  TOKEN :
  {
      <INCLUDE_DIRECTIVE: "#include">
      {
          incMode = true;
      }        
  |   <PARSE_DIRECTIVE:   "#parse">
      { 
          incMode = true; 
      }
  |   <IF_DIRECTIVE:      "#if">
  |   <ELSEIF_DIRECTIVE:  "#elseif">
  |   <ELSE_DIRECTIVE:    "#else">
  |   <FOREACH_DIRECTIVE: "#foreach">
  |   <SET_DIRECTIVE:     "#set" >
  |   <PARAM_DIRECTIVE:   "#param" >
  |   <USE_DIRECTIVE:     "#use">
  |   <STOP_DIRECTIVE:    "#stop">
      {
          matchedToken.kind = EOF;
          fileDepth = 0;
      }
  }
  
  //<REFERENCE> 
  TOKEN :
  {
    <ALPHA_CHAR: ["a"-"z", "A"-"Z"] >
  | <ALPHANUM_CHAR: [ "a"-"z", "A"-"Z", "0"-"9" ] >
  | <IDENTIFIER_CHAR: [ "a"-"z", "A"-"Z", "0"-"9", "-", "_", "=" ] >
  | <IDENTIFIER: <ALPHA_CHAR> (<IDENTIFIER_CHAR>)* >
  | <DIDENTIFIER: <DOLLAR> <IDENTIFIER> >
  
    // Remove all the special characters from TEXT that can belong
    // in a reference of the form $variable, $object.Property,
    // $object.method($this, "that", $the-other)
  
  | <TEXT: (~["$", "\n", "\r", "\t", " ", ".", "(", ")", ",", "\"", "-", "_","<",">"])+ >
  }
  
  
  // DIRECTIVES 
  
  
  // I'm probably going to have to add a node type to
  // deal with comments. I need to collapse the space
  // that comments take up so the formatting will be
  // more accurate.
  
  // COMMENTS
  
  //<DEFAULT> 
  SPECIAL_TOKEN : 
  {
    <SINGLE_LINE_COMMENT: "##" (~["\n","\r"])* ("\n"|"\r"|"\r\n")>
  }
  
  
  /**
   * This gets inserted into the ParserMacroTokenManager
   * and is being used here strictly for the #parse
   * directive: an #include type behaviour. We have
   * to save the state the stream currently being
   * parsed and we have to save the state of the
   * lexer (TokenManager class) then we create
   * a new stream from the file named in the
   * #parse directive then we ReInit the lexer. 
   * Whatever it parses will get placed 
   * into the AST.
   *
   * I need a simple way to detect circular
   * inclusions so this thing doesn't go wild
   * and drag down the VM.
   */
  TOKEN_MGR_DECLS: 
  {  
      boolean incMode;
      int fileDepth = 0;
      int documentLine = 0;
      int lastLine = 0;
      
      Stack streams = new Stack();
      Stack states = new Stack();
      
      // remove double quotes in the string
      String stripQuotes(String str) 
      {
          int start = str.indexOf("\"");
          int end = str.indexOf("\"",start+1);    
          return str.substring(start+1,end);
      }    
      
      /**
       * Save the state of the current input stream
       * and the state of the lexer. So we can process
       * the new one.
       */
      void pushFile(String filename)
      {
          fileDepth++;
          
          streams.push(input_stream);
          states.push(new Integer(curLexState));
          documentLine += lastLine;
          
          try
          {
              FileInputStream fs = new FileInputStream(filename);
              ASCII_CharStream new_stream = new ASCII_CharStream(fs,1,1);    
              ReInit(new_stream);
          }
          catch(Exception e)
          {
          }
      }    
    
      /**
       * Retrieve the oldStream and oldState and
       * continue processing the input.
       */
      void popFile()
      {
          ReInit((ASCII_CharStream) streams.pop(), ((Integer) states.pop()).intValue());
          fileDepth--;
      }    
      
      private boolean AtParent()
      {
          if (fileDepth == 0)
              return true;
          else
              return false;
      }
      
      void CommonTokenAction(Token t)
      {
          if (t.kind == EOF && ! AtParent())
          {
              Token new_t;
              popFile();
              new_t = getNextToken();
              t.kind = new_t.kind;
              t.beginLine = new_t.beginLine;
              t.beginColumn = new_t.beginColumn;
              t.endLine = new_t.endLine;
              t.endColumn = new_t.endColumn;
              t.image = new_t.image;
              t.next = new_t.next;
              t.specialToken = new_t.specialToken;
          }
          else
          {
              lastLine = t.endLine;
              t.beginLine += documentLine;
              t.endLine += documentLine;
          }
      } 
  } 
  
  /**
   * This method is what starts the whole parsing
   * process. After the parsing is complete and
   * the template has been turned into an AST,
   * this method returns the root of AST which
   * can subsequently be traversed by a visitor
   * which implements the ParserVisitor interface
   * which is generated automatically by JavaCC
   */
  SimpleNode process() : {}
  {
     ( Statement() )* <EOF>
     { return jjtThis; }
  }
  
  /*
   * Expression syntax follows.
   */
  
  /*
  void Expression() : {}
  {
      //Reference()
      True()
  |   False()
  |   LOOKAHEAD( PrimaryExpression() "=" ) Assignment()
  |   ConditionalOrExpression()
  }
  */
  
  void Expression() : {}
  {
      StringLiteral()
  |   NumberLiteral()    
  |   Reference() 
  |   True() 
  |   False()
  }
  
  
  void Assignment() #Assignment(2) : {}
  {
      PrimaryExpression() <EQUALS> Expression()
  }
  
  void ConditionalOrExpression() #void : {}
  {
    ConditionalAndExpression()
    ( <LOGICAL_OR> ConditionalAndExpression() #OrNode(2) )*
  }
  
  
  void ConditionalAndExpression() #void : {}
  {
    EqualityExpression()
    ( <LOGICAL_AND>  EqualityExpression() #AndNode(2) )*
  }
  
  /*
  
  void ConditionalAndExpression() #void : {}
  {
    InclusiveOrExpression()
    ( <LOGICAL_AND>  InclusiveOrExpression() #AndNode(2) )*
  }
  
  
  void InclusiveOrExpression() #void : {}
  {
    ExclusiveOrExpression()
    ( "|" ExclusiveOrExpression() #BitwiseOrNode(2) )*
  }
  
  void ExclusiveOrExpression() #void : {}
  {
    AndExpression()
    ( "^" AndExpression() #BitwiseXorNode(2) )*
  }
  
  void AndExpression() #void : {}
  {
    EqualityExpression()
    ( "&" EqualityExpression() #BitwiseAndNode(2) )*
  }
  
  */
  
  void EqualityExpression() #void : {}
  {
      RelationalExpression()
      (
            <LOGICAL_EQUALS> RelationalExpression()     #EQNode(2)
          | <LOGICAL_NOT_EQUALS> RelationalExpression() #NENode(2)
      )*
  }
  
  void RelationalExpression() #void : {}
  {
      AdditiveExpression()
      (
            <LOGICAL_LT> AdditiveExpression() #LTNode(2)
          | <LOGICAL_GT> AdditiveExpression() #GTNode(2)
          | <LOGICAL_LE> AdditiveExpression() #LENode(2)
          | <LOGICAL_GE> AdditiveExpression() #GENode(2)
      )*
  }
  
  void AdditiveExpression() #void : {}
  {
      MultiplicativeExpression()
      (
            <PLUS>  MultiplicativeExpression() #AddNode(2)
          | <MINUS> MultiplicativeExpression() #SubtractNode(2)
      )*
  }
  
  void MultiplicativeExpression() #void : {}
  {
    UnaryExpression()
    (
       <MULTIPLY> UnaryExpression() #MulNode(2)
     | <DIVIDE>   UnaryExpression() #DivNode(2)
     | <MODULUS>  UnaryExpression() #ModNode(2)
    )*
  }
  
  void UnaryExpression() #void : {}
  {
      //"~" UnaryExpression() #BitwiseComplNode(1)
      <LOGICAL_NOT> UnaryExpression() #NotNode(1)
  |   PrimaryExpression()
  }
  
  void PrimaryExpression() #void : {}
  {    
      StringLiteral()
  |   NumberLiteral()    
  |   Reference() //Identifier() 
  |   <LPAREN> Expression() <RPAREN>
  }
  
  /**
   * These are the types of statements that
   * are acceptable in Velocity templates.
   * I have not found that the order here
   * matters much. Someone please correct
   * me here if I'm wrong.
   */
  void Statement() #void : {}
  {
      Text()
  |   Block()    
  |   IfStatement()
  |   ElseIfStatement()
  |   ForeachStatement()
  |   IncludeStatement()
  |   SetStatement()
  |   ParseStatement()
  |   UseStatement()
  |   ParamStatement()
  |   StopStatement()
  |   Reference()
  
  }
  
  void NumberLiteral() : {}
  {
      <NUMBER_LITERAL>
  }    
  
  void StringLiteral() : {}
  {
      <STRING_LITERAL>
  }    
  
  /**
   * This method corresponds to variable
   * references in Velocity templates.
   * The following are examples of variable
   * references that may be found in a
   * template:
   *
   * $foo
   * $bar
   *
   */
  void Identifier() : {}
  {    
      <IDENTIFIER>
  }
  
  /**
   * This method has yet to be fully implemented
   * but will allow arbitrarily nested method
   * calls
   */
  void Parameter() #void: {}
  {
      Reference() | StringLiteral()
  }
  
  /**
   * This method has yet to be fully implemented
   * but will allow arbitrarily nested method
   * calls
   */
  void Method() : {}
  {
      Identifier() <LPAREN> [ Parameter() ( <COMMA> Parameter() )* ] <RPAREN>
  }
  
  void Reference() : {}
  {
      <DIDENTIFIER> (LOOKAHEAD(2) <DOT> (LOOKAHEAD(3) Method() | Identifier()) )*
  }
  
  void True() : {}
  {
      <TRUE>
  }
  
  void False() : {}
  {
      <FALSE>
  }
  
  
  /**
   * This method corresponds to a block in
   * a Velocity template. Blocks are
   * currently associated with:
   *
   * #if
   * #foreach
   * #while (not implemented)
   *
   */
  void Block() : {}
  {
      //<LBRACKET> [ ( Statement() )* <RBRACKET> ]
      <BEGIN> ( Statement() )* <END>
  }
  
  /**
   * This method is responsible for allowing
   * all non-grammar text to pass through
   * unscathed.
   */
  void Text() : {}
  {
      <TEXT>
  |   <ALPHA_CHAR>    
  |   <IDENTIFIER>    
  |   <DOLLAR>
  |   <DOT>
  |   <LPAREN>
  |   <RPAREN>
  |   <COMMA>
  |   <QUOTE>
  |   <MINUS>
  |   <PLUS>
  |   <MULTIPLY>
  |   <DIVIDE>
  |   <MODULUS>
  |   <UNDERSCORE>
  |   <EQUALS>
  |   <IN>
  |   <TRUE>
  |   <FALSE>
  |   <STRING_LITERAL>
  |   <LOGICAL_AND>
  |   <LOGICAL_OR>
  |   <LOGICAL_LT>
  |   <LOGICAL_LE>
  |   <LOGICAL_GT>
  |   <LOGICAL_GE>
  |   <LOGICAL_EQUALS>
  |   <LOGICAL_NOT_EQUALS>
  |   <LOGICAL_NOT>
  |   <NUMBER_LITERAL>
  }
  
  /**
   * This method corresponds to an #if directive
   * in a Velocity template. The following are
   * examples if #if constructs that are
   * acceptable in a template:
   *
   * #if ($customer.owesMoney() && $customer.Name == "Fred") (not implemented)
   * {
   *     Pay up, or else!
   * }
   * #else
   * {
   *     Thankyou for your patronage.
   * }
   *
   * #if ($dynanmicContent)
   * {
   *     This is our $dynamicContent
   * }
   *
   * #if ($customer.owesMoney())
   * {
   *     You better pay up!
   * }
   *
   */
  void IfStatement() : {}
  {
      <IF_DIRECTIVE> 
      <LPAREN> Expression() <RPAREN>
      Statement()
      [ LOOKAHEAD(1) ElseStatement() ]
  }
  
  void ElseStatement() : {}
  {
      <ELSE_DIRECTIVE> Statement()
  }
  
  void ElseIfStatement() : {}
  {
    <ELSEIF_DIRECTIVE> 
    <LPAREN>
    Expression()
    <RPAREN>
    Statement()
    [ LOOKAHEAD(1) ElseStatement() ]
  }
  
  /**
   * This method corresponds to a #foreach
   * directive in a Velocity template. The
   * following are examples of #foreach
   * constructs that are acceptable in
   * a template:
   *
   * #foreach $element in $list
   * {
   *     This is the fifth $element
   * }
   *
   * #foreach $element in $foo.List
   * {
   *     This is the fifth $element
   * }
   *
   * #foreach $element in $foo.getList()
   * {
   *     This is the fifth $element
   * }
   *
   */
  void ForeachStatement() : {}
  {
    <FOREACH_DIRECTIVE> 
    Reference()
    <IN>
    Reference()
    Statement()
  }
  
  /**
   * This method corresponds to an #include
   * directive in a Velocity template. The
   * following are examples of #include
   * constructs that are acceptable in
   * a template:
   *
   * #include "foo.inc" 
   */
  void IncludeStatement() #void: {}
  {
    <INCLUDE_DIRECTIVE> 
    <STRING_LITERAL>
  }
  
  /**
   * This method corresponds to a #set
   * directive in a Velocity template. The
   * following are examples of #set
   * constructs that are acceptable in
   * a template:
   *
   * #set name = "Fred"
   * #set $Customer.Name = "Sidney"
   * #set $Database.findItem($partNum).Description = $newDescription (not implemented)
   *
   */
  void SetStatement() : {}
  {
      <SET_DIRECTIVE> //Expression()
      Reference()
      <EQUALS> 
      Expression()
      
      /*
      ( 
          StringLiteral() 
      | 
          NumberLiteral() 
      | 
          <LPAREN> Expression() <RPAREN>
          //Reference() 
      //| 
          //True() 
      //| 
          //False() 
      )
      */
  }
  
  /**
   * This method corresponds to a #parse
   * directive in a Velocity template. The
   * following are examples of #parse
   * constructs that are acceptable in
   * a template:
   *
   * #parse "bar.vt"
   */
  void ParseStatement() #void: {}
  {
    <PARSE_DIRECTIVE> <STRING_LITERAL>
  }
  
  /**
   * This method corresponds to a #use
   * directive in a Velocity template. The
   * following are examples of #use
   * constructs that are acceptable in
   * a template:
   *
   * This has not been implemented and may
   * not need to be because the Velocity
   * parser doesn't have any problem with
   * normal text that isn't part of Velocity's
   * grammar.
   *
   */
  void UseStatement() : {}
  {
    <USE_DIRECTIVE>
  }
  
  /**
   * This method corresponds to a #param
   * directive in a Velocity template. The
   * following are examples of #param
   * constructs that are acceptable in
   * a template:
   *
   * #param $language = "en"
   *
   */
  void ParamStatement() : {}
  {
    <PARAM_DIRECTIVE> Reference() <EQUALS> <STRING_LITERAL>
  }
  
  /**
   * This method corresponds to the #stop
   * directive which just simulates and EOF
   * so that parsing stops. The #stop directive
   * is really only useful for debugging
   * purposes.
   */
  void StopStatement() #void: {}
  {    
      <STOP_DIRECTIVE>
  }
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/webmacro/ParserConstants.java
  
  Index: ParserConstants.java
  ===================================================================
  /* Generated By:JJTree&JavaCC: Do not edit this line. ParserConstants.java */
  package org.apache.velocity.processor.javacc.parser.webmacro;
  
  public interface ParserConstants {
  
    int EOF = 0;
    int DOLLAR = 6;
    int DOT = 7;
    int LPAREN = 8;
    int RPAREN = 9;
    int COMMA = 10;
    int QUOTE = 11;
    int UNDERSCORE = 12;
    int DIGIT = 13;
    int NUMBER_LITERAL = 14;
    int MINUS = 15;
    int PLUS = 16;
    int MULTIPLY = 17;
    int DIVIDE = 18;
    int MODULUS = 19;
    int LOGICAL_AND = 20;
    int LOGICAL_OR = 21;
    int LOGICAL_LT = 22;
    int LOGICAL_LE = 23;
    int LOGICAL_GT = 24;
    int LOGICAL_GE = 25;
    int LOGICAL_EQUALS = 26;
    int LOGICAL_NOT_EQUALS = 27;
    int LOGICAL_NOT = 28;
    int EQUALS = 29;
    int IN = 30;
    int TRUE = 31;
    int FALSE = 32;
    int STRING_LITERAL = 33;
    int BEGIN = 34;
    int END = 35;
    int INCLUDE_DIRECTIVE = 36;
    int PARSE_DIRECTIVE = 37;
    int IF_DIRECTIVE = 38;
    int ELSEIF_DIRECTIVE = 39;
    int ELSE_DIRECTIVE = 40;
    int FOREACH_DIRECTIVE = 41;
    int SET_DIRECTIVE = 42;
    int PARAM_DIRECTIVE = 43;
    int USE_DIRECTIVE = 44;
    int STOP_DIRECTIVE = 45;
    int ALPHA_CHAR = 46;
    int ALPHANUM_CHAR = 47;
    int IDENTIFIER_CHAR = 48;
    int IDENTIFIER = 49;
    int DIDENTIFIER = 50;
    int TEXT = 51;
    int SINGLE_LINE_COMMENT = 52;
  
    int DEFAULT = 0;
  
    String[] tokenImage = {
      "<EOF>",
      "\" \"",
      "\"\\t\"",
      "\"\\n\"",
      "\"\\r\"",
      "\"\\f\"",
      "\"$\"",
      "\".\"",
      "\"(\"",
      "\")\"",
      "\",\"",
      "\"\\\"\"",
      "\"_\"",
      "<DIGIT>",
      "<NUMBER_LITERAL>",
      "\"-\"",
      "\"+\"",
      "\"*\"",
      "\"/\"",
      "\"%\"",
      "\"&&\"",
      "\"||\"",
      "\"<\"",
      "\"<=\"",
      "\">\"",
      "\">=\"",
      "\"==\"",
      "\"!=\"",
      "\"!\"",
      "\"=\"",
      "\"in\"",
      "\"true\"",
      "\"false\"",
      "<STRING_LITERAL>",
      "\"#begin\"",
      "\"#end\"",
      "\"#include\"",
      "\"#parse\"",
      "\"#if\"",
      "\"#elseif\"",
      "\"#else\"",
      "\"#foreach\"",
      "\"#set\"",
      "\"#param\"",
      "\"#use\"",
      "\"#stop\"",
      "<ALPHA_CHAR>",
      "<ALPHANUM_CHAR>",
      "<IDENTIFIER_CHAR>",
      "<IDENTIFIER>",
      "<DIDENTIFIER>",
      "<TEXT>",
      "<SINGLE_LINE_COMMENT>",
    };
  
  }
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/webmacro/ParserTokenManager.java
  
  Index: ParserTokenManager.java
  ===================================================================
  /* Generated By:JJTree&JavaCC: Do not edit this line. ParserTokenManager.java */
  package org.apache.velocity.processor.javacc.parser.webmacro;
  import java.io.*;
  import java.util.*;
  import org.apache.velocity.processor.javacc.parser.*;
  
  public class ParserTokenManager implements ParserConstants
  {
      boolean incMode;
      int fileDepth = 0;
      int documentLine = 0;
      int lastLine = 0;
  
      Stack streams = new Stack();
      Stack states = new Stack();
  
      // remove double quotes in the string
      String stripQuotes(String str)
      {
          int start = str.indexOf("\"");
          int end = str.indexOf("\"",start+1);
          return str.substring(start+1,end);
      }
  
      /**
       * Save the state of the current input stream
       * and the state of the lexer. So we can process
       * the new one.
       */
      void pushFile(String filename)
      {
          fileDepth++;
  
          streams.push(input_stream);
          states.push(new Integer(curLexState));
          documentLine += lastLine;
  
          try
          {
              FileInputStream fs = new FileInputStream(filename);
              ASCII_CharStream new_stream = new ASCII_CharStream(fs,1,1);
              ReInit(new_stream);
          }
          catch(Exception e)
          {
          }
      }
  
      /**
       * Retrieve the oldStream and oldState and
       * continue processing the input.
       */
      void popFile()
      {
          ReInit((ASCII_CharStream) streams.pop(), ((Integer) states.pop()).intValue());
          fileDepth--;
      }
  
      private boolean AtParent()
      {
          if (fileDepth == 0)
              return true;
          else
              return false;
      }
  
      void CommonTokenAction(Token t)
      {
          if (t.kind == EOF && ! AtParent())
          {
              Token new_t;
              popFile();
              new_t = getNextToken();
              t.kind = new_t.kind;
              t.beginLine = new_t.beginLine;
              t.beginColumn = new_t.beginColumn;
              t.endLine = new_t.endLine;
              t.endColumn = new_t.endColumn;
              t.image = new_t.image;
              t.next = new_t.next;
              t.specialToken = new_t.specialToken;
          }
          else
          {
              lastLine = t.endLine;
              t.beginLine += documentLine;
              t.endLine += documentLine;
          }
      }
  private final int jjStopStringLiteralDfa_0(int pos, long active0)
  {
     switch (pos)
     {
        case 0:
           if ((active0 & 0x3ffc00000000L) != 0L)
           {
              jjmatchedKind = 51;
              return 10;
           }
           if ((active0 & 0x300000L) != 0L)
           {
              jjmatchedKind = 51;
              return 9;
           }
           if ((active0 & 0x800L) != 0L)
              return 18;
           if ((active0 & 0x1c0000000L) != 0L)
           {
              jjmatchedKind = 46;
              return 19;
           }
           if ((active0 & 0x40L) != 0L)
              return 7;
           if ((active0 & 0x3c0f0020L) != 0L)
              return 9;
           return -1;
        case 1:
           if ((active0 & 0x40000000L) != 0L)
              return 19;
           if ((active0 & 0x3ffc00000000L) != 0L)
           {
              jjmatchedKind = 51;
              jjmatchedPos = 1;
              return 9;
           }
           if ((active0 & 0x180000000L) != 0L)
           {
              jjmatchedKind = 49;
              jjmatchedPos = 1;
              return 19;
           }
           if ((active0 & 0xc300000L) != 0L)
              return 9;
           return -1;
        case 2:
           if ((active0 & 0x3fbc00000000L) != 0L)
           {
              jjmatchedKind = 51;
              jjmatchedPos = 2;
              return 9;
           }
           if ((active0 & 0x180000000L) != 0L)
           {
              jjmatchedKind = 49;
              jjmatchedPos = 2;
              return 19;
           }
           if ((active0 & 0x4000000000L) != 0L)
              return 9;
           return -1;
        case 3:
           if ((active0 & 0x80000000L) != 0L)
              return 19;
           if ((active0 & 0x100000000L) != 0L)
           {
              jjmatchedKind = 49;
              jjmatchedPos = 3;
              return 19;
           }
           if ((active0 & 0x2bb400000000L) != 0L)
           {
              jjmatchedKind = 51;
              jjmatchedPos = 3;
              return 9;
           }
           if ((active0 & 0x140800000000L) != 0L)
              return 9;
           return -1;
        case 4:
           if ((active0 & 0x100000000L) != 0L)
              return 19;
           if ((active0 & 0xa3400000000L) != 0L)
           {
              if (jjmatchedPos != 4)
              {
                 jjmatchedKind = 51;
                 jjmatchedPos = 4;
              }
              return 9;
           }
           if ((active0 & 0x218000000000L) != 0L)
              return 9;
           return -1;
        case 5:
           if ((active0 & 0x29000000000L) != 0L)
           {
              jjmatchedKind = 51;
              jjmatchedPos = 5;
              return 9;
           }
           if ((active0 & 0x82400000000L) != 0L)
              return 9;
           return -1;
        case 6:
           if ((active0 & 0x21000000000L) != 0L)
           {
              jjmatchedKind = 51;
              jjmatchedPos = 6;
              return 9;
           }
           if ((active0 & 0x8000000000L) != 0L)
              return 9;
           return -1;
        default :
           return -1;
     }
  }
  private final int jjStartNfa_0(int pos, long active0)
  {
     return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
  }
  private final int jjStopAtPos(int pos, int kind)
  {
     jjmatchedKind = kind;
     jjmatchedPos = pos;
     return pos + 1;
  }
  private final int jjStartNfaWithStates_0(int pos, int kind, int state)
  {
     jjmatchedKind = kind;
     jjmatchedPos = pos;
     try { curChar = input_stream.readChar(); }
     catch(java.io.IOException e) { return pos + 1; }
     return jjMoveNfa_0(state, pos + 1);
  }
  private final int jjMoveStringLiteralDfa0_0()
  {
     switch(curChar)
     {
        case 12:
           return jjStartNfaWithStates_0(0, 5, 9);
        case 33:
           jjmatchedKind = 28;
           return jjMoveStringLiteralDfa1_0(0x8000000L);
        case 34:
           return jjStartNfaWithStates_0(0, 11, 18);
        case 35:
           return jjMoveStringLiteralDfa1_0(0x3ffc00000000L);
        case 36:
           return jjStartNfaWithStates_0(0, 6, 7);
        case 37:
           return jjStartNfaWithStates_0(0, 19, 9);
        case 38:
           return jjMoveStringLiteralDfa1_0(0x100000L);
        case 40:
           return jjStopAtPos(0, 8);
        case 41:
           return jjStopAtPos(0, 9);
        case 42:
           return jjStartNfaWithStates_0(0, 17, 9);
        case 43:
           return jjStartNfaWithStates_0(0, 16, 9);
        case 44:
           return jjStopAtPos(0, 10);
        case 45:
           return jjStopAtPos(0, 15);
        case 46:
           return jjStopAtPos(0, 7);
        case 47:
           return jjStartNfaWithStates_0(0, 18, 9);
        case 60:
           jjmatchedKind = 22;
           return jjMoveStringLiteralDfa1_0(0x800000L);
        case 61:
           jjmatchedKind = 29;
           return jjMoveStringLiteralDfa1_0(0x4000000L);
        case 62:
           jjmatchedKind = 24;
           return jjMoveStringLiteralDfa1_0(0x2000000L);
        case 95:
           return jjStopAtPos(0, 12);
        case 102:
           return jjMoveStringLiteralDfa1_0(0x100000000L);
        case 105:
           return jjMoveStringLiteralDfa1_0(0x40000000L);
        case 116:
           return jjMoveStringLiteralDfa1_0(0x80000000L);
        case 124:
           return jjMoveStringLiteralDfa1_0(0x200000L);
        default :
           return jjMoveNfa_0(1, 0);
     }
  }
  private final int jjMoveStringLiteralDfa1_0(long active0)
  {
     try { curChar = input_stream.readChar(); }
     catch(java.io.IOException e) {
        jjStopStringLiteralDfa_0(0, active0);
        return 1;
     }
     switch(curChar)
     {
        case 38:
           if ((active0 & 0x100000L) != 0L)
              return jjStartNfaWithStates_0(1, 20, 9);
           break;
        case 61:
           if ((active0 & 0x800000L) != 0L)
              return jjStopAtPos(1, 23);
           else if ((active0 & 0x2000000L) != 0L)
              return jjStopAtPos(1, 25);
           else if ((active0 & 0x4000000L) != 0L)
              return jjStartNfaWithStates_0(1, 26, 9);
           else if ((active0 & 0x8000000L) != 0L)
              return jjStartNfaWithStates_0(1, 27, 9);
           break;
        case 97:
           return jjMoveStringLiteralDfa2_0(active0, 0x100000000L);
        case 98:
           return jjMoveStringLiteralDfa2_0(active0, 0x400000000L);
        case 101:
           return jjMoveStringLiteralDfa2_0(active0, 0x18800000000L);
        case 102:
           return jjMoveStringLiteralDfa2_0(active0, 0x20000000000L);
        case 105:
           return jjMoveStringLiteralDfa2_0(active0, 0x5000000000L);
        case 110:
           if ((active0 & 0x40000000L) != 0L)
              return jjStartNfaWithStates_0(1, 30, 19);
           break;
        case 112:
           return jjMoveStringLiteralDfa2_0(active0, 0x82000000000L);
        case 114:
           return jjMoveStringLiteralDfa2_0(active0, 0x80000000L);
        case 115:
           return jjMoveStringLiteralDfa2_0(active0, 0x240000000000L);
        case 117:
           return jjMoveStringLiteralDfa2_0(active0, 0x100000000000L);
        case 124:
           if ((active0 & 0x200000L) != 0L)
              return jjStartNfaWithStates_0(1, 21, 9);
           break;
        default :
           break;
     }
     return jjStartNfa_0(0, active0);
  }
  private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
  {
     if (((active0 &= old0)) == 0L)
        return jjStartNfa_0(0, old0); 
     try { curChar = input_stream.readChar(); }
     catch(java.io.IOException e) {
        jjStopStringLiteralDfa_0(1, active0);
        return 2;
     }
     switch(curChar)
     {
        case 97:
           return jjMoveStringLiteralDfa3_0(active0, 0x82000000000L);
        case 101:
           return jjMoveStringLiteralDfa3_0(active0, 0x40400000000L);
        case 102:
           if ((active0 & 0x4000000000L) != 0L)
              return jjStartNfaWithStates_0(2, 38, 9);
           break;
        case 108:
           return jjMoveStringLiteralDfa3_0(active0, 0x18100000000L);
        case 110:
           return jjMoveStringLiteralDfa3_0(active0, 0x1800000000L);
        case 111:
           return jjMoveStringLiteralDfa3_0(active0, 0x20000000000L);
        case 115:
           return jjMoveStringLiteralDfa3_0(active0, 0x100000000000L);
        case 116:
           return jjMoveStringLiteralDfa3_0(active0, 0x200000000000L);
        case 117:
           return jjMoveStringLiteralDfa3_0(active0, 0x80000000L);
        default :
           break;
     }
     return jjStartNfa_0(1, active0);
  }
  private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
  {
     if (((active0 &= old0)) == 0L)
        return jjStartNfa_0(1, old0); 
     try { curChar = input_stream.readChar(); }
     catch(java.io.IOException e) {
        jjStopStringLiteralDfa_0(2, active0);
        return 3;
     }
     switch(curChar)
     {
        case 99:
           return jjMoveStringLiteralDfa4_0(active0, 0x1000000000L);
        case 100:
           if ((active0 & 0x800000000L) != 0L)
              return jjStartNfaWithStates_0(3, 35, 9);
           break;
        case 101:
           if ((active0 & 0x80000000L) != 0L)
              return jjStartNfaWithStates_0(3, 31, 19);
           else if ((active0 & 0x100000000000L) != 0L)
              return jjStartNfaWithStates_0(3, 44, 9);
           break;
        case 103:
           return jjMoveStringLiteralDfa4_0(active0, 0x400000000L);
        case 111:
           return jjMoveStringLiteralDfa4_0(active0, 0x200000000000L);
        case 114:
           return jjMoveStringLiteralDfa4_0(active0, 0xa2000000000L);
        case 115:
           return jjMoveStringLiteralDfa4_0(active0, 0x18100000000L);
        case 116:
           if ((active0 & 0x40000000000L) != 0L)
              return jjStartNfaWithStates_0(3, 42, 9);
           break;
        default :
           break;
     }
     return jjStartNfa_0(2, active0);
  }
  private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
  {
     if (((active0 &= old0)) == 0L)
        return jjStartNfa_0(2, old0); 
     try { curChar = input_stream.readChar(); }
     catch(java.io.IOException e) {
        jjStopStringLiteralDfa_0(3, active0);
        return 4;
     }
     switch(curChar)
     {
        case 97:
           return jjMoveStringLiteralDfa5_0(active0, 0x80000000000L);
        case 101:
           if ((active0 & 0x100000000L) != 0L)
              return jjStartNfaWithStates_0(4, 32, 19);
           else if ((active0 & 0x10000000000L) != 0L)
           {
              jjmatchedKind = 40;
              jjmatchedPos = 4;
           }
           return jjMoveStringLiteralDfa5_0(active0, 0x28000000000L);
        case 105:
           return jjMoveStringLiteralDfa5_0(active0, 0x400000000L);
        case 108:
           return jjMoveStringLiteralDfa5_0(active0, 0x1000000000L);
        case 112:
           if ((active0 & 0x200000000000L) != 0L)
              return jjStartNfaWithStates_0(4, 45, 9);
           break;
        case 115:
           return jjMoveStringLiteralDfa5_0(active0, 0x2000000000L);
        default :
           break;
     }
     return jjStartNfa_0(3, active0);
  }
  private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
  {
     if (((active0 &= old0)) == 0L)
        return jjStartNfa_0(3, old0); 
     try { curChar = input_stream.readChar(); }
     catch(java.io.IOException e) {
        jjStopStringLiteralDfa_0(4, active0);
        return 5;
     }
     switch(curChar)
     {
        case 97:
           return jjMoveStringLiteralDfa6_0(active0, 0x20000000000L);
        case 101:
           if ((active0 & 0x2000000000L) != 0L)
              return jjStartNfaWithStates_0(5, 37, 9);
           break;
        case 105:
           return jjMoveStringLiteralDfa6_0(active0, 0x8000000000L);
        case 109:
           if ((active0 & 0x80000000000L) != 0L)
              return jjStartNfaWithStates_0(5, 43, 9);
           break;
        case 110:
           if ((active0 & 0x400000000L) != 0L)
              return jjStartNfaWithStates_0(5, 34, 9);
           break;
        case 117:
           return jjMoveStringLiteralDfa6_0(active0, 0x1000000000L);
        default :
           break;
     }
     return jjStartNfa_0(4, active0);
  }
  private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
  {
     if (((active0 &= old0)) == 0L)
        return jjStartNfa_0(4, old0); 
     try { curChar = input_stream.readChar(); }
     catch(java.io.IOException e) {
        jjStopStringLiteralDfa_0(5, active0);
        return 6;
     }
     switch(curChar)
     {
        case 99:
           return jjMoveStringLiteralDfa7_0(active0, 0x20000000000L);
        case 100:
           return jjMoveStringLiteralDfa7_0(active0, 0x1000000000L);
        case 102:
           if ((active0 & 0x8000000000L) != 0L)
              return jjStartNfaWithStates_0(6, 39, 9);
           break;
        default :
           break;
     }
     return jjStartNfa_0(5, active0);
  }
  private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
  {
     if (((active0 &= old0)) == 0L)
        return jjStartNfa_0(5, old0); 
     try { curChar = input_stream.readChar(); }
     catch(java.io.IOException e) {
        jjStopStringLiteralDfa_0(6, active0);
        return 7;
     }
     switch(curChar)
     {
        case 101:
           if ((active0 & 0x1000000000L) != 0L)
              return jjStartNfaWithStates_0(7, 36, 9);
           break;
        case 104:
           if ((active0 & 0x20000000000L) != 0L)
              return jjStartNfaWithStates_0(7, 41, 9);
           break;
        default :
           break;
     }
     return jjStartNfa_0(6, active0);
  }
  private final void jjCheckNAdd(int state)
  {
     if (jjrounds[state] != jjround)
     {
        jjstateSet[jjnewStateCnt++] = state;
        jjrounds[state] = jjround;
     }
  }
  private final void jjAddStates(int start, int end)
  {
     do {
        jjstateSet[jjnewStateCnt++] = jjnextStates[start];
     } while (start++ != end);
  }
  private final void jjCheckNAddTwoStates(int state1, int state2)
  {
     jjCheckNAdd(state1);
     jjCheckNAdd(state2);
  }
  private final void jjCheckNAddStates(int start, int end)
  {
     do {
        jjCheckNAdd(jjnextStates[start]);
     } while (start++ != end);
  }
  private final void jjCheckNAddStates(int start)
  {
     jjCheckNAdd(jjnextStates[start]);
     jjCheckNAdd(jjnextStates[start + 1]);
  }
  static final long[] jjbitVec0 = {
     0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
  };
  private final int jjMoveNfa_0(int startState, int curPos)
  {
     int[] nextStates;
     int startsAt = 0;
     jjnewStateCnt = 18;
     int i = 1;
     jjstateSet[0] = startState;
     int j, kind = 0x7fffffff;
     for (;;)
     {
        if (++jjround == 0x7fffffff)
           ReInitRounds();
        if (curChar < 64)
        {
           long l = 1L << curChar;
           MatchLoop: do
           {
              switch(jjstateSet[--i])
              {
                 case 10:
                    if ((0xafff8ceaffffd9ffL & l) != 0L)
                    {
                       if (kind > 51)
                          kind = 51;
                       jjCheckNAdd(9);
                    }
                    if (curChar == 35)
                       jjCheckNAddStates(0, 2);
                    break;
                 case 1:
                    if ((0xafff8ceaffffd9ffL & l) != 0L)
                    {
                       if (kind > 51)
                          kind = 51;
                       jjCheckNAdd(9);
                    }
                    else if (curChar == 36)
                       jjstateSet[jjnewStateCnt++] = 7;
                    else if (curChar == 34)
                       jjCheckNAddTwoStates(2, 3);
                    if ((0x23ff200000000000L & l) != 0L)
                    {
                       if (kind > 48)
                          kind = 48;
                    }
                    else if (curChar == 35)
                       jjstateSet[jjnewStateCnt++] = 10;
                    if ((0x3ff000000000000L & l) != 0L)
                    {
                       if (kind > 47)
                          kind = 47;
                    }
                    if ((0x3ff000000000000L & l) != 0L)
                    {
                       if (kind > 14)
                          kind = 14;
                       jjCheckNAdd(0);
                    }
                    break;
                 case 18:
                    if ((0xfffffffbffffdbffL & l) != 0L)
                       jjCheckNAddTwoStates(2, 3);
                    else if (curChar == 34)
                    {
                       if (kind > 33)
                          kind = 33;
                    }
                    break;
                 case 19:
                    if ((0xafff8ceaffffd9ffL & l) != 0L)
                    {
                       if (kind > 51)
                          kind = 51;
                       jjCheckNAdd(9);
                    }
                    if ((0x23ff200000000000L & l) != 0L)
                    {
                       if (kind > 49)
                          kind = 49;
                       jjCheckNAdd(17);
                    }
                    break;
                 case 0:
                    if ((0x3ff000000000000L & l) == 0L)
                       break;
                    if (kind > 14)
                       kind = 14;
                    jjCheckNAdd(0);
                    break;
                 case 2:
                    if ((0xfffffffbffffdbffL & l) != 0L)
                       jjCheckNAddTwoStates(2, 3);
                    break;
                 case 3:
                    if (curChar == 34 && kind > 33)
                       kind = 33;
                    break;
                 case 4:
                    if ((0x3ff000000000000L & l) != 0L && kind > 47)
                       kind = 47;
                    break;
                 case 5:
                    if ((0x23ff200000000000L & l) != 0L && kind > 48)
                       kind = 48;
                    break;
                 case 6:
                    if (curChar == 36)
                       jjstateSet[jjnewStateCnt++] = 7;
                    break;
                 case 8:
                    if ((0x23ff200000000000L & l) == 0L)
                       break;
                    if (kind > 50)
                       kind = 50;
                    jjstateSet[jjnewStateCnt++] = 8;
                    break;
                 case 9:
                    if ((0xafff8ceaffffd9ffL & l) == 0L)
                       break;
                    if (kind > 51)
                       kind = 51;
                    jjCheckNAdd(9);
                    break;
                 case 11:
                    if ((0xffffffffffffdbffL & l) != 0L)
                       jjCheckNAddStates(0, 2);
                    break;
                 case 12:
                    if ((0x2400L & l) != 0L && kind > 52)
                       kind = 52;
                    break;
                 case 13:
                    if (curChar == 10 && kind > 52)
                       kind = 52;
                    break;
                 case 14:
                    if (curChar == 13)
                       jjstateSet[jjnewStateCnt++] = 13;
                    break;
                 case 15:
                    if (curChar == 35)
                       jjstateSet[jjnewStateCnt++] = 10;
                    break;
                 case 17:
                    if ((0x23ff200000000000L & l) == 0L)
                       break;
                    if (kind > 49)
                       kind = 49;
                    jjCheckNAdd(17);
                    break;
                 default : break;
              }
           } while(i != startsAt);
        }
        else if (curChar < 128)
        {
           long l = 1L << (curChar & 077);
           MatchLoop: do
           {
              switch(jjstateSet[--i])
              {
                 case 10:
                 case 9:
                    if ((0xffffffff7fffffffL & l) == 0L)
                       break;
                    if (kind > 51)
                       kind = 51;
                    jjCheckNAdd(9);
                    break;
                 case 1:
                    if ((0xffffffff7fffffffL & l) != 0L)
                    {
                       if (kind > 51)
                          kind = 51;
                       jjCheckNAdd(9);
                    }
                    if ((0x7fffffe87fffffeL & l) != 0L)
                    {
                       if (kind > 48)
                          kind = 48;
                    }
                    if ((0x7fffffe07fffffeL & l) != 0L)
                    {
                       if (kind > 46)
                          kind = 46;
                       jjCheckNAdd(17);
                    }
                    if ((0x7fffffe07fffffeL & l) != 0L)
                    {
                       if (kind > 47)
                          kind = 47;
                    }
                    break;
                 case 18:
                 case 2:
                    jjCheckNAddTwoStates(2, 3);
                    break;
                 case 19:
                    if ((0xffffffff7fffffffL & l) != 0L)
                    {
                       if (kind > 51)
                          kind = 51;
                       jjCheckNAdd(9);
                    }
                    if ((0x7fffffe87fffffeL & l) != 0L)
                    {
                       if (kind > 49)
                          kind = 49;
                       jjCheckNAdd(17);
                    }
                    break;
                 case 4:
                    if ((0x7fffffe07fffffeL & l) != 0L && kind > 47)
                       kind = 47;
                    break;
                 case 5:
                    if ((0x7fffffe87fffffeL & l) != 0L && kind > 48)
                       kind = 48;
                    break;
                 case 7:
                    if ((0x7fffffe07fffffeL & l) == 0L)
                       break;
                    if (kind > 50)
                       kind = 50;
                    jjCheckNAdd(8);
                    break;
                 case 8:
                    if ((0x7fffffe87fffffeL & l) == 0L)
                       break;
                    if (kind > 50)
                       kind = 50;
                    jjCheckNAdd(8);
                    break;
                 case 11:
                    jjAddStates(0, 2);
                    break;
                 case 16:
                    if ((0x7fffffe07fffffeL & l) == 0L)
                       break;
                    if (kind > 46)
                       kind = 46;
                    jjCheckNAdd(17);
                    break;
                 case 17:
                    if ((0x7fffffe87fffffeL & l) == 0L)
                       break;
                    if (kind > 49)
                       kind = 49;
                    jjCheckNAdd(17);
                    break;
                 default : break;
              }
           } while(i != startsAt);
        }
        else
        {
           int i2 = (curChar & 0xff) >> 6;
           long l2 = 1L << (curChar & 077);
           MatchLoop: do
           {
              switch(jjstateSet[--i])
              {
                 case 10:
                 case 9:
                    if ((jjbitVec0[i2] & l2) == 0L)
                       break;
                    if (kind > 51)
                       kind = 51;
                    jjCheckNAdd(9);
                    break;
                 case 1:
                    if ((jjbitVec0[i2] & l2) == 0L)
                       break;
                    if (kind > 51)
                       kind = 51;
                    jjCheckNAdd(9);
                    break;
                 case 18:
                 case 2:
                    if ((jjbitVec0[i2] & l2) != 0L)
                       jjCheckNAddTwoStates(2, 3);
                    break;
                 case 19:
                    if ((jjbitVec0[i2] & l2) == 0L)
                       break;
                    if (kind > 51)
                       kind = 51;
                    jjCheckNAdd(9);
                    break;
                 case 11:
                    if ((jjbitVec0[i2] & l2) != 0L)
                       jjAddStates(0, 2);
                    break;
                 default : break;
              }
           } while(i != startsAt);
        }
        if (kind != 0x7fffffff)
        {
           jjmatchedKind = kind;
           jjmatchedPos = curPos;
           kind = 0x7fffffff;
        }
        ++curPos;
        if ((i = jjnewStateCnt) == (startsAt = 18 - (jjnewStateCnt = startsAt)))
           return curPos;
        try { curChar = input_stream.readChar(); }
        catch(java.io.IOException e) { return curPos; }
     }
  }
  static final int[] jjnextStates = {
     11, 12, 14, 
  };
  public static final String[] jjstrLiteralImages = {
  "", null, null, null, null, null, "\44", "\56", "\50", "\51", "\54", "\42", 
  "\137", null, null, "\55", "\53", "\52", "\57", "\45", "\46\46", "\174\174", "\74", 
  "\74\75", "\76", "\76\75", "\75\75", "\41\75", "\41", "\75", "\151\156", 
  "\164\162\165\145", "\146\141\154\163\145", null, "\43\142\145\147\151\156", "\43\145\156\144", 
  "\43\151\156\143\154\165\144\145", "\43\160\141\162\163\145", "\43\151\146", "\43\145\154\163\145\151\146", 
  "\43\145\154\163\145", "\43\146\157\162\145\141\143\150", "\43\163\145\164", 
  "\43\160\141\162\141\155", "\43\165\163\145", "\43\163\164\157\160", null, null, null, null, null, null, 
  null, };
  public static final String[] lexStateNames = {
     "DEFAULT", 
  };
  static final long[] jjtoToken = {
     0xfffffffffdfc1L, 
  };
  static final long[] jjtoSkip = {
     0x1000000000003eL, 
  };
  static final long[] jjtoSpecial = {
     0x10000000000000L, 
  };
  private ASCII_CharStream input_stream;
  private final int[] jjrounds = new int[18];
  private final int[] jjstateSet = new int[36];
  StringBuffer image;
  int jjimageLen;
  int lengthOfMatch;
  protected char curChar;
  public ParserTokenManager(ASCII_CharStream stream)
  {
     if (ASCII_CharStream.staticFlag)
        throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
     input_stream = stream;
  }
  public ParserTokenManager(ASCII_CharStream stream, int lexState)
  {
     this(stream);
     SwitchTo(lexState);
  }
  public void ReInit(ASCII_CharStream stream)
  {
     jjmatchedPos = jjnewStateCnt = 0;
     curLexState = defaultLexState;
     input_stream = stream;
     ReInitRounds();
  }
  private final void ReInitRounds()
  {
     int i;
     jjround = 0x80000001;
     for (i = 18; i-- > 0;)
        jjrounds[i] = 0x80000000;
  }
  public void ReInit(ASCII_CharStream stream, int lexState)
  {
     ReInit(stream);
     SwitchTo(lexState);
  }
  public void SwitchTo(int lexState)
  {
     if (lexState >= 1 || lexState < 0)
        throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
     else
        curLexState = lexState;
  }
  
  private final Token jjFillToken()
  {
     Token t = Token.newToken(jjmatchedKind);
     t.kind = jjmatchedKind;
     String im = jjstrLiteralImages[jjmatchedKind];
     t.image = (im == null) ? input_stream.GetImage() : im;
     t.beginLine = input_stream.getBeginLine();
     t.beginColumn = input_stream.getBeginColumn();
     t.endLine = input_stream.getEndLine();
     t.endColumn = input_stream.getEndColumn();
     return t;
  }
  
  int curLexState = 0;
  int defaultLexState = 0;
  int jjnewStateCnt;
  int jjround;
  int jjmatchedPos;
  int jjmatchedKind;
  
  public final Token getNextToken() 
  {
    int kind;
    Token specialToken = null;
    Token matchedToken;
    int curPos = 0;
  
    EOFLoop :
    for (;;)
    {   
     try   
     {     
        curChar = input_stream.BeginToken();
     }     
     catch(java.io.IOException e)
     {        
        jjmatchedKind = 0;
        matchedToken = jjFillToken();
        matchedToken.specialToken = specialToken;
        CommonTokenAction(matchedToken);
        return matchedToken;
     }
     image = null;
     jjimageLen = 0;
  
     try { input_stream.backup(0);
        while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
           curChar = input_stream.BeginToken();
     }
     catch (java.io.IOException e1) { continue EOFLoop; }
     jjmatchedKind = 0x7fffffff;
     jjmatchedPos = 0;
     curPos = jjMoveStringLiteralDfa0_0();
     if (jjmatchedKind != 0x7fffffff)
     {
        if (jjmatchedPos + 1 < curPos)
           input_stream.backup(curPos - jjmatchedPos - 1);
        if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
        {
           matchedToken = jjFillToken();
           matchedToken.specialToken = specialToken;
           TokenLexicalActions(matchedToken);
           CommonTokenAction(matchedToken);
           return matchedToken;
        }
        else
        {
           if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
           {
              matchedToken = jjFillToken();
              if (specialToken == null)
                 specialToken = matchedToken;
              else
              {
                 matchedToken.specialToken = specialToken;
                 specialToken = (specialToken.next = matchedToken);
              }
           }
           continue EOFLoop;
        }
     }
     int error_line = input_stream.getEndLine();
     int error_column = input_stream.getEndColumn();
     String error_after = null;
     boolean EOFSeen = false;
     try { input_stream.readChar(); input_stream.backup(1); }
     catch (java.io.IOException e1) {
        EOFSeen = true;
        error_after = curPos <= 1 ? "" : input_stream.GetImage();
        if (curChar == '\n' || curChar == '\r') {
           error_line++;
           error_column = 0;
        }
        else
           error_column++;
     }
     if (!EOFSeen) {
        input_stream.backup(1);
        error_after = curPos <= 1 ? "" : input_stream.GetImage();
     }
     throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
    }
  }
  
  final void TokenLexicalActions(Token matchedToken)
  {
     switch(jjmatchedKind)
     {
        case 33 :
          if (image == null)
              image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))));
           else
              image.append(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))));
          if (incMode)
          {
              matchedToken.image = stripQuotes(image.toString());
              pushFile(matchedToken.image);
          }
          incMode = false;
           break;
        case 36 :
          if (image == null)
              image = new StringBuffer(jjstrLiteralImages[36]);
           else
              image.append(jjstrLiteralImages[36]);
          incMode = true;
           break;
        case 37 :
          if (image == null)
              image = new StringBuffer(jjstrLiteralImages[37]);
           else
              image.append(jjstrLiteralImages[37]);
          incMode = true;
           break;
        case 45 :
          if (image == null)
              image = new StringBuffer(jjstrLiteralImages[45]);
           else
              image.append(jjstrLiteralImages[45]);
          matchedToken.kind = EOF;
          fileDepth = 0;
           break;
        default : 
           break;
     }
  }
  }
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/webmacro/build
  
  Index: build
  ===================================================================
  #!/bin/sh
  
  jjtree Parser.jjt
  javacc Parser.jj
  ./remove.sh
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/webmacro/remove.list
  
  Index: remove.list
  ===================================================================
  ASCII_CharStream.java
  ASTAddNode.java
  ASTAndNode.java
  ASTAssignment.java
  ASTBlock.java
  ASTDivNode.java
  ASTEQNode.java
  ASTElseIfStatement.java
  ASTElseStatement.java
  ASTExpression.java
  ASTFalse.java
  ASTForeachStatement.java
  ASTGENode.java
  ASTGTNode.java
  ASTIdentifier.java
  ASTIfStatement.java
  ASTIncludeStatement.java
  ASTLENode.java
  ASTLTNode.java
  ASTMethod.java
  ASTModNode.java
  ASTMulNode.java
  ASTNENode.java
  ASTNotNode.java
  ASTNumberLiteral.java
  ASTOrNode.java
  ASTParamStatement.java
  ASTParameter.java
  ASTParameters.java
  ASTProperty.java
  ASTPropertyMethod.java
  ASTReference.java
  ASTSetStatement.java
  ASTStringLiteral.java
  ASTSubtractNode.java
  ASTText.java
  ASTTrue.java
  ASTUseStatement.java
  ASTVariable.java
  ASTprocess.java
  Node.java
  ParseException.java
  ParserTreeConstants.java
  ParserVisitor.java
  SimpleNode.java
  Token.java
  TokenMgrError.java
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/parser/webmacro/remove.sh
  
  Index: remove.sh
  ===================================================================
  #!/bin/sh
  
  for i in `cat remove.list`
  do
      rm -f $i
  done    
  
  
  
  1.4       +15 -0     jakarta-velocity/src/java/org/apache/velocity/processor/javacc/visitor/BaseVisitor.java
  
  Index: BaseVisitor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/visitor/BaseVisitor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BaseVisitor.java	2000/09/08 21:06:31	1.3
  +++ BaseVisitor.java	2000/09/12 01:42:17	1.4
  @@ -55,6 +55,8 @@
           String method;
           String identifier;
           
  +        String signature = "";
  +        
           // How many child nodes do we have?
           int children = node.jjtGetNumChildren();
           
  @@ -82,14 +84,20 @@
                           
                           if (result instanceof Map)
                           {
  +                            // This can be created once.
                               ptypes = new Class[1];
                               ptypes[0] = new Object().getClass();
  +                            signature = signature + "Map.";
                           }                            
                           
                           result = Utils.invoke(result, method, args, ptypes);
                       }
                       else
  +                    {
                           result = newResult;
  +                        signature = signature + "Property.";
  +     
  +                    }                        
                       
                       break;
               
  @@ -127,6 +135,9 @@
                       }                        
                   
                   result = Utils.invoke(result, method, params);
  +                
  +                signature = signature + "Method.";
  +                
                   break;                    
               }
           }
  @@ -134,6 +145,8 @@
           if (tailChildrenToIgnore == 1)
               property = node.jjtGetChild(children - 1).getFirstToken().image;
   
  +        //System.out.println("signature: " + signature);
  +        
           return result;
       }
   
  @@ -171,6 +184,7 @@
   
       public Object visit(SimpleNode node, Object data){ return data; }
       public Object visit(ASTprocess node, Object data){ return data; }
  +    public Object visit(ASTExpression node, Object data){ return data; }
       public Object visit(ASTAssignment node, Object data){ return data; }
       public Object visit(ASTOrNode node, Object data){ return data; }
       public Object visit(ASTAndNode node, Object data){ return data; }
  @@ -186,6 +200,7 @@
       public Object visit(ASTDivNode node, Object data){ return data; }
       public Object visit(ASTModNode node, Object data){ return data; }
       public Object visit(ASTNotNode node, Object data){ return data; }
  +    public Object visit(ASTNumberLiteral node, Object data){ return data; }
       public Object visit(ASTStringLiteral node, Object data){ return data; }
       public Object visit(ASTIdentifier node, Object data){ return data; }
       public Object visit(ASTMethod node, Object data){ return data; }
  
  
  
  1.3       +3 -1      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/visitor/DumpMode.java
  
  Index: DumpMode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/visitor/DumpMode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DumpMode.java	2000/09/08 21:06:31	1.2
  +++ DumpMode.java	2000/09/12 01:42:17	1.3
  @@ -66,7 +66,7 @@
    * as well.
    *
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
  - * @version $Id: DumpMode.java,v 1.2 2000/09/08 21:06:31 jvanzyl Exp $
  + * @version $Id: DumpMode.java,v 1.3 2000/09/12 01:42:17 jvanzyl Exp $
    */
   public class DumpMode extends BaseVisitor
   {
  @@ -108,6 +108,7 @@
   
       public Object visit(SimpleNode node, Object data){ return showNode(node,data); }
       public Object visit(ASTprocess node, Object data){ return showNode(node,data); }
  +    public Object visit(ASTExpression node, Object data){ return showNode(node,data); }
       public Object visit(ASTAssignment node, Object data){ return showNode(node,data); }
       public Object visit(ASTOrNode node, Object data){ return showNode(node,data); }
       public Object visit(ASTAndNode node, Object data){ return showNode(node,data); }
  @@ -123,6 +124,7 @@
       public Object visit(ASTDivNode node, Object data){ return showNode(node,data); }
       public Object visit(ASTModNode node, Object data){ return showNode(node,data); }
       public Object visit(ASTNotNode node, Object data){ return showNode(node,data); }
  +    public Object visit(ASTNumberLiteral node, Object data){ return showNode(node,data); }
       public Object visit(ASTStringLiteral node, Object data){ return showNode(node,data); }
       public Object visit(ASTIdentifier node, Object data){ return showNode(node,data); }
       public Object visit(ASTMethod node, Object data){ return showNode(node,data); }
  
  
  
  1.4       +5 -5      jakarta-velocity/src/java/org/apache/velocity/processor/javacc/visitor/NoCacheMode.java
  
  Index: NoCacheMode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/processor/javacc/visitor/NoCacheMode.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- NoCacheMode.java	2000/09/08 21:06:31	1.3
  +++ NoCacheMode.java	2000/09/12 01:42:17	1.4
  @@ -78,7 +78,7 @@
    * Look at the InjectorVisitor for that.
    *
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
  - * @version $Id: NoCacheMode.java,v 1.3 2000/09/08 21:06:31 jvanzyl Exp $
  + * @version $Id: NoCacheMode.java,v 1.4 2000/09/12 01:42:17 jvanzyl Exp $
    */
   public class NoCacheMode extends BaseVisitor
   {
  @@ -266,7 +266,7 @@
           ifExpression = false;
           
           // token 3
  -        Node expression = node.jjtGetChild(0);//.jjtGetChild(0);
  +        Node expression = node.jjtGetChild(0).jjtGetChild(0);
   
           // Only process the child nodes if the expression
           // evaluates to true. But we also need to look for
  @@ -344,7 +344,7 @@
           }            
           
           // token 3
  -        Node expression = node.jjtGetChild(0);//.jjtGetChild(0);
  +        Node expression = node.jjtGetChild(0).jjtGetChild(0);
   
           // Only process the child nodes if the expression
           // evaluates to true. But we also need to look for
  @@ -524,8 +524,8 @@
       public Object visit(ASTSetStatement node, Object data)
       {
           // tokens 2,4
  -        Object value = null;;
  -        Node right = node.jjtGetChild(1);
  +        Object value = null;
  +        Node right = node.jjtGetChild(1).jjtGetChild(0);
           
           switch(right.getType())
           {
  
  
  
  1.1                  jakarta-velocity/src/java/org/apache/velocity/processor/javacc/visitor/CacheMode.java
  
  Index: CacheMode.java
  ===================================================================
  package org.apache.velocity.processor.javacc.visitor;
  
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Velocity", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  import java.io.Writer;
  import java.io.IOException;
  
  import java.util.Collection;
  import java.util.Iterator;
  import java.util.Vector;
  import java.util.Enumeration;
  import java.util.Stack;
  import java.util.ArrayList;
  
  import org.apache.velocity.Utils;
  import org.apache.velocity.Context;
  import org.apache.velocity.processor.javacc.parser.*;
  
  /**
   * This is an extension of the NoCacheMode visistor. Here
   * we are going to cache all the static content in the
   * top level block.
   *
   * Going to try and make a first version of an injector,
   * right now the injector will just hold a bit of the
   * AST. I would like to make this more efficient later
   * on, but this is a start.
   *
   * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
   * @version $Id: CacheMode.java,v 1.1 2000/09/12 01:42:17 jvanzyl Exp $
   */
  public class CacheMode extends NoCacheMode
  {
      protected int blockDepth;
      protected StringBuffer currentStaticBit;
      protected ArrayList staticBits;
  
      public CacheMode()
      {
          reset();        
      }
  
      public void reset()
      {
          super.reset();
          blockDepth = 0;
          currentStaticBit = new StringBuffer();
          staticBits = new ArrayList();
      }
  
      /** */
      private void print(String text, int x, int y)
      {
          print(text, x, y, 0);
      }
  
      /** */
      private void print(String text, int x, int y, int columnAdjustment)
      {
          for (int i = line; line < (y + lineAdjustment); i++)
          {
              currentStaticBit.append("\n");
              line++;
          }
          
          if (line != lastLine)
              column = 1;
              
          for (int j = column; column < x; j++)
          {
              currentStaticBit.append(" ");
              column++;
          }
          
          currentStaticBit.append(text);
          
          column += text.length() + columnAdjustment;
          lastLine = line;
      }
  
      /** */
      private String location(Token t)
      {
          return " (" + t.beginColumn + "," + t.beginLine + ")";
      }
  
      /** */
      public Object visit(ASTBlock node, Object data)
      {
          data = node.childrenAccept(this, data);
          return data;
      }
  
      public Object visit(ASTStringLiteral node, Object data)
      {
          data = node.childrenAccept(this, data);
          return data;
      }    
  
      public Object visit(ASTReference node, Object data)
      {
          data = node.childrenAccept(this, data);
          return data;
      }
  
      public Object visit(ASTIfStatement node, Object data)
      {
          data = node.childrenAccept(this, data);
          return data;
      }
  
      public Object visit(ASTElseIfStatement node, Object data)
      {
          data = node.childrenAccept(this, data);
          return data;
      }
  
      public Object visit(ASTForeachStatement node, Object data)
      {
          data = node.childrenAccept(this, data);
          return data;
      }        
      
      public Object visit(ASTSetStatement node, Object data)
      {
          data = node.childrenAccept(this, data);
          return data;
      }
      
      public Object visit(ASTUseStatement node, Object data)
      {
          data = node.childrenAccept(this, data);
          return data;
      }
      
      public Object visit(ASTParamStatement node, Object data)
      {
          data = node.childrenAccept(this, data);
          return data;
      }
      
      public Object visit(ASTText node, Object data)
      {
          Token text = node.getFirstToken();
          print(text.toString(), text.beginColumn, text.beginLine);
          
          // I don't think I have to do this. Text nodes
          // don't have kids.
          data = node.childrenAccept(this, data);
          return data;
      }
  }