FileDocCategorySizeDatePackage
SPathParserTokenManager.javaAPI DocGlassfish v2 API22567Sat May 05 19:17:16 BST 2007org.apache.taglibs.standard.extra.spath

SPathParserTokenManager

public class SPathParserTokenManager extends Object implements SPathParserConstants

Fields Summary
static final long[]
jjbitVec0
static final long[]
jjbitVec2
static final long[]
jjbitVec3
static final long[]
jjbitVec4
static final long[]
jjbitVec5
static final long[]
jjbitVec6
static final long[]
jjbitVec7
static final long[]
jjbitVec8
static final long[]
jjbitVec9
static final long[]
jjbitVec10
static final long[]
jjbitVec11
static final long[]
jjbitVec12
static final long[]
jjbitVec13
static final long[]
jjbitVec14
static final long[]
jjbitVec15
static final long[]
jjbitVec16
static final long[]
jjbitVec17
static final long[]
jjbitVec18
static final long[]
jjbitVec19
static final long[]
jjbitVec20
static final long[]
jjbitVec21
static final long[]
jjbitVec22
static final long[]
jjbitVec23
static final long[]
jjbitVec24
static final long[]
jjbitVec25
static final long[]
jjbitVec26
static final long[]
jjbitVec27
static final long[]
jjbitVec28
static final long[]
jjbitVec29
static final long[]
jjbitVec30
static final long[]
jjbitVec31
static final long[]
jjbitVec32
static final long[]
jjbitVec33
static final long[]
jjbitVec34
static final long[]
jjbitVec35
static final long[]
jjbitVec36
static final long[]
jjbitVec37
static final long[]
jjbitVec38
static final long[]
jjbitVec39
static final long[]
jjbitVec40
static final long[]
jjbitVec41
static final int[]
jjnextStates
public static final String[]
jjstrLiteralImages
public static final String[]
lexStateNames
private ASCII_UCodeESC_CharStream
input_stream
private final int[]
jjrounds
private final int[]
jjstateSet
protected char
curChar
int
curLexState
int
defaultLexState
int
jjnewStateCnt
int
jjround
int
jjmatchedPos
int
jjmatchedKind
Constructors Summary
public SPathParserTokenManager(ASCII_UCodeESC_CharStream stream)

  

   if (ASCII_UCodeESC_CharStream.staticFlag)
      throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
   input_stream = stream;
public SPathParserTokenManager(ASCII_UCodeESC_CharStream stream, int lexState)

   this(stream);
   SwitchTo(lexState);
Methods Summary
public voidReInit(ASCII_UCodeESC_CharStream stream)

   jjmatchedPos = jjnewStateCnt = 0;
   curLexState = defaultLexState;
   input_stream = stream;
   ReInitRounds();
public voidReInit(ASCII_UCodeESC_CharStream stream, int lexState)

   ReInit(stream);
   SwitchTo(lexState);
private final voidReInitRounds()

   int i;
   jjround = 0x80000001;
   for (i = 19; i-- > 0;)
      jjrounds[i] = 0x80000000;
public voidSwitchTo(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;
public final TokengetNextToken()


    

  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();
      return matchedToken;
   }

   jjmatchedKind = 0x7fffffff;
   jjmatchedPos = 0;
   curPos = jjMoveStringLiteralDfa0_0();
   if (jjmatchedKind != 0x7fffffff)
   {
      if (jjmatchedPos + 1 < curPos)
         input_stream.backup(curPos - jjmatchedPos - 1);
         matchedToken = jjFillToken();
         return matchedToken;
   }
   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);
  }
private final voidjjAddStates(int start, int end)

   do {
      jjstateSet[jjnewStateCnt++] = jjnextStates[start];
   } while (start++ != end);
private static final booleanjjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)

             

   switch(hiByte)
   {
      case 0:
         return ((jjbitVec2[i2] & l2) != 0L);
      default : 
         if ((jjbitVec0[i1] & l1) != 0L)
            return true;
         return false;
   }
private static final booleanjjCanMove_1(int hiByte, int i1, int i2, long l1, long l2)

   switch(hiByte)
   {
      case 0:
         return ((jjbitVec4[i2] & l2) != 0L);
      case 1:
         return ((jjbitVec5[i2] & l2) != 0L);
      case 2:
         return ((jjbitVec6[i2] & l2) != 0L);
      case 3:
         return ((jjbitVec7[i2] & l2) != 0L);
      case 4:
         return ((jjbitVec8[i2] & l2) != 0L);
      case 5:
         return ((jjbitVec9[i2] & l2) != 0L);
      case 6:
         return ((jjbitVec10[i2] & l2) != 0L);
      case 9:
         return ((jjbitVec11[i2] & l2) != 0L);
      case 10:
         return ((jjbitVec12[i2] & l2) != 0L);
      case 11:
         return ((jjbitVec13[i2] & l2) != 0L);
      case 12:
         return ((jjbitVec14[i2] & l2) != 0L);
      case 13:
         return ((jjbitVec15[i2] & l2) != 0L);
      case 14:
         return ((jjbitVec16[i2] & l2) != 0L);
      case 15:
         return ((jjbitVec17[i2] & l2) != 0L);
      case 16:
         return ((jjbitVec18[i2] & l2) != 0L);
      case 17:
         return ((jjbitVec19[i2] & l2) != 0L);
      case 30:
         return ((jjbitVec20[i2] & l2) != 0L);
      case 31:
         return ((jjbitVec21[i2] & l2) != 0L);
      case 33:
         return ((jjbitVec22[i2] & l2) != 0L);
      case 48:
         return ((jjbitVec23[i2] & l2) != 0L);
      case 49:
         return ((jjbitVec24[i2] & l2) != 0L);
      case 159:
         return ((jjbitVec25[i2] & l2) != 0L);
      case 215:
         return ((jjbitVec26[i2] & l2) != 0L);
      default : 
         if ((jjbitVec3[i1] & l1) != 0L)
            return true;
         return false;
   }
private static final booleanjjCanMove_2(int hiByte, int i1, int i2, long l1, long l2)

   switch(hiByte)
   {
      case 0:
         return ((jjbitVec27[i2] & l2) != 0L);
      case 1:
         return ((jjbitVec5[i2] & l2) != 0L);
      case 2:
         return ((jjbitVec28[i2] & l2) != 0L);
      case 3:
         return ((jjbitVec29[i2] & l2) != 0L);
      case 4:
         return ((jjbitVec30[i2] & l2) != 0L);
      case 5:
         return ((jjbitVec31[i2] & l2) != 0L);
      case 6:
         return ((jjbitVec32[i2] & l2) != 0L);
      case 9:
         return ((jjbitVec33[i2] & l2) != 0L);
      case 10:
         return ((jjbitVec34[i2] & l2) != 0L);
      case 11:
         return ((jjbitVec35[i2] & l2) != 0L);
      case 12:
         return ((jjbitVec36[i2] & l2) != 0L);
      case 13:
         return ((jjbitVec37[i2] & l2) != 0L);
      case 14:
         return ((jjbitVec38[i2] & l2) != 0L);
      case 15:
         return ((jjbitVec39[i2] & l2) != 0L);
      case 16:
         return ((jjbitVec18[i2] & l2) != 0L);
      case 17:
         return ((jjbitVec19[i2] & l2) != 0L);
      case 30:
         return ((jjbitVec20[i2] & l2) != 0L);
      case 31:
         return ((jjbitVec21[i2] & l2) != 0L);
      case 32:
         return ((jjbitVec40[i2] & l2) != 0L);
      case 33:
         return ((jjbitVec22[i2] & l2) != 0L);
      case 48:
         return ((jjbitVec41[i2] & l2) != 0L);
      case 49:
         return ((jjbitVec24[i2] & l2) != 0L);
      case 159:
         return ((jjbitVec25[i2] & l2) != 0L);
      case 215:
         return ((jjbitVec26[i2] & l2) != 0L);
      default : 
         if ((jjbitVec3[i1] & l1) != 0L)
            return true;
         return false;
   }
private final voidjjCheckNAdd(int state)

   if (jjrounds[state] != jjround)
   {
      jjstateSet[jjnewStateCnt++] = state;
      jjrounds[state] = jjround;
   }
private final voidjjCheckNAddStates(int start)

   jjCheckNAdd(jjnextStates[start]);
   jjCheckNAdd(jjnextStates[start + 1]);
private final voidjjCheckNAddStates(int start, int end)

   do {
      jjCheckNAdd(jjnextStates[start]);
   } while (start++ != end);
private final voidjjCheckNAddTwoStates(int state1, int state2)

   jjCheckNAdd(state1);
   jjCheckNAdd(state2);
private final TokenjjFillToken()

   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;
private final intjjMoveNfa_0(int startState, int curPos)

      

   int[] nextStates;
   int startsAt = 0;
   jjnewStateCnt = 19;
   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 0:
                  if (curChar == 39)
                     jjCheckNAddStates(0, 2);
                  else if (curChar == 34)
                     jjCheckNAddStates(3, 5);
                  break;
               case 1:
                  if ((0xfffffffbffffffffL & l) != 0L)
                     jjCheckNAddStates(3, 5);
                  break;
               case 3:
                  if (curChar == 34)
                     jjCheckNAddStates(3, 5);
                  break;
               case 4:
                  if (curChar == 34 && kind > 1)
                     kind = 1;
                  break;
               case 5:
               case 8:
                  if (curChar == 39)
                     jjCheckNAddStates(0, 2);
                  break;
               case 6:
                  if ((0xffffff7fffffffffL & l) != 0L)
                     jjCheckNAddStates(0, 2);
                  break;
               case 9:
                  if (curChar == 39 && kind > 1)
                     kind = 1;
                  break;
               case 11:
                  if ((0x3ff600000000000L & l) != 0L)
                     jjAddStates(6, 7);
                  break;
               case 12:
                  if (curChar == 58)
                     jjstateSet[jjnewStateCnt++] = 13;
                  break;
               case 14:
                  if ((0x3ff600000000000L & l) == 0L)
                     break;
                  if (kind > 2)
                     kind = 2;
                  jjstateSet[jjnewStateCnt++] = 14;
                  break;
               case 15:
                  if ((0x3ff600000000000L & l) == 0L)
                     break;
                  if (kind > 3)
                     kind = 3;
                  jjstateSet[jjnewStateCnt++] = 15;
                  break;
               case 16:
                  if ((0x3ff600000000000L & l) != 0L)
                     jjAddStates(8, 9);
                  break;
               case 17:
                  if (curChar == 58)
                     jjstateSet[jjnewStateCnt++] = 18;
                  break;
               case 18:
                  if (curChar == 42 && kind > 4)
                     kind = 4;
                  break;
               default : break;
            }
         } while(i != startsAt);
      }
      else if (curChar < 128)
      {
         long l = 1L << (curChar & 077);
         MatchLoop: do
         {
            switch(jjstateSet[--i])
            {
               case 0:
                  if ((0x7fffffe87fffffeL & l) == 0L)
                     break;
                  if (kind > 2)
                     kind = 2;
                  jjCheckNAddStates(10, 15);
                  break;
               case 1:
                  if ((0xffffffffefffffffL & l) != 0L)
                     jjCheckNAddStates(3, 5);
                  break;
               case 2:
                  if (curChar == 92)
                     jjstateSet[jjnewStateCnt++] = 3;
                  break;
               case 3:
                  if (curChar == 92)
                     jjCheckNAddStates(3, 5);
                  break;
               case 6:
                  if ((0xffffffffefffffffL & l) != 0L)
                     jjCheckNAddStates(0, 2);
                  break;
               case 7:
                  if (curChar == 92)
                     jjstateSet[jjnewStateCnt++] = 8;
                  break;
               case 8:
                  if (curChar == 92)
                     jjCheckNAddStates(0, 2);
                  break;
               case 11:
                  if ((0x7fffffe87fffffeL & l) != 0L)
                     jjCheckNAddTwoStates(11, 12);
                  break;
               case 13:
               case 14:
                  if ((0x7fffffe87fffffeL & l) == 0L)
                     break;
                  if (kind > 2)
                     kind = 2;
                  jjCheckNAdd(14);
                  break;
               case 15:
                  if ((0x7fffffe87fffffeL & l) == 0L)
                     break;
                  if (kind > 3)
                     kind = 3;
                  jjCheckNAdd(15);
                  break;
               case 16:
                  if ((0x7fffffe87fffffeL & l) != 0L)
                     jjCheckNAddTwoStates(16, 17);
                  break;
               default : break;
            }
         } while(i != startsAt);
      }
      else
      {
         int hiByte = (int)(curChar >> 8);
         int i1 = hiByte >> 6;
         long l1 = 1L << (hiByte & 077);
         int i2 = (curChar & 0xff) >> 6;
         long l2 = 1L << (curChar & 077);
         MatchLoop: do
         {
            switch(jjstateSet[--i])
            {
               case 0:
                  if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
                     break;
                  if (kind > 2)
                     kind = 2;
                  jjCheckNAddStates(10, 15);
                  break;
               case 1:
                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
                     jjAddStates(3, 5);
                  break;
               case 6:
                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
                     jjAddStates(0, 2);
                  break;
               case 11:
                  if (jjCanMove_2(hiByte, i1, i2, l1, l2))
                     jjCheckNAddTwoStates(11, 12);
                  break;
               case 13:
                  if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
                     break;
                  if (kind > 2)
                     kind = 2;
                  jjCheckNAdd(14);
                  break;
               case 14:
                  if (!jjCanMove_2(hiByte, i1, i2, l1, l2))
                     break;
                  if (kind > 2)
                     kind = 2;
                  jjCheckNAdd(14);
                  break;
               case 15:
                  if (!jjCanMove_2(hiByte, i1, i2, l1, l2))
                     break;
                  if (kind > 3)
                     kind = 3;
                  jjCheckNAdd(15);
                  break;
               case 16:
                  if (jjCanMove_2(hiByte, i1, i2, l1, l2))
                     jjCheckNAddTwoStates(16, 17);
                  break;
               default : break;
            }
         } while(i != startsAt);
      }
      if (kind != 0x7fffffff)
      {
         jjmatchedKind = kind;
         jjmatchedPos = curPos;
         kind = 0x7fffffff;
      }
      ++curPos;
      if ((i = jjnewStateCnt) == (startsAt = 19 - (jjnewStateCnt = startsAt)))
         return curPos;
      try { curChar = input_stream.readChar(); }
      catch(java.io.IOException e) { return curPos; }
   }
private final intjjMoveStringLiteralDfa0_0()

   switch(curChar)
   {
      case 42:
         return jjStopAtPos(0, 14);
      case 47:
         return jjStopAtPos(0, 13);
      case 58:
         return jjStopAtPos(0, 15);
      case 61:
         return jjStopAtPos(0, 19);
      case 64:
         return jjStopAtPos(0, 18);
      case 91:
         return jjStopAtPos(0, 16);
      case 93:
         return jjStopAtPos(0, 17);
      default :
         return jjMoveNfa_0(0, 0);
   }
private final intjjStartNfaWithStates_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 intjjStartNfa_0(int pos, long active0)

   return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
private final intjjStopAtPos(int pos, int kind)

   jjmatchedKind = kind;
   jjmatchedPos = pos;
   return pos + 1;
private final intjjStopStringLiteralDfa_0(int pos, long active0)

   switch (pos)
   {
      default :
         return -1;
   }