geirm       00/12/09 20:50:05

  Modified:    src/java/org/apache/velocity/runtime/parser Parser.java
                        Parser.jj
  Log:
  Parser.jjt followers.
  
  Revision  Changes    Path
  1.41      +62 -53    
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/Parser.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- Parser.java       2000/12/08 03:19:23     1.40
  +++ Parser.java       2000/12/10 04:50:04     1.41
  @@ -21,7 +21,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
  - * @version $Id: Parser.java,v 1.40 2000/12/08 03:19:23 geirm Exp $ 
  + * @version $Id: Parser.java,v 1.41 2000/12/10 04:50:04 geirm Exp $ 
   */
   public class Parser/*@bgen(jjtree)*/implements ParserTreeConstants, ParserConstants 
{/*@bgen(jjtree)*/
     protected JJTParserState jjtree = new JJTParserState();/**
  @@ -62,6 +62,15 @@
   
           strCurrentTemplateName = strTemplateName;
   
  +        /*
  +         *  clearing the VM namespace for this template
  +         *  the VM factory / manager will determine if this 
  +         *  is appropose, but I think this is the place to indicate
  +         *  that it should be done.
  +         */
  +
  +        Runtime.dumpVMNamespace( strCurrentTemplateName );
  +
           try
           {
               token_source.clearStateVars();
  @@ -133,7 +142,7 @@
           {
              bRecognizedDirective = true;
           }
  -        else if (Runtime.isVelocimacro( strDirective.substring(1)))
  +        else if (Runtime.isVelocimacro( strDirective.substring(1), 
strCurrentTemplateName))
           {
               bRecognizedDirective = true;
           }
  @@ -358,7 +367,7 @@
   
           if ( isDirective( t.next.image.substring(1)))
               bControl = true;
  -        else if ( Runtime.isVelocimacro( t.next.image.substring(1)))
  +        else if ( Runtime.isVelocimacro( t.next.image.substring(1), 
strCurrentTemplateName))
               bControl = true;
   
           t.image = "";
  @@ -546,7 +555,7 @@
                *  if null, then not a real directive, but maybe a Velocimacro
                 */
   
  -            d  =  (Directive) Runtime.getVelocimacro( strDirectiveName );
  +            d  =  (Directive) Runtime.getVelocimacro( strDirectiveName, 
strCurrentTemplateName );
   
               if (d == null)
               {
  @@ -2069,51 +2078,6 @@
       return retval;
     }
   
  -  final private boolean jj_3R_73() {
  -    if (jj_scan_token(LOGICAL_LT)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_61()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_67() {
  -    Token xsp;
  -    xsp = jj_scanpos;
  -    if (jj_3R_73()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_74()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_75()) {
  -    jj_scanpos = xsp;
  -    if (jj_3R_76()) 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_58() {
  -    if (jj_3R_61()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    Token xsp;
  -    while (true) {
  -      xsp = jj_scanpos;
  -      if (jj_3R_67()) { jj_scanpos = xsp; break; }
  -      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    }
  -    return false;
  -  }
  -
  -  final private boolean jj_3R_64() {
  -    if (jj_scan_token(COMMA)) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    if (jj_3R_35()) return true;
  -    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  -    return false;
  -  }
  -
     final private boolean jj_3R_69() {
       if (jj_scan_token(LOGICAL_NOT_EQUALS)) return true;
       if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  @@ -2446,14 +2410,14 @@
       return false;
     }
   
  -  final private boolean jj_3R_29() {
  -    if (jj_3R_40()) return true;
  +  final private boolean jj_3_4() {
  +    if (jj_scan_token(WHITESPACE)) return true;
       if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
       return false;
     }
   
  -  final private boolean jj_3_4() {
  -    if (jj_scan_token(WHITESPACE)) return true;
  +  final private boolean jj_3R_29() {
  +    if (jj_3R_40()) return true;
       if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
       return false;
     }
  @@ -2707,6 +2671,51 @@
       if (jj_scan_token(LOGICAL_GT)) return true;
       if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
       if (jj_3R_61()) return true;
  +    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  +    return false;
  +  }
  +
  +  final private boolean jj_3R_73() {
  +    if (jj_scan_token(LOGICAL_LT)) return true;
  +    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  +    if (jj_3R_61()) return true;
  +    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  +    return false;
  +  }
  +
  +  final private boolean jj_3R_67() {
  +    Token xsp;
  +    xsp = jj_scanpos;
  +    if (jj_3R_73()) {
  +    jj_scanpos = xsp;
  +    if (jj_3R_74()) {
  +    jj_scanpos = xsp;
  +    if (jj_3R_75()) {
  +    jj_scanpos = xsp;
  +    if (jj_3R_76()) 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_58() {
  +    if (jj_3R_61()) return true;
  +    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  +    Token xsp;
  +    while (true) {
  +      xsp = jj_scanpos;
  +      if (jj_3R_67()) { jj_scanpos = xsp; break; }
  +      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  +    }
  +    return false;
  +  }
  +
  +  final private boolean jj_3R_64() {
  +    if (jj_scan_token(COMMA)) return true;
  +    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
  +    if (jj_3R_35()) return true;
       if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
       return false;
     }
  
  
  
  1.39      +13 -4     
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/Parser.jj
  
  Index: Parser.jj
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/Parser.jj,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- Parser.jj 2000/12/08 03:19:23     1.38
  +++ Parser.jj 2000/12/10 04:50:05     1.39
  @@ -96,7 +96,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
  - * @version $Id: Parser.jj,v 1.38 2000/12/08 03:19:23 geirm Exp $ 
  + * @version $Id: Parser.jj,v 1.39 2000/12/10 04:50:05 geirm Exp $ 
   */
   public class Parser/*@bgen(jjtree)*/implements ParserTreeConstants/*@egen*/
   {/*@bgen(jjtree)*/
  @@ -141,6 +141,15 @@
           
           strCurrentTemplateName = strTemplateName;
   
  +        /*
  +         *  clearing the VM namespace for this template
  +         *  the VM factory / manager will determine if this 
  +         *  is appropose, but I think this is the place to indicate
  +         *  that it should be done.
  +         */
  +
  +        Runtime.dumpVMNamespace( strCurrentTemplateName );
  +
           try
           {
               token_source.clearStateVars();
  @@ -212,7 +221,7 @@
           {
              bRecognizedDirective = true;
           }
  -        else if (Runtime.isVelocimacro( strDirective.substring(1)))
  +        else if (Runtime.isVelocimacro( strDirective.substring(1), 
strCurrentTemplateName))
           {
               bRecognizedDirective = true;
           }
  @@ -1048,7 +1057,7 @@
   
           if ( isDirective( t.next.image.substring(1)))
               bControl = true;
  -        else if ( Runtime.isVelocimacro( t.next.image.substring(1)))
  +        else if ( Runtime.isVelocimacro( t.next.image.substring(1), 
strCurrentTemplateName))
               bControl = true;
   
           t.image = "";
  @@ -1230,7 +1239,7 @@
                *  if null, then not a real directive, but maybe a Velocimacro
                 */
   
  -            d  =  (Directive) Runtime.getVelocimacro( strDirectiveName );
  +            d  =  (Directive) Runtime.getVelocimacro( strDirectiveName, 
strCurrentTemplateName );
   
               if (d == null) 
               {   
  
  
  

Reply via email to