lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gol...@apache.org
Subject cvs commit: jakarta-lucene/src/demo/org/apache/lucene/demo/html HTMLParserTokenManager.java HTMLParserConstants.java HTMLParser.java HTMLParser.jj
Date Sun, 23 Nov 2003 18:37:32 GMT
goller      2003/11/23 10:37:32

  Modified:    src/demo/org/apache/lucene/demo/html
                        HTMLParserTokenManager.java
                        HTMLParserConstants.java HTMLParser.java
                        HTMLParser.jj
  Log:
  Fix for problem with "<" and ">" within script.
  Fixes bug #16952
  
  Revision  Changes    Path
  1.2       +431 -176  jakarta-lucene/src/demo/org/apache/lucene/demo/html/HTMLParserTokenManager.java
  
  Index: HTMLParserTokenManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/demo/org/apache/lucene/demo/html/HTMLParserTokenManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HTMLParserTokenManager.java	11 Sep 2003 01:51:33 -0000	1.1
  +++ HTMLParserTokenManager.java	23 Nov 2003 18:37:32 -0000	1.2
  @@ -12,12 +12,53 @@
      switch (pos)
      {
         case 0:
  -         if ((active0 & 0x18L) != 0L)
  +         if ((active0 & 0x32L) != 0L)
               return 17;
            return -1;
         case 1:
  -         if ((active0 & 0x18L) != 0L)
  +         if ((active0 & 0x30L) != 0L)
               return 22;
  +         if ((active0 & 0x2L) != 0L)
  +         {
  +            if (jjmatchedPos != 1)
  +            {
  +               jjmatchedKind = 2;
  +               jjmatchedPos = 1;
  +            }
  +            return 19;
  +         }
  +         return -1;
  +      case 2:
  +         if ((active0 & 0x2L) != 0L)
  +         {
  +            jjmatchedKind = 2;
  +            jjmatchedPos = 2;
  +            return 20;
  +         }
  +         return -1;
  +      case 3:
  +         if ((active0 & 0x2L) != 0L)
  +         {
  +            jjmatchedKind = 2;
  +            jjmatchedPos = 3;
  +            return 20;
  +         }
  +         return -1;
  +      case 4:
  +         if ((active0 & 0x2L) != 0L)
  +         {
  +            jjmatchedKind = 2;
  +            jjmatchedPos = 4;
  +            return 20;
  +         }
  +         return -1;
  +      case 5:
  +         if ((active0 & 0x2L) != 0L)
  +         {
  +            jjmatchedKind = 2;
  +            jjmatchedPos = 5;
  +            return 20;
  +         }
            return -1;
         default :
            return -1;
  @@ -46,7 +87,7 @@
      switch(curChar)
      {
         case 60:
  -         return jjMoveStringLiteralDfa1_0(0x18L);
  +         return jjMoveStringLiteralDfa1_0(0x32L);
         default :
            return jjMoveNfa_0(11, 0);
      }
  @@ -61,12 +102,14 @@
      switch(curChar)
      {
         case 33:
  -         if ((active0 & 0x10L) != 0L)
  +         if ((active0 & 0x20L) != 0L)
            {
  -            jjmatchedKind = 4;
  +            jjmatchedKind = 5;
               jjmatchedPos = 1;
            }
  -         return jjMoveStringLiteralDfa2_0(active0, 0x8L);
  +         return jjMoveStringLiteralDfa2_0(active0, 0x10L);
  +      case 115:
  +         return jjMoveStringLiteralDfa2_0(active0, 0x2L);
         default :
            break;
      }
  @@ -84,7 +127,9 @@
      switch(curChar)
      {
         case 45:
  -         return jjMoveStringLiteralDfa3_0(active0, 0x8L);
  +         return jjMoveStringLiteralDfa3_0(active0, 0x10L);
  +      case 99:
  +         return jjMoveStringLiteralDfa3_0(active0, 0x2L);
         default :
            break;
      }
  @@ -102,14 +147,72 @@
      switch(curChar)
      {
         case 45:
  -         if ((active0 & 0x8L) != 0L)
  -            return jjStopAtPos(3, 3);
  +         if ((active0 & 0x10L) != 0L)
  +            return jjStopAtPos(3, 4);
            break;
  +      case 114:
  +         return jjMoveStringLiteralDfa4_0(active0, 0x2L);
         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 105:
  +         return jjMoveStringLiteralDfa5_0(active0, 0x2L);
  +      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 112:
  +         return jjMoveStringLiteralDfa6_0(active0, 0x2L);
  +      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 116:
  +         if ((active0 & 0x2L) != 0L)
  +            return jjStartNfaWithStates_0(6, 1, 20);
  +         break;
  +      default :
  +         break;
  +   }
  +   return jjStartNfa_0(5, active0);
  +}
   private final void jjCheckNAdd(int state)
   {
      if (jjrounds[state] != jjround)
  @@ -167,8 +270,8 @@
                        jjCheckNAddTwoStates(7, 2);
                     else if ((0x100002600L & l) != 0L)
                     {
  -                     if (kind > 9)
  -                        kind = 9;
  +                     if (kind > 10)
  +                        kind = 10;
                        jjCheckNAdd(10);
                     }
                     else if (curChar == 60)
  @@ -179,8 +282,8 @@
                        jjstateSet[jjnewStateCnt++] = 1;
                     if ((0x3ff000000000000L & l) != 0L)
                     {
  -                     if (kind > 5)
  -                        kind = 5;
  +                     if (kind > 6)
  +                        kind = 6;
                        jjCheckNAddStates(5, 9);
                     }
                     break;
  @@ -206,22 +309,22 @@
                  case 9:
                     if ((0x3ff000000000000L & l) == 0L)
                        break;
  -                  if (kind > 5)
  -                     kind = 5;
  +                  if (kind > 6)
  +                     kind = 6;
                     jjCheckNAddStates(10, 12);
                     break;
                  case 4:
                     if ((0x3ff000000000000L & l) == 0L)
                        break;
  -                  if (kind > 5)
  -                     kind = 5;
  +                  if (kind > 6)
  +                     kind = 6;
                     jjCheckNAddStates(5, 9);
                     break;
                  case 5:
                     if ((0x880000000000L & l) == 0L)
                        break;
  -                  if (kind > 5)
  -                     kind = 5;
  +                  if (kind > 6)
  +                     kind = 6;
                     jjCheckNAddStates(13, 16);
                     break;
                  case 6:
  @@ -231,8 +334,8 @@
                  case 7:
                     if (curChar != 34)
                        break;
  -                  if (kind > 5)
  -                     kind = 5;
  +                  if (kind > 6)
  +                     kind = 6;
                     jjCheckNAddStates(10, 12);
                     break;
                  case 8:
  @@ -242,12 +345,12 @@
                  case 10:
                     if ((0x100002600L & l) == 0L)
                        break;
  -                  kind = 9;
  +                  kind = 10;
                     jjCheckNAdd(10);
                     break;
                  case 13:
  -                  if (curChar == 59 && kind > 8)
  -                     kind = 8;
  +                  if (curChar == 59 && kind > 9)
  +                     kind = 9;
                     break;
                  case 14:
                     if (curChar == 35)
  @@ -256,8 +359,8 @@
                  case 15:
                     if ((0x3ff000000000000L & l) == 0L)
                        break;
  -                  if (kind > 8)
  -                     kind = 8;
  +                  if (kind > 9)
  +                     kind = 9;
                     jjCheckNAddTwoStates(15, 13);
                     break;
                  case 16:
  @@ -267,15 +370,15 @@
                  case 19:
                     if ((0x9fffff7affffd9ffL & l) == 0L)
                        break;
  -                  if (kind > 1)
  -                     kind = 1;
  +                  if (kind > 2)
  +                     kind = 2;
                     jjCheckNAdd(20);
                     break;
                  case 20:
                     if ((0x9ffffffeffffd9ffL & l) == 0L)
                        break;
  -                  if (kind > 1)
  -                     kind = 1;
  +                  if (kind > 2)
  +                     kind = 2;
                     jjCheckNAdd(20);
                     break;
                  case 21:
  @@ -285,15 +388,15 @@
                  case 23:
                     if ((0x9fffff7affffd9ffL & l) == 0L)
                        break;
  -                  if (kind > 2)
  -                     kind = 2;
  +                  if (kind > 3)
  +                     kind = 3;
                     jjCheckNAdd(24);
                     break;
                  case 24:
                     if ((0x9ffffffeffffd9ffL & l) == 0L)
                        break;
  -                  if (kind > 2)
  -                     kind = 2;
  +                  if (kind > 3)
  +                     kind = 3;
                     jjCheckNAdd(24);
                     break;
                  default : break;
  @@ -311,49 +414,49 @@
                  case 4:
                     if ((0x7fffffe07fffffeL & l) == 0L)
                        break;
  -                  if (kind > 5)
  -                     kind = 5;
  +                  if (kind > 6)
  +                     kind = 6;
                     jjCheckNAddStates(5, 9);
                     break;
                  case 17:
                  case 18:
                     if ((0x7fffffe07fffffeL & l) == 0L)
                        break;
  -                  if (kind > 1)
  -                     kind = 1;
  +                  if (kind > 2)
  +                     kind = 2;
                     jjstateSet[jjnewStateCnt++] = 19;
                     break;
                  case 9:
                     if ((0x7fffffe07fffffeL & l) == 0L)
                        break;
  -                  if (kind > 5)
  -                     kind = 5;
  +                  if (kind > 6)
  +                     kind = 6;
                     jjCheckNAddStates(10, 12);
                     break;
                  case 12:
                     if ((0x7fffffe07fffffeL & l) == 0L)
                        break;
  -                  if (kind > 8)
  -                     kind = 8;
  +                  if (kind > 9)
  +                     kind = 9;
                     jjAddStates(17, 18);
                     break;
                  case 19:
                  case 20:
  -                  if (kind > 1)
  -                     kind = 1;
  +                  if (kind > 2)
  +                     kind = 2;
                     jjCheckNAdd(20);
                     break;
                  case 22:
                     if ((0x7fffffe07fffffeL & l) == 0L)
                        break;
  -                  if (kind > 2)
  -                     kind = 2;
  +                  if (kind > 3)
  +                     kind = 3;
                     jjstateSet[jjnewStateCnt++] = 23;
                     break;
                  case 23:
                  case 24:
  -                  if (kind > 2)
  -                     kind = 2;
  +                  if (kind > 3)
  +                     kind = 3;
                     jjCheckNAdd(24);
                     break;
                  default : break;
  @@ -372,16 +475,16 @@
                  case 20:
                     if ((jjbitVec0[i2] & l2) == 0L)
                        break;
  -                  if (kind > 1)
  -                     kind = 1;
  +                  if (kind > 2)
  +                     kind = 2;
                     jjCheckNAdd(20);
                     break;
                  case 23:
                  case 24:
                     if ((jjbitVec0[i2] & l2) == 0L)
                        break;
  -                  if (kind > 2)
  -                     kind = 2;
  +                  if (kind > 3)
  +                     kind = 3;
                     jjCheckNAdd(24);
                     break;
                  default : break;
  @@ -401,11 +504,11 @@
         catch(java.io.IOException e) { return curPos; }
      }
   }
  -private final int jjMoveStringLiteralDfa0_4()
  +private final int jjMoveStringLiteralDfa0_5()
   {
  -   return jjMoveNfa_4(1, 0);
  +   return jjMoveNfa_5(1, 0);
   }
  -private final int jjMoveNfa_4(int startState, int curPos)
  +private final int jjMoveNfa_5(int startState, int curPos)
   {
      int[] nextStates;
      int startsAt = 0;
  @@ -427,20 +530,20 @@
                  case 1:
                     if ((0xfffffffbffffffffL & l) != 0L)
                     {
  -                     if (kind > 21)
  -                        kind = 21;
  +                     if (kind > 24)
  +                        kind = 24;
                        jjCheckNAdd(0);
                     }
                     else if (curChar == 34)
                     {
  -                     if (kind > 22)
  -                        kind = 22;
  +                     if (kind > 25)
  +                        kind = 25;
                     }
                     break;
                  case 0:
                     if ((0xfffffffbffffffffL & l) == 0L)
                        break;
  -                  kind = 21;
  +                  kind = 24;
                     jjCheckNAdd(0);
                     break;
                  default : break;
  @@ -456,7 +559,7 @@
               {
                  case 1:
                  case 0:
  -                  kind = 21;
  +                  kind = 24;
                     jjCheckNAdd(0);
                     break;
                  default : break;
  @@ -475,8 +578,8 @@
                  case 0:
                     if ((jjbitVec0[i2] & l2) == 0L)
                        break;
  -                  if (kind > 21)
  -                     kind = 21;
  +                  if (kind > 24)
  +                     kind = 24;
                     jjCheckNAdd(0);
                     break;
                  default : break;
  @@ -496,7 +599,7 @@
         catch(java.io.IOException e) { return curPos; }
      }
   }
  -private final int jjStopStringLiteralDfa_6(int pos, long active0)
  +private final int jjStopStringLiteralDfa_7(int pos, long active0)
   {
      switch (pos)
      {
  @@ -504,29 +607,29 @@
            return -1;
      }
   }
  -private final int jjStartNfa_6(int pos, long active0)
  +private final int jjStartNfa_7(int pos, long active0)
   {
  -   return jjMoveNfa_6(jjStopStringLiteralDfa_6(pos, active0), pos + 1);
  +   return jjMoveNfa_7(jjStopStringLiteralDfa_7(pos, active0), pos + 1);
   }
  -private final int jjStartNfaWithStates_6(int pos, int kind, int state)
  +private final int jjStartNfaWithStates_7(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_6(state, pos + 1);
  +   return jjMoveNfa_7(state, pos + 1);
   }
  -private final int jjMoveStringLiteralDfa0_6()
  +private final int jjMoveStringLiteralDfa0_7()
   {
      switch(curChar)
      {
         case 62:
  -         return jjStopAtPos(0, 26);
  +         return jjStopAtPos(0, 29);
         default :
  -         return jjMoveNfa_6(0, 0);
  +         return jjMoveNfa_7(0, 0);
      }
   }
  -private final int jjMoveNfa_6(int startState, int curPos)
  +private final int jjMoveNfa_7(int startState, int curPos)
   {
      int[] nextStates;
      int startsAt = 0;
  @@ -548,7 +651,7 @@
                  case 0:
                     if ((0xbfffffffffffffffL & l) == 0L)
                        break;
  -                  kind = 25;
  +                  kind = 28;
                     jjstateSet[jjnewStateCnt++] = 0;
                     break;
                  default : break;
  @@ -563,7 +666,7 @@
               switch(jjstateSet[--i])
               {
                  case 0:
  -                  kind = 25;
  +                  kind = 28;
                     jjstateSet[jjnewStateCnt++] = 0;
                     break;
                  default : break;
  @@ -581,8 +684,8 @@
                  case 0:
                     if ((jjbitVec0[i2] & l2) == 0L)
                        break;
  -                  if (kind > 25)
  -                     kind = 25;
  +                  if (kind > 28)
  +                     kind = 28;
                     jjstateSet[jjnewStateCnt++] = 0;
                     break;
                  default : break;
  @@ -602,11 +705,11 @@
         catch(java.io.IOException e) { return curPos; }
      }
   }
  -private final int jjMoveStringLiteralDfa0_3()
  +private final int jjMoveStringLiteralDfa0_4()
   {
  -   return jjMoveNfa_3(1, 0);
  +   return jjMoveNfa_4(1, 0);
   }
  -private final int jjMoveNfa_3(int startState, int curPos)
  +private final int jjMoveNfa_4(int startState, int curPos)
   {
      int[] nextStates;
      int startsAt = 0;
  @@ -628,20 +731,20 @@
                  case 1:
                     if ((0xffffff7fffffffffL & l) != 0L)
                     {
  -                     if (kind > 19)
  -                        kind = 19;
  +                     if (kind > 22)
  +                        kind = 22;
                        jjCheckNAdd(0);
                     }
                     else if (curChar == 39)
                     {
  -                     if (kind > 20)
  -                        kind = 20;
  +                     if (kind > 23)
  +                        kind = 23;
                     }
                     break;
                  case 0:
                     if ((0xffffff7fffffffffL & l) == 0L)
                        break;
  -                  kind = 19;
  +                  kind = 22;
                     jjCheckNAdd(0);
                     break;
                  default : break;
  @@ -657,7 +760,7 @@
               {
                  case 1:
                  case 0:
  -                  kind = 19;
  +                  kind = 22;
                     jjCheckNAdd(0);
                     break;
                  default : break;
  @@ -676,8 +779,8 @@
                  case 0:
                     if ((jjbitVec0[i2] & l2) == 0L)
                        break;
  -                  if (kind > 19)
  -                     kind = 19;
  +                  if (kind > 22)
  +                     kind = 22;
                     jjCheckNAdd(0);
                     break;
                  default : break;
  @@ -697,7 +800,7 @@
         catch(java.io.IOException e) { return curPos; }
      }
   }
  -private final int jjStopStringLiteralDfa_2(int pos, long active0)
  +private final int jjStopStringLiteralDfa_3(int pos, long active0)
   {
      switch (pos)
      {
  @@ -705,31 +808,31 @@
            return -1;
      }
   }
  -private final int jjStartNfa_2(int pos, long active0)
  +private final int jjStartNfa_3(int pos, long active0)
   {
  -   return jjMoveNfa_2(jjStopStringLiteralDfa_2(pos, active0), pos + 1);
  +   return jjMoveNfa_3(jjStopStringLiteralDfa_3(pos, active0), pos + 1);
   }
  -private final int jjStartNfaWithStates_2(int pos, int kind, int state)
  +private final int jjStartNfaWithStates_3(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_2(state, pos + 1);
  +   return jjMoveNfa_3(state, pos + 1);
   }
  -private final int jjMoveStringLiteralDfa0_2()
  +private final int jjMoveStringLiteralDfa0_3()
   {
      switch(curChar)
      {
         case 34:
  -         return jjStopAtPos(0, 17);
  +         return jjStopAtPos(0, 20);
         case 39:
  -         return jjStopAtPos(0, 16);
  +         return jjStopAtPos(0, 19);
         default :
  -         return jjMoveNfa_2(0, 0);
  +         return jjMoveNfa_3(0, 0);
      }
   }
  -private final int jjMoveNfa_2(int startState, int curPos)
  +private final int jjMoveNfa_3(int startState, int curPos)
   {
      int[] nextStates;
      int startsAt = 0;
  @@ -751,28 +854,28 @@
                  case 0:
                     if ((0x9fffff7affffd9ffL & l) != 0L)
                     {
  -                     if (kind > 15)
  -                        kind = 15;
  +                     if (kind > 18)
  +                        kind = 18;
                        jjCheckNAdd(1);
                     }
                     else if ((0x100002600L & l) != 0L)
                     {
  -                     if (kind > 18)
  -                        kind = 18;
  +                     if (kind > 21)
  +                        kind = 21;
                        jjCheckNAdd(2);
                     }
                     break;
                  case 1:
                     if ((0xbffffffeffffd9ffL & l) == 0L)
                        break;
  -                  if (kind > 15)
  -                     kind = 15;
  +                  if (kind > 18)
  +                     kind = 18;
                     jjCheckNAdd(1);
                     break;
                  case 2:
                     if ((0x100002600L & l) == 0L)
                        break;
  -                  kind = 18;
  +                  kind = 21;
                     jjCheckNAdd(2);
                     break;
                  default : break;
  @@ -788,8 +891,8 @@
               {
                  case 0:
                  case 1:
  -                  if (kind > 15)
  -                     kind = 15;
  +                  if (kind > 18)
  +                     kind = 18;
                     jjCheckNAdd(1);
                     break;
                  default : break;
  @@ -808,8 +911,8 @@
                  case 1:
                     if ((jjbitVec0[i2] & l2) == 0L)
                        break;
  -                  if (kind > 15)
  -                     kind = 15;
  +                  if (kind > 18)
  +                     kind = 18;
                     jjCheckNAdd(1);
                     break;
                  default : break;
  @@ -829,23 +932,23 @@
         catch(java.io.IOException e) { return curPos; }
      }
   }
  -private final int jjStopStringLiteralDfa_5(int pos, long active0)
  +private final int jjStopStringLiteralDfa_6(int pos, long active0)
   {
      switch (pos)
      {
         case 0:
  -         if ((active0 & 0x1000000L) != 0L)
  +         if ((active0 & 0x8000000L) != 0L)
            {
  -            jjmatchedKind = 23;
  +            jjmatchedKind = 26;
               return -1;
            }
            return -1;
         case 1:
  -         if ((active0 & 0x1000000L) != 0L)
  +         if ((active0 & 0x8000000L) != 0L)
            {
               if (jjmatchedPos == 0)
               {
  -               jjmatchedKind = 23;
  +               jjmatchedKind = 26;
                  jjmatchedPos = 0;
               }
               return -1;
  @@ -855,65 +958,65 @@
            return -1;
      }
   }
  -private final int jjStartNfa_5(int pos, long active0)
  +private final int jjStartNfa_6(int pos, long active0)
   {
  -   return jjMoveNfa_5(jjStopStringLiteralDfa_5(pos, active0), pos + 1);
  +   return jjMoveNfa_6(jjStopStringLiteralDfa_6(pos, active0), pos + 1);
   }
  -private final int jjStartNfaWithStates_5(int pos, int kind, int state)
  +private final int jjStartNfaWithStates_6(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_5(state, pos + 1);
  +   return jjMoveNfa_6(state, pos + 1);
   }
  -private final int jjMoveStringLiteralDfa0_5()
  +private final int jjMoveStringLiteralDfa0_6()
   {
      switch(curChar)
      {
         case 45:
  -         return jjMoveStringLiteralDfa1_5(0x1000000L);
  +         return jjMoveStringLiteralDfa1_6(0x8000000L);
         default :
  -         return jjMoveNfa_5(1, 0);
  +         return jjMoveNfa_6(1, 0);
      }
   }
  -private final int jjMoveStringLiteralDfa1_5(long active0)
  +private final int jjMoveStringLiteralDfa1_6(long active0)
   {
      try { curChar = input_stream.readChar(); }
      catch(java.io.IOException e) {
  -      jjStopStringLiteralDfa_5(0, active0);
  +      jjStopStringLiteralDfa_6(0, active0);
         return 1;
      }
      switch(curChar)
      {
         case 45:
  -         return jjMoveStringLiteralDfa2_5(active0, 0x1000000L);
  +         return jjMoveStringLiteralDfa2_6(active0, 0x8000000L);
         default :
            break;
      }
  -   return jjStartNfa_5(0, active0);
  +   return jjStartNfa_6(0, active0);
   }
  -private final int jjMoveStringLiteralDfa2_5(long old0, long active0)
  +private final int jjMoveStringLiteralDfa2_6(long old0, long active0)
   {
      if (((active0 &= old0)) == 0L)
  -      return jjStartNfa_5(0, old0); 
  +      return jjStartNfa_6(0, old0); 
      try { curChar = input_stream.readChar(); }
      catch(java.io.IOException e) {
  -      jjStopStringLiteralDfa_5(1, active0);
  +      jjStopStringLiteralDfa_6(1, active0);
         return 2;
      }
      switch(curChar)
      {
         case 62:
  -         if ((active0 & 0x1000000L) != 0L)
  -            return jjStopAtPos(2, 24);
  +         if ((active0 & 0x8000000L) != 0L)
  +            return jjStopAtPos(2, 27);
            break;
         default :
            break;
      }
  -   return jjStartNfa_5(1, active0);
  +   return jjStartNfa_6(1, active0);
   }
  -private final int jjMoveNfa_5(int startState, int curPos)
  +private final int jjMoveNfa_6(int startState, int curPos)
   {
      int[] nextStates;
      int startsAt = 0;
  @@ -935,20 +1038,20 @@
                  case 1:
                     if ((0xffffdfffffffffffL & l) != 0L)
                     {
  -                     if (kind > 23)
  -                        kind = 23;
  +                     if (kind > 26)
  +                        kind = 26;
                        jjCheckNAdd(0);
                     }
                     else if (curChar == 45)
                     {
  -                     if (kind > 23)
  -                        kind = 23;
  +                     if (kind > 26)
  +                        kind = 26;
                     }
                     break;
                  case 0:
                     if ((0xffffdfffffffffffL & l) == 0L)
                        break;
  -                  kind = 23;
  +                  kind = 26;
                     jjCheckNAdd(0);
                     break;
                  default : break;
  @@ -964,7 +1067,7 @@
               {
                  case 1:
                  case 0:
  -                  kind = 23;
  +                  kind = 26;
                     jjCheckNAdd(0);
                     break;
                  default : break;
  @@ -983,8 +1086,8 @@
                  case 0:
                     if ((jjbitVec0[i2] & l2) == 0L)
                        break;
  -                  if (kind > 23)
  -                     kind = 23;
  +                  if (kind > 26)
  +                     kind = 26;
                     jjCheckNAdd(0);
                     break;
                  default : break;
  @@ -1004,7 +1107,153 @@
         catch(java.io.IOException e) { return curPos; }
      }
   }
  -private final int jjStopStringLiteralDfa_1(int pos, long active0)
  +private final int jjMoveStringLiteralDfa0_1()
  +{
  +   return jjMoveNfa_1(1, 0);
  +}
  +private final int jjMoveNfa_1(int startState, int curPos)
  +{
  +   int[] nextStates;
  +   int startsAt = 0;
  +   jjnewStateCnt = 12;
  +   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 1:
  +                  if ((0xafffffffffffffffL & l) != 0L)
  +                  {
  +                     if (kind > 13)
  +                        kind = 13;
  +                     jjCheckNAdd(0);
  +                  }
  +                  else if ((0x5000000000000000L & l) != 0L)
  +                  {
  +                     if (kind > 13)
  +                        kind = 13;
  +                  }
  +                  if (curChar == 60)
  +                     jjstateSet[jjnewStateCnt++] = 10;
  +                  break;
  +               case 0:
  +                  if ((0xafffffffffffffffL & l) == 0L)
  +                     break;
  +                  if (kind > 13)
  +                     kind = 13;
  +                  jjCheckNAdd(0);
  +                  break;
  +               case 3:
  +                  if ((0xafffffffffffffffL & l) != 0L)
  +                     jjAddStates(19, 20);
  +                  break;
  +               case 4:
  +                  if (curChar == 62 && kind > 14)
  +                     kind = 14;
  +                  break;
  +               case 10:
  +                  if (curChar == 47)
  +                     jjstateSet[jjnewStateCnt++] = 9;
  +                  break;
  +               case 11:
  +                  if (curChar == 60)
  +                     jjstateSet[jjnewStateCnt++] = 10;
  +                  break;
  +               default : break;
  +            }
  +         } while(i != startsAt);
  +      }
  +      else if (curChar < 128)
  +      {
  +         long l = 1L << (curChar & 077);
  +         MatchLoop: do
  +         {
  +            switch(jjstateSet[--i])
  +            {
  +               case 1:
  +               case 0:
  +                  if (kind > 13)
  +                     kind = 13;
  +                  jjCheckNAdd(0);
  +                  break;
  +               case 2:
  +                  if (curChar == 116)
  +                     jjCheckNAddTwoStates(3, 4);
  +                  break;
  +               case 3:
  +                  jjCheckNAddTwoStates(3, 4);
  +                  break;
  +               case 5:
  +                  if (curChar == 112)
  +                     jjstateSet[jjnewStateCnt++] = 2;
  +                  break;
  +               case 6:
  +                  if (curChar == 105)
  +                     jjstateSet[jjnewStateCnt++] = 5;
  +                  break;
  +               case 7:
  +                  if (curChar == 114)
  +                     jjstateSet[jjnewStateCnt++] = 6;
  +                  break;
  +               case 8:
  +                  if (curChar == 99)
  +                     jjstateSet[jjnewStateCnt++] = 7;
  +                  break;
  +               case 9:
  +                  if (curChar == 115)
  +                     jjstateSet[jjnewStateCnt++] = 8;
  +                  break;
  +               default : break;
  +            }
  +         } while(i != startsAt);
  +      }
  +      else
  +      {
  +         int i2 = (curChar & 0xff) >> 6;
  +         long l2 = 1L << (curChar & 077);
  +         MatchLoop: do
  +         {
  +            switch(jjstateSet[--i])
  +            {
  +               case 1:
  +               case 0:
  +                  if ((jjbitVec0[i2] & l2) == 0L)
  +                     break;
  +                  if (kind > 13)
  +                     kind = 13;
  +                  jjCheckNAdd(0);
  +                  break;
  +               case 3:
  +                  if ((jjbitVec0[i2] & l2) != 0L)
  +                     jjAddStates(19, 20);
  +                  break;
  +               default : break;
  +            }
  +         } while(i != startsAt);
  +      }
  +      if (kind != 0x7fffffff)
  +      {
  +         jjmatchedKind = kind;
  +         jjmatchedPos = curPos;
  +         kind = 0x7fffffff;
  +      }
  +      ++curPos;
  +      if ((i = jjnewStateCnt) == (startsAt = 12 - (jjnewStateCnt = startsAt)))
  +         return curPos;
  +      try { curChar = input_stream.readChar(); }
  +      catch(java.io.IOException e) { return curPos; }
  +   }
  +}
  +private final int jjStopStringLiteralDfa_2(int pos, long active0)
   {
      switch (pos)
      {
  @@ -1012,33 +1261,33 @@
            return -1;
      }
   }
  -private final int jjStartNfa_1(int pos, long active0)
  +private final int jjStartNfa_2(int pos, long active0)
   {
  -   return jjMoveNfa_1(jjStopStringLiteralDfa_1(pos, active0), pos + 1);
  +   return jjMoveNfa_2(jjStopStringLiteralDfa_2(pos, active0), pos + 1);
   }
  -private final int jjStartNfaWithStates_1(int pos, int kind, int state)
  +private final int jjStartNfaWithStates_2(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_1(state, pos + 1);
  +   return jjMoveNfa_2(state, pos + 1);
   }
  -private final int jjMoveStringLiteralDfa0_1()
  +private final int jjMoveStringLiteralDfa0_2()
   {
      switch(curChar)
      {
         case 34:
  -         return jjStopAtPos(0, 17);
  +         return jjStopAtPos(0, 20);
         case 39:
  -         return jjStopAtPos(0, 16);
  +         return jjStopAtPos(0, 19);
         case 61:
  -         return jjStartNfaWithStates_1(0, 13, 3);
  +         return jjStartNfaWithStates_2(0, 16, 3);
         default :
  -         return jjMoveNfa_1(0, 0);
  +         return jjMoveNfa_2(0, 0);
      }
   }
  -private final int jjMoveNfa_1(int startState, int curPos)
  +private final int jjMoveNfa_2(int startState, int curPos)
   {
      int[] nextStates;
      int startsAt = 0;
  @@ -1060,35 +1309,35 @@
                  case 0:
                     if ((0x9fffff7affffd9ffL & l) != 0L)
                     {
  -                     if (kind > 12)
  -                        kind = 12;
  +                     if (kind > 15)
  +                        kind = 15;
                        jjCheckNAdd(1);
                     }
                     else if ((0x100002600L & l) != 0L)
                     {
  -                     if (kind > 18)
  -                        kind = 18;
  +                     if (kind > 21)
  +                        kind = 21;
                        jjCheckNAdd(5);
                     }
                     else if (curChar == 61)
                        jjstateSet[jjnewStateCnt++] = 3;
                     else if (curChar == 62)
                     {
  -                     if (kind > 14)
  -                        kind = 14;
  +                     if (kind > 17)
  +                        kind = 17;
                     }
                     break;
                  case 1:
                     if ((0x9ffffffeffffd9ffL & l) == 0L)
                        break;
  -                  if (kind > 12)
  -                     kind = 12;
  +                  if (kind > 15)
  +                     kind = 15;
                     jjCheckNAdd(1);
                     break;
                  case 2:
                  case 3:
  -                  if (curChar == 62 && kind > 14)
  -                     kind = 14;
  +                  if (curChar == 62 && kind > 17)
  +                     kind = 17;
                     break;
                  case 4:
                     if (curChar == 61)
  @@ -1097,7 +1346,7 @@
                  case 5:
                     if ((0x100002600L & l) == 0L)
                        break;
  -                  kind = 18;
  +                  kind = 21;
                     jjCheckNAdd(5);
                     break;
                  default : break;
  @@ -1113,8 +1362,8 @@
               {
                  case 0:
                  case 1:
  -                  if (kind > 12)
  -                     kind = 12;
  +                  if (kind > 15)
  +                     kind = 15;
                     jjCheckNAdd(1);
                     break;
                  default : break;
  @@ -1133,8 +1382,8 @@
                  case 1:
                     if ((jjbitVec0[i2] & l2) == 0L)
                        break;
  -                  if (kind > 12)
  -                     kind = 12;
  +                  if (kind > 15)
  +                     kind = 15;
                     jjCheckNAdd(1);
                     break;
                  default : break;
  @@ -1156,14 +1405,15 @@
   }
   static final int[] jjnextStates = {
      17, 18, 21, 12, 14, 5, 8, 0, 4, 6, 0, 4, 6, 5, 0, 4, 
  -   6, 12, 13, 
  +   6, 12, 13, 3, 4, 
   };
   public static final String[] jjstrLiteralImages = {
  -"", null, null, "\74\41\55\55", "\74\41", null, null, null, null, null, null, 
  -null, null, "\75", null, null, "\47", "\42", null, null, null, null, null, null, 
  -"\55\55\76", null, "\76", };
  +"", "\74\163\143\162\151\160\164", null, null, "\74\41\55\55", "\74\41", null, 
  +null, null, null, null, null, null, null, null, null, "\75", null, null, "\47", 
  +"\42", null, null, null, null, null, null, "\55\55\76", null, "\76", };
   public static final String[] lexStateNames = {
      "DEFAULT", 
  +   "WithinScript", 
      "WithinTag", 
      "AfterEquals", 
      "WithinQuote1", 
  @@ -1172,14 +1422,14 @@
      "WithinComment2", 
   };
   public static final int[] jjnewLexState = {
  -   -1, 1, 1, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, 2, 0, 1, 3, 4, -1, -1, 1, -1, 1, -1, 0, 
  -   -1, 0, 
  +   -1, 1, 2, 2, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 3, 0, 2, 4, 5, -1, -1, 2, -1, 
  +   2, -1, 0, -1, 0, 
   };
   static final long[] jjtoToken = {
  -   0x7fbfb3fL, 
  +   0x3fdff67fL, 
   };
   static final long[] jjtoSkip = {
  -   0x40000L, 
  +   0x200000L, 
   };
   protected SimpleCharStream input_stream;
   private final int[] jjrounds = new int[25];
  @@ -1217,7 +1467,7 @@
   }
   public void SwitchTo(int lexState)
   {
  -   if (lexState >= 7 || lexState < 0)
  +   if (lexState >= 8 || lexState < 0)
         throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
      else
         curLexState = lexState;
  @@ -1270,9 +1520,9 @@
          jjmatchedKind = 0x7fffffff;
          jjmatchedPos = 0;
          curPos = jjMoveStringLiteralDfa0_0();
  -       if (jjmatchedPos == 0 && jjmatchedKind > 11)
  +       if (jjmatchedPos == 0 && jjmatchedKind > 12)
          {
  -          jjmatchedKind = 11;
  +          jjmatchedKind = 12;
          }
          break;
        case 1:
  @@ -1304,6 +1554,11 @@
          jjmatchedKind = 0x7fffffff;
          jjmatchedPos = 0;
          curPos = jjMoveStringLiteralDfa0_6();
  +       break;
  +     case 7:
  +       jjmatchedKind = 0x7fffffff;
  +       jjmatchedPos = 0;
  +       curPos = jjMoveStringLiteralDfa0_7();
          break;
      }
        if (jjmatchedKind != 0x7fffffff)
  
  
  
  1.2       +39 -32    jakarta-lucene/src/demo/org/apache/lucene/demo/html/HTMLParserConstants.java
  
  Index: HTMLParserConstants.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/demo/org/apache/lucene/demo/html/HTMLParserConstants.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HTMLParserConstants.java	11 Sep 2003 01:51:33 -0000	1.1
  +++ HTMLParserConstants.java	23 Nov 2003 18:37:32 -0000	1.2
  @@ -4,42 +4,47 @@
   public interface HTMLParserConstants {
   
     int EOF = 0;
  -  int TagName = 1;
  -  int DeclName = 2;
  -  int Comment1 = 3;
  -  int Comment2 = 4;
  -  int Word = 5;
  -  int LET = 6;
  -  int NUM = 7;
  -  int Entity = 8;
  -  int Space = 9;
  -  int SP = 10;
  -  int Punct = 11;
  -  int ArgName = 12;
  -  int ArgEquals = 13;
  -  int TagEnd = 14;
  -  int ArgValue = 15;
  -  int ArgQuote1 = 16;
  -  int ArgQuote2 = 17;
  -  int Quote1Text = 19;
  -  int CloseQuote1 = 20;
  -  int Quote2Text = 21;
  -  int CloseQuote2 = 22;
  -  int CommentText1 = 23;
  -  int CommentEnd1 = 24;
  -  int CommentText2 = 25;
  -  int CommentEnd2 = 26;
  +  int ScriptStart = 1;
  +  int TagName = 2;
  +  int DeclName = 3;
  +  int Comment1 = 4;
  +  int Comment2 = 5;
  +  int Word = 6;
  +  int LET = 7;
  +  int NUM = 8;
  +  int Entity = 9;
  +  int Space = 10;
  +  int SP = 11;
  +  int Punct = 12;
  +  int ScriptText = 13;
  +  int ScriptEnd = 14;
  +  int ArgName = 15;
  +  int ArgEquals = 16;
  +  int TagEnd = 17;
  +  int ArgValue = 18;
  +  int ArgQuote1 = 19;
  +  int ArgQuote2 = 20;
  +  int Quote1Text = 22;
  +  int CloseQuote1 = 23;
  +  int Quote2Text = 24;
  +  int CloseQuote2 = 25;
  +  int CommentText1 = 26;
  +  int CommentEnd1 = 27;
  +  int CommentText2 = 28;
  +  int CommentEnd2 = 29;
   
     int DEFAULT = 0;
  -  int WithinTag = 1;
  -  int AfterEquals = 2;
  -  int WithinQuote1 = 3;
  -  int WithinQuote2 = 4;
  -  int WithinComment1 = 5;
  -  int WithinComment2 = 6;
  +  int WithinScript = 1;
  +  int WithinTag = 2;
  +  int AfterEquals = 3;
  +  int WithinQuote1 = 4;
  +  int WithinQuote2 = 5;
  +  int WithinComment1 = 6;
  +  int WithinComment2 = 7;
   
     String[] tokenImage = {
       "<EOF>",
  +    "\"<script\"",
       "<TagName>",
       "<DeclName>",
       "\"<!--\"",
  @@ -51,13 +56,15 @@
       "<Space>",
       "<SP>",
       "<Punct>",
  +    "<ScriptText>",
  +    "<ScriptEnd>",
       "<ArgName>",
       "\"=\"",
       "<TagEnd>",
       "<ArgValue>",
       "\"\\\'\"",
       "\"\\\"\"",
  -    "<token of kind 18>",
  +    "<token of kind 21>",
       "<Quote1Text>",
       "<CloseQuote1>",
       "<Quote2Text>",
  
  
  
  1.4       +41 -28    jakarta-lucene/src/demo/org/apache/lucene/demo/html/HTMLParser.java
  
  Index: HTMLParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/demo/org/apache/lucene/demo/html/HTMLParser.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HTMLParser.java	23 Nov 2003 17:24:32 -0000	1.3
  +++ HTMLParser.java	23 Nov 2003 18:37:32 -0000	1.4
  @@ -16,7 +16,6 @@
     boolean inTitle = false;
     boolean inMetaTag = false;
     boolean inStyle = false;
  -  boolean inScript = false;
     boolean afterTag = false;
     boolean afterSpace = false;
     String eol = System.getProperty("line.separator");
  @@ -119,8 +118,6 @@
     }
   
     void addText(String text) throws IOException {
  -    if (inScript)
  -      return;
       if (inStyle)
         return;
       if (inMetaTag)
  @@ -147,8 +144,6 @@
     }
   
     void addSpace() throws IOException {
  -    if (inScript)
  -      return;
       if (!afterSpace) {
         if (inTitle)
           title.append(" ");
  @@ -167,6 +162,7 @@
       label_1:
       while (true) {
         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  +      case ScriptStart:
         case TagName:
         case DeclName:
         case Comment1:
  @@ -195,6 +191,10 @@
           CommentTag();
                         afterTag = true;
           break;
  +      case ScriptStart:
  +        ScriptTag();
  +                     afterTag = true;
  +        break;
         case Word:
           t = jj_consume_token(Word);
                         addText(t.image); afterTag = false;
  @@ -232,11 +232,7 @@
       inMetaTag = tagName.equalsIgnoreCase("<META"); // keep track if in <META>
       inStyle = tagName.equalsIgnoreCase("<STYLE"); // keep track if in <STYLE>
       inImg = tagName.equalsIgnoreCase("<img");     // keep track if in <IMG>
  -    if (inScript) {                               // keep track if in <SCRIPT>
  -      inScript = !tagName.equalsIgnoreCase("</script");
  -    } else {
  -      inScript = tagName.equalsIgnoreCase("<script");
  -    }
  +
       label_2:
       while (true) {
         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  @@ -414,6 +410,23 @@
       }
     }
   
  +  final public void ScriptTag() throws ParseException {
  +    jj_consume_token(ScriptStart);
  +    label_6:
  +    while (true) {
  +      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  +      case ScriptText:
  +        ;
  +        break;
  +      default:
  +        jj_la1[13] = jj_gen;
  +        break label_6;
  +      }
  +      jj_consume_token(ScriptText);
  +    }
  +    jj_consume_token(ScriptEnd);
  +  }
  +
     final private boolean jj_2_1(int xla) {
       jj_la = xla; jj_lastpos = jj_scanpos = token;
       try { return !jj_3_1(); }
  @@ -428,18 +441,18 @@
       finally { jj_save(1, xla); }
     }
   
  -  final private boolean jj_3_1() {
  -    if (jj_scan_token(ArgQuote1)) return true;
  -    if (jj_scan_token(CloseQuote1)) return true;
  -    return false;
  -  }
  -
     final private boolean jj_3_2() {
       if (jj_scan_token(ArgQuote2)) return true;
       if (jj_scan_token(CloseQuote2)) return true;
       return false;
     }
   
  +  final private boolean jj_3_1() {
  +    if (jj_scan_token(ArgQuote1)) return true;
  +    if (jj_scan_token(CloseQuote1)) return true;
  +    return false;
  +  }
  +
     public HTMLParserTokenManager token_source;
     SimpleCharStream jj_input_stream;
     public Token token, jj_nt;
  @@ -449,13 +462,13 @@
     public boolean lookingAhead = false;
     private boolean jj_semLA;
     private int jj_gen;
  -  final private int[] jj_la1 = new int[13];
  +  final private int[] jj_la1 = new int[14];
     static private int[] jj_la1_0;
     static {
         jj_la1_0();
      }
      private static void jj_la1_0() {
  -      jj_la1_0 = new int[] {0xb3e,0xb3e,0x1000,0x38000,0x2000,0x8000,0x10000,0x20000,0x3b000,0x3b000,0x800000,0x2000000,0x18,};
  +      jj_la1_0 = new int[] {0x167e,0x167e,0x8000,0x1c0000,0x10000,0x40000,0x80000,0x100000,0x1d8000,0x1d8000,0x4000000,0x10000000,0x30,0x2000,};
      }
     final private JJCalls[] jj_2_rtns = new JJCalls[2];
     private boolean jj_rescan = false;
  @@ -467,7 +480,7 @@
       token = new Token();
       jj_ntk = -1;
       jj_gen = 0;
  -    for (int i = 0; i < 13; i++) jj_la1[i] = -1;
  +    for (int i = 0; i < 14; i++) jj_la1[i] = -1;
       for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
     }
   
  @@ -477,7 +490,7 @@
       token = new Token();
       jj_ntk = -1;
       jj_gen = 0;
  -    for (int i = 0; i < 13; i++) jj_la1[i] = -1;
  +    for (int i = 0; i < 14; i++) jj_la1[i] = -1;
       for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
     }
   
  @@ -487,7 +500,7 @@
       token = new Token();
       jj_ntk = -1;
       jj_gen = 0;
  -    for (int i = 0; i < 13; i++) jj_la1[i] = -1;
  +    for (int i = 0; i < 14; i++) jj_la1[i] = -1;
       for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
     }
   
  @@ -497,7 +510,7 @@
       token = new Token();
       jj_ntk = -1;
       jj_gen = 0;
  -    for (int i = 0; i < 13; i++) jj_la1[i] = -1;
  +    for (int i = 0; i < 14; i++) jj_la1[i] = -1;
       for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
     }
   
  @@ -506,7 +519,7 @@
       token = new Token();
       jj_ntk = -1;
       jj_gen = 0;
  -    for (int i = 0; i < 13; i++) jj_la1[i] = -1;
  +    for (int i = 0; i < 14; i++) jj_la1[i] = -1;
       for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
     }
   
  @@ -515,7 +528,7 @@
       token = new Token();
       jj_ntk = -1;
       jj_gen = 0;
  -    for (int i = 0; i < 13; i++) jj_la1[i] = -1;
  +    for (int i = 0; i < 14; i++) jj_la1[i] = -1;
       for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
     }
   
  @@ -626,15 +639,15 @@
   
     public ParseException generateParseException() {
       jj_expentries.removeAllElements();
  -    boolean[] la1tokens = new boolean[27];
  -    for (int i = 0; i < 27; i++) {
  +    boolean[] la1tokens = new boolean[30];
  +    for (int i = 0; i < 30; i++) {
         la1tokens[i] = false;
       }
       if (jj_kind >= 0) {
         la1tokens[jj_kind] = true;
         jj_kind = -1;
       }
  -    for (int i = 0; i < 13; i++) {
  +    for (int i = 0; i < 14; i++) {
         if (jj_la1[i] == jj_gen) {
           for (int j = 0; j < 32; j++) {
             if ((jj_la1_0[i] & (1<<j)) != 0) {
  @@ -643,7 +656,7 @@
           }
         }
       }
  -    for (int i = 0; i < 27; i++) {
  +    for (int i = 0; i < 30; i++) {
         if (la1tokens[i]) {
           jj_expentry = new int[1];
           jj_expentry[0] = i;
  
  
  
  1.5       +14 -11    jakarta-lucene/src/demo/org/apache/lucene/demo/html/HTMLParser.jj
  
  Index: HTMLParser.jj
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/demo/org/apache/lucene/demo/html/HTMLParser.jj,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HTMLParser.jj	23 Nov 2003 17:24:32 -0000	1.4
  +++ HTMLParser.jj	23 Nov 2003 18:37:32 -0000	1.5
  @@ -80,7 +80,6 @@
     boolean inTitle = false;
     boolean inMetaTag = false;
     boolean inStyle = false;
  -  boolean inScript = false;
     boolean afterTag = false;
     boolean afterSpace = false;
     String eol = System.getProperty("line.separator");
  @@ -183,8 +182,6 @@
     }
   
     void addText(String text) throws IOException {
  -    if (inScript)
  -      return;
       if (inStyle)
         return;
       if (inMetaTag)
  @@ -211,8 +208,6 @@
     }
   
     void addSpace() throws IOException {
  -    if (inScript)
  -      return;
       if (!afterSpace) {
         if (inTitle)
   	title.append(" ");
  @@ -248,6 +243,7 @@
       ( Tag()         { afterTag = true; }
       | t=Decl()      { afterTag = true; }
       | CommentTag()  { afterTag = true; }
  +    | ScriptTag()  { afterTag = true; }
       | t=<Word>      { addText(t.image); afterTag = false; }
       | t=<Entity>    { addText(Entities.decode(t.image)); afterTag = false; }
       | t=<Punct>     { addText(t.image); afterTag = false; }
  @@ -273,11 +269,6 @@
       inMetaTag = tagName.equalsIgnoreCase("<META"); // keep track if in <META>
       inStyle = tagName.equalsIgnoreCase("<STYLE"); // keep track if in <STYLE>
       inImg = tagName.equalsIgnoreCase("<img");	  // keep track if in <IMG>
  -    if (inScript) {				  // keep track if in <SCRIPT>
  -      inScript = !tagName.equalsIgnoreCase("</script");
  -    } else {
  -      inScript = tagName.equalsIgnoreCase("<script");
  -    }
     }
     (t1=<ArgName>
      (<ArgEquals>
  @@ -339,10 +330,17 @@
     (<Comment2> ( <CommentText2> )* <CommentEnd2>)
   }
   
  +void ScriptTag() :
  +{}
  +{
  +  <ScriptStart> ( <ScriptText> )* <ScriptEnd>
  +}
  +
   
   TOKEN :
   {
  -  < TagName:  "<" ("/")? ["A"-"Z","a"-"z"] (<ArgName>)? > : WithinTag
  +  < ScriptStart: "<script" > : WithinScript
  +| < TagName:  "<" ("/")? ["A"-"Z","a"-"z"] (<ArgName>)? > : WithinTag
   | < DeclName: "<"  "!"   ["A"-"Z","a"-"z"] (<ArgName>)? > : WithinTag
   
   | < Comment1:  "<!--" > : WithinComment1
  @@ -361,6 +359,11 @@
   | < Punct:    ~[] > // Keep this last.  It is a catch-all.
   }
   
  +<WithinScript> TOKEN:
  +{
  +  < ScriptText:  (~["<",">"])+ | "<" | ">" >
  +| < ScriptEnd: "</script" (~["<",">"])* ">" > : DEFAULT
  +}
   
   <WithinTag> TOKEN:
   {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message