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/08/28 00:18:14 UTC

cvs commit: jakarta-velocity/src/java/org/apache/velocity/parser Parser.java Parser.jj Parser.jjt ParserConstants.java ParserTokenManager.java

jvanzyl     00/08/27 15:18:13

  Modified:    src/java/org/apache/velocity/parser Parser.java Parser.jj
                        Parser.jjt ParserConstants.java
                        ParserTokenManager.java
  Log:
  - fixed comma problem reported Christoph Cemper.
  
  Revision  Changes    Path
  1.2       +4 -4      jakarta-velocity/src/java/org/apache/velocity/parser/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/parser/Parser.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Parser.java	2000/08/24 21:42:47	1.1
  +++ Parser.java	2000/08/27 22:18:08	1.2
  @@ -272,14 +272,14 @@
           label_2:
           while (true) {
             switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  -          case COMMA:
  +          case 37:
               ;
               break;
             default:
               jj_la1[3] = jj_gen;
               break label_2;
             }
  -          jj_consume_token(COMMA);
  +          jj_consume_token(37);
             Parameter();
           }
           break;
  @@ -748,8 +748,8 @@
     private int jj_ntk;
     private int jj_gen;
     final private int[] jj_la1 = new int[12];
  -  final private int[] jj_la1_0 = {0x4beffb80,0x4beffb80,0x10000,0x4000000,0x10000,0x4beffb80,0x3000000,0x400,0x0,0x0,0x3010000,0x4be70000,};
  -  final private int[] jj_la1_1 = {0x2c,0x2c,0x2c,0x0,0x2c,0x2c,0x2c,0x0,0x2c,0xc,0x2c,0x0,};
  +  final private int[] jj_la1_0 = {0x27effb80,0x27effb80,0x10000,0x0,0x10000,0x27effb80,0x3000000,0x400,0x0,0x0,0x3010000,0x27e70000,};
  +  final private int[] jj_la1_1 = {0x16,0x16,0x16,0x20,0x16,0x16,0x16,0x0,0x16,0x6,0x16,0x0,};
   
     public Parser(java.io.InputStream stream) {
       jj_input_stream = new ASCII_CharStream(stream, 1, 1);
  
  
  
  1.3       +1 -1      jakarta-velocity/src/java/org/apache/velocity/parser/Parser.jj
  
  Index: Parser.jj
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/parser/Parser.jj,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Parser.jj	2000/08/25 15:35:05	1.2
  +++ Parser.jj	2000/08/27 22:18:08	1.3
  @@ -197,7 +197,7 @@
   |   <QUOTE: "\"">
   |   <TRUE: "true">
   |   <FALSE: "false">
  -|   <COMMA: ",">
  +//|   <COMMA: ",">
   }
   
   // Had to add the "(", ")" to <TEXT> so that
  
  
  
  1.3       +1 -1      jakarta-velocity/src/java/org/apache/velocity/parser/Parser.jjt
  
  Index: Parser.jjt
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/parser/Parser.jjt,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Parser.jjt	2000/08/25 15:35:05	1.2
  +++ Parser.jjt	2000/08/27 22:18:08	1.3
  @@ -218,7 +218,7 @@
   |   <QUOTE: "\"">
   |   <TRUE: "true">
   |   <FALSE: "false">
  -|   <COMMA: ",">
  +//|   <COMMA: ",">
   }
   
   // Had to add the "(", ")" to <TEXT> so that
  
  
  
  1.2       +12 -13    jakarta-velocity/src/java/org/apache/velocity/parser/ParserConstants.java
  
  Index: ParserConstants.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/parser/ParserConstants.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ParserConstants.java	2000/08/24 21:42:47	1.1
  +++ ParserConstants.java	2000/08/27 22:18:09	1.2
  @@ -24,18 +24,17 @@
     int QUOTE = 23;
     int TRUE = 24;
     int FALSE = 25;
  -  int COMMA = 26;
  -  int TEXT = 27;
  -  int ALPHA_CHAR = 28;
  -  int NUM_CHAR = 29;
  -  int MONEY = 30;
  -  int ALPHANUM_CHAR = 31;
  -  int IDENTIFIER_CHAR = 32;
  -  int IDENTIFIER = 33;
  -  int VARIABLE = 34;
  -  int PROPERTY = 35;
  -  int METHOD_CHAR = 36;
  -  int METHOD = 37;
  +  int TEXT = 26;
  +  int ALPHA_CHAR = 27;
  +  int NUM_CHAR = 28;
  +  int MONEY = 29;
  +  int ALPHANUM_CHAR = 30;
  +  int IDENTIFIER_CHAR = 31;
  +  int IDENTIFIER = 32;
  +  int VARIABLE = 33;
  +  int PROPERTY = 34;
  +  int METHOD_CHAR = 35;
  +  int METHOD = 36;
   
     int DEFAULT = 0;
   
  @@ -66,7 +65,6 @@
       "\"\\\"\"",
       "\"true\"",
       "\"false\"",
  -    "\",\"",
       "<TEXT>",
       "<ALPHA_CHAR>",
       "<NUM_CHAR>",
  @@ -78,6 +76,7 @@
       "<PROPERTY>",
       "<METHOD_CHAR>",
       "<METHOD>",
  +    "\",\"",
     };
   
   }
  
  
  
  1.3       +108 -103  jakarta-velocity/src/java/org/apache/velocity/parser/ParserTokenManager.java
  
  Index: ParserTokenManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/parser/ParserTokenManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ParserTokenManager.java	2000/08/25 15:35:06	1.2
  +++ ParserTokenManager.java	2000/08/27 22:18:10	1.3
  @@ -91,47 +91,52 @@
      switch (pos)
      {
         case 0:
  +         if ((active0 & 0x2000000000L) != 0L)
  +         {
  +            jjmatchedKind = 26;
  +            return 9;
  +         }
            if ((active0 & 0xff80L) != 0L)
            {
  -            jjmatchedKind = 27;
  +            jjmatchedKind = 26;
               return 0;
            }
            if ((active0 & 0x800000L) != 0L)
               return 33;
            if ((active0 & 0x3400000L) != 0L)
            {
  -            jjmatchedKind = 27;
  +            jjmatchedKind = 26;
               return 34;
            }
  -         if ((active0 & 0x4380020L) != 0L)
  +         if ((active0 & 0x380020L) != 0L)
               return 9;
            return -1;
         case 1:
            if ((active0 & 0x400000L) != 0L)
               return 34;
  -         if ((active0 & 0x3000000L) != 0L)
  +         if ((active0 & 0xff80L) != 0L)
            {
  -            jjmatchedKind = 27;
  +            jjmatchedKind = 26;
               jjmatchedPos = 1;
  -            return 34;
  +            return 9;
            }
  -         if ((active0 & 0xff80L) != 0L)
  +         if ((active0 & 0x3000000L) != 0L)
            {
  -            jjmatchedKind = 27;
  +            jjmatchedKind = 26;
               jjmatchedPos = 1;
  -            return 9;
  +            return 34;
            }
            return -1;
         case 2:
            if ((active0 & 0xfd80L) != 0L)
            {
  -            jjmatchedKind = 27;
  +            jjmatchedKind = 26;
               jjmatchedPos = 2;
               return 9;
            }
            if ((active0 & 0x3000000L) != 0L)
            {
  -            jjmatchedKind = 27;
  +            jjmatchedKind = 26;
               jjmatchedPos = 2;
               return 34;
            }
  @@ -143,13 +148,13 @@
               return 34;
            if ((active0 & 0xad80L) != 0L)
            {
  -            jjmatchedKind = 27;
  +            jjmatchedKind = 26;
               jjmatchedPos = 3;
               return 9;
            }
            if ((active0 & 0x2000000L) != 0L)
            {
  -            jjmatchedKind = 27;
  +            jjmatchedKind = 26;
               jjmatchedPos = 3;
               return 34;
            }
  @@ -161,7 +166,7 @@
               return 34;
            if ((active0 & 0x2980L) != 0L)
            {
  -            jjmatchedKind = 27;
  +            jjmatchedKind = 26;
               jjmatchedPos = 4;
               return 9;
            }
  @@ -171,7 +176,7 @@
         case 5:
            if ((active0 & 0x880L) != 0L)
            {
  -            jjmatchedKind = 27;
  +            jjmatchedKind = 26;
               jjmatchedPos = 5;
               return 9;
            }
  @@ -181,7 +186,7 @@
         case 6:
            if ((active0 & 0x880L) != 0L)
            {
  -            jjmatchedKind = 27;
  +            jjmatchedKind = 26;
               jjmatchedPos = 6;
               return 9;
            }
  @@ -510,16 +515,16 @@
                     }
                     if ((0xfffffceeffffd9ffL & l) != 0L)
                     {
  -                     if (kind > 27)
  -                        kind = 27;
  +                     if (kind > 26)
  +                        kind = 26;
                        jjCheckNAdd(9);
                     }
                     break;
                  case 0:
                     if ((0xfffffceeffffd9ffL & l) != 0L)
                     {
  -                     if (kind > 27)
  -                        kind = 27;
  +                     if (kind > 26)
  +                        kind = 26;
                        jjCheckNAdd(9);
                     }
                     if (curChar == 35)
  @@ -528,53 +533,53 @@
                  case 34:
                     if ((0xfffffceeffffd9ffL & l) != 0L)
                     {
  -                     if (kind > 27)
  -                        kind = 27;
  +                     if (kind > 26)
  +                        kind = 26;
                        jjCheckNAdd(9);
                     }
                     if ((0x3ff200000000000L & l) != 0L)
                     {
  -                     if (kind > 33)
  -                        kind = 33;
  +                     if (kind > 32)
  +                        kind = 32;
                        jjCheckNAdd(15);
                     }
                     break;
                  case 5:
                     if ((0xfffffceeffffd9ffL & l) != 0L)
                     {
  -                     if (kind > 27)
  -                        kind = 27;
  +                     if (kind > 26)
  +                        kind = 26;
                        jjCheckNAdd(9);
                     }
                     else if (curChar == 36)
                     {
  -                     if (kind > 30)
  -                        kind = 30;
  +                     if (kind > 29)
  +                        kind = 29;
                        jjCheckNAddStates(3, 7);
                     }
                     if ((0x3ff501400000000L & l) != 0L)
                     {
  -                     if (kind > 36)
  -                        kind = 36;
  +                     if (kind > 35)
  +                        kind = 35;
                     }
                     else if (curChar == 35)
                        jjstateSet[jjnewStateCnt++] = 0;
                     if ((0x3ff200000000000L & l) != 0L)
                     {
  -                     if (kind > 32)
  -                        kind = 32;
  +                     if (kind > 31)
  +                        kind = 31;
                     }
                     else if (curChar == 34)
                        jjCheckNAddTwoStates(7, 8);
                     if ((0x3ff000000000000L & l) != 0L)
                     {
  -                     if (kind > 31)
  -                        kind = 31;
  +                     if (kind > 30)
  +                        kind = 30;
                     }
                     if ((0x3ff000000000000L & l) != 0L)
                     {
  -                     if (kind > 29)
  -                        kind = 29;
  +                     if (kind > 28)
  +                        kind = 28;
                     }
                     break;
                  case 1:
  @@ -608,59 +613,59 @@
                  case 9:
                     if ((0xfffffceeffffd9ffL & l) == 0L)
                        break;
  -                  if (kind > 27)
  -                     kind = 27;
  +                  if (kind > 26)
  +                     kind = 26;
                     jjCheckNAdd(9);
                     break;
                  case 10:
  -                  if ((0x3ff000000000000L & l) != 0L && kind > 29)
  -                     kind = 29;
  +                  if ((0x3ff000000000000L & l) != 0L && kind > 28)
  +                     kind = 28;
                     break;
                  case 11:
  -                  if ((0x3ff000000000000L & l) != 0L && kind > 31)
  -                     kind = 31;
  +                  if ((0x3ff000000000000L & l) != 0L && kind > 30)
  +                     kind = 30;
                     break;
                  case 12:
  -                  if ((0x3ff200000000000L & l) != 0L && kind > 32)
  -                     kind = 32;
  +                  if ((0x3ff200000000000L & l) != 0L && kind > 31)
  +                     kind = 31;
                     break;
                  case 13:
  -                  if ((0x3ff501400000000L & l) != 0L && kind > 36)
  -                     kind = 36;
  +                  if ((0x3ff501400000000L & l) != 0L && kind > 35)
  +                     kind = 35;
                     break;
                  case 15:
                     if ((0x3ff200000000000L & l) == 0L)
                        break;
  -                  if (kind > 33)
  -                     kind = 33;
  +                  if (kind > 32)
  +                     kind = 32;
                     jjCheckNAdd(15);
                     break;
                  case 16:
                     if (curChar != 36)
                        break;
  -                  if (kind > 30)
  -                     kind = 30;
  +                  if (kind > 29)
  +                     kind = 29;
                     jjCheckNAddStates(3, 7);
                     break;
                  case 17:
                     if (curChar != 46)
                        break;
  -                  if (kind > 30)
  -                     kind = 30;
  +                  if (kind > 29)
  +                     kind = 29;
                     jjCheckNAdd(18);
                     break;
                  case 18:
                     if ((0x3ff000000000000L & l) == 0L)
                        break;
  -                  if (kind > 30)
  -                     kind = 30;
  +                  if (kind > 29)
  +                     kind = 29;
                     jjCheckNAdd(18);
                     break;
                  case 20:
                     if ((0x3ff200000000000L & l) == 0L)
                        break;
  -                  if (kind > 34)
  -                     kind = 34;
  +                  if (kind > 33)
  +                     kind = 33;
                     jjstateSet[jjnewStateCnt++] = 20;
                     break;
                  case 23:
  @@ -674,8 +679,8 @@
                  case 26:
                     if ((0x3ff200000000000L & l) == 0L)
                        break;
  -                  if (kind > 35)
  -                     kind = 35;
  +                  if (kind > 34)
  +                     kind = 34;
                     jjstateSet[jjnewStateCnt++] = 26;
                     break;
                  case 28:
  @@ -693,15 +698,15 @@
                  case 31:
                     if (curChar != 41)
                        break;
  -                  if (kind > 37)
  -                     kind = 37;
  +                  if (kind > 36)
  +                     kind = 36;
                     jjCheckNAddTwoStates(28, 29);
                     break;
                  case 32:
                     if ((0x3ff000000000000L & l) == 0L)
                        break;
  -                  if (kind > 30)
  -                     kind = 30;
  +                  if (kind > 29)
  +                     kind = 29;
                     jjCheckNAddStates(10, 12);
                     break;
                  default : break;
  @@ -716,52 +721,52 @@
               switch(jjstateSet[--i])
               {
                  case 33:
  -                  if (kind > 27)
  -                     kind = 27;
  +                  if (kind > 26)
  +                     kind = 26;
                     jjCheckNAdd(9);
                     jjCheckNAddTwoStates(7, 8);
                     break;
                  case 0:
                  case 9:
  -                  if (kind > 27)
  -                     kind = 27;
  +                  if (kind > 26)
  +                     kind = 26;
                     jjCheckNAdd(9);
                     break;
                  case 34:
  -                  if (kind > 27)
  -                     kind = 27;
  +                  if (kind > 26)
  +                     kind = 26;
                     jjCheckNAdd(9);
                     if ((0x7fffffe07fffffeL & l) != 0L)
                     {
  -                     if (kind > 33)
  -                        kind = 33;
  +                     if (kind > 32)
  +                        kind = 32;
                        jjCheckNAdd(15);
                     }
                     break;
                  case 5:
  -                  if (kind > 27)
  -                     kind = 27;
  +                  if (kind > 26)
  +                     kind = 26;
                     jjCheckNAdd(9);
                     if ((0x7fffffe07fffffeL & l) != 0L)
                     {
  -                     if (kind > 28)
  -                        kind = 28;
  +                     if (kind > 27)
  +                        kind = 27;
                        jjCheckNAdd(15);
                     }
                     if ((0x7fffffe07fffffeL & l) != 0L)
                     {
  -                     if (kind > 36)
  -                        kind = 36;
  +                     if (kind > 35)
  +                        kind = 35;
                     }
                     if ((0x7fffffe07fffffeL & l) != 0L)
                     {
  -                     if (kind > 32)
  -                        kind = 32;
  +                     if (kind > 31)
  +                        kind = 31;
                     }
                     if ((0x7fffffe07fffffeL & l) != 0L)
                     {
  -                     if (kind > 31)
  -                        kind = 31;
  +                     if (kind > 30)
  +                        kind = 30;
                     }
                     break;
                  case 1:
  @@ -771,37 +776,37 @@
                     jjCheckNAddTwoStates(7, 8);
                     break;
                  case 11:
  -                  if ((0x7fffffe07fffffeL & l) != 0L && kind > 31)
  -                     kind = 31;
  +                  if ((0x7fffffe07fffffeL & l) != 0L && kind > 30)
  +                     kind = 30;
                     break;
                  case 12:
  -                  if ((0x7fffffe07fffffeL & l) != 0L && kind > 32)
  -                     kind = 32;
  +                  if ((0x7fffffe07fffffeL & l) != 0L && kind > 31)
  +                     kind = 31;
                     break;
                  case 13:
  -                  if ((0x7fffffe07fffffeL & l) != 0L && kind > 36)
  -                     kind = 36;
  +                  if ((0x7fffffe07fffffeL & l) != 0L && kind > 35)
  +                     kind = 35;
                     break;
                  case 14:
                     if ((0x7fffffe07fffffeL & l) == 0L)
                        break;
  -                  if (kind > 28)
  -                     kind = 28;
  +                  if (kind > 27)
  +                     kind = 27;
                     jjCheckNAdd(15);
                     break;
                  case 15:
                     if ((0x7fffffe07fffffeL & l) == 0L)
                        break;
  -                  if (kind > 33)
  -                     kind = 33;
  +                  if (kind > 32)
  +                     kind = 32;
                     jjCheckNAdd(15);
                     break;
                  case 19:
                  case 20:
                     if ((0x7fffffe07fffffeL & l) == 0L)
                        break;
  -                  if (kind > 34)
  -                     kind = 34;
  +                  if (kind > 33)
  +                     kind = 33;
                     jjCheckNAdd(20);
                     break;
                  case 21:
  @@ -817,8 +822,8 @@
                  case 26:
                     if ((0x7fffffe07fffffeL & l) == 0L)
                        break;
  -                  if (kind > 35)
  -                     kind = 35;
  +                  if (kind > 34)
  +                     kind = 34;
                     jjCheckNAdd(26);
                     break;
                  case 27:
  @@ -847,8 +852,8 @@
                        jjCheckNAddTwoStates(7, 8);
                     if ((jjbitVec0[i2] & l2) != 0L)
                     {
  -                     if (kind > 27)
  -                        kind = 27;
  +                     if (kind > 26)
  +                        kind = 26;
                        jjCheckNAdd(9);
                     }
                     break;
  @@ -856,22 +861,22 @@
                  case 9:
                     if ((jjbitVec0[i2] & l2) == 0L)
                        break;
  -                  if (kind > 27)
  -                     kind = 27;
  +                  if (kind > 26)
  +                     kind = 26;
                     jjCheckNAdd(9);
                     break;
                  case 34:
                     if ((jjbitVec0[i2] & l2) == 0L)
                        break;
  -                  if (kind > 27)
  -                     kind = 27;
  +                  if (kind > 26)
  +                     kind = 26;
                     jjCheckNAdd(9);
                     break;
                  case 5:
                     if ((jjbitVec0[i2] & l2) == 0L)
                        break;
  -                  if (kind > 27)
  -                     kind = 27;
  +                  if (kind > 26)
  +                     kind = 26;
                     jjCheckNAdd(9);
                     break;
                  case 1:
  @@ -907,7 +912,7 @@
   "\43\160\141\162\163\145", "\43\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, 
   "\50", "\51", "\173", "\175", "\75", "\151\156", "\42", "\164\162\165\145", 
  -"\146\141\154\163\145", "\54", null, null, null, null, null, null, null, null, null, null, null, };
  +"\146\141\154\163\145", null, null, null, null, null, null, null, null, null, null, null, "\54", };
   public static final String[] lexStateNames = {
      "DEFAULT", 
   };