0001: /* Generated By:JJTree&JavaCC: Do not edit this line. SyntaxTreeBuilder.java */
0002: package org.openrdf.query.parser.serql.ast;
0003:
0004: import java.io.StringReader;
0005:
0006: import org.openrdf.query.algebra.Compare.CompareOp;
0007: import org.openrdf.model.vocabulary.XMLSchema;
0008:
0009: public class SyntaxTreeBuilder/*@bgen(jjtree)*/implements
0010: SyntaxTreeBuilderTreeConstants, SyntaxTreeBuilderConstants {/*@bgen(jjtree)*/
0011: protected JJTSyntaxTreeBuilderState jjtree = new JJTSyntaxTreeBuilderState();
0012:
0013: /**
0014: * Parses the supplied SeRQL query and builds a syntax tree from it.
0015: *
0016: * @param query A SeRQL query string.
0017: * @return The root of the syntax tree.
0018: * @throws TokenMgrError If the query was syntactically incorrect.
0019: * @throws ParseException If the query was syntactically incorrect.
0020: */
0021: public static ASTQueryContainer parseQuery(String query)
0022: throws TokenMgrError, ParseException {
0023: SyntaxTreeBuilder stb = new SyntaxTreeBuilder(new StringReader(
0024: query));
0025: return stb.QueryContainer();
0026: }
0027:
0028: /**
0029: * Trims the first and last character from the supplied string.
0030: */
0031: private static String _trimString(String s) {
0032: if (s.length() >= 2) {
0033: s = s.substring(1, s.length() - 1);
0034: }
0035: return s;
0036: }
0037:
0038: final public ASTQueryContainer QueryContainer()
0039: throws ParseException {
0040: /*@bgen(jjtree) QueryContainer */
0041: ASTQueryContainer jjtn000 = new ASTQueryContainer(
0042: JJTQUERYCONTAINER);
0043: boolean jjtc000 = true;
0044: jjtree.openNodeScope(jjtn000);
0045: try {
0046: Query();
0047: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0048: case USING:
0049: NamespaceDeclList();
0050: break;
0051: default:
0052: jj_la1[0] = jj_gen;
0053: ;
0054: }
0055: jj_consume_token(0);
0056: jjtree.closeNodeScope(jjtn000, true);
0057: jjtc000 = false;
0058: {
0059: if (true)
0060: return jjtn000;
0061: }
0062: } catch (Throwable jjte000) {
0063: if (jjtc000) {
0064: jjtree.clearNodeScope(jjtn000);
0065: jjtc000 = false;
0066: } else {
0067: jjtree.popNode();
0068: }
0069: if (jjte000 instanceof RuntimeException) {
0070: {
0071: if (true)
0072: throw (RuntimeException) jjte000;
0073: }
0074: }
0075: if (jjte000 instanceof ParseException) {
0076: {
0077: if (true)
0078: throw (ParseException) jjte000;
0079: }
0080: }
0081: {
0082: if (true)
0083: throw (Error) jjte000;
0084: }
0085: } finally {
0086: if (jjtc000) {
0087: jjtree.closeNodeScope(jjtn000, true);
0088: }
0089: }
0090: throw new Error("Missing return statement in function");
0091: }
0092:
0093: final public void NamespaceDeclList() throws ParseException {
0094: jj_consume_token(USING);
0095: jj_consume_token(NAMESPACE);
0096: NamespaceDecl();
0097: label_1: while (true) {
0098: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0099: case COMMA:
0100: ;
0101: break;
0102: default:
0103: jj_la1[1] = jj_gen;
0104: break label_1;
0105: }
0106: jj_consume_token(COMMA);
0107: NamespaceDecl();
0108: }
0109: }
0110:
0111: final public void NamespaceDecl() throws ParseException {
0112: /*@bgen(jjtree) NamespaceDecl */
0113: ASTNamespaceDecl jjtn000 = new ASTNamespaceDecl(
0114: JJTNAMESPACEDECL);
0115: boolean jjtc000 = true;
0116: jjtree.openNodeScope(jjtn000);
0117: Token prefix;
0118: try {
0119: prefix = jj_consume_token(PREFIX_NAME);
0120: jj_consume_token(EQ);
0121: URI();
0122: jjtree.closeNodeScope(jjtn000, true);
0123: jjtc000 = false;
0124: jjtn000.setPrefix(prefix.image);
0125: } catch (Throwable jjte000) {
0126: if (jjtc000) {
0127: jjtree.clearNodeScope(jjtn000);
0128: jjtc000 = false;
0129: } else {
0130: jjtree.popNode();
0131: }
0132: if (jjte000 instanceof RuntimeException) {
0133: {
0134: if (true)
0135: throw (RuntimeException) jjte000;
0136: }
0137: }
0138: if (jjte000 instanceof ParseException) {
0139: {
0140: if (true)
0141: throw (ParseException) jjte000;
0142: }
0143: }
0144: {
0145: if (true)
0146: throw (Error) jjte000;
0147: }
0148: } finally {
0149: if (jjtc000) {
0150: jjtree.closeNodeScope(jjtn000, true);
0151: }
0152: }
0153: }
0154:
0155: final public void Query() throws ParseException {
0156: if (jj_2_1(2147483647)) {
0157: TupleQuerySet();
0158: } else {
0159: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0160: case LPAREN:
0161: case CONSTRUCT:
0162: GraphQuerySet();
0163: break;
0164: default:
0165: jj_la1[2] = jj_gen;
0166: jj_consume_token(-1);
0167: throw new ParseException();
0168: }
0169: }
0170: }
0171:
0172: final public void TupleQuerySet() throws ParseException {
0173: boolean distinct = true;
0174: TupleQuery();
0175: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0176: case UNION:
0177: case MINUS:
0178: case INTERSECT:
0179: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0180: case UNION:
0181: jj_consume_token(UNION);
0182: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0183: case ALL:
0184: jj_consume_token(ALL);
0185: distinct = false;
0186: break;
0187: default:
0188: jj_la1[3] = jj_gen;
0189: ;
0190: }
0191: TupleQuerySet();
0192: ASTTupleUnion jjtn001 = new ASTTupleUnion(JJTTUPLEUNION);
0193: boolean jjtc001 = true;
0194: jjtree.openNodeScope(jjtn001);
0195: try {
0196: jjtree.closeNodeScope(jjtn001, 2);
0197: jjtc001 = false;
0198: jjtn001.setDistinct(distinct);
0199: } finally {
0200: if (jjtc001) {
0201: jjtree.closeNodeScope(jjtn001, 2);
0202: }
0203: }
0204: break;
0205: case MINUS:
0206: jj_consume_token(MINUS);
0207: ASTTupleMinus jjtn002 = new ASTTupleMinus(JJTTUPLEMINUS);
0208: boolean jjtc002 = true;
0209: jjtree.openNodeScope(jjtn002);
0210: try {
0211: TupleQuerySet();
0212: } catch (Throwable jjte002) {
0213: if (jjtc002) {
0214: jjtree.clearNodeScope(jjtn002);
0215: jjtc002 = false;
0216: } else {
0217: jjtree.popNode();
0218: }
0219: if (jjte002 instanceof RuntimeException) {
0220: {
0221: if (true)
0222: throw (RuntimeException) jjte002;
0223: }
0224: }
0225: if (jjte002 instanceof ParseException) {
0226: {
0227: if (true)
0228: throw (ParseException) jjte002;
0229: }
0230: }
0231: {
0232: if (true)
0233: throw (Error) jjte002;
0234: }
0235: } finally {
0236: if (jjtc002) {
0237: jjtree.closeNodeScope(jjtn002, 2);
0238: }
0239: }
0240: break;
0241: case INTERSECT:
0242: jj_consume_token(INTERSECT);
0243: ASTTupleIntersect jjtn003 = new ASTTupleIntersect(
0244: JJTTUPLEINTERSECT);
0245: boolean jjtc003 = true;
0246: jjtree.openNodeScope(jjtn003);
0247: try {
0248: TupleQuerySet();
0249: } catch (Throwable jjte003) {
0250: if (jjtc003) {
0251: jjtree.clearNodeScope(jjtn003);
0252: jjtc003 = false;
0253: } else {
0254: jjtree.popNode();
0255: }
0256: if (jjte003 instanceof RuntimeException) {
0257: {
0258: if (true)
0259: throw (RuntimeException) jjte003;
0260: }
0261: }
0262: if (jjte003 instanceof ParseException) {
0263: {
0264: if (true)
0265: throw (ParseException) jjte003;
0266: }
0267: }
0268: {
0269: if (true)
0270: throw (Error) jjte003;
0271: }
0272: } finally {
0273: if (jjtc003) {
0274: jjtree.closeNodeScope(jjtn003, 2);
0275: }
0276: }
0277: break;
0278: default:
0279: jj_la1[4] = jj_gen;
0280: jj_consume_token(-1);
0281: throw new ParseException();
0282: }
0283: break;
0284: default:
0285: jj_la1[5] = jj_gen;
0286: ;
0287: }
0288: }
0289:
0290: final public void GraphQuerySet() throws ParseException {
0291: boolean distinct = true;
0292: GraphQuery();
0293: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0294: case UNION:
0295: case MINUS:
0296: case INTERSECT:
0297: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0298: case UNION:
0299: jj_consume_token(UNION);
0300: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0301: case ALL:
0302: jj_consume_token(ALL);
0303: distinct = false;
0304: break;
0305: default:
0306: jj_la1[6] = jj_gen;
0307: ;
0308: }
0309: GraphQuerySet();
0310: ASTGraphUnion jjtn001 = new ASTGraphUnion(JJTGRAPHUNION);
0311: boolean jjtc001 = true;
0312: jjtree.openNodeScope(jjtn001);
0313: try {
0314: jjtree.closeNodeScope(jjtn001, 2);
0315: jjtc001 = false;
0316: jjtn001.setDistinct(distinct);
0317: } finally {
0318: if (jjtc001) {
0319: jjtree.closeNodeScope(jjtn001, 2);
0320: }
0321: }
0322: break;
0323: case MINUS:
0324: jj_consume_token(MINUS);
0325: ASTGraphMinus jjtn002 = new ASTGraphMinus(JJTGRAPHMINUS);
0326: boolean jjtc002 = true;
0327: jjtree.openNodeScope(jjtn002);
0328: try {
0329: GraphQuerySet();
0330: } catch (Throwable jjte002) {
0331: if (jjtc002) {
0332: jjtree.clearNodeScope(jjtn002);
0333: jjtc002 = false;
0334: } else {
0335: jjtree.popNode();
0336: }
0337: if (jjte002 instanceof RuntimeException) {
0338: {
0339: if (true)
0340: throw (RuntimeException) jjte002;
0341: }
0342: }
0343: if (jjte002 instanceof ParseException) {
0344: {
0345: if (true)
0346: throw (ParseException) jjte002;
0347: }
0348: }
0349: {
0350: if (true)
0351: throw (Error) jjte002;
0352: }
0353: } finally {
0354: if (jjtc002) {
0355: jjtree.closeNodeScope(jjtn002, 2);
0356: }
0357: }
0358: break;
0359: case INTERSECT:
0360: jj_consume_token(INTERSECT);
0361: ASTGraphIntersect jjtn003 = new ASTGraphIntersect(
0362: JJTGRAPHINTERSECT);
0363: boolean jjtc003 = true;
0364: jjtree.openNodeScope(jjtn003);
0365: try {
0366: GraphQuerySet();
0367: } catch (Throwable jjte003) {
0368: if (jjtc003) {
0369: jjtree.clearNodeScope(jjtn003);
0370: jjtc003 = false;
0371: } else {
0372: jjtree.popNode();
0373: }
0374: if (jjte003 instanceof RuntimeException) {
0375: {
0376: if (true)
0377: throw (RuntimeException) jjte003;
0378: }
0379: }
0380: if (jjte003 instanceof ParseException) {
0381: {
0382: if (true)
0383: throw (ParseException) jjte003;
0384: }
0385: }
0386: {
0387: if (true)
0388: throw (Error) jjte003;
0389: }
0390: } finally {
0391: if (jjtc003) {
0392: jjtree.closeNodeScope(jjtn003, 2);
0393: }
0394: }
0395: break;
0396: default:
0397: jj_la1[7] = jj_gen;
0398: jj_consume_token(-1);
0399: throw new ParseException();
0400: }
0401: break;
0402: default:
0403: jj_la1[8] = jj_gen;
0404: ;
0405: }
0406: }
0407:
0408: final public void TupleQuery() throws ParseException {
0409: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0410: case LPAREN:
0411: jj_consume_token(LPAREN);
0412: TupleQuerySet();
0413: jj_consume_token(RPAREN);
0414: break;
0415: case SELECT:
0416: SelectQuery();
0417: break;
0418: default:
0419: jj_la1[9] = jj_gen;
0420: jj_consume_token(-1);
0421: throw new ParseException();
0422: }
0423: }
0424:
0425: final public void GraphQuery() throws ParseException {
0426: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0427: case LPAREN:
0428: jj_consume_token(LPAREN);
0429: GraphQuery();
0430: jj_consume_token(RPAREN);
0431: break;
0432: case CONSTRUCT:
0433: ConstructQuery();
0434: break;
0435: default:
0436: jj_la1[10] = jj_gen;
0437: jj_consume_token(-1);
0438: throw new ParseException();
0439: }
0440: }
0441:
0442: final public void SelectQuery() throws ParseException {
0443: /*@bgen(jjtree) SelectQuery */
0444: ASTSelectQuery jjtn000 = new ASTSelectQuery(JJTSELECTQUERY);
0445: boolean jjtc000 = true;
0446: jjtree.openNodeScope(jjtn000);
0447: try {
0448: Select();
0449: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0450: case FROM:
0451: QueryBody();
0452: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0453: case LIMIT:
0454: Limit();
0455: break;
0456: default:
0457: jj_la1[11] = jj_gen;
0458: ;
0459: }
0460: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0461: case OFFSET:
0462: Offset();
0463: break;
0464: default:
0465: jj_la1[12] = jj_gen;
0466: ;
0467: }
0468: break;
0469: default:
0470: jj_la1[13] = jj_gen;
0471: ;
0472: }
0473: } catch (Throwable jjte000) {
0474: if (jjtc000) {
0475: jjtree.clearNodeScope(jjtn000);
0476: jjtc000 = false;
0477: } else {
0478: jjtree.popNode();
0479: }
0480: if (jjte000 instanceof RuntimeException) {
0481: {
0482: if (true)
0483: throw (RuntimeException) jjte000;
0484: }
0485: }
0486: if (jjte000 instanceof ParseException) {
0487: {
0488: if (true)
0489: throw (ParseException) jjte000;
0490: }
0491: }
0492: {
0493: if (true)
0494: throw (Error) jjte000;
0495: }
0496: } finally {
0497: if (jjtc000) {
0498: jjtree.closeNodeScope(jjtn000, true);
0499: }
0500: }
0501: }
0502:
0503: final public void Select() throws ParseException {
0504: /*@bgen(jjtree) Select */
0505: ASTSelect jjtn000 = new ASTSelect(JJTSELECT);
0506: boolean jjtc000 = true;
0507: jjtree.openNodeScope(jjtn000);
0508: try {
0509: jj_consume_token(SELECT);
0510: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0511: case DISTINCT:
0512: jj_consume_token(DISTINCT);
0513: jjtn000.setDistinct(true);
0514: break;
0515: default:
0516: jj_la1[14] = jj_gen;
0517: ;
0518: }
0519: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0520: case STAR:
0521: jj_consume_token(STAR);
0522: jjtree.closeNodeScope(jjtn000, true);
0523: jjtc000 = false;
0524: jjtn000.setWildcard(true);
0525: break;
0526: default:
0527: jj_la1[17] = jj_gen;
0528: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0529: case NAMESPACE:
0530: case LABEL:
0531: case LANG:
0532: case DATATYPE:
0533: case LOCALNAME:
0534: case NULL:
0535: case LANG_LITERAL:
0536: case DATATYPED_LITERAL:
0537: case STRING:
0538: case URI:
0539: case QNAME:
0540: case BNODE:
0541: case PREFIX_NAME:
0542: case POS_INTEGER:
0543: case NEG_INTEGER:
0544: case DECIMAL:
0545: ProjectionElem();
0546: label_2: while (true) {
0547: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0548: case COMMA:
0549: ;
0550: break;
0551: default:
0552: jj_la1[15] = jj_gen;
0553: break label_2;
0554: }
0555: jj_consume_token(COMMA);
0556: ProjectionElem();
0557: }
0558: break;
0559: default:
0560: jj_la1[16] = jj_gen;
0561: ;
0562: }
0563: }
0564: } catch (Throwable jjte000) {
0565: if (jjtc000) {
0566: jjtree.clearNodeScope(jjtn000);
0567: jjtc000 = false;
0568: } else {
0569: jjtree.popNode();
0570: }
0571: if (jjte000 instanceof RuntimeException) {
0572: {
0573: if (true)
0574: throw (RuntimeException) jjte000;
0575: }
0576: }
0577: if (jjte000 instanceof ParseException) {
0578: {
0579: if (true)
0580: throw (ParseException) jjte000;
0581: }
0582: }
0583: {
0584: if (true)
0585: throw (Error) jjte000;
0586: }
0587: } finally {
0588: if (jjtc000) {
0589: jjtree.closeNodeScope(jjtn000, true);
0590: }
0591: }
0592: }
0593:
0594: final public void ProjectionElem() throws ParseException {
0595: /*@bgen(jjtree) ProjectionElem */
0596: ASTProjectionElem jjtn000 = new ASTProjectionElem(
0597: JJTPROJECTIONELEM);
0598: boolean jjtc000 = true;
0599: jjtree.openNodeScope(jjtn000);
0600: try {
0601: ValueExprOrNull();
0602: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0603: case AS:
0604: jj_consume_token(AS);
0605: String();
0606: break;
0607: default:
0608: jj_la1[18] = jj_gen;
0609: ;
0610: }
0611: } catch (Throwable jjte000) {
0612: if (jjtc000) {
0613: jjtree.clearNodeScope(jjtn000);
0614: jjtc000 = false;
0615: } else {
0616: jjtree.popNode();
0617: }
0618: if (jjte000 instanceof RuntimeException) {
0619: {
0620: if (true)
0621: throw (RuntimeException) jjte000;
0622: }
0623: }
0624: if (jjte000 instanceof ParseException) {
0625: {
0626: if (true)
0627: throw (ParseException) jjte000;
0628: }
0629: }
0630: {
0631: if (true)
0632: throw (Error) jjte000;
0633: }
0634: } finally {
0635: if (jjtc000) {
0636: jjtree.closeNodeScope(jjtn000, true);
0637: }
0638: }
0639: }
0640:
0641: final public void ConstructQuery() throws ParseException {
0642: /*@bgen(jjtree) ConstructQuery */
0643: ASTConstructQuery jjtn000 = new ASTConstructQuery(
0644: JJTCONSTRUCTQUERY);
0645: boolean jjtc000 = true;
0646: jjtree.openNodeScope(jjtn000);
0647: try {
0648: Construct();
0649: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0650: case FROM:
0651: QueryBody();
0652: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0653: case LIMIT:
0654: Limit();
0655: break;
0656: default:
0657: jj_la1[19] = jj_gen;
0658: ;
0659: }
0660: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0661: case OFFSET:
0662: Offset();
0663: break;
0664: default:
0665: jj_la1[20] = jj_gen;
0666: ;
0667: }
0668: break;
0669: default:
0670: jj_la1[21] = jj_gen;
0671: ;
0672: }
0673: } catch (Throwable jjte000) {
0674: if (jjtc000) {
0675: jjtree.clearNodeScope(jjtn000);
0676: jjtc000 = false;
0677: } else {
0678: jjtree.popNode();
0679: }
0680: if (jjte000 instanceof RuntimeException) {
0681: {
0682: if (true)
0683: throw (RuntimeException) jjte000;
0684: }
0685: }
0686: if (jjte000 instanceof ParseException) {
0687: {
0688: if (true)
0689: throw (ParseException) jjte000;
0690: }
0691: }
0692: {
0693: if (true)
0694: throw (Error) jjte000;
0695: }
0696: } finally {
0697: if (jjtc000) {
0698: jjtree.closeNodeScope(jjtn000, true);
0699: }
0700: }
0701: }
0702:
0703: final public void Construct() throws ParseException {
0704: /*@bgen(jjtree) Construct */
0705: ASTConstruct jjtn000 = new ASTConstruct(JJTCONSTRUCT);
0706: boolean jjtc000 = true;
0707: jjtree.openNodeScope(jjtn000);
0708: try {
0709: jj_consume_token(CONSTRUCT);
0710: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0711: case DISTINCT:
0712: jj_consume_token(DISTINCT);
0713: jjtn000.setDistinct(true);
0714: break;
0715: default:
0716: jj_la1[22] = jj_gen;
0717: ;
0718: }
0719: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0720: case STAR:
0721: jj_consume_token(STAR);
0722: jjtree.closeNodeScope(jjtn000, true);
0723: jjtc000 = false;
0724: jjtn000.setWildcard(true);
0725: break;
0726: case LBRACE:
0727: case LBRACK:
0728: PathExprList();
0729: break;
0730: default:
0731: jj_la1[23] = jj_gen;
0732: jj_consume_token(-1);
0733: throw new ParseException();
0734: }
0735: } catch (Throwable jjte000) {
0736: if (jjtc000) {
0737: jjtree.clearNodeScope(jjtn000);
0738: jjtc000 = false;
0739: } else {
0740: jjtree.popNode();
0741: }
0742: if (jjte000 instanceof RuntimeException) {
0743: {
0744: if (true)
0745: throw (RuntimeException) jjte000;
0746: }
0747: }
0748: if (jjte000 instanceof ParseException) {
0749: {
0750: if (true)
0751: throw (ParseException) jjte000;
0752: }
0753: }
0754: {
0755: if (true)
0756: throw (Error) jjte000;
0757: }
0758: } finally {
0759: if (jjtc000) {
0760: jjtree.closeNodeScope(jjtn000, true);
0761: }
0762: }
0763: }
0764:
0765: final public void QueryBody() throws ParseException {
0766: /*@bgen(jjtree) QueryBody */
0767: ASTQueryBody jjtn000 = new ASTQueryBody(JJTQUERYBODY);
0768: boolean jjtc000 = true;
0769: jjtree.openNodeScope(jjtn000);
0770: try {
0771: label_3: while (true) {
0772: From();
0773: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0774: case FROM:
0775: ;
0776: break;
0777: default:
0778: jj_la1[24] = jj_gen;
0779: break label_3;
0780: }
0781: }
0782: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0783: case WHERE:
0784: Where();
0785: break;
0786: default:
0787: jj_la1[25] = jj_gen;
0788: ;
0789: }
0790: } catch (Throwable jjte000) {
0791: if (jjtc000) {
0792: jjtree.clearNodeScope(jjtn000);
0793: jjtc000 = false;
0794: } else {
0795: jjtree.popNode();
0796: }
0797: if (jjte000 instanceof RuntimeException) {
0798: {
0799: if (true)
0800: throw (RuntimeException) jjte000;
0801: }
0802: }
0803: if (jjte000 instanceof ParseException) {
0804: {
0805: if (true)
0806: throw (ParseException) jjte000;
0807: }
0808: }
0809: {
0810: if (true)
0811: throw (Error) jjte000;
0812: }
0813: } finally {
0814: if (jjtc000) {
0815: jjtree.closeNodeScope(jjtn000, true);
0816: }
0817: }
0818: }
0819:
0820: final public void From() throws ParseException {
0821: /*@bgen(jjtree) From */
0822: ASTFrom jjtn000 = new ASTFrom(JJTFROM);
0823: boolean jjtc000 = true;
0824: jjtree.openNodeScope(jjtn000);
0825: try {
0826: jj_consume_token(FROM);
0827: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0828: case CONTEXT:
0829: jj_consume_token(CONTEXT);
0830: ContextID();
0831: break;
0832: default:
0833: jj_la1[26] = jj_gen;
0834: ;
0835: }
0836: PathExprList();
0837: } catch (Throwable jjte000) {
0838: if (jjtc000) {
0839: jjtree.clearNodeScope(jjtn000);
0840: jjtc000 = false;
0841: } else {
0842: jjtree.popNode();
0843: }
0844: if (jjte000 instanceof RuntimeException) {
0845: {
0846: if (true)
0847: throw (RuntimeException) jjte000;
0848: }
0849: }
0850: if (jjte000 instanceof ParseException) {
0851: {
0852: if (true)
0853: throw (ParseException) jjte000;
0854: }
0855: }
0856: {
0857: if (true)
0858: throw (Error) jjte000;
0859: }
0860: } finally {
0861: if (jjtc000) {
0862: jjtree.closeNodeScope(jjtn000, true);
0863: }
0864: }
0865: }
0866:
0867: final public void Where() throws ParseException {
0868: /*@bgen(jjtree) Where */
0869: ASTWhere jjtn000 = new ASTWhere(JJTWHERE);
0870: boolean jjtc000 = true;
0871: jjtree.openNodeScope(jjtn000);
0872: try {
0873: jj_consume_token(WHERE);
0874: BooleanExpr();
0875: } catch (Throwable jjte000) {
0876: if (jjtc000) {
0877: jjtree.clearNodeScope(jjtn000);
0878: jjtc000 = false;
0879: } else {
0880: jjtree.popNode();
0881: }
0882: if (jjte000 instanceof RuntimeException) {
0883: {
0884: if (true)
0885: throw (RuntimeException) jjte000;
0886: }
0887: }
0888: if (jjte000 instanceof ParseException) {
0889: {
0890: if (true)
0891: throw (ParseException) jjte000;
0892: }
0893: }
0894: {
0895: if (true)
0896: throw (Error) jjte000;
0897: }
0898: } finally {
0899: if (jjtc000) {
0900: jjtree.closeNodeScope(jjtn000, true);
0901: }
0902: }
0903: }
0904:
0905: final public void Limit() throws ParseException {
0906: /*@bgen(jjtree) Limit */
0907: ASTLimit jjtn000 = new ASTLimit(JJTLIMIT);
0908: boolean jjtc000 = true;
0909: jjtree.openNodeScope(jjtn000);
0910: int limit;
0911: try {
0912: jj_consume_token(LIMIT);
0913: limit = PosInteger();
0914: jjtree.closeNodeScope(jjtn000, true);
0915: jjtc000 = false;
0916: jjtn000.setValue(limit);
0917: } catch (Throwable jjte000) {
0918: if (jjtc000) {
0919: jjtree.clearNodeScope(jjtn000);
0920: jjtc000 = false;
0921: } else {
0922: jjtree.popNode();
0923: }
0924: if (jjte000 instanceof RuntimeException) {
0925: {
0926: if (true)
0927: throw (RuntimeException) jjte000;
0928: }
0929: }
0930: if (jjte000 instanceof ParseException) {
0931: {
0932: if (true)
0933: throw (ParseException) jjte000;
0934: }
0935: }
0936: {
0937: if (true)
0938: throw (Error) jjte000;
0939: }
0940: } finally {
0941: if (jjtc000) {
0942: jjtree.closeNodeScope(jjtn000, true);
0943: }
0944: }
0945: }
0946:
0947: final public void Offset() throws ParseException {
0948: /*@bgen(jjtree) Offset */
0949: ASTOffset jjtn000 = new ASTOffset(JJTOFFSET);
0950: boolean jjtc000 = true;
0951: jjtree.openNodeScope(jjtn000);
0952: int offset;
0953: try {
0954: jj_consume_token(OFFSET);
0955: offset = PosInteger();
0956: jjtree.closeNodeScope(jjtn000, true);
0957: jjtc000 = false;
0958: jjtn000.setValue(offset);
0959: } catch (Throwable jjte000) {
0960: if (jjtc000) {
0961: jjtree.clearNodeScope(jjtn000);
0962: jjtc000 = false;
0963: } else {
0964: jjtree.popNode();
0965: }
0966: if (jjte000 instanceof RuntimeException) {
0967: {
0968: if (true)
0969: throw (RuntimeException) jjte000;
0970: }
0971: }
0972: if (jjte000 instanceof ParseException) {
0973: {
0974: if (true)
0975: throw (ParseException) jjte000;
0976: }
0977: }
0978: {
0979: if (true)
0980: throw (Error) jjte000;
0981: }
0982: } finally {
0983: if (jjtc000) {
0984: jjtree.closeNodeScope(jjtn000, true);
0985: }
0986: }
0987: }
0988:
0989: final public void ContextID() throws ParseException {
0990: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
0991: case PREFIX_NAME:
0992: Var();
0993: break;
0994: case URI:
0995: case QNAME:
0996: URIRef();
0997: break;
0998: case BNODE:
0999: BNode();
1000: break;
1001: default:
1002: jj_la1[27] = jj_gen;
1003: jj_consume_token(-1);
1004: throw new ParseException();
1005: }
1006: }
1007:
1008: final public void PathExprList() throws ParseException {
1009: PathExpr();
1010: label_4: while (true) {
1011: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1012: case COMMA:
1013: ;
1014: break;
1015: default:
1016: jj_la1[28] = jj_gen;
1017: break label_4;
1018: }
1019: jj_consume_token(COMMA);
1020: PathExpr();
1021: }
1022: }
1023:
1024: final public void PathExpr() throws ParseException {
1025: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1026: case LBRACE:
1027: BasicPathExpr();
1028: break;
1029: case LBRACK:
1030: OptPathExpr();
1031: break;
1032: default:
1033: jj_la1[29] = jj_gen;
1034: jj_consume_token(-1);
1035: throw new ParseException();
1036: }
1037: }
1038:
1039: final public void BasicPathExpr() throws ParseException {
1040: /*@bgen(jjtree) BasicPathExpr */
1041: ASTBasicPathExpr jjtn000 = new ASTBasicPathExpr(
1042: JJTBASICPATHEXPR);
1043: boolean jjtc000 = true;
1044: jjtree.openNodeScope(jjtn000);
1045: try {
1046: Node();
1047: BasicPathExprTail();
1048: } catch (Throwable jjte000) {
1049: if (jjtc000) {
1050: jjtree.clearNodeScope(jjtn000);
1051: jjtc000 = false;
1052: } else {
1053: jjtree.popNode();
1054: }
1055: if (jjte000 instanceof RuntimeException) {
1056: {
1057: if (true)
1058: throw (RuntimeException) jjte000;
1059: }
1060: }
1061: if (jjte000 instanceof ParseException) {
1062: {
1063: if (true)
1064: throw (ParseException) jjte000;
1065: }
1066: }
1067: {
1068: if (true)
1069: throw (Error) jjte000;
1070: }
1071: } finally {
1072: if (jjtc000) {
1073: jjtree.closeNodeScope(jjtn000, true);
1074: }
1075: }
1076: }
1077:
1078: final public void OptPathExpr() throws ParseException {
1079: /*@bgen(jjtree) OptPathExpr */
1080: ASTOptPathExpr jjtn000 = new ASTOptPathExpr(JJTOPTPATHEXPR);
1081: boolean jjtc000 = true;
1082: jjtree.openNodeScope(jjtn000);
1083: try {
1084: jj_consume_token(LBRACK);
1085: PathExprList();
1086: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1087: case WHERE:
1088: Where();
1089: break;
1090: default:
1091: jj_la1[30] = jj_gen;
1092: ;
1093: }
1094: jj_consume_token(RBRACK);
1095: } catch (Throwable jjte000) {
1096: if (jjtc000) {
1097: jjtree.clearNodeScope(jjtn000);
1098: jjtc000 = false;
1099: } else {
1100: jjtree.popNode();
1101: }
1102: if (jjte000 instanceof RuntimeException) {
1103: {
1104: if (true)
1105: throw (RuntimeException) jjte000;
1106: }
1107: }
1108: if (jjte000 instanceof ParseException) {
1109: {
1110: if (true)
1111: throw (ParseException) jjte000;
1112: }
1113: }
1114: {
1115: if (true)
1116: throw (Error) jjte000;
1117: }
1118: } finally {
1119: if (jjtc000) {
1120: jjtree.closeNodeScope(jjtn000, true);
1121: }
1122: }
1123: }
1124:
1125: final public void PathExprCont() throws ParseException {
1126: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1127: case SEMICOLON:
1128: PathExprBranch();
1129: break;
1130: case LBRACK:
1131: case URI:
1132: case QNAME:
1133: case PREFIX_NAME:
1134: PathExprTail();
1135: break;
1136: default:
1137: jj_la1[31] = jj_gen;
1138: jj_consume_token(-1);
1139: throw new ParseException();
1140: }
1141: }
1142:
1143: final public void PathExprBranch() throws ParseException {
1144: ASTPathExprTail tail;
1145: jj_consume_token(SEMICOLON);
1146: tail = PathExprTail();
1147: tail.setBranch(true);
1148: }
1149:
1150: final public ASTPathExprTail PathExprTail() throws ParseException {
1151: ASTPathExprTail result;
1152: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1153: case URI:
1154: case QNAME:
1155: case PREFIX_NAME:
1156: result = BasicPathExprTail();
1157: break;
1158: case LBRACK:
1159: result = OptPathExprTail();
1160: break;
1161: default:
1162: jj_la1[32] = jj_gen;
1163: jj_consume_token(-1);
1164: throw new ParseException();
1165: }
1166: {
1167: if (true)
1168: return result;
1169: }
1170: throw new Error("Missing return statement in function");
1171: }
1172:
1173: final public ASTPathExprTail BasicPathExprTail()
1174: throws ParseException {
1175: /*@bgen(jjtree) BasicPathExprTail */
1176: ASTBasicPathExprTail jjtn000 = new ASTBasicPathExprTail(
1177: JJTBASICPATHEXPRTAIL);
1178: boolean jjtc000 = true;
1179: jjtree.openNodeScope(jjtn000);
1180: try {
1181: Edge();
1182: Node();
1183: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1184: case SEMICOLON:
1185: case LBRACK:
1186: case URI:
1187: case QNAME:
1188: case PREFIX_NAME:
1189: PathExprCont();
1190: break;
1191: default:
1192: jj_la1[33] = jj_gen;
1193: ;
1194: }
1195: jjtree.closeNodeScope(jjtn000, true);
1196: jjtc000 = false;
1197: {
1198: if (true)
1199: return jjtn000;
1200: }
1201: } catch (Throwable jjte000) {
1202: if (jjtc000) {
1203: jjtree.clearNodeScope(jjtn000);
1204: jjtc000 = false;
1205: } else {
1206: jjtree.popNode();
1207: }
1208: if (jjte000 instanceof RuntimeException) {
1209: {
1210: if (true)
1211: throw (RuntimeException) jjte000;
1212: }
1213: }
1214: if (jjte000 instanceof ParseException) {
1215: {
1216: if (true)
1217: throw (ParseException) jjte000;
1218: }
1219: }
1220: {
1221: if (true)
1222: throw (Error) jjte000;
1223: }
1224: } finally {
1225: if (jjtc000) {
1226: jjtree.closeNodeScope(jjtn000, true);
1227: }
1228: }
1229: throw new Error("Missing return statement in function");
1230: }
1231:
1232: final public ASTPathExprTail OptPathExprTail()
1233: throws ParseException {
1234: /*@bgen(jjtree) OptPathExprTail */
1235: ASTOptPathExprTail jjtn000 = new ASTOptPathExprTail(
1236: JJTOPTPATHEXPRTAIL);
1237: boolean jjtc000 = true;
1238: jjtree.openNodeScope(jjtn000);
1239: try {
1240: jj_consume_token(LBRACK);
1241: BasicPathExprTail();
1242: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1243: case WHERE:
1244: Where();
1245: break;
1246: default:
1247: jj_la1[34] = jj_gen;
1248: ;
1249: }
1250: jj_consume_token(RBRACK);
1251: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1252: case SEMICOLON:
1253: PathExprBranch();
1254: break;
1255: default:
1256: jj_la1[35] = jj_gen;
1257: ;
1258: }
1259: jjtree.closeNodeScope(jjtn000, true);
1260: jjtc000 = false;
1261: {
1262: if (true)
1263: return jjtn000;
1264: }
1265: } catch (Throwable jjte000) {
1266: if (jjtc000) {
1267: jjtree.clearNodeScope(jjtn000);
1268: jjtc000 = false;
1269: } else {
1270: jjtree.popNode();
1271: }
1272: if (jjte000 instanceof RuntimeException) {
1273: {
1274: if (true)
1275: throw (RuntimeException) jjte000;
1276: }
1277: }
1278: if (jjte000 instanceof ParseException) {
1279: {
1280: if (true)
1281: throw (ParseException) jjte000;
1282: }
1283: }
1284: {
1285: if (true)
1286: throw (Error) jjte000;
1287: }
1288: } finally {
1289: if (jjtc000) {
1290: jjtree.closeNodeScope(jjtn000, true);
1291: }
1292: }
1293: throw new Error("Missing return statement in function");
1294: }
1295:
1296: final public void Edge() throws ParseException {
1297: /*@bgen(jjtree) Edge */
1298: ASTEdge jjtn000 = new ASTEdge(JJTEDGE);
1299: boolean jjtc000 = true;
1300: jjtree.openNodeScope(jjtn000);
1301: try {
1302: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1303: case PREFIX_NAME:
1304: Var();
1305: break;
1306: case URI:
1307: case QNAME:
1308: URIRef();
1309: break;
1310: default:
1311: jj_la1[36] = jj_gen;
1312: jj_consume_token(-1);
1313: throw new ParseException();
1314: }
1315: } catch (Throwable jjte000) {
1316: if (jjtc000) {
1317: jjtree.clearNodeScope(jjtn000);
1318: jjtc000 = false;
1319: } else {
1320: jjtree.popNode();
1321: }
1322: if (jjte000 instanceof RuntimeException) {
1323: {
1324: if (true)
1325: throw (RuntimeException) jjte000;
1326: }
1327: }
1328: if (jjte000 instanceof ParseException) {
1329: {
1330: if (true)
1331: throw (ParseException) jjte000;
1332: }
1333: }
1334: {
1335: if (true)
1336: throw (Error) jjte000;
1337: }
1338: } finally {
1339: if (jjtc000) {
1340: jjtree.closeNodeScope(jjtn000, true);
1341: }
1342: }
1343: }
1344:
1345: final public void Node() throws ParseException {
1346: /*@bgen(jjtree) Node */
1347: ASTNode jjtn000 = new ASTNode(JJTNODE);
1348: boolean jjtc000 = true;
1349: jjtree.openNodeScope(jjtn000);
1350: try {
1351: jj_consume_token(LBRACE);
1352: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1353: case LBRACE:
1354: case LANG_LITERAL:
1355: case DATATYPED_LITERAL:
1356: case STRING:
1357: case URI:
1358: case QNAME:
1359: case BNODE:
1360: case PREFIX_NAME:
1361: case POS_INTEGER:
1362: case NEG_INTEGER:
1363: case DECIMAL:
1364: NodeElem();
1365: label_5: while (true) {
1366: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1367: case COMMA:
1368: ;
1369: break;
1370: default:
1371: jj_la1[37] = jj_gen;
1372: break label_5;
1373: }
1374: jj_consume_token(COMMA);
1375: NodeElem();
1376: }
1377: break;
1378: default:
1379: jj_la1[38] = jj_gen;
1380: ;
1381: }
1382: jj_consume_token(RBRACE);
1383: } catch (Throwable jjte000) {
1384: if (jjtc000) {
1385: jjtree.clearNodeScope(jjtn000);
1386: jjtc000 = false;
1387: } else {
1388: jjtree.popNode();
1389: }
1390: if (jjte000 instanceof RuntimeException) {
1391: {
1392: if (true)
1393: throw (RuntimeException) jjte000;
1394: }
1395: }
1396: if (jjte000 instanceof ParseException) {
1397: {
1398: if (true)
1399: throw (ParseException) jjte000;
1400: }
1401: }
1402: {
1403: if (true)
1404: throw (Error) jjte000;
1405: }
1406: } finally {
1407: if (jjtc000) {
1408: jjtree.closeNodeScope(jjtn000, true);
1409: }
1410: }
1411: }
1412:
1413: final public void NodeElem() throws ParseException {
1414: /*@bgen(jjtree) NodeElem */
1415: ASTNodeElem jjtn000 = new ASTNodeElem(JJTNODEELEM);
1416: boolean jjtc000 = true;
1417: jjtree.openNodeScope(jjtn000);
1418: try {
1419: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1420: case PREFIX_NAME:
1421: Var();
1422: break;
1423: case LANG_LITERAL:
1424: case DATATYPED_LITERAL:
1425: case STRING:
1426: case URI:
1427: case QNAME:
1428: case BNODE:
1429: case POS_INTEGER:
1430: case NEG_INTEGER:
1431: case DECIMAL:
1432: Value();
1433: break;
1434: case LBRACE:
1435: ReifiedStat();
1436: break;
1437: default:
1438: jj_la1[39] = jj_gen;
1439: jj_consume_token(-1);
1440: throw new ParseException();
1441: }
1442: } catch (Throwable jjte000) {
1443: if (jjtc000) {
1444: jjtree.clearNodeScope(jjtn000);
1445: jjtc000 = false;
1446: } else {
1447: jjtree.popNode();
1448: }
1449: if (jjte000 instanceof RuntimeException) {
1450: {
1451: if (true)
1452: throw (RuntimeException) jjte000;
1453: }
1454: }
1455: if (jjte000 instanceof ParseException) {
1456: {
1457: if (true)
1458: throw (ParseException) jjte000;
1459: }
1460: }
1461: {
1462: if (true)
1463: throw (Error) jjte000;
1464: }
1465: } finally {
1466: if (jjtc000) {
1467: jjtree.closeNodeScope(jjtn000, true);
1468: }
1469: }
1470: }
1471:
1472: final public void ReifiedStat() throws ParseException {
1473: /*@bgen(jjtree) ReifiedStat */
1474: ASTReifiedStat jjtn000 = new ASTReifiedStat(JJTREIFIEDSTAT);
1475: boolean jjtc000 = true;
1476: jjtree.openNodeScope(jjtn000);
1477: try {
1478: jj_consume_token(LBRACE);
1479: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1480: case LBRACE:
1481: case LANG_LITERAL:
1482: case DATATYPED_LITERAL:
1483: case STRING:
1484: case URI:
1485: case QNAME:
1486: case BNODE:
1487: case PREFIX_NAME:
1488: case POS_INTEGER:
1489: case NEG_INTEGER:
1490: case DECIMAL:
1491: NodeElem();
1492: break;
1493: default:
1494: jj_la1[40] = jj_gen;
1495: ;
1496: }
1497: jj_consume_token(RBRACE);
1498: Edge();
1499: jj_consume_token(LBRACE);
1500: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1501: case LBRACE:
1502: case LANG_LITERAL:
1503: case DATATYPED_LITERAL:
1504: case STRING:
1505: case URI:
1506: case QNAME:
1507: case BNODE:
1508: case PREFIX_NAME:
1509: case POS_INTEGER:
1510: case NEG_INTEGER:
1511: case DECIMAL:
1512: NodeElem();
1513: break;
1514: default:
1515: jj_la1[41] = jj_gen;
1516: ;
1517: }
1518: jj_consume_token(RBRACE);
1519: } catch (Throwable jjte000) {
1520: if (jjtc000) {
1521: jjtree.clearNodeScope(jjtn000);
1522: jjtc000 = false;
1523: } else {
1524: jjtree.popNode();
1525: }
1526: if (jjte000 instanceof RuntimeException) {
1527: {
1528: if (true)
1529: throw (RuntimeException) jjte000;
1530: }
1531: }
1532: if (jjte000 instanceof ParseException) {
1533: {
1534: if (true)
1535: throw (ParseException) jjte000;
1536: }
1537: }
1538: {
1539: if (true)
1540: throw (Error) jjte000;
1541: }
1542: } finally {
1543: if (jjtc000) {
1544: jjtree.closeNodeScope(jjtn000, true);
1545: }
1546: }
1547: }
1548:
1549: final public void BooleanExpr() throws ParseException {
1550: Or();
1551: }
1552:
1553: final public void Or() throws ParseException {
1554: ASTOr jjtn001 = new ASTOr(JJTOR);
1555: boolean jjtc001 = true;
1556: jjtree.openNodeScope(jjtn001);
1557: try {
1558: And();
1559: label_6: while (true) {
1560: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1561: case OR:
1562: ;
1563: break;
1564: default:
1565: jj_la1[42] = jj_gen;
1566: break label_6;
1567: }
1568: jj_consume_token(OR);
1569: And();
1570: }
1571: } catch (Throwable jjte001) {
1572: if (jjtc001) {
1573: jjtree.clearNodeScope(jjtn001);
1574: jjtc001 = false;
1575: } else {
1576: jjtree.popNode();
1577: }
1578: if (jjte001 instanceof RuntimeException) {
1579: {
1580: if (true)
1581: throw (RuntimeException) jjte001;
1582: }
1583: }
1584: if (jjte001 instanceof ParseException) {
1585: {
1586: if (true)
1587: throw (ParseException) jjte001;
1588: }
1589: }
1590: {
1591: if (true)
1592: throw (Error) jjte001;
1593: }
1594: } finally {
1595: if (jjtc001) {
1596: jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1);
1597: }
1598: }
1599: }
1600:
1601: final public void And() throws ParseException {
1602: ASTAnd jjtn001 = new ASTAnd(JJTAND);
1603: boolean jjtc001 = true;
1604: jjtree.openNodeScope(jjtn001);
1605: try {
1606: BooleanElem();
1607: label_7: while (true) {
1608: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1609: case AND:
1610: ;
1611: break;
1612: default:
1613: jj_la1[43] = jj_gen;
1614: break label_7;
1615: }
1616: jj_consume_token(AND);
1617: BooleanElem();
1618: }
1619: } catch (Throwable jjte001) {
1620: if (jjtc001) {
1621: jjtree.clearNodeScope(jjtn001);
1622: jjtc001 = false;
1623: } else {
1624: jjtree.popNode();
1625: }
1626: if (jjte001 instanceof RuntimeException) {
1627: {
1628: if (true)
1629: throw (RuntimeException) jjte001;
1630: }
1631: }
1632: if (jjte001 instanceof ParseException) {
1633: {
1634: if (true)
1635: throw (ParseException) jjte001;
1636: }
1637: }
1638: {
1639: if (true)
1640: throw (Error) jjte001;
1641: }
1642: } finally {
1643: if (jjtc001) {
1644: jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1);
1645: }
1646: }
1647: }
1648:
1649: final public void BooleanElem() throws ParseException {
1650: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1651: case LPAREN:
1652: jj_consume_token(LPAREN);
1653: BooleanExpr();
1654: jj_consume_token(RPAREN);
1655: break;
1656: case TRUE:
1657: case FALSE:
1658: BooleanConstant();
1659: break;
1660: case NOT:
1661: Not();
1662: break;
1663: case BOUND:
1664: Bound();
1665: break;
1666: case ISRESOURCE:
1667: IsResource();
1668: break;
1669: case ISLITERAL:
1670: IsLiteral();
1671: break;
1672: case ISURI:
1673: IsURI();
1674: break;
1675: case ISBNODE:
1676: IsBNode();
1677: break;
1678: case EXISTS:
1679: Exists();
1680: break;
1681: case NAMESPACE:
1682: case LABEL:
1683: case LANG:
1684: case DATATYPE:
1685: case LOCALNAME:
1686: case NULL:
1687: case LANG_LITERAL:
1688: case DATATYPED_LITERAL:
1689: case STRING:
1690: case URI:
1691: case QNAME:
1692: case BNODE:
1693: case PREFIX_NAME:
1694: case POS_INTEGER:
1695: case NEG_INTEGER:
1696: case DECIMAL:
1697: BooleanValueOp();
1698: break;
1699: default:
1700: jj_la1[44] = jj_gen;
1701: jj_consume_token(-1);
1702: throw new ParseException();
1703: }
1704: }
1705:
1706: final public void BooleanConstant() throws ParseException {
1707: /*@bgen(jjtree) BooleanConstant */
1708: ASTBooleanConstant jjtn000 = new ASTBooleanConstant(
1709: JJTBOOLEANCONSTANT);
1710: boolean jjtc000 = true;
1711: jjtree.openNodeScope(jjtn000);
1712: try {
1713: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1714: case TRUE:
1715: jj_consume_token(TRUE);
1716: jjtree.closeNodeScope(jjtn000, true);
1717: jjtc000 = false;
1718: jjtn000.setValue(true);
1719: break;
1720: case FALSE:
1721: jj_consume_token(FALSE);
1722: jjtree.closeNodeScope(jjtn000, true);
1723: jjtc000 = false;
1724: jjtn000.setValue(false);
1725: break;
1726: default:
1727: jj_la1[45] = jj_gen;
1728: jj_consume_token(-1);
1729: throw new ParseException();
1730: }
1731: } finally {
1732: if (jjtc000) {
1733: jjtree.closeNodeScope(jjtn000, true);
1734: }
1735: }
1736: }
1737:
1738: final public void Not() throws ParseException {
1739: /*@bgen(jjtree) Not */
1740: ASTNot jjtn000 = new ASTNot(JJTNOT);
1741: boolean jjtc000 = true;
1742: jjtree.openNodeScope(jjtn000);
1743: try {
1744: jj_consume_token(NOT);
1745: BooleanElem();
1746: } catch (Throwable jjte000) {
1747: if (jjtc000) {
1748: jjtree.clearNodeScope(jjtn000);
1749: jjtc000 = false;
1750: } else {
1751: jjtree.popNode();
1752: }
1753: if (jjte000 instanceof RuntimeException) {
1754: {
1755: if (true)
1756: throw (RuntimeException) jjte000;
1757: }
1758: }
1759: if (jjte000 instanceof ParseException) {
1760: {
1761: if (true)
1762: throw (ParseException) jjte000;
1763: }
1764: }
1765: {
1766: if (true)
1767: throw (Error) jjte000;
1768: }
1769: } finally {
1770: if (jjtc000) {
1771: jjtree.closeNodeScope(jjtn000, true);
1772: }
1773: }
1774: }
1775:
1776: final public void IsResource() throws ParseException {
1777: /*@bgen(jjtree) IsResource */
1778: ASTIsResource jjtn000 = new ASTIsResource(JJTISRESOURCE);
1779: boolean jjtc000 = true;
1780: jjtree.openNodeScope(jjtn000);
1781: try {
1782: jj_consume_token(ISRESOURCE);
1783: jj_consume_token(LPAREN);
1784: Var();
1785: jj_consume_token(RPAREN);
1786: } catch (Throwable jjte000) {
1787: if (jjtc000) {
1788: jjtree.clearNodeScope(jjtn000);
1789: jjtc000 = false;
1790: } else {
1791: jjtree.popNode();
1792: }
1793: if (jjte000 instanceof RuntimeException) {
1794: {
1795: if (true)
1796: throw (RuntimeException) jjte000;
1797: }
1798: }
1799: if (jjte000 instanceof ParseException) {
1800: {
1801: if (true)
1802: throw (ParseException) jjte000;
1803: }
1804: }
1805: {
1806: if (true)
1807: throw (Error) jjte000;
1808: }
1809: } finally {
1810: if (jjtc000) {
1811: jjtree.closeNodeScope(jjtn000, true);
1812: }
1813: }
1814: }
1815:
1816: final public void IsLiteral() throws ParseException {
1817: /*@bgen(jjtree) IsLiteral */
1818: ASTIsLiteral jjtn000 = new ASTIsLiteral(JJTISLITERAL);
1819: boolean jjtc000 = true;
1820: jjtree.openNodeScope(jjtn000);
1821: try {
1822: jj_consume_token(ISLITERAL);
1823: jj_consume_token(LPAREN);
1824: Var();
1825: jj_consume_token(RPAREN);
1826: } catch (Throwable jjte000) {
1827: if (jjtc000) {
1828: jjtree.clearNodeScope(jjtn000);
1829: jjtc000 = false;
1830: } else {
1831: jjtree.popNode();
1832: }
1833: if (jjte000 instanceof RuntimeException) {
1834: {
1835: if (true)
1836: throw (RuntimeException) jjte000;
1837: }
1838: }
1839: if (jjte000 instanceof ParseException) {
1840: {
1841: if (true)
1842: throw (ParseException) jjte000;
1843: }
1844: }
1845: {
1846: if (true)
1847: throw (Error) jjte000;
1848: }
1849: } finally {
1850: if (jjtc000) {
1851: jjtree.closeNodeScope(jjtn000, true);
1852: }
1853: }
1854: }
1855:
1856: final public void IsURI() throws ParseException {
1857: /*@bgen(jjtree) IsURI */
1858: ASTIsURI jjtn000 = new ASTIsURI(JJTISURI);
1859: boolean jjtc000 = true;
1860: jjtree.openNodeScope(jjtn000);
1861: try {
1862: jj_consume_token(ISURI);
1863: jj_consume_token(LPAREN);
1864: Var();
1865: jj_consume_token(RPAREN);
1866: } catch (Throwable jjte000) {
1867: if (jjtc000) {
1868: jjtree.clearNodeScope(jjtn000);
1869: jjtc000 = false;
1870: } else {
1871: jjtree.popNode();
1872: }
1873: if (jjte000 instanceof RuntimeException) {
1874: {
1875: if (true)
1876: throw (RuntimeException) jjte000;
1877: }
1878: }
1879: if (jjte000 instanceof ParseException) {
1880: {
1881: if (true)
1882: throw (ParseException) jjte000;
1883: }
1884: }
1885: {
1886: if (true)
1887: throw (Error) jjte000;
1888: }
1889: } finally {
1890: if (jjtc000) {
1891: jjtree.closeNodeScope(jjtn000, true);
1892: }
1893: }
1894: }
1895:
1896: final public void IsBNode() throws ParseException {
1897: /*@bgen(jjtree) IsBNode */
1898: ASTIsBNode jjtn000 = new ASTIsBNode(JJTISBNODE);
1899: boolean jjtc000 = true;
1900: jjtree.openNodeScope(jjtn000);
1901: try {
1902: jj_consume_token(ISBNODE);
1903: jj_consume_token(LPAREN);
1904: Var();
1905: jj_consume_token(RPAREN);
1906: } catch (Throwable jjte000) {
1907: if (jjtc000) {
1908: jjtree.clearNodeScope(jjtn000);
1909: jjtc000 = false;
1910: } else {
1911: jjtree.popNode();
1912: }
1913: if (jjte000 instanceof RuntimeException) {
1914: {
1915: if (true)
1916: throw (RuntimeException) jjte000;
1917: }
1918: }
1919: if (jjte000 instanceof ParseException) {
1920: {
1921: if (true)
1922: throw (ParseException) jjte000;
1923: }
1924: }
1925: {
1926: if (true)
1927: throw (Error) jjte000;
1928: }
1929: } finally {
1930: if (jjtc000) {
1931: jjtree.closeNodeScope(jjtn000, true);
1932: }
1933: }
1934: }
1935:
1936: final public void Exists() throws ParseException {
1937: /*@bgen(jjtree) Exists */
1938: ASTExists jjtn000 = new ASTExists(JJTEXISTS);
1939: boolean jjtc000 = true;
1940: jjtree.openNodeScope(jjtn000);
1941: try {
1942: jj_consume_token(EXISTS);
1943: jj_consume_token(LPAREN);
1944: TupleQuerySet();
1945: jj_consume_token(RPAREN);
1946: } catch (Throwable jjte000) {
1947: if (jjtc000) {
1948: jjtree.clearNodeScope(jjtn000);
1949: jjtc000 = false;
1950: } else {
1951: jjtree.popNode();
1952: }
1953: if (jjte000 instanceof RuntimeException) {
1954: {
1955: if (true)
1956: throw (RuntimeException) jjte000;
1957: }
1958: }
1959: if (jjte000 instanceof ParseException) {
1960: {
1961: if (true)
1962: throw (ParseException) jjte000;
1963: }
1964: }
1965: {
1966: if (true)
1967: throw (Error) jjte000;
1968: }
1969: } finally {
1970: if (jjtc000) {
1971: jjtree.closeNodeScope(jjtn000, true);
1972: }
1973: }
1974: }
1975:
1976: final public void BooleanValueOp() throws ParseException {
1977: ValueExprOrNull();
1978: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1979: case EQ:
1980: case NE:
1981: case LT:
1982: case LE:
1983: case GE:
1984: case GT:
1985: CompOperator();
1986: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
1987: case NAMESPACE:
1988: case LABEL:
1989: case LANG:
1990: case DATATYPE:
1991: case LOCALNAME:
1992: case NULL:
1993: case LANG_LITERAL:
1994: case DATATYPED_LITERAL:
1995: case STRING:
1996: case URI:
1997: case QNAME:
1998: case BNODE:
1999: case PREFIX_NAME:
2000: case POS_INTEGER:
2001: case NEG_INTEGER:
2002: case DECIMAL:
2003: ASTCompare jjtn001 = new ASTCompare(JJTCOMPARE);
2004: boolean jjtc001 = true;
2005: jjtree.openNodeScope(jjtn001);
2006: try {
2007: ValueExprOrNull();
2008: } catch (Throwable jjte001) {
2009: if (jjtc001) {
2010: jjtree.clearNodeScope(jjtn001);
2011: jjtc001 = false;
2012: } else {
2013: jjtree.popNode();
2014: }
2015: if (jjte001 instanceof RuntimeException) {
2016: {
2017: if (true)
2018: throw (RuntimeException) jjte001;
2019: }
2020: }
2021: if (jjte001 instanceof ParseException) {
2022: {
2023: if (true)
2024: throw (ParseException) jjte001;
2025: }
2026: }
2027: {
2028: if (true)
2029: throw (Error) jjte001;
2030: }
2031: } finally {
2032: if (jjtc001) {
2033: jjtree.closeNodeScope(jjtn001, 3);
2034: }
2035: }
2036: break;
2037: case ANY:
2038: jj_consume_token(ANY);
2039: jj_consume_token(LPAREN);
2040: TupleQuerySet();
2041: ASTCompareAny jjtn002 = new ASTCompareAny(JJTCOMPAREANY);
2042: boolean jjtc002 = true;
2043: jjtree.openNodeScope(jjtn002);
2044: try {
2045: jj_consume_token(RPAREN);
2046: } finally {
2047: if (jjtc002) {
2048: jjtree.closeNodeScope(jjtn002, 3);
2049: }
2050: }
2051: break;
2052: case ALL:
2053: jj_consume_token(ALL);
2054: jj_consume_token(LPAREN);
2055: TupleQuerySet();
2056: ASTCompareAll jjtn003 = new ASTCompareAll(JJTCOMPAREALL);
2057: boolean jjtc003 = true;
2058: jjtree.openNodeScope(jjtn003);
2059: try {
2060: jj_consume_token(RPAREN);
2061: } finally {
2062: if (jjtc003) {
2063: jjtree.closeNodeScope(jjtn003, 3);
2064: }
2065: }
2066: break;
2067: default:
2068: jj_la1[46] = jj_gen;
2069: jj_consume_token(-1);
2070: throw new ParseException();
2071: }
2072: break;
2073: case LIKE:
2074: jj_consume_token(LIKE);
2075: String();
2076: ASTLike jjtn004 = new ASTLike(JJTLIKE);
2077: boolean jjtc004 = true;
2078: jjtree.openNodeScope(jjtn004);
2079: try {
2080: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
2081: case IGNORE:
2082: jj_consume_token(IGNORE);
2083: jj_consume_token(CASE);
2084: jjtn004.setIgnoreCase(true);
2085: break;
2086: default:
2087: jj_la1[47] = jj_gen;
2088: ;
2089: }
2090: } finally {
2091: if (jjtc004) {
2092: jjtree.closeNodeScope(jjtn004, 2);
2093: }
2094: }
2095: break;
2096: case IN:
2097: jj_consume_token(IN);
2098: jj_consume_token(LPAREN);
2099: TupleQuerySet();
2100: ASTIn jjtn005 = new ASTIn(JJTIN);
2101: boolean jjtc005 = true;
2102: jjtree.openNodeScope(jjtn005);
2103: try {
2104: jj_consume_token(RPAREN);
2105: } finally {
2106: if (jjtc005) {
2107: jjtree.closeNodeScope(jjtn005, 2);
2108: }
2109: }
2110: break;
2111: default:
2112: jj_la1[48] = jj_gen;
2113: jj_consume_token(-1);
2114: throw new ParseException();
2115: }
2116: }
2117:
2118: final public void CompOperator() throws ParseException {
2119: /*@bgen(jjtree) CompOperator */
2120: ASTCompOperator jjtn000 = new ASTCompOperator(JJTCOMPOPERATOR);
2121: boolean jjtc000 = true;
2122: jjtree.openNodeScope(jjtn000);
2123: try {
2124: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
2125: case EQ:
2126: jj_consume_token(EQ);
2127: jjtree.closeNodeScope(jjtn000, true);
2128: jjtc000 = false;
2129: jjtn000.setValue(CompareOp.EQ);
2130: break;
2131: case NE:
2132: jj_consume_token(NE);
2133: jjtree.closeNodeScope(jjtn000, true);
2134: jjtc000 = false;
2135: jjtn000.setValue(CompareOp.NE);
2136: break;
2137: case LT:
2138: jj_consume_token(LT);
2139: jjtree.closeNodeScope(jjtn000, true);
2140: jjtc000 = false;
2141: jjtn000.setValue(CompareOp.LT);
2142: break;
2143: case LE:
2144: jj_consume_token(LE);
2145: jjtree.closeNodeScope(jjtn000, true);
2146: jjtc000 = false;
2147: jjtn000.setValue(CompareOp.LE);
2148: break;
2149: case GE:
2150: jj_consume_token(GE);
2151: jjtree.closeNodeScope(jjtn000, true);
2152: jjtc000 = false;
2153: jjtn000.setValue(CompareOp.GE);
2154: break;
2155: case GT:
2156: jj_consume_token(GT);
2157: jjtree.closeNodeScope(jjtn000, true);
2158: jjtc000 = false;
2159: jjtn000.setValue(CompareOp.GT);
2160: break;
2161: default:
2162: jj_la1[49] = jj_gen;
2163: jj_consume_token(-1);
2164: throw new ParseException();
2165: }
2166: } finally {
2167: if (jjtc000) {
2168: jjtree.closeNodeScope(jjtn000, true);
2169: }
2170: }
2171: }
2172:
2173: // For backwards compatibility; NULL will be phased out, use BOUND instead
2174: final public void ValueExprOrNull() throws ParseException {
2175: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
2176: case NAMESPACE:
2177: case LABEL:
2178: case LANG:
2179: case DATATYPE:
2180: case LOCALNAME:
2181: case LANG_LITERAL:
2182: case DATATYPED_LITERAL:
2183: case STRING:
2184: case URI:
2185: case QNAME:
2186: case BNODE:
2187: case PREFIX_NAME:
2188: case POS_INTEGER:
2189: case NEG_INTEGER:
2190: case DECIMAL:
2191: ValueExpr();
2192: break;
2193: case NULL:
2194: Null();
2195: break;
2196: default:
2197: jj_la1[50] = jj_gen;
2198: jj_consume_token(-1);
2199: throw new ParseException();
2200: }
2201: }
2202:
2203: final public void ValueExpr() throws ParseException {
2204: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
2205: case PREFIX_NAME:
2206: Var();
2207: break;
2208: case DATATYPE:
2209: Datatype();
2210: break;
2211: case LANG:
2212: Lang();
2213: break;
2214: case LABEL:
2215: Label();
2216: break;
2217: case NAMESPACE:
2218: Namespace();
2219: break;
2220: case LOCALNAME:
2221: LocalName();
2222: break;
2223: default:
2224: jj_la1[51] = jj_gen;
2225: if (jj_2_2(2)) {
2226: FunctionCall();
2227: } else {
2228: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
2229: case LANG_LITERAL:
2230: case DATATYPED_LITERAL:
2231: case STRING:
2232: case URI:
2233: case QNAME:
2234: case BNODE:
2235: case POS_INTEGER:
2236: case NEG_INTEGER:
2237: case DECIMAL:
2238: Value();
2239: break;
2240: default:
2241: jj_la1[52] = jj_gen;
2242: jj_consume_token(-1);
2243: throw new ParseException();
2244: }
2245: }
2246: }
2247: }
2248:
2249: final public void Var() throws ParseException {
2250: /*@bgen(jjtree) Var */
2251: ASTVar jjtn000 = new ASTVar(JJTVAR);
2252: boolean jjtc000 = true;
2253: jjtree.openNodeScope(jjtn000);
2254: Token t;
2255: try {
2256: t = jj_consume_token(PREFIX_NAME);
2257: jjtree.closeNodeScope(jjtn000, true);
2258: jjtc000 = false;
2259: jjtn000.setName(t.image);
2260: } finally {
2261: if (jjtc000) {
2262: jjtree.closeNodeScope(jjtn000, true);
2263: }
2264: }
2265: }
2266:
2267: final public void Datatype() throws ParseException {
2268: /*@bgen(jjtree) Datatype */
2269: ASTDatatype jjtn000 = new ASTDatatype(JJTDATATYPE);
2270: boolean jjtc000 = true;
2271: jjtree.openNodeScope(jjtn000);
2272: try {
2273: jj_consume_token(DATATYPE);
2274: jj_consume_token(LPAREN);
2275: Var();
2276: jj_consume_token(RPAREN);
2277: } catch (Throwable jjte000) {
2278: if (jjtc000) {
2279: jjtree.clearNodeScope(jjtn000);
2280: jjtc000 = false;
2281: } else {
2282: jjtree.popNode();
2283: }
2284: if (jjte000 instanceof RuntimeException) {
2285: {
2286: if (true)
2287: throw (RuntimeException) jjte000;
2288: }
2289: }
2290: if (jjte000 instanceof ParseException) {
2291: {
2292: if (true)
2293: throw (ParseException) jjte000;
2294: }
2295: }
2296: {
2297: if (true)
2298: throw (Error) jjte000;
2299: }
2300: } finally {
2301: if (jjtc000) {
2302: jjtree.closeNodeScope(jjtn000, true);
2303: }
2304: }
2305: }
2306:
2307: final public void Lang() throws ParseException {
2308: /*@bgen(jjtree) Lang */
2309: ASTLang jjtn000 = new ASTLang(JJTLANG);
2310: boolean jjtc000 = true;
2311: jjtree.openNodeScope(jjtn000);
2312: try {
2313: jj_consume_token(LANG);
2314: jj_consume_token(LPAREN);
2315: Var();
2316: jj_consume_token(RPAREN);
2317: } catch (Throwable jjte000) {
2318: if (jjtc000) {
2319: jjtree.clearNodeScope(jjtn000);
2320: jjtc000 = false;
2321: } else {
2322: jjtree.popNode();
2323: }
2324: if (jjte000 instanceof RuntimeException) {
2325: {
2326: if (true)
2327: throw (RuntimeException) jjte000;
2328: }
2329: }
2330: if (jjte000 instanceof ParseException) {
2331: {
2332: if (true)
2333: throw (ParseException) jjte000;
2334: }
2335: }
2336: {
2337: if (true)
2338: throw (Error) jjte000;
2339: }
2340: } finally {
2341: if (jjtc000) {
2342: jjtree.closeNodeScope(jjtn000, true);
2343: }
2344: }
2345: }
2346:
2347: final public void Label() throws ParseException {
2348: /*@bgen(jjtree) Label */
2349: ASTLabel jjtn000 = new ASTLabel(JJTLABEL);
2350: boolean jjtc000 = true;
2351: jjtree.openNodeScope(jjtn000);
2352: try {
2353: jj_consume_token(LABEL);
2354: jj_consume_token(LPAREN);
2355: Var();
2356: jj_consume_token(RPAREN);
2357: } catch (Throwable jjte000) {
2358: if (jjtc000) {
2359: jjtree.clearNodeScope(jjtn000);
2360: jjtc000 = false;
2361: } else {
2362: jjtree.popNode();
2363: }
2364: if (jjte000 instanceof RuntimeException) {
2365: {
2366: if (true)
2367: throw (RuntimeException) jjte000;
2368: }
2369: }
2370: if (jjte000 instanceof ParseException) {
2371: {
2372: if (true)
2373: throw (ParseException) jjte000;
2374: }
2375: }
2376: {
2377: if (true)
2378: throw (Error) jjte000;
2379: }
2380: } finally {
2381: if (jjtc000) {
2382: jjtree.closeNodeScope(jjtn000, true);
2383: }
2384: }
2385: }
2386:
2387: final public void Namespace() throws ParseException {
2388: /*@bgen(jjtree) Namespace */
2389: ASTNamespace jjtn000 = new ASTNamespace(JJTNAMESPACE);
2390: boolean jjtc000 = true;
2391: jjtree.openNodeScope(jjtn000);
2392: try {
2393: jj_consume_token(NAMESPACE);
2394: jj_consume_token(LPAREN);
2395: Var();
2396: jj_consume_token(RPAREN);
2397: } catch (Throwable jjte000) {
2398: if (jjtc000) {
2399: jjtree.clearNodeScope(jjtn000);
2400: jjtc000 = false;
2401: } else {
2402: jjtree.popNode();
2403: }
2404: if (jjte000 instanceof RuntimeException) {
2405: {
2406: if (true)
2407: throw (RuntimeException) jjte000;
2408: }
2409: }
2410: if (jjte000 instanceof ParseException) {
2411: {
2412: if (true)
2413: throw (ParseException) jjte000;
2414: }
2415: }
2416: {
2417: if (true)
2418: throw (Error) jjte000;
2419: }
2420: } finally {
2421: if (jjtc000) {
2422: jjtree.closeNodeScope(jjtn000, true);
2423: }
2424: }
2425: }
2426:
2427: final public void LocalName() throws ParseException {
2428: /*@bgen(jjtree) LocalName */
2429: ASTLocalName jjtn000 = new ASTLocalName(JJTLOCALNAME);
2430: boolean jjtc000 = true;
2431: jjtree.openNodeScope(jjtn000);
2432: try {
2433: jj_consume_token(LOCALNAME);
2434: jj_consume_token(LPAREN);
2435: Var();
2436: jj_consume_token(RPAREN);
2437: } catch (Throwable jjte000) {
2438: if (jjtc000) {
2439: jjtree.clearNodeScope(jjtn000);
2440: jjtc000 = false;
2441: } else {
2442: jjtree.popNode();
2443: }
2444: if (jjte000 instanceof RuntimeException) {
2445: {
2446: if (true)
2447: throw (RuntimeException) jjte000;
2448: }
2449: }
2450: if (jjte000 instanceof ParseException) {
2451: {
2452: if (true)
2453: throw (ParseException) jjte000;
2454: }
2455: }
2456: {
2457: if (true)
2458: throw (Error) jjte000;
2459: }
2460: } finally {
2461: if (jjtc000) {
2462: jjtree.closeNodeScope(jjtn000, true);
2463: }
2464: }
2465: }
2466:
2467: final public void Bound() throws ParseException {
2468: /*@bgen(jjtree) Bound */
2469: ASTBound jjtn000 = new ASTBound(JJTBOUND);
2470: boolean jjtc000 = true;
2471: jjtree.openNodeScope(jjtn000);
2472: try {
2473: jj_consume_token(BOUND);
2474: jj_consume_token(LPAREN);
2475: Var();
2476: jj_consume_token(RPAREN);
2477: } catch (Throwable jjte000) {
2478: if (jjtc000) {
2479: jjtree.clearNodeScope(jjtn000);
2480: jjtc000 = false;
2481: } else {
2482: jjtree.popNode();
2483: }
2484: if (jjte000 instanceof RuntimeException) {
2485: {
2486: if (true)
2487: throw (RuntimeException) jjte000;
2488: }
2489: }
2490: if (jjte000 instanceof ParseException) {
2491: {
2492: if (true)
2493: throw (ParseException) jjte000;
2494: }
2495: }
2496: {
2497: if (true)
2498: throw (Error) jjte000;
2499: }
2500: } finally {
2501: if (jjtc000) {
2502: jjtree.closeNodeScope(jjtn000, true);
2503: }
2504: }
2505: }
2506:
2507: final public void FunctionCall() throws ParseException {
2508: /*@bgen(jjtree) FunctionCall */
2509: ASTFunctionCall jjtn000 = new ASTFunctionCall(JJTFUNCTIONCALL);
2510: boolean jjtc000 = true;
2511: jjtree.openNodeScope(jjtn000);
2512: try {
2513: URIRef();
2514: jj_consume_token(LPAREN);
2515: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
2516: case NAMESPACE:
2517: case LABEL:
2518: case LANG:
2519: case DATATYPE:
2520: case LOCALNAME:
2521: case LANG_LITERAL:
2522: case DATATYPED_LITERAL:
2523: case STRING:
2524: case URI:
2525: case QNAME:
2526: case BNODE:
2527: case PREFIX_NAME:
2528: case POS_INTEGER:
2529: case NEG_INTEGER:
2530: case DECIMAL:
2531: ArgList();
2532: break;
2533: default:
2534: jj_la1[53] = jj_gen;
2535: ;
2536: }
2537: jj_consume_token(RPAREN);
2538: } catch (Throwable jjte000) {
2539: if (jjtc000) {
2540: jjtree.clearNodeScope(jjtn000);
2541: jjtc000 = false;
2542: } else {
2543: jjtree.popNode();
2544: }
2545: if (jjte000 instanceof RuntimeException) {
2546: {
2547: if (true)
2548: throw (RuntimeException) jjte000;
2549: }
2550: }
2551: if (jjte000 instanceof ParseException) {
2552: {
2553: if (true)
2554: throw (ParseException) jjte000;
2555: }
2556: }
2557: {
2558: if (true)
2559: throw (Error) jjte000;
2560: }
2561: } finally {
2562: if (jjtc000) {
2563: jjtree.closeNodeScope(jjtn000, true);
2564: }
2565: }
2566: }
2567:
2568: final public void ArgList() throws ParseException {
2569: ValueExpr();
2570: label_8: while (true) {
2571: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
2572: case COMMA:
2573: ;
2574: break;
2575: default:
2576: jj_la1[54] = jj_gen;
2577: break label_8;
2578: }
2579: jj_consume_token(COMMA);
2580: ValueExpr();
2581: }
2582: }
2583:
2584: final public void Value() throws ParseException {
2585: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
2586: case URI:
2587: case QNAME:
2588: URIRef();
2589: break;
2590: case BNODE:
2591: BNode();
2592: break;
2593: case LANG_LITERAL:
2594: case DATATYPED_LITERAL:
2595: case STRING:
2596: case POS_INTEGER:
2597: case NEG_INTEGER:
2598: case DECIMAL:
2599: Literal();
2600: break;
2601: default:
2602: jj_la1[55] = jj_gen;
2603: jj_consume_token(-1);
2604: throw new ParseException();
2605: }
2606: }
2607:
2608: final public void URIRef() throws ParseException {
2609: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
2610: case URI:
2611: URI();
2612: break;
2613: case QNAME:
2614: QName();
2615: break;
2616: default:
2617: jj_la1[56] = jj_gen;
2618: jj_consume_token(-1);
2619: throw new ParseException();
2620: }
2621: }
2622:
2623: final public void URI() throws ParseException {
2624: /*@bgen(jjtree) URI */
2625: ASTURI jjtn000 = new ASTURI(JJTURI);
2626: boolean jjtc000 = true;
2627: jjtree.openNodeScope(jjtn000);
2628: Token t;
2629: try {
2630: t = jj_consume_token(URI);
2631: jjtree.closeNodeScope(jjtn000, true);
2632: jjtc000 = false;
2633: jjtn000.setValue(_trimString(t.image));
2634: } finally {
2635: if (jjtc000) {
2636: jjtree.closeNodeScope(jjtn000, true);
2637: }
2638: }
2639: }
2640:
2641: final public void QName() throws ParseException {
2642: /*@bgen(jjtree) QName */
2643: ASTQName jjtn000 = new ASTQName(JJTQNAME);
2644: boolean jjtc000 = true;
2645: jjtree.openNodeScope(jjtn000);
2646: Token t;
2647: try {
2648: t = jj_consume_token(QNAME);
2649: jjtree.closeNodeScope(jjtn000, true);
2650: jjtc000 = false;
2651: jjtn000.setValue(t.image);
2652: } finally {
2653: if (jjtc000) {
2654: jjtree.closeNodeScope(jjtn000, true);
2655: }
2656: }
2657: }
2658:
2659: final public void BNode() throws ParseException {
2660: /*@bgen(jjtree) BNode */
2661: ASTBNode jjtn000 = new ASTBNode(JJTBNODE);
2662: boolean jjtc000 = true;
2663: jjtree.openNodeScope(jjtn000);
2664: Token t;
2665: try {
2666: t = jj_consume_token(BNODE);
2667: jjtree.closeNodeScope(jjtn000, true);
2668: jjtc000 = false;
2669: jjtn000.setID(t.image.substring(2));
2670: } finally {
2671: if (jjtc000) {
2672: jjtree.closeNodeScope(jjtn000, true);
2673: }
2674: }
2675: }
2676:
2677: final public void Literal() throws ParseException {
2678: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
2679: case STRING:
2680: SimpleLiteral();
2681: break;
2682: case LANG_LITERAL:
2683: LangLiteral();
2684: break;
2685: case DATATYPED_LITERAL:
2686: DatatypedLiteral();
2687: break;
2688: case POS_INTEGER:
2689: case NEG_INTEGER:
2690: IntegerLiteral();
2691: break;
2692: case DECIMAL:
2693: DecimalLiteral();
2694: break;
2695: default:
2696: jj_la1[57] = jj_gen;
2697: jj_consume_token(-1);
2698: throw new ParseException();
2699: }
2700: }
2701:
2702: final public void SimpleLiteral() throws ParseException {
2703: /*@bgen(jjtree) Literal */
2704: ASTLiteral jjtn000 = new ASTLiteral(JJTLITERAL);
2705: boolean jjtc000 = true;
2706: jjtree.openNodeScope(jjtn000);
2707: Token t;
2708: try {
2709: t = jj_consume_token(STRING);
2710: jjtree.closeNodeScope(jjtn000, true);
2711: jjtc000 = false;
2712: jjtn000.setLabel(_trimString(t.image));
2713: } finally {
2714: if (jjtc000) {
2715: jjtree.closeNodeScope(jjtn000, true);
2716: }
2717: }
2718: }
2719:
2720: final public void LangLiteral() throws ParseException {
2721: /*@bgen(jjtree) Literal */
2722: ASTLiteral jjtn000 = new ASTLiteral(JJTLITERAL);
2723: boolean jjtc000 = true;
2724: jjtree.openNodeScope(jjtn000);
2725: Token t;
2726: try {
2727: t = jj_consume_token(LANG_LITERAL);
2728: jjtree.closeNodeScope(jjtn000, true);
2729: jjtc000 = false;
2730: int atIdx = t.image.lastIndexOf('@');
2731: jjtn000.setLabel(t.image.substring(1, atIdx - 1));
2732: jjtn000.setLang(t.image.substring(atIdx + 1));
2733: } finally {
2734: if (jjtc000) {
2735: jjtree.closeNodeScope(jjtn000, true);
2736: }
2737: }
2738: }
2739:
2740: final public void DatatypedLiteral() throws ParseException {
2741: /*@bgen(jjtree) Literal */
2742: ASTLiteral jjtn000 = new ASTLiteral(JJTLITERAL);
2743: boolean jjtc000 = true;
2744: jjtree.openNodeScope(jjtn000);
2745: Token t;
2746: try {
2747: t = jj_consume_token(DATATYPED_LITERAL);
2748: jjtree.closeNodeScope(jjtn000, true);
2749: jjtc000 = false;
2750: int dtIdx;
2751: if (t.image.endsWith(">")) {
2752: // URI
2753: dtIdx = t.image.lastIndexOf("<") - 2;
2754: String uri = t.image.substring(dtIdx + 3, t.image
2755: .length() - 1);
2756: ASTURI uriNode = new ASTURI(JJTURI, uri);
2757: jjtn000.jjtAddChild(uriNode, 0);
2758: uriNode.jjtSetParent(jjtn000);
2759: } else {
2760: // QNAME
2761: dtIdx = t.image.lastIndexOf("^^");
2762: String qname = t.image.substring(dtIdx + 2);
2763: ASTQName qnameNode = new ASTQName(JJTQNAME, qname);
2764: jjtn000.jjtAddChild(qnameNode, 0);
2765: qnameNode.jjtSetParent(jjtn000);
2766: }
2767:
2768: jjtn000.setLabel(t.image.substring(1, dtIdx - 1));
2769: } finally {
2770: if (jjtc000) {
2771: jjtree.closeNodeScope(jjtn000, true);
2772: }
2773: }
2774: }
2775:
2776: final public void IntegerLiteral() throws ParseException {
2777: /*@bgen(jjtree) Literal */
2778: ASTLiteral jjtn000 = new ASTLiteral(JJTLITERAL);
2779: boolean jjtc000 = true;
2780: jjtree.openNodeScope(jjtn000);
2781: Token t;
2782: try {
2783: switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
2784: case POS_INTEGER:
2785: t = jj_consume_token(POS_INTEGER);
2786: break;
2787: case NEG_INTEGER:
2788: t = jj_consume_token(NEG_INTEGER);
2789: break;
2790: default:
2791: jj_la1[58] = jj_gen;
2792: jj_consume_token(-1);
2793: throw new ParseException();
2794: }
2795: jjtree.closeNodeScope(jjtn000, true);
2796: jjtc000 = false;
2797: jjtn000.setLabel(t.image);
2798:
2799: ASTURI uriNode = new ASTURI(JJTURI, XMLSchema.INTEGER
2800: .toString());
2801: jjtn000.jjtAddChild(uriNode, 0);
2802: uriNode.jjtSetParent(jjtn000);
2803: } finally {
2804: if (jjtc000) {
2805: jjtree.closeNodeScope(jjtn000, true);
2806: }
2807: }
2808: }
2809:
2810: final public void DecimalLiteral() throws ParseException {
2811: /*@bgen(jjtree) Literal */
2812: ASTLiteral jjtn000 = new ASTLiteral(JJTLITERAL);
2813: boolean jjtc000 = true;
2814: jjtree.openNodeScope(jjtn000);
2815: Token t;
2816: try {
2817: t = jj_consume_token(DECIMAL);
2818: jjtree.closeNodeScope(jjtn000, true);
2819: jjtc000 = false;
2820: jjtn000.setLabel(t.image);
2821:
2822: ASTURI uriNode = new ASTURI(JJTURI, XMLSchema.DECIMAL
2823: .toString());
2824: jjtn000.jjtAddChild(uriNode, 0);
2825: uriNode.jjtSetParent(jjtn000);
2826: } finally {
2827: if (jjtc000) {
2828: jjtree.closeNodeScope(jjtn000, true);
2829: }
2830: }
2831: }
2832:
2833: final public void String() throws ParseException {
2834: /*@bgen(jjtree) String */
2835: ASTString jjtn000 = new ASTString(JJTSTRING);
2836: boolean jjtc000 = true;
2837: jjtree.openNodeScope(jjtn000);
2838: Token t;
2839: try {
2840: t = jj_consume_token(STRING);
2841: jjtree.closeNodeScope(jjtn000, true);
2842: jjtc000 = false;
2843: jjtn000.setValue(_trimString(t.image));
2844: } finally {
2845: if (jjtc000) {
2846: jjtree.closeNodeScope(jjtn000, true);
2847: }
2848: }
2849: }
2850:
2851: final public void Null() throws ParseException {
2852: /*@bgen(jjtree) Null */
2853: ASTNull jjtn000 = new ASTNull(JJTNULL);
2854: boolean jjtc000 = true;
2855: jjtree.openNodeScope(jjtn000);
2856: try {
2857: jj_consume_token(NULL);
2858: } finally {
2859: if (jjtc000) {
2860: jjtree.closeNodeScope(jjtn000, true);
2861: }
2862: }
2863: }
2864:
2865: final public int PosInteger() throws ParseException {
2866: Token t;
2867: t = jj_consume_token(POS_INTEGER);
2868: {
2869: if (true)
2870: return Integer.parseInt(t.image);
2871: }
2872: throw new Error("Missing return statement in function");
2873: }
2874:
2875: final private boolean jj_2_1(int xla) {
2876: jj_la = xla;
2877: jj_lastpos = jj_scanpos = token;
2878: try {
2879: return !jj_3_1();
2880: } catch (LookaheadSuccess ls) {
2881: return true;
2882: } finally {
2883: jj_save(0, xla);
2884: }
2885: }
2886:
2887: final private boolean jj_2_2(int xla) {
2888: jj_la = xla;
2889: jj_lastpos = jj_scanpos = token;
2890: try {
2891: return !jj_3_2();
2892: } catch (LookaheadSuccess ls) {
2893: return true;
2894: } finally {
2895: jj_save(1, xla);
2896: }
2897: }
2898:
2899: final private boolean jj_3R_9() {
2900: if (jj_3R_10())
2901: return true;
2902: if (jj_scan_token(LPAREN))
2903: return true;
2904: return false;
2905: }
2906:
2907: final private boolean jj_3R_14() {
2908: if (jj_scan_token(QNAME))
2909: return true;
2910: return false;
2911: }
2912:
2913: final private boolean jj_3R_11() {
2914: if (jj_3R_13())
2915: return true;
2916: return false;
2917: }
2918:
2919: final private boolean jj_3R_10() {
2920: Token xsp;
2921: xsp = jj_scanpos;
2922: if (jj_3R_11()) {
2923: jj_scanpos = xsp;
2924: if (jj_3R_12())
2925: return true;
2926: }
2927: return false;
2928: }
2929:
2930: final private boolean jj_3_2() {
2931: if (jj_3R_9())
2932: return true;
2933: return false;
2934: }
2935:
2936: final private boolean jj_3R_12() {
2937: if (jj_3R_14())
2938: return true;
2939: return false;
2940: }
2941:
2942: final private boolean jj_3R_13() {
2943: if (jj_scan_token(URI))
2944: return true;
2945: return false;
2946: }
2947:
2948: final private boolean jj_3_1() {
2949: Token xsp;
2950: while (true) {
2951: xsp = jj_scanpos;
2952: if (jj_scan_token(17)) {
2953: jj_scanpos = xsp;
2954: break;
2955: }
2956: }
2957: if (jj_scan_token(SELECT))
2958: return true;
2959: return false;
2960: }
2961:
2962: public SyntaxTreeBuilderTokenManager token_source;
2963: SimpleCharStream jj_input_stream;
2964: public Token token, jj_nt;
2965: private int jj_ntk;
2966: private Token jj_scanpos, jj_lastpos;
2967: private int jj_la;
2968: public boolean lookingAhead = false;
2969: private boolean jj_semLA;
2970: private int jj_gen;
2971: final private int[] jj_la1 = new int[59];
2972: static private int[] jj_la1_0;
2973: static private int[] jj_la1_1;
2974: static private int[] jj_la1_2;
2975: static {
2976: jj_la1_0();
2977: jj_la1_1();
2978: jj_la1_2();
2979: }
2980:
2981: private static void jj_la1_0() {
2982: jj_la1_0 = new int[] { 0x200000, 0x2000, 0x1020000, 0x0, 0x0,
2983: 0x0, 0x0, 0x0, 0x0, 0x820000, 0x1020000, 0x20000000,
2984: 0x40000000, 0x4000000, 0x2000000, 0x2000, 0x400000,
2985: 0x1000, 0x0, 0x20000000, 0x40000000, 0x4000000,
2986: 0x2000000, 0x89000, 0x4000000, 0x10000000, 0x8000000,
2987: 0x0, 0x2000, 0x88000, 0x10000000, 0x84000, 0x80000,
2988: 0x84000, 0x10000000, 0x4000, 0x0, 0x2000, 0x8000,
2989: 0x8000, 0x8000, 0x8000, 0x0, 0x0, 0x80420000,
2990: 0x80000000, 0x400000, 0x0, 0xfc0, 0xfc0, 0x400000,
2991: 0x400000, 0x0, 0x400000, 0x2000, 0x0, 0x0, 0x0, 0x0, };
2992: }
2993:
2994: private static void jj_la1_1() {
2995: jj_la1_1 = new int[] { 0x0, 0x0, 0x0, 0x400000, 0x1c0000,
2996: 0x1c0000, 0x400000, 0x1c0000, 0x1c0000, 0x0, 0x0, 0x0,
2997: 0x0, 0x0, 0x0, 0x0, 0xe001780, 0x0, 0x20000, 0x0, 0x0,
2998: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
2999: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe000000, 0xe000000,
3000: 0xe000000, 0xe000000, 0x8, 0x4, 0xf01ff83, 0x1,
3001: 0xe601780, 0x20, 0x800010, 0x0, 0xe001780, 0x780,
3002: 0xe000000, 0xe000780, 0x0, 0xe000000, 0x0, 0xe000000,
3003: 0x0, };
3004: }
3005:
3006: private static void jj_la1_2() {
3007: jj_la1_2 = new int[] { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
3008: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xfd, 0x0, 0x0,
3009: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1d, 0x0, 0x0,
3010: 0x0, 0x15, 0x15, 0x15, 0x0, 0x0, 0x15, 0x0, 0xfd, 0xfd,
3011: 0xfd, 0xfd, 0x0, 0x0, 0xfd, 0x0, 0xfd, 0x0, 0x0, 0x0,
3012: 0xfd, 0x10, 0xed, 0xfd, 0x0, 0xed, 0x5, 0xe0, 0x60, };
3013: }
3014:
3015: final private JJCalls[] jj_2_rtns = new JJCalls[2];
3016: private boolean jj_rescan = false;
3017: private int jj_gc = 0;
3018:
3019: public SyntaxTreeBuilder(java.io.InputStream stream) {
3020: this (stream, null);
3021: }
3022:
3023: public SyntaxTreeBuilder(java.io.InputStream stream, String encoding) {
3024: try {
3025: jj_input_stream = new SimpleCharStream(stream, encoding, 1,
3026: 1);
3027: } catch (java.io.UnsupportedEncodingException e) {
3028: throw new RuntimeException(e);
3029: }
3030: token_source = new SyntaxTreeBuilderTokenManager(
3031: jj_input_stream);
3032: token = new Token();
3033: jj_ntk = -1;
3034: jj_gen = 0;
3035: for (int i = 0; i < 59; i++)
3036: jj_la1[i] = -1;
3037: for (int i = 0; i < jj_2_rtns.length; i++)
3038: jj_2_rtns[i] = new JJCalls();
3039: }
3040:
3041: public void ReInit(java.io.InputStream stream) {
3042: ReInit(stream, null);
3043: }
3044:
3045: public void ReInit(java.io.InputStream stream, String encoding) {
3046: try {
3047: jj_input_stream.ReInit(stream, encoding, 1, 1);
3048: } catch (java.io.UnsupportedEncodingException e) {
3049: throw new RuntimeException(e);
3050: }
3051: token_source.ReInit(jj_input_stream);
3052: token = new Token();
3053: jj_ntk = -1;
3054: jjtree.reset();
3055: jj_gen = 0;
3056: for (int i = 0; i < 59; i++)
3057: jj_la1[i] = -1;
3058: for (int i = 0; i < jj_2_rtns.length; i++)
3059: jj_2_rtns[i] = new JJCalls();
3060: }
3061:
3062: public SyntaxTreeBuilder(java.io.Reader stream) {
3063: jj_input_stream = new SimpleCharStream(stream, 1, 1);
3064: token_source = new SyntaxTreeBuilderTokenManager(
3065: jj_input_stream);
3066: token = new Token();
3067: jj_ntk = -1;
3068: jj_gen = 0;
3069: for (int i = 0; i < 59; i++)
3070: jj_la1[i] = -1;
3071: for (int i = 0; i < jj_2_rtns.length; i++)
3072: jj_2_rtns[i] = new JJCalls();
3073: }
3074:
3075: public void ReInit(java.io.Reader stream) {
3076: jj_input_stream.ReInit(stream, 1, 1);
3077: token_source.ReInit(jj_input_stream);
3078: token = new Token();
3079: jj_ntk = -1;
3080: jjtree.reset();
3081: jj_gen = 0;
3082: for (int i = 0; i < 59; i++)
3083: jj_la1[i] = -1;
3084: for (int i = 0; i < jj_2_rtns.length; i++)
3085: jj_2_rtns[i] = new JJCalls();
3086: }
3087:
3088: public SyntaxTreeBuilder(SyntaxTreeBuilderTokenManager tm) {
3089: token_source = tm;
3090: token = new Token();
3091: jj_ntk = -1;
3092: jj_gen = 0;
3093: for (int i = 0; i < 59; i++)
3094: jj_la1[i] = -1;
3095: for (int i = 0; i < jj_2_rtns.length; i++)
3096: jj_2_rtns[i] = new JJCalls();
3097: }
3098:
3099: public void ReInit(SyntaxTreeBuilderTokenManager tm) {
3100: token_source = tm;
3101: token = new Token();
3102: jj_ntk = -1;
3103: jjtree.reset();
3104: jj_gen = 0;
3105: for (int i = 0; i < 59; i++)
3106: jj_la1[i] = -1;
3107: for (int i = 0; i < jj_2_rtns.length; i++)
3108: jj_2_rtns[i] = new JJCalls();
3109: }
3110:
3111: final private Token jj_consume_token(int kind)
3112: throws ParseException {
3113: Token oldToken;
3114: if ((oldToken = token).next != null)
3115: token = token.next;
3116: else
3117: token = token.next = token_source.getNextToken();
3118: jj_ntk = -1;
3119: if (token.kind == kind) {
3120: jj_gen++;
3121: if (++jj_gc > 100) {
3122: jj_gc = 0;
3123: for (int i = 0; i < jj_2_rtns.length; i++) {
3124: JJCalls c = jj_2_rtns[i];
3125: while (c != null) {
3126: if (c.gen < jj_gen)
3127: c.first = null;
3128: c = c.next;
3129: }
3130: }
3131: }
3132: return token;
3133: }
3134: token = oldToken;
3135: jj_kind = kind;
3136: throw generateParseException();
3137: }
3138:
3139: static private final class LookaheadSuccess extends java.lang.Error {
3140: }
3141:
3142: final private LookaheadSuccess jj_ls = new LookaheadSuccess();
3143:
3144: final private boolean jj_scan_token(int kind) {
3145: if (jj_scanpos == jj_lastpos) {
3146: jj_la--;
3147: if (jj_scanpos.next == null) {
3148: jj_lastpos = jj_scanpos = jj_scanpos.next = token_source
3149: .getNextToken();
3150: } else {
3151: jj_lastpos = jj_scanpos = jj_scanpos.next;
3152: }
3153: } else {
3154: jj_scanpos = jj_scanpos.next;
3155: }
3156: if (jj_rescan) {
3157: int i = 0;
3158: Token tok = token;
3159: while (tok != null && tok != jj_scanpos) {
3160: i++;
3161: tok = tok.next;
3162: }
3163: if (tok != null)
3164: jj_add_error_token(kind, i);
3165: }
3166: if (jj_scanpos.kind != kind)
3167: return true;
3168: if (jj_la == 0 && jj_scanpos == jj_lastpos)
3169: throw jj_ls;
3170: return false;
3171: }
3172:
3173: final public Token getNextToken() {
3174: if (token.next != null)
3175: token = token.next;
3176: else
3177: token = token.next = token_source.getNextToken();
3178: jj_ntk = -1;
3179: jj_gen++;
3180: return token;
3181: }
3182:
3183: final public Token getToken(int index) {
3184: Token t = lookingAhead ? jj_scanpos : token;
3185: for (int i = 0; i < index; i++) {
3186: if (t.next != null)
3187: t = t.next;
3188: else
3189: t = t.next = token_source.getNextToken();
3190: }
3191: return t;
3192: }
3193:
3194: final private int jj_ntk() {
3195: if ((jj_nt = token.next) == null)
3196: return (jj_ntk = (token.next = token_source.getNextToken()).kind);
3197: else
3198: return (jj_ntk = jj_nt.kind);
3199: }
3200:
3201: private java.util.Vector jj_expentries = new java.util.Vector();
3202: private int[] jj_expentry;
3203: private int jj_kind = -1;
3204: private int[] jj_lasttokens = new int[100];
3205: private int jj_endpos;
3206:
3207: private void jj_add_error_token(int kind, int pos) {
3208: if (pos >= 100)
3209: return;
3210: if (pos == jj_endpos + 1) {
3211: jj_lasttokens[jj_endpos++] = kind;
3212: } else if (jj_endpos != 0) {
3213: jj_expentry = new int[jj_endpos];
3214: for (int i = 0; i < jj_endpos; i++) {
3215: jj_expentry[i] = jj_lasttokens[i];
3216: }
3217: boolean exists = false;
3218: for (java.util.Enumeration e = jj_expentries.elements(); e
3219: .hasMoreElements();) {
3220: int[] oldentry = (int[]) (e.nextElement());
3221: if (oldentry.length == jj_expentry.length) {
3222: exists = true;
3223: for (int i = 0; i < jj_expentry.length; i++) {
3224: if (oldentry[i] != jj_expentry[i]) {
3225: exists = false;
3226: break;
3227: }
3228: }
3229: if (exists)
3230: break;
3231: }
3232: }
3233: if (!exists)
3234: jj_expentries.addElement(jj_expentry);
3235: if (pos != 0)
3236: jj_lasttokens[(jj_endpos = pos) - 1] = kind;
3237: }
3238: }
3239:
3240: public ParseException generateParseException() {
3241: jj_expentries.removeAllElements();
3242: boolean[] la1tokens = new boolean[83];
3243: if (jj_kind >= 0) {
3244: la1tokens[jj_kind] = true;
3245: jj_kind = -1;
3246: }
3247: for (int i = 0; i < 59; i++) {
3248: if (jj_la1[i] == jj_gen) {
3249: for (int j = 0; j < 32; j++) {
3250: if ((jj_la1_0[i] & (1 << j)) != 0) {
3251: la1tokens[j] = true;
3252: }
3253: if ((jj_la1_1[i] & (1 << j)) != 0) {
3254: la1tokens[32 + j] = true;
3255: }
3256: if ((jj_la1_2[i] & (1 << j)) != 0) {
3257: la1tokens[64 + j] = true;
3258: }
3259: }
3260: }
3261: }
3262: for (int i = 0; i < 83; i++) {
3263: if (la1tokens[i]) {
3264: jj_expentry = new int[1];
3265: jj_expentry[0] = i;
3266: jj_expentries.addElement(jj_expentry);
3267: }
3268: }
3269: jj_endpos = 0;
3270: jj_rescan_token();
3271: jj_add_error_token(0, 0);
3272: int[][] exptokseq = new int[jj_expentries.size()][];
3273: for (int i = 0; i < jj_expentries.size(); i++) {
3274: exptokseq[i] = (int[]) jj_expentries.elementAt(i);
3275: }
3276: return new ParseException(token, exptokseq, tokenImage);
3277: }
3278:
3279: final public void enable_tracing() {
3280: }
3281:
3282: final public void disable_tracing() {
3283: }
3284:
3285: final private void jj_rescan_token() {
3286: jj_rescan = true;
3287: for (int i = 0; i < 2; i++) {
3288: try {
3289: JJCalls p = jj_2_rtns[i];
3290: do {
3291: if (p.gen > jj_gen) {
3292: jj_la = p.arg;
3293: jj_lastpos = jj_scanpos = p.first;
3294: switch (i) {
3295: case 0:
3296: jj_3_1();
3297: break;
3298: case 1:
3299: jj_3_2();
3300: break;
3301: }
3302: }
3303: p = p.next;
3304: } while (p != null);
3305: } catch (LookaheadSuccess ls) {
3306: }
3307: }
3308: jj_rescan = false;
3309: }
3310:
3311: final private void jj_save(int index, int xla) {
3312: JJCalls p = jj_2_rtns[index];
3313: while (p.gen > jj_gen) {
3314: if (p.next == null) {
3315: p = p.next = new JJCalls();
3316: break;
3317: }
3318: p = p.next;
3319: }
3320: p.gen = jj_gen + xla - jj_la;
3321: p.first = token;
3322: p.arg = xla;
3323: }
3324:
3325: static final class JJCalls {
3326: int gen;
3327: Token first;
3328: int arg;
3329: JJCalls next;
3330: }
3331:
3332: }
|