0001: /* Generated By:JavaCC: Do not edit this line. JDOQL.java */
0002: package org.xorm.query.jdoql;
0003:
0004: import java.io.IOException;
0005: import java.io.StringReader;
0006: import java.util.HashMap;
0007: import java.util.Map;
0008: import java.util.Stack;
0009:
0010: import org.xorm.query.*;
0011:
0012: /**
0013: This class, generated by JavaCC, contains the grammar described in
0014: the Java Data Objects specification, transformed from LALR to LL by
0015: unrolling any instances of left recursion.
0016:
0017: For the sake of clarity, I have removed the production name(),
0018: which is listed in the JDO spec. At the raw grammar level,
0019: we don't have enough contextual information to determine which
0020: IDs are fields, parameters, or variables. The symbolic names
0021: fieldAccess() and methodInvocation() are dealt with inline in
0022: the _primary() production, rather than having top-level names.
0023:
0024: The output of this parser is an instance of org.xorm.query.Expression
0025: that represents the Expression parse tree. Because Expression trees
0026: can be created from other sources for use in XORM (for example,
0027: the CodeQuery class converts JVM bytecode to Expressions) I felt it
0028: was best NOT to use JJTree.
0029:
0030: @author Wes Biggs
0031: */
0032: public class JDOQL extends AbstractQueryLanguage implements
0033: JDOQLConstants {
0034: /**
0035: * Test bootstrap. Allows you to enter JDOQL expressions using
0036: * STDIN and see the results. For the purposes of testing,
0037: * variables var, var2 and var3 and parameters param, param2,
0038: * and param3 are declared.
0039: */
0040: public static void main(String args[]) throws ParseException,
0041: IOException {
0042: JDOQL parser = new JDOQL(System.in);
0043:
0044: parser.declareVariable("var", String.class);
0045: parser.declareVariable("var2", String.class);
0046: parser.declareVariable("var3", String.class);
0047:
0048: parser.declareParameter("param", String.class);
0049: parser.declareParameter("param1", String.class);
0050: parser.declareParameter("param2", String.class);
0051:
0052: while (true) {
0053: try {
0054: parser.compile();
0055: System.out.println("PARSED: " + parser.getExpression());
0056: } catch (QuerySyntaxException e) {
0057: if (!e.getCause().getMessage().startsWith(
0058: "Encountered \"<EOF>\"")) {
0059: System.out.println("Error: " + e.getMessage());
0060: }
0061: System.exit(1);
0062: }
0063: parser.expressions = new Stack();
0064: }
0065: }
0066:
0067: private Stack expressions = new Stack();
0068: private boolean working;
0069: private boolean compiled;
0070:
0071: public void compile() throws QuerySyntaxException {
0072: if (expressions.isEmpty()) {
0073: try {
0074: expression();
0075: } catch (ParseException e) {
0076: throw new QuerySyntaxException(e);
0077: }
0078: }
0079: }
0080:
0081: public JDOQL() {
0082: this (new StringReader("true"));
0083: }
0084:
0085: public void setFilter(Object filter) {
0086: StringReader sr = new StringReader(filter.toString());
0087: jj_input_stream = new SimpleCharStream(sr, 1, 1);
0088: token_source = new JDOQLTokenManager(jj_input_stream);
0089: ReInit(sr);
0090: }
0091:
0092: public Expression getExpression() {
0093: return (Expression) expressions.peek();
0094: }
0095:
0096: private void doMember(Expression here) {
0097: if (working) {
0098: if (!expressions.isEmpty()
0099: && (expressions.peek() instanceof Expression.Member)) {
0100: Expression sub = (Expression) expressions.pop();
0101: // Climb to the top
0102: Expression.Member top = (Expression.Member) sub;
0103: if (top != Expression.FieldAccess.THIS) {
0104: while (top.getOwner() != Expression.FieldAccess.THIS) {
0105: top = (Expression.Member) top.getOwner();
0106: }
0107: }
0108: ((Expression.Member) top).setOwner(here);
0109: expressions.push(sub);
0110: } else {
0111: expressions.push(here);
0112: }
0113: } else {
0114: expressions.push(here);
0115: working = true;
0116: }
0117: }
0118:
0119: private static final Character SLASH_B = new Character('\b');
0120: private static final Character SLASH_F = new Character('\f');
0121: private static final Character SLASH_N = new Character('\n');
0122: private static final Character SLASH_R = new Character('\r');
0123: private static final Character SLASH_T = new Character('\t');
0124: private static final Character SLASH = new Character('\\');
0125: private static final Character DOUBLE_QUOTE = new Character('\"');
0126: private static final Character SINGLE_QUOTE = new Character('\'');
0127:
0128: /**
0129: * Returns the character read after escaping, or null if
0130: * at the end of the input.
0131: */
0132: public static Character readChar(StringReader reader) {
0133: int i = -1;
0134: try {
0135: i = reader.read();
0136: } catch (IOException ignore) {
0137: }
0138: if (i == -1)
0139: return null;
0140: char ch = (char) i;
0141: if (ch == '\\') {
0142: char c2;
0143: try {
0144: c2 = (char) reader.read();
0145: } catch (IOException e) {
0146: return null;
0147: }
0148: switch (c2) {
0149: case 'b':
0150: return SLASH_B;
0151: case 'f':
0152: return SLASH_F;
0153: case 'n':
0154: return SLASH_N;
0155: case 'r':
0156: return SLASH_R;
0157: case 't':
0158: return SLASH_T;
0159: case '\'':
0160: return SINGLE_QUOTE;
0161: case '\"':
0162: return DOUBLE_QUOTE;
0163: case '\\':
0164: return SLASH;
0165: }
0166: }
0167: return new Character(ch);
0168: }
0169:
0170: final public void literal() throws ParseException {
0171: String x;
0172: Object o = null;
0173: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0174: case FLOATING_POINT_LITERAL:
0175: jj_consume_token(FLOATING_POINT_LITERAL);
0176: x = token.image;
0177: if (x.endsWith("d") || x.endsWith("D")) {
0178: o = new Double(x.substring(0, x.length() - 1));
0179: } else if (x.endsWith("f") || x.endsWith("F")) {
0180: o = new Float(x.substring(0, x.length() - 1));
0181: } else {
0182: o = new Float(x);
0183: }
0184: expressions.push(new Expression.Constant(o));
0185: break;
0186: case INTEGER_LITERAL:
0187: jj_consume_token(INTEGER_LITERAL);
0188: x = token.image;
0189: if (x.endsWith("l") || x.endsWith("L")) {
0190: o = new Long(x.substring(0, x.length() - 1));
0191: } else {
0192: try {
0193: o = new Integer(x);
0194: } catch (NumberFormatException e) {
0195: // If it's out of the range of an int, make it a long
0196: o = new Long(x);
0197: }
0198: }
0199: expressions.push(new Expression.Constant(o));
0200: break;
0201: case STRING_LITERAL:
0202: jj_consume_token(STRING_LITERAL);
0203: StringReader sr = new StringReader(token.image.substring(1,
0204: token.image.length() - 1));
0205: Character ch;
0206: StringBuffer sb = new StringBuffer();
0207: while ((ch = readChar(sr)) != null) {
0208: sb.append(ch.charValue());
0209: }
0210: expressions.push(new Expression.Constant(sb.toString()));
0211: break;
0212: case CHARACTER_LITERAL:
0213: jj_consume_token(CHARACTER_LITERAL);
0214: ch = readChar(new StringReader(token.image.substring(1)));
0215: expressions.push(new Expression.Constant(ch));
0216: break;
0217: case NULL:
0218: jj_consume_token(NULL);
0219: expressions.push(Expression.Constant.NULL);
0220: break;
0221: case TRUE:
0222: jj_consume_token(TRUE);
0223: expressions.push(Expression.Constant.TRUE);
0224: break;
0225: case FALSE:
0226: jj_consume_token(FALSE);
0227: expressions.push(Expression.Constant.FALSE);
0228: break;
0229: default:
0230: jj_la1[0] = jj_gen;
0231: jj_consume_token(-1);
0232: throw new ParseException();
0233: }
0234: }
0235:
0236: /**
0237: * This is an empty-grammar pattern that gives the expression
0238: * generator a hint that it's now working on a new expression.
0239: */
0240: final public void clear() throws ParseException {
0241:
0242: working = false;
0243: }
0244:
0245: /**
0246: * This is the top-level method that gets called to parse the JDOQL
0247: * filter expression.
0248: */
0249: final public void expression() throws ParseException {
0250: conditionalOr();
0251: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0252: case EOL:
0253: jj_consume_token(EOL);
0254: break;
0255: default:
0256: jj_la1[1] = jj_gen;
0257: ;
0258: }
0259: }
0260:
0261: final public void conditionalOr() throws ParseException {
0262: conditionalAnd();
0263: _conditionalOr();
0264: }
0265:
0266: final public void _conditionalOr() throws ParseException {
0267: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0268: case ORC:
0269: jj_consume_token(ORC);
0270: clear();
0271: conditionalOr();
0272: Expression rhs = (Expression) expressions.pop();
0273: Expression lhs = (Expression) expressions.pop();
0274: expressions.push(new Expression.ConditionalOr(lhs, rhs));
0275: break;
0276: default:
0277: jj_la1[2] = jj_gen;
0278:
0279: }
0280: }
0281:
0282: final public void conditionalAnd() throws ParseException {
0283: inclusiveOr();
0284: _conditionalAnd();
0285: }
0286:
0287: final public void _conditionalAnd() throws ParseException {
0288: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0289: case ANDC:
0290: jj_consume_token(ANDC);
0291: clear();
0292: conditionalAnd();
0293: Expression rhs = (Expression) expressions.pop();
0294: Expression lhs = (Expression) expressions.pop();
0295: expressions.push(new Expression.ConditionalAnd(lhs, rhs));
0296: break;
0297: default:
0298: jj_la1[3] = jj_gen;
0299:
0300: }
0301: }
0302:
0303: final public void inclusiveOr() throws ParseException {
0304: exclusiveOr();
0305: _inclusiveOr();
0306: }
0307:
0308: final public void _inclusiveOr() throws ParseException {
0309: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0310: case ORL:
0311: jj_consume_token(ORL);
0312: clear();
0313: inclusiveOr();
0314: Expression rhs = (Expression) expressions.pop();
0315: Expression lhs = (Expression) expressions.pop();
0316: expressions.push(new Expression.InclusiveOr(lhs, rhs));
0317: break;
0318: default:
0319: jj_la1[4] = jj_gen;
0320:
0321: }
0322: }
0323:
0324: final public void exclusiveOr() throws ParseException {
0325: and();
0326: _exclusiveOr();
0327: }
0328:
0329: final public void _exclusiveOr() throws ParseException {
0330: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0331: case XOR:
0332: jj_consume_token(XOR);
0333: clear();
0334: exclusiveOr();
0335: Expression rhs = (Expression) expressions.pop();
0336: Expression lhs = (Expression) expressions.pop();
0337: expressions.push(new Expression.ExclusiveOr(lhs, rhs));
0338: break;
0339: default:
0340: jj_la1[5] = jj_gen;
0341:
0342: }
0343: }
0344:
0345: final public void and() throws ParseException {
0346: equality();
0347: _and();
0348: }
0349:
0350: final public void _and() throws ParseException {
0351: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0352: case ANDL:
0353: jj_consume_token(ANDL);
0354: clear();
0355: and();
0356: Expression rhs = (Expression) expressions.pop();
0357: Expression lhs = (Expression) expressions.pop();
0358: expressions.push(new Expression.And(lhs, rhs));
0359: break;
0360: default:
0361: jj_la1[6] = jj_gen;
0362:
0363: }
0364: }
0365:
0366: final public void equality() throws ParseException {
0367: relational();
0368: _equality();
0369: }
0370:
0371: final public void _equality() throws ParseException {
0372: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0373: case EQ:
0374: jj_consume_token(EQ);
0375: clear();
0376: equality();
0377: Expression rhs = (Expression) expressions.pop();
0378: Expression lhs = expressions.isEmpty() ? Expression.FieldAccess.THIS
0379: : (Expression) expressions.pop();
0380: expressions.push(new Expression.Equal(lhs, rhs));
0381: break;
0382: case NE:
0383: jj_consume_token(NE);
0384: clear();
0385: equality();
0386: rhs = (Expression) expressions.pop();
0387: lhs = expressions.isEmpty() ? Expression.FieldAccess.THIS
0388: : (Expression) expressions.pop();
0389: expressions.push(new Expression.NotEqual(lhs, rhs));
0390: break;
0391: default:
0392: jj_la1[7] = jj_gen;
0393:
0394: }
0395: }
0396:
0397: final public void relational() throws ParseException {
0398: additive();
0399: _relational();
0400: }
0401:
0402: final public void _relational() throws ParseException {
0403: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0404: case LT:
0405: jj_consume_token(LT);
0406: clear();
0407: relational();
0408: Expression rhs = (Expression) expressions.pop();
0409: Expression lhs = (Expression) expressions.pop();
0410: expressions.push(new Expression.LessThan(lhs, rhs));
0411: break;
0412: case LTE:
0413: jj_consume_token(LTE);
0414: clear();
0415: relational();
0416: rhs = (Expression) expressions.pop();
0417: lhs = (Expression) expressions.pop();
0418: expressions.push(new Expression.LessThanEqual(lhs, rhs));
0419: break;
0420: case GT:
0421: jj_consume_token(GT);
0422: clear();
0423: relational();
0424: rhs = (Expression) expressions.pop();
0425: lhs = (Expression) expressions.pop();
0426: expressions.push(new Expression.GreaterThan(lhs, rhs));
0427: break;
0428: case GTE:
0429: jj_consume_token(GTE);
0430: clear();
0431: relational();
0432: rhs = (Expression) expressions.pop();
0433: lhs = (Expression) expressions.pop();
0434: expressions.push(new Expression.GreaterThanEqual(lhs, rhs));
0435: break;
0436: default:
0437: jj_la1[8] = jj_gen;
0438:
0439: }
0440: }
0441:
0442: final public void additive() throws ParseException {
0443: multiplicative();
0444: _additive();
0445: }
0446:
0447: final public void _additive() throws ParseException {
0448: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0449: case PLUS:
0450: jj_consume_token(PLUS);
0451: clear();
0452: additive();
0453: Expression rhs = (Expression) expressions.pop();
0454: Expression lhs = (Expression) expressions.pop();
0455: expressions.push(new Expression.Add(lhs, rhs));
0456: break;
0457: case MINUS:
0458: jj_consume_token(MINUS);
0459: clear();
0460: additive();
0461: rhs = (Expression) expressions.pop();
0462: lhs = (Expression) expressions.pop();
0463: expressions.push(new Expression.Subtract(lhs, rhs));
0464: break;
0465: default:
0466: jj_la1[9] = jj_gen;
0467:
0468: }
0469: }
0470:
0471: final public void multiplicative() throws ParseException {
0472: unary();
0473: _multiplicative();
0474: }
0475:
0476: final public void _multiplicative() throws ParseException {
0477: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0478: case TIMES:
0479: jj_consume_token(TIMES);
0480: clear();
0481: multiplicative();
0482: Expression rhs = (Expression) expressions.pop();
0483: Expression lhs = (Expression) expressions.pop();
0484: expressions.push(new Expression.Multiply(lhs, rhs));
0485: break;
0486: case DIVIDE:
0487: jj_consume_token(DIVIDE);
0488: clear();
0489: additive();
0490: rhs = (Expression) expressions.pop();
0491: lhs = (Expression) expressions.pop();
0492: expressions.push(new Expression.Divide(lhs, rhs));
0493: break;
0494: default:
0495: jj_la1[10] = jj_gen;
0496:
0497: }
0498: }
0499:
0500: final public void unary() throws ParseException {
0501: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0502: case PLUS:
0503: jj_consume_token(PLUS);
0504: unary();
0505:
0506: break;
0507: case MINUS:
0508: jj_consume_token(MINUS);
0509: unary();
0510: Expression operand = (Expression) expressions.pop();
0511: expressions.push(new Expression.UnaryMinus(operand));
0512: break;
0513: case COMP:
0514: case NOT:
0515: case NULL:
0516: case TRUE:
0517: case FALSE:
0518: case THIS:
0519: case ID:
0520: case LPAREN:
0521: case INTEGER_LITERAL:
0522: case FLOATING_POINT_LITERAL:
0523: case CHARACTER_LITERAL:
0524: case STRING_LITERAL:
0525: unaryNotPlusMinus();
0526: break;
0527: default:
0528: jj_la1[11] = jj_gen;
0529: jj_consume_token(-1);
0530: throw new ParseException();
0531: }
0532: }
0533:
0534: final public void unaryNotPlusMinus() throws ParseException {
0535: if (jj_2_1(3)) {
0536: primary();
0537:
0538: } else {
0539: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0540: case COMP:
0541: jj_consume_token(COMP);
0542: unary();
0543: Expression operand = (Expression) expressions.pop();
0544: expressions.push(new Expression.BitwiseComplement(
0545: operand));
0546: break;
0547: case NOT:
0548: jj_consume_token(NOT);
0549: unary();
0550: operand = (Expression) expressions.pop();
0551: expressions.push(new Expression.Not(operand));
0552: break;
0553: case LPAREN:
0554: cast();
0555:
0556: break;
0557: default:
0558: jj_la1[12] = jj_gen;
0559: jj_consume_token(-1);
0560: throw new ParseException();
0561: }
0562: }
0563: }
0564:
0565: final public void cast() throws ParseException {
0566: jj_consume_token(LPAREN);
0567: type();
0568: jj_consume_token(RPAREN);
0569: unary();
0570:
0571: }
0572:
0573: final public void type() throws ParseException {
0574: Token t;
0575: t = jj_consume_token(ID);
0576: System.out.println("type == " + t.image);
0577: }
0578:
0579: final public void primary() throws ParseException {
0580: Token t;
0581: if (jj_2_2(2)) {
0582: literal();
0583: _primary();
0584:
0585: } else if (jj_2_3(2)) {
0586: jj_consume_token(THIS);
0587: _primary();
0588:
0589: } else {
0590: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0591: case ID:
0592: t = jj_consume_token(ID);
0593: _primary();
0594: // We need to determine if this is a field, parameter,
0595: // or variable.
0596: Expression here = null;
0597:
0598: // It might be a variable or parameter
0599: Class clazz;
0600: if ((clazz = getVariableType(t.image)) != null) {
0601: here = new Expression.Variable(t.image, clazz);
0602: } else if ((clazz = getParameterType(t.image)) != null) {
0603: here = new Expression.Parameter(t.image, clazz);
0604: } else {
0605: // It's a field
0606: // TODO resolve class type from mapping info
0607: here = new Expression.FieldAccess(
0608: Expression.FieldAccess.THIS, t.image, null);
0609: }
0610: doMember(here);
0611: break;
0612: default:
0613: jj_la1[13] = jj_gen;
0614: if (jj_2_4(3)) {
0615: jj_consume_token(LPAREN);
0616: expression();
0617: jj_consume_token(RPAREN);
0618: _primary();
0619:
0620: } else {
0621: jj_consume_token(-1);
0622: throw new ParseException();
0623: }
0624: }
0625: }
0626: }
0627:
0628: final public void _primary() throws ParseException {
0629: Token t;
0630: if (jj_2_5(3)) {
0631: jj_consume_token(DOT);
0632: t = jj_consume_token(ID);
0633: jj_consume_token(LPAREN);
0634: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0635: case COMP:
0636: case NOT:
0637: case NULL:
0638: case TRUE:
0639: case FALSE:
0640: case THIS:
0641: case ID:
0642: case LPAREN:
0643: case MINUS:
0644: case PLUS:
0645: case INTEGER_LITERAL:
0646: case FLOATING_POINT_LITERAL:
0647: case CHARACTER_LITERAL:
0648: case STRING_LITERAL:
0649: argumentList();
0650: break;
0651: default:
0652: jj_la1[14] = jj_gen;
0653: ;
0654: }
0655: jj_consume_token(RPAREN);
0656: _primary();
0657: Expression[] params;
0658: if ("startsWith".equals(t.image)
0659: || "endsWith".equals(t.image)
0660: || "contains".equals(t.image)
0661: || "strstr".equals(t.image)
0662: || "indexOf".equals(t.image)) {
0663: params = new Expression[] { (Expression) expressions
0664: .pop() };
0665: } else {
0666: params = new Expression[0];
0667: }
0668:
0669: Expression here = new Expression.MethodCall(
0670: Expression.FieldAccess.THIS, t.image, params,
0671: Boolean.class);
0672: expressions.push(here);
0673: working = true;
0674: } else if (jj_2_6(3)) {
0675: jj_consume_token(DOT);
0676: t = jj_consume_token(ID);
0677: _primary();
0678: Expression here = new Expression.FieldAccess(
0679: Expression.FieldAccess.THIS, t.image, null);
0680: doMember(here);
0681: } else {
0682:
0683: }
0684: }
0685:
0686: final public void argumentList() throws ParseException {
0687: expression();
0688: _argumentList();
0689: }
0690:
0691: final public void _argumentList() throws ParseException {
0692: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0693: case COMMA:
0694: jj_consume_token(COMMA);
0695: clear();
0696: argumentList();
0697: break;
0698: default:
0699: jj_la1[15] = jj_gen;
0700:
0701: }
0702: }
0703:
0704: final private boolean jj_2_1(int xla) {
0705: jj_la = xla;
0706: jj_lastpos = jj_scanpos = token;
0707: boolean retval = !jj_3_1();
0708: jj_save(0, xla);
0709: return retval;
0710: }
0711:
0712: final private boolean jj_2_2(int xla) {
0713: jj_la = xla;
0714: jj_lastpos = jj_scanpos = token;
0715: boolean retval = !jj_3_2();
0716: jj_save(1, xla);
0717: return retval;
0718: }
0719:
0720: final private boolean jj_2_3(int xla) {
0721: jj_la = xla;
0722: jj_lastpos = jj_scanpos = token;
0723: boolean retval = !jj_3_3();
0724: jj_save(2, xla);
0725: return retval;
0726: }
0727:
0728: final private boolean jj_2_4(int xla) {
0729: jj_la = xla;
0730: jj_lastpos = jj_scanpos = token;
0731: boolean retval = !jj_3_4();
0732: jj_save(3, xla);
0733: return retval;
0734: }
0735:
0736: final private boolean jj_2_5(int xla) {
0737: jj_la = xla;
0738: jj_lastpos = jj_scanpos = token;
0739: boolean retval = !jj_3_5();
0740: jj_save(4, xla);
0741: return retval;
0742: }
0743:
0744: final private boolean jj_2_6(int xla) {
0745: jj_la = xla;
0746: jj_lastpos = jj_scanpos = token;
0747: boolean retval = !jj_3_6();
0748: jj_save(5, xla);
0749: return retval;
0750: }
0751:
0752: final private boolean jj_3R_24() {
0753: if (jj_scan_token(ANDC))
0754: return true;
0755: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0756: return false;
0757: return false;
0758: }
0759:
0760: final private boolean jj_3R_19() {
0761: Token xsp;
0762: xsp = jj_scanpos;
0763: if (jj_3R_24()) {
0764: jj_scanpos = xsp;
0765: if (jj_3R_25())
0766: return true;
0767: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0768: return false;
0769: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
0770: return false;
0771: return false;
0772: }
0773:
0774: final private boolean jj_3R_15() {
0775: if (jj_scan_token(EOL))
0776: return true;
0777: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0778: return false;
0779: return false;
0780: }
0781:
0782: final private boolean jj_3R_21() {
0783: return false;
0784: }
0785:
0786: final private boolean jj_3R_16() {
0787: if (jj_3R_18())
0788: return true;
0789: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0790: return false;
0791: if (jj_3R_19())
0792: return true;
0793: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0794: return false;
0795: return false;
0796: }
0797:
0798: final private boolean jj_3_5() {
0799: if (jj_scan_token(DOT))
0800: return true;
0801: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0802: return false;
0803: if (jj_scan_token(ID))
0804: return true;
0805: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0806: return false;
0807: if (jj_scan_token(LPAREN))
0808: return true;
0809: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0810: return false;
0811: return false;
0812: }
0813:
0814: final private boolean jj_3R_3() {
0815: Token xsp;
0816: xsp = jj_scanpos;
0817: if (jj_3_5()) {
0818: jj_scanpos = xsp;
0819: if (jj_3_6()) {
0820: jj_scanpos = xsp;
0821: if (jj_3R_13())
0822: return true;
0823: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0824: return false;
0825: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
0826: return false;
0827: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
0828: return false;
0829: return false;
0830: }
0831:
0832: final private boolean jj_3R_20() {
0833: if (jj_scan_token(ORC))
0834: return true;
0835: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0836: return false;
0837: return false;
0838: }
0839:
0840: final private boolean jj_3R_17() {
0841: Token xsp;
0842: xsp = jj_scanpos;
0843: if (jj_3R_20()) {
0844: jj_scanpos = xsp;
0845: if (jj_3R_21())
0846: return true;
0847: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0848: return false;
0849: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
0850: return false;
0851: return false;
0852: }
0853:
0854: final private boolean jj_3_4() {
0855: if (jj_scan_token(LPAREN))
0856: return true;
0857: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0858: return false;
0859: if (jj_3R_4())
0860: return true;
0861: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0862: return false;
0863: if (jj_scan_token(RPAREN))
0864: return true;
0865: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0866: return false;
0867: return false;
0868: }
0869:
0870: final private boolean jj_3R_14() {
0871: if (jj_3R_16())
0872: return true;
0873: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0874: return false;
0875: if (jj_3R_17())
0876: return true;
0877: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0878: return false;
0879: return false;
0880: }
0881:
0882: final private boolean jj_3R_4() {
0883: if (jj_3R_14())
0884: return true;
0885: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0886: return false;
0887: Token xsp;
0888: xsp = jj_scanpos;
0889: if (jj_3R_15())
0890: jj_scanpos = xsp;
0891: else if (jj_la == 0 && jj_scanpos == jj_lastpos)
0892: return false;
0893: return false;
0894: }
0895:
0896: final private boolean jj_3R_5() {
0897: if (jj_scan_token(ID))
0898: return true;
0899: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0900: return false;
0901: if (jj_3R_3())
0902: return true;
0903: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0904: return false;
0905: return false;
0906: }
0907:
0908: final private boolean jj_3_3() {
0909: if (jj_scan_token(THIS))
0910: return true;
0911: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0912: return false;
0913: if (jj_3R_3())
0914: return true;
0915: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0916: return false;
0917: return false;
0918: }
0919:
0920: final private boolean jj_3R_12() {
0921: if (jj_scan_token(FALSE))
0922: return true;
0923: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0924: return false;
0925: return false;
0926: }
0927:
0928: final private boolean jj_3R_11() {
0929: if (jj_scan_token(TRUE))
0930: return true;
0931: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0932: return false;
0933: return false;
0934: }
0935:
0936: final private boolean jj_3R_1() {
0937: Token xsp;
0938: xsp = jj_scanpos;
0939: if (jj_3_2()) {
0940: jj_scanpos = xsp;
0941: if (jj_3_3()) {
0942: jj_scanpos = xsp;
0943: if (jj_3R_5()) {
0944: jj_scanpos = xsp;
0945: if (jj_3_4())
0946: return true;
0947: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0948: return false;
0949: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
0950: return false;
0951: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
0952: return false;
0953: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
0954: return false;
0955: return false;
0956: }
0957:
0958: final private boolean jj_3_2() {
0959: if (jj_3R_2())
0960: return true;
0961: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0962: return false;
0963: if (jj_3R_3())
0964: return true;
0965: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0966: return false;
0967: return false;
0968: }
0969:
0970: final private boolean jj_3R_10() {
0971: if (jj_scan_token(NULL))
0972: return true;
0973: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0974: return false;
0975: return false;
0976: }
0977:
0978: final private boolean jj_3R_9() {
0979: if (jj_scan_token(CHARACTER_LITERAL))
0980: return true;
0981: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0982: return false;
0983: return false;
0984: }
0985:
0986: final private boolean jj_3R_66() {
0987: if (jj_scan_token(ID))
0988: return true;
0989: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0990: return false;
0991: return false;
0992: }
0993:
0994: final private boolean jj_3R_8() {
0995: if (jj_scan_token(STRING_LITERAL))
0996: return true;
0997: if (jj_la == 0 && jj_scanpos == jj_lastpos)
0998: return false;
0999: return false;
1000: }
1001:
1002: final private boolean jj_3R_65() {
1003: if (jj_scan_token(LPAREN))
1004: return true;
1005: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1006: return false;
1007: if (jj_3R_66())
1008: return true;
1009: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1010: return false;
1011: return false;
1012: }
1013:
1014: final private boolean jj_3R_64() {
1015: if (jj_3R_65())
1016: return true;
1017: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1018: return false;
1019: return false;
1020: }
1021:
1022: final private boolean jj_3R_63() {
1023: if (jj_scan_token(NOT))
1024: return true;
1025: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1026: return false;
1027: if (jj_3R_50())
1028: return true;
1029: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1030: return false;
1031: return false;
1032: }
1033:
1034: final private boolean jj_3R_62() {
1035: if (jj_scan_token(COMP))
1036: return true;
1037: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1038: return false;
1039: if (jj_3R_50())
1040: return true;
1041: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1042: return false;
1043: return false;
1044: }
1045:
1046: final private boolean jj_3R_7() {
1047: if (jj_scan_token(INTEGER_LITERAL))
1048: return true;
1049: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1050: return false;
1051: return false;
1052: }
1053:
1054: final private boolean jj_3_1() {
1055: if (jj_3R_1())
1056: return true;
1057: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1058: return false;
1059: return false;
1060: }
1061:
1062: final private boolean jj_3R_57() {
1063: if (jj_3R_61())
1064: return true;
1065: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1066: return false;
1067: return false;
1068: }
1069:
1070: final private boolean jj_3R_61() {
1071: Token xsp;
1072: xsp = jj_scanpos;
1073: if (jj_3_1()) {
1074: jj_scanpos = xsp;
1075: if (jj_3R_62()) {
1076: jj_scanpos = xsp;
1077: if (jj_3R_63()) {
1078: jj_scanpos = xsp;
1079: if (jj_3R_64())
1080: return true;
1081: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1082: return false;
1083: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1084: return false;
1085: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1086: return false;
1087: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1088: return false;
1089: return false;
1090: }
1091:
1092: final private boolean jj_3R_56() {
1093: if (jj_scan_token(MINUS))
1094: return true;
1095: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1096: return false;
1097: if (jj_3R_50())
1098: return true;
1099: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1100: return false;
1101: return false;
1102: }
1103:
1104: final private boolean jj_3R_50() {
1105: Token xsp;
1106: xsp = jj_scanpos;
1107: if (jj_3R_55()) {
1108: jj_scanpos = xsp;
1109: if (jj_3R_56()) {
1110: jj_scanpos = xsp;
1111: if (jj_3R_57())
1112: return true;
1113: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1114: return false;
1115: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1116: return false;
1117: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1118: return false;
1119: return false;
1120: }
1121:
1122: final private boolean jj_3R_55() {
1123: if (jj_scan_token(PLUS))
1124: return true;
1125: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1126: return false;
1127: if (jj_3R_50())
1128: return true;
1129: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1130: return false;
1131: return false;
1132: }
1133:
1134: final private boolean jj_3R_60() {
1135: return false;
1136: }
1137:
1138: final private boolean jj_3R_59() {
1139: if (jj_scan_token(DIVIDE))
1140: return true;
1141: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1142: return false;
1143: return false;
1144: }
1145:
1146: final private boolean jj_3R_2() {
1147: Token xsp;
1148: xsp = jj_scanpos;
1149: if (jj_3R_6()) {
1150: jj_scanpos = xsp;
1151: if (jj_3R_7()) {
1152: jj_scanpos = xsp;
1153: if (jj_3R_8()) {
1154: jj_scanpos = xsp;
1155: if (jj_3R_9()) {
1156: jj_scanpos = xsp;
1157: if (jj_3R_10()) {
1158: jj_scanpos = xsp;
1159: if (jj_3R_11()) {
1160: jj_scanpos = xsp;
1161: if (jj_3R_12())
1162: return true;
1163: if (jj_la == 0
1164: && jj_scanpos == jj_lastpos)
1165: return false;
1166: } else if (jj_la == 0
1167: && jj_scanpos == jj_lastpos)
1168: return false;
1169: } else if (jj_la == 0
1170: && jj_scanpos == jj_lastpos)
1171: return false;
1172: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1173: return false;
1174: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1175: return false;
1176: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1177: return false;
1178: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1179: return false;
1180: return false;
1181: }
1182:
1183: final private boolean jj_3R_6() {
1184: if (jj_scan_token(FLOATING_POINT_LITERAL))
1185: return true;
1186: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1187: return false;
1188: return false;
1189: }
1190:
1191: final private boolean jj_3R_51() {
1192: Token xsp;
1193: xsp = jj_scanpos;
1194: if (jj_3R_58()) {
1195: jj_scanpos = xsp;
1196: if (jj_3R_59()) {
1197: jj_scanpos = xsp;
1198: if (jj_3R_60())
1199: return true;
1200: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1201: return false;
1202: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1203: return false;
1204: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1205: return false;
1206: return false;
1207: }
1208:
1209: final private boolean jj_3R_58() {
1210: if (jj_scan_token(TIMES))
1211: return true;
1212: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1213: return false;
1214: return false;
1215: }
1216:
1217: final private boolean jj_3R_43() {
1218: if (jj_3R_50())
1219: return true;
1220: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1221: return false;
1222: if (jj_3R_51())
1223: return true;
1224: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1225: return false;
1226: return false;
1227: }
1228:
1229: final private boolean jj_3R_54() {
1230: return false;
1231: }
1232:
1233: final private boolean jj_3R_53() {
1234: if (jj_scan_token(MINUS))
1235: return true;
1236: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1237: return false;
1238: return false;
1239: }
1240:
1241: final private boolean jj_3R_44() {
1242: Token xsp;
1243: xsp = jj_scanpos;
1244: if (jj_3R_52()) {
1245: jj_scanpos = xsp;
1246: if (jj_3R_53()) {
1247: jj_scanpos = xsp;
1248: if (jj_3R_54())
1249: return true;
1250: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1251: return false;
1252: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1253: return false;
1254: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1255: return false;
1256: return false;
1257: }
1258:
1259: final private boolean jj_3R_52() {
1260: if (jj_scan_token(PLUS))
1261: return true;
1262: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1263: return false;
1264: return false;
1265: }
1266:
1267: final private boolean jj_3R_38() {
1268: if (jj_3R_43())
1269: return true;
1270: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1271: return false;
1272: if (jj_3R_44())
1273: return true;
1274: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1275: return false;
1276: return false;
1277: }
1278:
1279: final private boolean jj_3R_49() {
1280: return false;
1281: }
1282:
1283: final private boolean jj_3R_48() {
1284: if (jj_scan_token(GTE))
1285: return true;
1286: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1287: return false;
1288: return false;
1289: }
1290:
1291: final private boolean jj_3R_47() {
1292: if (jj_scan_token(GT))
1293: return true;
1294: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1295: return false;
1296: return false;
1297: }
1298:
1299: final private boolean jj_3R_46() {
1300: if (jj_scan_token(LTE))
1301: return true;
1302: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1303: return false;
1304: return false;
1305: }
1306:
1307: final private boolean jj_3R_39() {
1308: Token xsp;
1309: xsp = jj_scanpos;
1310: if (jj_3R_45()) {
1311: jj_scanpos = xsp;
1312: if (jj_3R_46()) {
1313: jj_scanpos = xsp;
1314: if (jj_3R_47()) {
1315: jj_scanpos = xsp;
1316: if (jj_3R_48()) {
1317: jj_scanpos = xsp;
1318: if (jj_3R_49())
1319: return true;
1320: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1321: return false;
1322: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1323: return false;
1324: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1325: return false;
1326: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1327: return false;
1328: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1329: return false;
1330: return false;
1331: }
1332:
1333: final private boolean jj_3R_45() {
1334: if (jj_scan_token(LT))
1335: return true;
1336: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1337: return false;
1338: return false;
1339: }
1340:
1341: final private boolean jj_3R_34() {
1342: if (jj_3R_38())
1343: return true;
1344: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1345: return false;
1346: if (jj_3R_39())
1347: return true;
1348: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1349: return false;
1350: return false;
1351: }
1352:
1353: final private boolean jj_3R_42() {
1354: return false;
1355: }
1356:
1357: final private boolean jj_3R_41() {
1358: if (jj_scan_token(NE))
1359: return true;
1360: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1361: return false;
1362: return false;
1363: }
1364:
1365: final private boolean jj_3R_35() {
1366: Token xsp;
1367: xsp = jj_scanpos;
1368: if (jj_3R_40()) {
1369: jj_scanpos = xsp;
1370: if (jj_3R_41()) {
1371: jj_scanpos = xsp;
1372: if (jj_3R_42())
1373: return true;
1374: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1375: return false;
1376: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1377: return false;
1378: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1379: return false;
1380: return false;
1381: }
1382:
1383: final private boolean jj_3R_40() {
1384: if (jj_scan_token(EQ))
1385: return true;
1386: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1387: return false;
1388: return false;
1389: }
1390:
1391: final private boolean jj_3R_30() {
1392: if (jj_3R_34())
1393: return true;
1394: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1395: return false;
1396: if (jj_3R_35())
1397: return true;
1398: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1399: return false;
1400: return false;
1401: }
1402:
1403: final private boolean jj_3R_37() {
1404: return false;
1405: }
1406:
1407: final private boolean jj_3R_31() {
1408: Token xsp;
1409: xsp = jj_scanpos;
1410: if (jj_3R_36()) {
1411: jj_scanpos = xsp;
1412: if (jj_3R_37())
1413: return true;
1414: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1415: return false;
1416: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1417: return false;
1418: return false;
1419: }
1420:
1421: final private boolean jj_3R_36() {
1422: if (jj_scan_token(ANDL))
1423: return true;
1424: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1425: return false;
1426: return false;
1427: }
1428:
1429: final private boolean jj_3R_26() {
1430: if (jj_3R_30())
1431: return true;
1432: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1433: return false;
1434: if (jj_3R_31())
1435: return true;
1436: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1437: return false;
1438: return false;
1439: }
1440:
1441: final private boolean jj_3R_33() {
1442: return false;
1443: }
1444:
1445: final private boolean jj_3R_27() {
1446: Token xsp;
1447: xsp = jj_scanpos;
1448: if (jj_3R_32()) {
1449: jj_scanpos = xsp;
1450: if (jj_3R_33())
1451: return true;
1452: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1453: return false;
1454: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1455: return false;
1456: return false;
1457: }
1458:
1459: final private boolean jj_3R_32() {
1460: if (jj_scan_token(XOR))
1461: return true;
1462: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1463: return false;
1464: return false;
1465: }
1466:
1467: final private boolean jj_3R_29() {
1468: return false;
1469: }
1470:
1471: final private boolean jj_3R_22() {
1472: if (jj_3R_26())
1473: return true;
1474: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1475: return false;
1476: if (jj_3R_27())
1477: return true;
1478: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1479: return false;
1480: return false;
1481: }
1482:
1483: final private boolean jj_3R_28() {
1484: if (jj_scan_token(ORL))
1485: return true;
1486: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1487: return false;
1488: return false;
1489: }
1490:
1491: final private boolean jj_3R_23() {
1492: Token xsp;
1493: xsp = jj_scanpos;
1494: if (jj_3R_28()) {
1495: jj_scanpos = xsp;
1496: if (jj_3R_29())
1497: return true;
1498: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1499: return false;
1500: } else if (jj_la == 0 && jj_scanpos == jj_lastpos)
1501: return false;
1502: return false;
1503: }
1504:
1505: final private boolean jj_3R_13() {
1506: return false;
1507: }
1508:
1509: final private boolean jj_3R_25() {
1510: return false;
1511: }
1512:
1513: final private boolean jj_3R_18() {
1514: if (jj_3R_22())
1515: return true;
1516: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1517: return false;
1518: if (jj_3R_23())
1519: return true;
1520: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1521: return false;
1522: return false;
1523: }
1524:
1525: final private boolean jj_3_6() {
1526: if (jj_scan_token(DOT))
1527: return true;
1528: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1529: return false;
1530: if (jj_scan_token(ID))
1531: return true;
1532: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1533: return false;
1534: if (jj_3R_3())
1535: return true;
1536: if (jj_la == 0 && jj_scanpos == jj_lastpos)
1537: return false;
1538: return false;
1539: }
1540:
1541: public JDOQLTokenManager token_source;
1542: SimpleCharStream jj_input_stream;
1543: public Token token, jj_nt;
1544: private int jj_ntk;
1545: private Token jj_scanpos, jj_lastpos;
1546: private int jj_la;
1547: public boolean lookingAhead = false;
1548: private boolean jj_semLA;
1549: private int jj_gen;
1550: final private int[] jj_la1 = new int[16];
1551: final private int[] jj_la1_0 = { 0xe0000, 0x0, 0x1000, 0x400,
1552: 0x2000, 0x4000, 0x800, 0x30, 0x3c0, 0x30000000, 0xc0000000,
1553: 0x323f8000, 0x2018000, 0x200000, 0x323f8000, 0x0, };
1554: final private int[] jj_la1_1 = { 0x6a0, 0x1, 0x0, 0x0, 0x0, 0x0,
1555: 0x0, 0x0, 0x0, 0x0, 0x0, 0x6a0, 0x0, 0x0, 0x6a0, 0x2, };
1556: final private JJCalls[] jj_2_rtns = new JJCalls[6];
1557: private boolean jj_rescan = false;
1558: private int jj_gc = 0;
1559:
1560: public JDOQL(java.io.InputStream stream) {
1561: jj_input_stream = new SimpleCharStream(stream, 1, 1);
1562: token_source = new JDOQLTokenManager(jj_input_stream);
1563: token = new Token();
1564: jj_ntk = -1;
1565: jj_gen = 0;
1566: for (int i = 0; i < 16; i++)
1567: jj_la1[i] = -1;
1568: for (int i = 0; i < jj_2_rtns.length; i++)
1569: jj_2_rtns[i] = new JJCalls();
1570: }
1571:
1572: public void ReInit(java.io.InputStream stream) {
1573: jj_input_stream.ReInit(stream, 1, 1);
1574: token_source.ReInit(jj_input_stream);
1575: token = new Token();
1576: jj_ntk = -1;
1577: jj_gen = 0;
1578: for (int i = 0; i < 16; i++)
1579: jj_la1[i] = -1;
1580: for (int i = 0; i < jj_2_rtns.length; i++)
1581: jj_2_rtns[i] = new JJCalls();
1582: }
1583:
1584: public JDOQL(java.io.Reader stream) {
1585: jj_input_stream = new SimpleCharStream(stream, 1, 1);
1586: token_source = new JDOQLTokenManager(jj_input_stream);
1587: token = new Token();
1588: jj_ntk = -1;
1589: jj_gen = 0;
1590: for (int i = 0; i < 16; i++)
1591: jj_la1[i] = -1;
1592: for (int i = 0; i < jj_2_rtns.length; i++)
1593: jj_2_rtns[i] = new JJCalls();
1594: }
1595:
1596: public void ReInit(java.io.Reader stream) {
1597: jj_input_stream.ReInit(stream, 1, 1);
1598: token_source.ReInit(jj_input_stream);
1599: token = new Token();
1600: jj_ntk = -1;
1601: jj_gen = 0;
1602: for (int i = 0; i < 16; i++)
1603: jj_la1[i] = -1;
1604: for (int i = 0; i < jj_2_rtns.length; i++)
1605: jj_2_rtns[i] = new JJCalls();
1606: }
1607:
1608: public JDOQL(JDOQLTokenManager tm) {
1609: token_source = tm;
1610: token = new Token();
1611: jj_ntk = -1;
1612: jj_gen = 0;
1613: for (int i = 0; i < 16; i++)
1614: jj_la1[i] = -1;
1615: for (int i = 0; i < jj_2_rtns.length; i++)
1616: jj_2_rtns[i] = new JJCalls();
1617: }
1618:
1619: public void ReInit(JDOQLTokenManager tm) {
1620: token_source = tm;
1621: token = new Token();
1622: jj_ntk = -1;
1623: jj_gen = 0;
1624: for (int i = 0; i < 16; i++)
1625: jj_la1[i] = -1;
1626: for (int i = 0; i < jj_2_rtns.length; i++)
1627: jj_2_rtns[i] = new JJCalls();
1628: }
1629:
1630: final private Token jj_consume_token(int kind)
1631: throws ParseException {
1632: Token oldToken;
1633: if ((oldToken = token).next != null)
1634: token = token.next;
1635: else
1636: token = token.next = token_source.getNextToken();
1637: jj_ntk = -1;
1638: if (token.kind == kind) {
1639: jj_gen++;
1640: if (++jj_gc > 100) {
1641: jj_gc = 0;
1642: for (int i = 0; i < jj_2_rtns.length; i++) {
1643: JJCalls c = jj_2_rtns[i];
1644: while (c != null) {
1645: if (c.gen < jj_gen)
1646: c.first = null;
1647: c = c.next;
1648: }
1649: }
1650: }
1651: return token;
1652: }
1653: token = oldToken;
1654: jj_kind = kind;
1655: throw generateParseException();
1656: }
1657:
1658: final private boolean jj_scan_token(int kind) {
1659: if (jj_scanpos == jj_lastpos) {
1660: jj_la--;
1661: if (jj_scanpos.next == null) {
1662: jj_lastpos = jj_scanpos = jj_scanpos.next = token_source
1663: .getNextToken();
1664: } else {
1665: jj_lastpos = jj_scanpos = jj_scanpos.next;
1666: }
1667: } else {
1668: jj_scanpos = jj_scanpos.next;
1669: }
1670: if (jj_rescan) {
1671: int i = 0;
1672: Token tok = token;
1673: while (tok != null && tok != jj_scanpos) {
1674: i++;
1675: tok = tok.next;
1676: }
1677: if (tok != null)
1678: jj_add_error_token(kind, i);
1679: }
1680: return (jj_scanpos.kind != kind);
1681: }
1682:
1683: final public Token getNextToken() {
1684: if (token.next != null)
1685: token = token.next;
1686: else
1687: token = token.next = token_source.getNextToken();
1688: jj_ntk = -1;
1689: jj_gen++;
1690: return token;
1691: }
1692:
1693: final public Token getToken(int index) {
1694: Token t = lookingAhead ? jj_scanpos : token;
1695: for (int i = 0; i < index; i++) {
1696: if (t.next != null)
1697: t = t.next;
1698: else
1699: t = t.next = token_source.getNextToken();
1700: }
1701: return t;
1702: }
1703:
1704: final private int jj_ntk() {
1705: if ((jj_nt = token.next) == null)
1706: return (jj_ntk = (token.next = token_source.getNextToken()).kind);
1707: else
1708: return (jj_ntk = jj_nt.kind);
1709: }
1710:
1711: private java.util.Vector jj_expentries = new java.util.Vector();
1712: private int[] jj_expentry;
1713: private int jj_kind = -1;
1714: private int[] jj_lasttokens = new int[100];
1715: private int jj_endpos;
1716:
1717: private void jj_add_error_token(int kind, int pos) {
1718: if (pos >= 100) return;
1719: if (pos == jj_endpos + 1) {
1720: jj_lasttokens[jj_endpos++] = kind;
1721: } else if (jj_endpos != 0) {
1722: jj_expentry = new int[jj_endpos];
1723: for (int i = 0; i < jj_endpos; i++) {
1724: jj_expentry[i] = jj_lasttokens[i];
1725: }
1726: boolean exists = false;
1727: for (java.util.Enumeration enum = jj_expentries.elements(); enum.hasMoreElements();) {
1728: int[] oldentry = (int[])(enum.nextElement());
1729: if (oldentry.length == jj_expentry.length) {
1730: exists = true;
1731: for (int i = 0; i < jj_expentry.length; i++) {
1732: if (oldentry[i] != jj_expentry[i]) {
1733: exists = false;
1734: break;
1735: }
1736: }
1737: if (exists) break;
1738: }
1739: }
1740: if (!exists) jj_expentries.addElement(jj_expentry);
1741: if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
1742: }
1743: }
1744:
1745: final public ParseException generateParseException() {
1746: jj_expentries.removeAllElements();
1747: boolean[] la1tokens = new boolean[43];
1748: for (int i = 0; i < 43; i++) {
1749: la1tokens[i] = false;
1750: }
1751: if (jj_kind >= 0) {
1752: la1tokens[jj_kind] = true;
1753: jj_kind = -1;
1754: }
1755: for (int i = 0; i < 16; i++) {
1756: if (jj_la1[i] == jj_gen) {
1757: for (int j = 0; j < 32; j++) {
1758: if ((jj_la1_0[i] & (1 << j)) != 0) {
1759: la1tokens[j] = true;
1760: }
1761: if ((jj_la1_1[i] & (1 << j)) != 0) {
1762: la1tokens[32 + j] = true;
1763: }
1764: }
1765: }
1766: }
1767: for (int i = 0; i < 43; i++) {
1768: if (la1tokens[i]) {
1769: jj_expentry = new int[1];
1770: jj_expentry[0] = i;
1771: jj_expentries.addElement(jj_expentry);
1772: }
1773: }
1774: jj_endpos = 0;
1775: jj_rescan_token();
1776: jj_add_error_token(0, 0);
1777: int[][] exptokseq = new int[jj_expentries.size()][];
1778: for (int i = 0; i < jj_expentries.size(); i++) {
1779: exptokseq[i] = (int[]) jj_expentries.elementAt(i);
1780: }
1781: return new ParseException(token, exptokseq, tokenImage);
1782: }
1783:
1784: final public void enable_tracing() {
1785: }
1786:
1787: final public void disable_tracing() {
1788: }
1789:
1790: final private void jj_rescan_token() {
1791: jj_rescan = true;
1792: for (int i = 0; i < 6; i++) {
1793: JJCalls p = jj_2_rtns[i];
1794: do {
1795: if (p.gen > jj_gen) {
1796: jj_la = p.arg;
1797: jj_lastpos = jj_scanpos = p.first;
1798: switch (i) {
1799: case 0:
1800: jj_3_1();
1801: break;
1802: case 1:
1803: jj_3_2();
1804: break;
1805: case 2:
1806: jj_3_3();
1807: break;
1808: case 3:
1809: jj_3_4();
1810: break;
1811: case 4:
1812: jj_3_5();
1813: break;
1814: case 5:
1815: jj_3_6();
1816: break;
1817: }
1818: }
1819: p = p.next;
1820: } while (p != null);
1821: }
1822: jj_rescan = false;
1823: }
1824:
1825: final private void jj_save(int index, int xla) {
1826: JJCalls p = jj_2_rtns[index];
1827: while (p.gen > jj_gen) {
1828: if (p.next == null) {
1829: p = p.next = new JJCalls();
1830: break;
1831: }
1832: p = p.next;
1833: }
1834: p.gen = jj_gen + xla - jj_la;
1835: p.first = token;
1836: p.arg = xla;
1837: }
1838:
1839: static final class JJCalls {
1840: int gen;
1841: Token first;
1842: int arg;
1843: JJCalls next;
1844: }
1845:
1846: }
|