0001: // ===========================================================================
0002: // This file has been generated by
0003: // Rats! Parser Generator, version 1.13.1,
0004: // (C) 2004-2007 Robert Grimm,
0005: // on Monday, October 8, 2007 at 5:40:08 PM.
0006: // Edit at your own risk.
0007: // ===========================================================================
0008:
0009: package xtc.lang;
0010:
0011: import java.io.Reader;
0012: import java.io.IOException;
0013:
0014: import java.util.HashSet;
0015: import java.util.Set;
0016:
0017: import xtc.util.Action;
0018: import xtc.util.Pair;
0019:
0020: import xtc.tree.Node;
0021: import xtc.tree.GNode;
0022:
0023: import xtc.parser.ParserBase;
0024: import xtc.parser.Column;
0025: import xtc.parser.Result;
0026: import xtc.parser.SemanticValue;
0027: import xtc.parser.ParseError;
0028:
0029: /**
0030: * Packrat parser for grammar <code>xtc.lang.Java</code>.
0031: *
0032: * <p />This class has been generated by the <i>Rats!</i> parser
0033: * generator, version 1.13.1, (C) 2004-2007 Robert Grimm.
0034: */
0035: public final class JavaParser extends ParserBase {
0036:
0037: /** The JAVA_KEYWORDS set. */
0038: public static final Set<String> JAVA_KEYWORDS = new HashSet<String>();
0039:
0040: // =========================================================================
0041:
0042: /** Chunk 1 of memoized results. */
0043: static final class Chunk1 {
0044: Result fModifiers;
0045: Result fFormalParameters;
0046: Result fFormalParameters$$Star1;
0047: Result fDeclarators;
0048: Result fDeclarators$$Star1;
0049: Result fBlock;
0050: Result fBlock$$Star1;
0051: Result fParExpression;
0052: Result fCatchClause;
0053: Result fExpression;
0054: }
0055:
0056: /** Chunk 2 of memoized results. */
0057: static final class Chunk2 {
0058: Result fConditionalExpression;
0059: Result fLogicalOrExpression;
0060: Result fRelationalExpression;
0061: Result fVariableInitializer;
0062: Result fResultType;
0063: Result fType;
0064: Result fTypeName;
0065: Result fPrimitiveType;
0066: Result fDimensions;
0067: Result fDimensions$$Plus1;
0068: }
0069:
0070: /** Chunk 3 of memoized results. */
0071: static final class Chunk3 {
0072: Result fQualifiedIdentifier;
0073: Result fQualifiedIdentifier$$Star1;
0074: Result fIdentifier;
0075: Result fWord;
0076: Result fSymbol;
0077: }
0078:
0079: // =========================================================================
0080:
0081: /** Memoization table column. */
0082: static final class JavaParserColumn extends Column {
0083: Chunk1 chunk1;
0084: Chunk2 chunk2;
0085: Chunk3 chunk3;
0086: }
0087:
0088: // =========================================================================
0089:
0090: /**
0091: * Create a new packrat parser.
0092: *
0093: * @param reader The reader.
0094: * @param file The file name.
0095: */
0096: public JavaParser(final Reader reader, final String file) {
0097: super (reader, file);
0098: }
0099:
0100: /**
0101: * Create a new packrat parser.
0102: *
0103: * @param reader The file reader.
0104: * @param file The file name.
0105: * @param size The file size.
0106: */
0107: public JavaParser(final Reader reader, final String file,
0108: final int size) {
0109: super (reader, file, size);
0110: }
0111:
0112: // =========================================================================
0113:
0114: protected Column newColumn() {
0115: return new JavaParserColumn();
0116: }
0117:
0118: // =========================================================================
0119:
0120: /**
0121: * Parse nonterminal xtc.lang.Java.CompilationUnit.
0122: *
0123: * @param yyStart The index.
0124: * @return The result.
0125: * @throws IOException Signals an I/O error.
0126: */
0127: public Result pCompilationUnit(final int yyStart)
0128: throws IOException {
0129: int yyC;
0130: int yyIndex;
0131: Result yyResult;
0132: int yyRepetition1;
0133: Pair<Node> yyRepValue1;
0134: int yyOption1;
0135: Node yyOpValue1;
0136: Node yyValue;
0137: ParseError yyError = ParseError.DUMMY;
0138:
0139: // Alternative 1.
0140:
0141: yyResult = pSpacing(yyStart);
0142: yyError = yyResult.select(yyError);
0143: if (yyResult.hasValue()) {
0144:
0145: yyOption1 = yyResult.index;
0146: yyOpValue1 = null;
0147:
0148: yyResult = pPackageDeclaration(yyOption1);
0149: yyError = yyResult.select(yyError);
0150: if (yyResult.hasValue()) {
0151: final Node v$el$1 = yyResult.semanticValue();
0152:
0153: yyOption1 = yyResult.index;
0154: yyOpValue1 = v$el$1;
0155: }
0156: { // Start scope for v$g$1.
0157: final Node v$g$1 = yyOpValue1;
0158:
0159: yyRepetition1 = yyOption1;
0160: yyRepValue1 = Pair.empty();
0161: while (true) {
0162:
0163: yyResult = pImportDeclaration(yyRepetition1);
0164: yyError = yyResult.select(yyError);
0165: if (yyResult.hasValue()) {
0166: final Node v$el$2 = yyResult.semanticValue();
0167:
0168: yyRepetition1 = yyResult.index;
0169: yyRepValue1 = new Pair<Node>(v$el$2,
0170: yyRepValue1);
0171: continue;
0172: }
0173: break;
0174: }
0175: { // Start scope for v$g$2.
0176: final Pair<Node> v$g$2 = yyRepValue1.reverse();
0177:
0178: yyRepValue1 = Pair.empty();
0179: while (true) {
0180:
0181: yyResult = pDeclaration(yyRepetition1);
0182: yyError = yyResult.select(yyError);
0183: if (yyResult.hasValue()) {
0184: final Node v$el$3 = yyResult
0185: .semanticValue();
0186:
0187: yyRepetition1 = yyResult.index;
0188: yyRepValue1 = new Pair<Node>(v$el$3,
0189: yyRepValue1);
0190: continue;
0191: }
0192: break;
0193: }
0194: { // Start scope for v$g$3.
0195: final Pair<Node> v$g$3 = yyRepValue1.reverse();
0196:
0197: yyOption1 = yyRepetition1;
0198:
0199: yyC = character(yyOption1);
0200: if ('\u001a' == yyC) {
0201: yyIndex = yyOption1 + 1;
0202:
0203: yyOption1 = yyIndex;
0204: }
0205:
0206: yyResult = pEndOfFile(yyOption1);
0207: yyError = yyResult.select(yyError);
0208: if (yyResult.hasValue()) {
0209:
0210: yyValue = GNode.create("CompilationUnit",
0211: v$g$2.size() + v$g$3.size() + 1)
0212: .add(v$g$1).addAll(v$g$2).addAll(
0213: v$g$3);
0214: yyValue.setLocation(location(yyStart));
0215:
0216: return yyResult.createValue(yyValue,
0217: yyError);
0218: }
0219: } // End scope for v$g$3.
0220: } // End scope for v$g$2.
0221: } // End scope for v$g$1.
0222: }
0223:
0224: // Done.
0225: yyError = yyError.select("compilation unit expected", yyStart);
0226: return yyError;
0227: }
0228:
0229: // =========================================================================
0230:
0231: /**
0232: * Parse nonterminal xtc.lang.Java.PackageDeclaration.
0233: *
0234: * @param yyStart The index.
0235: * @return The result.
0236: * @throws IOException Signals an I/O error.
0237: */
0238: private Result pPackageDeclaration(final int yyStart)
0239: throws IOException {
0240: Result yyResult;
0241: int yyBase;
0242: Node yyValue;
0243: ParseError yyError = ParseError.DUMMY;
0244:
0245: // Alternative <Declaration>.
0246:
0247: yyResult = pWord(yyStart);
0248: yyError = yyResult.select(yyError);
0249: if (yyResult.hasValue("package")) {
0250:
0251: yyResult = pQualifiedIdentifier(yyResult.index);
0252: yyError = yyResult.select(yyError);
0253: if (yyResult.hasValue()) {
0254: final Node v$g$2 = yyResult.semanticValue();
0255:
0256: yyBase = yyResult.index;
0257: yyResult = pSymbol(yyBase);
0258: yyError = yyResult.select(yyError);
0259: if (yyResult.hasValue(";")) {
0260:
0261: yyValue = GNode.create("PackageDeclaration", null,
0262: v$g$2);
0263: yyValue.setLocation(location(yyStart));
0264:
0265: return yyResult.createValue(yyValue, yyError);
0266: } else {
0267: yyError = yyError.select("\";\" expected", yyBase);
0268: }
0269: }
0270: }
0271:
0272: // Done.
0273: yyError = yyError.select("package declaration expected",
0274: yyStart);
0275: return yyError;
0276: }
0277:
0278: // =========================================================================
0279:
0280: /**
0281: * Parse nonterminal xtc.lang.Java.ImportDeclaration.
0282: *
0283: * @param yyStart The index.
0284: * @return The result.
0285: * @throws IOException Signals an I/O error.
0286: */
0287: private Result pImportDeclaration(final int yyStart)
0288: throws IOException {
0289: Result yyResult;
0290: int yyBase;
0291: int yyOption1;
0292: String yyOpValue1;
0293: Node yyValue;
0294: ParseError yyError = ParseError.DUMMY;
0295:
0296: // Alternative <Declaration>.
0297:
0298: yyResult = pWord(yyStart);
0299: yyError = yyResult.select(yyError);
0300: if (yyResult.hasValue("import")) {
0301:
0302: yyResult = pQualifiedIdentifier(yyResult.index);
0303: yyError = yyResult.select(yyError);
0304: if (yyResult.hasValue()) {
0305: final Node v$g$2 = yyResult.semanticValue();
0306:
0307: yyOption1 = yyResult.index;
0308: yyOpValue1 = null;
0309:
0310: yyResult = pDotStarTail(yyOption1);
0311: yyError = yyResult.select(yyError);
0312: if (yyResult.hasValue()) {
0313: final String v$el$1 = yyResult.semanticValue();
0314:
0315: yyOption1 = yyResult.index;
0316: yyOpValue1 = v$el$1;
0317: }
0318: { // Start scope for v$g$3.
0319: final String v$g$3 = yyOpValue1;
0320:
0321: yyBase = yyOption1;
0322: yyResult = pSymbol(yyBase);
0323: yyError = yyResult.select(yyError);
0324: if (yyResult.hasValue(";")) {
0325:
0326: yyValue = GNode.create("ImportDeclaration",
0327: null, v$g$2, v$g$3);
0328: yyValue.setLocation(location(yyStart));
0329:
0330: return yyResult.createValue(yyValue, yyError);
0331: } else {
0332: yyError = yyError.select("\";\" expected",
0333: yyBase);
0334: }
0335: } // End scope for v$g$3.
0336: }
0337: }
0338:
0339: // Done.
0340: yyError = yyError
0341: .select("import declaration expected", yyStart);
0342: return yyError;
0343: }
0344:
0345: // =========================================================================
0346:
0347: /**
0348: * Parse nonterminal xtc.lang.Java.DotStarTail.
0349: *
0350: * @param yyStart The index.
0351: * @return The result.
0352: * @throws IOException Signals an I/O error.
0353: */
0354: private Result pDotStarTail(final int yyStart) throws IOException {
0355: Result yyResult;
0356: int yyBase;
0357: String yyValue;
0358: ParseError yyError = ParseError.DUMMY;
0359:
0360: // Alternative 1.
0361:
0362: yyResult = pSymbol(yyStart);
0363: yyError = yyResult.select(yyError);
0364: if (yyResult.hasValue(".")) {
0365:
0366: yyBase = yyResult.index;
0367: yyResult = pSymbol(yyBase);
0368: yyError = yyResult.select(yyError);
0369: if (yyResult.hasValue("*")) {
0370: yyValue = "*";
0371:
0372: return yyResult.createValue(yyValue, yyError);
0373: } else {
0374: yyError = yyError.select("\"*\" expected", yyBase);
0375: }
0376: }
0377:
0378: // Done.
0379: yyError = yyError.select("dot star tail expected", yyStart);
0380: return yyError;
0381: }
0382:
0383: // =========================================================================
0384:
0385: /**
0386: * Parse nonterminal xtc.lang.Java.Modifiers.
0387: *
0388: * @param yyStart The index.
0389: * @return The result.
0390: * @throws IOException Signals an I/O error.
0391: */
0392: private Result pModifiers(final int yyStart) throws IOException {
0393: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
0394: if (null == yyColumn.chunk1)
0395: yyColumn.chunk1 = new Chunk1();
0396: if (null == yyColumn.chunk1.fModifiers)
0397: yyColumn.chunk1.fModifiers = pModifiers$1(yyStart);
0398: return yyColumn.chunk1.fModifiers;
0399: }
0400:
0401: /** Actually parse xtc.lang.Java.Modifiers. */
0402: private Result pModifiers$1(final int yyStart) throws IOException {
0403: Result yyResult;
0404: Node yyValue;
0405: ParseError yyError = ParseError.DUMMY;
0406:
0407: // Alternative 1.
0408:
0409: yyResult = pModifierList(yyStart);
0410: yyError = yyResult.select(yyError);
0411: if (yyResult.hasValue()) {
0412: final Pair<Node> v$g$1 = yyResult.semanticValue();
0413:
0414: yyValue = GNode.createFromPair("Modifiers", v$g$1);
0415: yyValue.setLocation(location(yyStart));
0416:
0417: return yyResult.createValue(yyValue, yyError);
0418: }
0419:
0420: // Done.
0421: return yyError;
0422: }
0423:
0424: // =========================================================================
0425:
0426: /**
0427: * Parse nonterminal xtc.lang.Java.ModifierList.
0428: *
0429: * @param yyStart The index.
0430: * @return The result.
0431: * @throws IOException Signals an I/O error.
0432: */
0433: private Result pModifierList(final int yyStart) throws IOException {
0434: Result yyResult;
0435: int yyRepetition1;
0436: Pair<Node> yyRepValue1;
0437: Pair<Node> yyValue;
0438: ParseError yyError = ParseError.DUMMY;
0439:
0440: // Alternative 1.
0441:
0442: yyRepetition1 = yyStart;
0443: yyRepValue1 = Pair.empty();
0444: while (true) {
0445:
0446: yyResult = pModifier(yyRepetition1);
0447: yyError = yyResult.select(yyError);
0448: if (yyResult.hasValue()) {
0449: final Node v$el$1 = yyResult.semanticValue();
0450:
0451: yyRepetition1 = yyResult.index;
0452: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
0453: continue;
0454: }
0455: break;
0456: }
0457: { // Start scope for yyValue.
0458: yyValue = yyRepValue1.reverse();
0459:
0460: return new SemanticValue(yyValue, yyRepetition1, yyError);
0461: } // End scope for yyValue.
0462: }
0463:
0464: // =========================================================================
0465:
0466: /**
0467: * Parse nonterminal xtc.lang.Java.Modifier.
0468: *
0469: * @param yyStart The index.
0470: * @return The result.
0471: * @throws IOException Signals an I/O error.
0472: */
0473: private Result pModifier(final int yyStart) throws IOException {
0474: Result yyResult;
0475: Node yyValue;
0476: ParseError yyError = ParseError.DUMMY;
0477:
0478: // Alternative <Public>.
0479:
0480: yyResult = pWord(yyStart);
0481: yyError = yyResult.select(yyError);
0482: if (yyResult.hasValue("public")) {
0483: final String v$g$1 = "public";
0484:
0485: yyValue = GNode.create("Modifier", v$g$1);
0486: yyValue.setLocation(location(yyStart));
0487:
0488: return yyResult.createValue(yyValue, yyError);
0489: }
0490:
0491: // Alternative <Protected>.
0492:
0493: yyResult = pWord(yyStart);
0494: yyError = yyResult.select(yyError);
0495: if (yyResult.hasValue("protected")) {
0496: final String v$g$2 = "protected";
0497:
0498: yyValue = GNode.create("Modifier", v$g$2);
0499: yyValue.setLocation(location(yyStart));
0500:
0501: return yyResult.createValue(yyValue, yyError);
0502: }
0503:
0504: // Alternative <Private>.
0505:
0506: yyResult = pWord(yyStart);
0507: yyError = yyResult.select(yyError);
0508: if (yyResult.hasValue("private")) {
0509: final String v$g$3 = "private";
0510:
0511: yyValue = GNode.create("Modifier", v$g$3);
0512: yyValue.setLocation(location(yyStart));
0513:
0514: return yyResult.createValue(yyValue, yyError);
0515: }
0516:
0517: // Alternative <Static>.
0518:
0519: yyResult = pWord(yyStart);
0520: yyError = yyResult.select(yyError);
0521: if (yyResult.hasValue("static")) {
0522: final String v$g$4 = "static";
0523:
0524: yyValue = GNode.create("Modifier", v$g$4);
0525: yyValue.setLocation(location(yyStart));
0526:
0527: return yyResult.createValue(yyValue, yyError);
0528: }
0529:
0530: // Alternative <Abstract>.
0531:
0532: yyResult = pWord(yyStart);
0533: yyError = yyResult.select(yyError);
0534: if (yyResult.hasValue("abstract")) {
0535: final String v$g$5 = "abstract";
0536:
0537: yyValue = GNode.create("Modifier", v$g$5);
0538: yyValue.setLocation(location(yyStart));
0539:
0540: return yyResult.createValue(yyValue, yyError);
0541: }
0542:
0543: // Alternative <Final>.
0544:
0545: yyResult = pWord(yyStart);
0546: yyError = yyResult.select(yyError);
0547: if (yyResult.hasValue("final")) {
0548: final String v$g$6 = "final";
0549:
0550: yyValue = GNode.create("Modifier", v$g$6);
0551: yyValue.setLocation(location(yyStart));
0552:
0553: return yyResult.createValue(yyValue, yyError);
0554: }
0555:
0556: // Alternative <Native>.
0557:
0558: yyResult = pWord(yyStart);
0559: yyError = yyResult.select(yyError);
0560: if (yyResult.hasValue("native")) {
0561: final String v$g$7 = "native";
0562:
0563: yyValue = GNode.create("Modifier", v$g$7);
0564: yyValue.setLocation(location(yyStart));
0565:
0566: return yyResult.createValue(yyValue, yyError);
0567: }
0568:
0569: // Alternative <Synchronized>.
0570:
0571: yyResult = pWord(yyStart);
0572: yyError = yyResult.select(yyError);
0573: if (yyResult.hasValue("synchronized")) {
0574: final String v$g$8 = "synchronized";
0575:
0576: yyValue = GNode.create("Modifier", v$g$8);
0577: yyValue.setLocation(location(yyStart));
0578:
0579: return yyResult.createValue(yyValue, yyError);
0580: }
0581:
0582: // Alternative <Transient>.
0583:
0584: yyResult = pWord(yyStart);
0585: yyError = yyResult.select(yyError);
0586: if (yyResult.hasValue("transient")) {
0587: final String v$g$9 = "transient";
0588:
0589: yyValue = GNode.create("Modifier", v$g$9);
0590: yyValue.setLocation(location(yyStart));
0591:
0592: return yyResult.createValue(yyValue, yyError);
0593: }
0594:
0595: // Alternative <Volatile>.
0596:
0597: yyResult = pWord(yyStart);
0598: yyError = yyResult.select(yyError);
0599: if (yyResult.hasValue("volatile")) {
0600: final String v$g$10 = "volatile";
0601:
0602: yyValue = GNode.create("Modifier", v$g$10);
0603: yyValue.setLocation(location(yyStart));
0604:
0605: return yyResult.createValue(yyValue, yyError);
0606: }
0607:
0608: // Alternative <Strictfp>.
0609:
0610: yyResult = pWord(yyStart);
0611: yyError = yyResult.select(yyError);
0612: if (yyResult.hasValue("strictfp")) {
0613: final String v$g$11 = "strictfp";
0614:
0615: yyValue = GNode.create("Modifier", v$g$11);
0616: yyValue.setLocation(location(yyStart));
0617:
0618: return yyResult.createValue(yyValue, yyError);
0619: }
0620:
0621: // Done.
0622: yyError = yyError.select("modifier expected", yyStart);
0623: return yyError;
0624: }
0625:
0626: // =========================================================================
0627:
0628: /**
0629: * Parse nonterminal xtc.lang.Java.FormalParameter.
0630: *
0631: * @param yyStart The index.
0632: * @return The result.
0633: * @throws IOException Signals an I/O error.
0634: */
0635: private Result pFormalParameter(final int yyStart)
0636: throws IOException {
0637: Result yyResult;
0638: int yyOption1;
0639: Node yyOpValue1;
0640: Node yyValue;
0641: ParseError yyError = ParseError.DUMMY;
0642:
0643: // Alternative <Parameter>.
0644:
0645: yyResult = pVariableModifiers(yyStart);
0646: yyError = yyResult.select(yyError);
0647: if (yyResult.hasValue()) {
0648: final Node v$g$1 = yyResult.semanticValue();
0649:
0650: yyResult = pType(yyResult.index);
0651: yyError = yyResult.select(yyError);
0652: if (yyResult.hasValue()) {
0653: final Node v$g$2 = yyResult.semanticValue();
0654:
0655: yyResult = pIdentifier(yyResult.index);
0656: yyError = yyResult.select(yyError);
0657: if (yyResult.hasValue()) {
0658: final String v$g$4 = yyResult.semanticValue();
0659:
0660: yyOption1 = yyResult.index;
0661: yyOpValue1 = null;
0662:
0663: yyResult = pDimensions(yyOption1);
0664: yyError = yyResult.select(yyError);
0665: if (yyResult.hasValue()) {
0666: final Node v$el$1 = yyResult.semanticValue();
0667:
0668: yyOption1 = yyResult.index;
0669: yyOpValue1 = v$el$1;
0670: }
0671: { // Start scope for v$g$5.
0672: final Node v$g$5 = yyOpValue1;
0673:
0674: yyValue = GNode.create("FormalParameter",
0675: v$g$1, v$g$2, null, v$g$4, v$g$5);
0676: yyValue.setLocation(location(yyStart));
0677:
0678: return new SemanticValue(yyValue, yyOption1,
0679: yyError);
0680: } // End scope for v$g$5.
0681: }
0682: }
0683: }
0684:
0685: // Done.
0686: return yyError;
0687: }
0688:
0689: // =========================================================================
0690:
0691: /**
0692: * Parse nonterminal xtc.lang.Java.VariableModifiers.
0693: *
0694: * @param yyStart The index.
0695: * @return The result.
0696: * @throws IOException Signals an I/O error.
0697: */
0698: private Result pVariableModifiers(final int yyStart)
0699: throws IOException {
0700: Result yyResult;
0701: Node yyValue;
0702: ParseError yyError = ParseError.DUMMY;
0703:
0704: // Alternative <Final>.
0705:
0706: yyResult = pFinalModifier(yyStart);
0707: yyError = yyResult.select(yyError);
0708: if (yyResult.hasValue()) {
0709: final Node v$g$1 = yyResult.semanticValue();
0710:
0711: yyValue = GNode.create("Modifiers", v$g$1);
0712: yyValue.setLocation(location(yyStart));
0713:
0714: return yyResult.createValue(yyValue, yyError);
0715: }
0716:
0717: // Alternative <Nonfinal>.
0718:
0719: yyValue = GNode.create("Modifiers", false);
0720: yyValue.setLocation(location(yyStart));
0721:
0722: return new SemanticValue(yyValue, yyStart, yyError);
0723: }
0724:
0725: // =========================================================================
0726:
0727: /**
0728: * Parse nonterminal xtc.lang.Java.FinalModifier.
0729: *
0730: * @param yyStart The index.
0731: * @return The result.
0732: * @throws IOException Signals an I/O error.
0733: */
0734: private Result pFinalModifier(final int yyStart) throws IOException {
0735: Result yyResult;
0736: Node yyValue;
0737: ParseError yyError = ParseError.DUMMY;
0738:
0739: // Alternative 1.
0740:
0741: yyResult = pWord(yyStart);
0742: yyError = yyResult.select(yyError);
0743: if (yyResult.hasValue("final")) {
0744: final String v$g$1 = "final";
0745:
0746: yyValue = GNode.create("Modifier", v$g$1);
0747: yyValue.setLocation(location(yyStart));
0748:
0749: return yyResult.createValue(yyValue, yyError);
0750: }
0751:
0752: // Done.
0753: yyError = yyError.select("final modifier expected", yyStart);
0754: return yyError;
0755: }
0756:
0757: // =========================================================================
0758:
0759: /**
0760: * Parse nonterminal xtc.lang.Java.FormalParameters.
0761: *
0762: * @param yyStart The index.
0763: * @return The result.
0764: * @throws IOException Signals an I/O error.
0765: */
0766: private Result pFormalParameters(final int yyStart)
0767: throws IOException {
0768: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
0769: if (null == yyColumn.chunk1)
0770: yyColumn.chunk1 = new Chunk1();
0771: if (null == yyColumn.chunk1.fFormalParameters)
0772: yyColumn.chunk1.fFormalParameters = pFormalParameters$1(yyStart);
0773: return yyColumn.chunk1.fFormalParameters;
0774: }
0775:
0776: /** Actually parse xtc.lang.Java.FormalParameters. */
0777: private Result pFormalParameters$1(final int yyStart)
0778: throws IOException {
0779: Result yyResult;
0780: int yyBase;
0781: Node yyValue;
0782: ParseError yyError = ParseError.DUMMY;
0783:
0784: // Alternative 1.
0785:
0786: yyResult = pSymbol(yyStart);
0787: yyError = yyResult.select(yyError);
0788: if (yyResult.hasValue("(")) {
0789:
0790: final int yyChoice1 = yyResult.index;
0791:
0792: // Nested alternative 1.
0793:
0794: yyResult = pFormalParameter(yyChoice1);
0795: yyError = yyResult.select(yyError);
0796: if (yyResult.hasValue()) {
0797: final Node v$g$1 = yyResult.semanticValue();
0798:
0799: yyResult = pFormalParameters$$Star1(yyResult.index);
0800: yyError = yyResult.select(yyError);
0801: if (yyResult.hasValue()) {
0802: final Pair<Node> v$g$2 = yyResult.semanticValue();
0803:
0804: yyBase = yyResult.index;
0805: yyResult = pSymbol(yyBase);
0806: yyError = yyResult.select(yyError);
0807: if (yyResult.hasValue(")")) {
0808:
0809: yyValue = GNode.createFromPair(
0810: "FormalParameters", v$g$1, v$g$2);
0811: yyValue.setLocation(location(yyStart));
0812:
0813: return yyResult.createValue(yyValue, yyError);
0814: } else {
0815: yyError = yyError.select("\")\" expected",
0816: yyBase);
0817: }
0818: }
0819: }
0820:
0821: // Nested alternative 2.
0822:
0823: yyBase = yyChoice1;
0824: yyResult = pSymbol(yyBase);
0825: yyError = yyResult.select(yyError);
0826: if (yyResult.hasValue(")")) {
0827:
0828: yyValue = GNode.create("FormalParameters", false);
0829: yyValue.setLocation(location(yyStart));
0830:
0831: return yyResult.createValue(yyValue, yyError);
0832: } else {
0833: yyError = yyError.select("\")\" expected", yyBase);
0834: }
0835: }
0836:
0837: // Done.
0838: yyError = yyError.select("formal parameters expected", yyStart);
0839: return yyError;
0840: }
0841:
0842: // =========================================================================
0843:
0844: /**
0845: * Parse synthetic nonterminal xtc.lang.Java.FormalParameters$$Star1.
0846: *
0847: * @param yyStart The index.
0848: * @return The result.
0849: * @throws IOException Signals an I/O error.
0850: */
0851: private Result pFormalParameters$$Star1(final int yyStart)
0852: throws IOException {
0853:
0854: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
0855: if (null == yyColumn.chunk1)
0856: yyColumn.chunk1 = new Chunk1();
0857: if (null == yyColumn.chunk1.fFormalParameters$$Star1)
0858: yyColumn.chunk1.fFormalParameters$$Star1 = pFormalParameters$$Star1$1(yyStart);
0859: return yyColumn.chunk1.fFormalParameters$$Star1;
0860: }
0861:
0862: /** Actually parse xtc.lang.Java.FormalParameters$$Star1. */
0863: private Result pFormalParameters$$Star1$1(final int yyStart)
0864: throws IOException {
0865:
0866: Result yyResult;
0867: Pair<Node> yyValue;
0868: ParseError yyError = ParseError.DUMMY;
0869:
0870: // Alternative 1.
0871:
0872: yyResult = pSymbol(yyStart);
0873: yyError = yyResult.select(yyError);
0874: if (yyResult.hasValue(",")) {
0875:
0876: yyResult = pFormalParameter(yyResult.index);
0877: yyError = yyResult.select(yyError);
0878: if (yyResult.hasValue()) {
0879: final Node v$el$1 = yyResult.semanticValue();
0880:
0881: yyResult = pFormalParameters$$Star1(yyResult.index);
0882: yyError = yyResult.select(yyError);
0883: if (yyResult.hasValue()) {
0884: final Pair<Node> v$2 = yyResult.semanticValue();
0885:
0886: yyValue = new Pair<Node>(v$el$1, v$2);
0887:
0888: return yyResult.createValue(yyValue, yyError);
0889: }
0890: }
0891: }
0892:
0893: // Alternative 2.
0894:
0895: yyValue = Pair.empty();
0896:
0897: return new SemanticValue(yyValue, yyStart, yyError);
0898: }
0899:
0900: // =========================================================================
0901:
0902: /**
0903: * Parse nonterminal xtc.lang.Java.Declarator.
0904: *
0905: * @param yyStart The index.
0906: * @return The result.
0907: * @throws IOException Signals an I/O error.
0908: */
0909: private Result pDeclarator(final int yyStart) throws IOException {
0910: Result yyResult;
0911: int yyBase;
0912: int yyOption1;
0913: Node yyOpValue1;
0914: Node yyValue;
0915: ParseError yyError = ParseError.DUMMY;
0916:
0917: // Alternative <Declarator>.
0918:
0919: yyResult = pIdentifier(yyStart);
0920: yyError = yyResult.select(yyError);
0921: if (yyResult.hasValue()) {
0922: final String v$g$1 = yyResult.semanticValue();
0923:
0924: yyOption1 = yyResult.index;
0925: yyOpValue1 = null;
0926:
0927: yyResult = pDimensions(yyOption1);
0928: yyError = yyResult.select(yyError);
0929: if (yyResult.hasValue()) {
0930: final Node v$el$1 = yyResult.semanticValue();
0931:
0932: yyOption1 = yyResult.index;
0933: yyOpValue1 = v$el$1;
0934: }
0935: { // Start scope for v$g$2.
0936: final Node v$g$2 = yyOpValue1;
0937:
0938: yyOpValue1 = null;
0939:
0940: yyBase = yyOption1;
0941: yyResult = pSymbol(yyBase);
0942: yyError = yyResult.select(yyError);
0943: if (yyResult.hasValue("=")) {
0944:
0945: yyResult = pVariableInitializer(yyResult.index);
0946: yyError = yyResult.select(yyError);
0947: if (yyResult.hasValue()) {
0948: final Node v$el$2 = yyResult.semanticValue();
0949:
0950: yyOption1 = yyResult.index;
0951: yyOpValue1 = v$el$2;
0952: }
0953: } else {
0954: yyError = yyError.select("\"=\" expected", yyBase);
0955: }
0956: { // Start scope for v$g$3.
0957: final Node v$g$3 = yyOpValue1;
0958:
0959: yyValue = GNode.create("Declarator", v$g$1, v$g$2,
0960: v$g$3);
0961: yyValue.setLocation(location(yyStart));
0962:
0963: return new SemanticValue(yyValue, yyOption1,
0964: yyError);
0965: } // End scope for v$g$3.
0966: } // End scope for v$g$2.
0967: }
0968:
0969: // Done.
0970: return yyError;
0971: }
0972:
0973: // =========================================================================
0974:
0975: /**
0976: * Parse nonterminal xtc.lang.Java.Declarators.
0977: *
0978: * @param yyStart The index.
0979: * @return The result.
0980: * @throws IOException Signals an I/O error.
0981: */
0982: private Result pDeclarators(final int yyStart) throws IOException {
0983: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
0984: if (null == yyColumn.chunk1)
0985: yyColumn.chunk1 = new Chunk1();
0986: if (null == yyColumn.chunk1.fDeclarators)
0987: yyColumn.chunk1.fDeclarators = pDeclarators$1(yyStart);
0988: return yyColumn.chunk1.fDeclarators;
0989: }
0990:
0991: /** Actually parse xtc.lang.Java.Declarators. */
0992: private Result pDeclarators$1(final int yyStart) throws IOException {
0993: Result yyResult;
0994: Node yyValue;
0995: ParseError yyError = ParseError.DUMMY;
0996:
0997: // Alternative 1.
0998:
0999: yyResult = pDeclarator(yyStart);
1000: yyError = yyResult.select(yyError);
1001: if (yyResult.hasValue()) {
1002: final Node v$g$1 = yyResult.semanticValue();
1003:
1004: yyResult = pDeclarators$$Star1(yyResult.index);
1005: yyError = yyResult.select(yyError);
1006: if (yyResult.hasValue()) {
1007: final Pair<Node> v$g$2 = yyResult.semanticValue();
1008:
1009: yyValue = GNode.createFromPair("Declarators", v$g$1,
1010: v$g$2);
1011: yyValue.setLocation(location(yyStart));
1012:
1013: return yyResult.createValue(yyValue, yyError);
1014: }
1015: }
1016:
1017: // Done.
1018: return yyError;
1019: }
1020:
1021: // =========================================================================
1022:
1023: /**
1024: * Parse synthetic nonterminal xtc.lang.Java.Declarators$$Star1.
1025: *
1026: * @param yyStart The index.
1027: * @return The result.
1028: * @throws IOException Signals an I/O error.
1029: */
1030: private Result pDeclarators$$Star1(final int yyStart)
1031: throws IOException {
1032: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
1033: if (null == yyColumn.chunk1)
1034: yyColumn.chunk1 = new Chunk1();
1035: if (null == yyColumn.chunk1.fDeclarators$$Star1)
1036: yyColumn.chunk1.fDeclarators$$Star1 = pDeclarators$$Star1$1(yyStart);
1037: return yyColumn.chunk1.fDeclarators$$Star1;
1038: }
1039:
1040: /** Actually parse xtc.lang.Java.Declarators$$Star1. */
1041: private Result pDeclarators$$Star1$1(final int yyStart)
1042: throws IOException {
1043: Result yyResult;
1044: Pair<Node> yyValue;
1045: ParseError yyError = ParseError.DUMMY;
1046:
1047: // Alternative 1.
1048:
1049: yyResult = pSymbol(yyStart);
1050: yyError = yyResult.select(yyError);
1051: if (yyResult.hasValue(",")) {
1052:
1053: yyResult = pDeclarator(yyResult.index);
1054: yyError = yyResult.select(yyError);
1055: if (yyResult.hasValue()) {
1056: final Node v$el$1 = yyResult.semanticValue();
1057:
1058: yyResult = pDeclarators$$Star1(yyResult.index);
1059: yyError = yyResult.select(yyError);
1060: if (yyResult.hasValue()) {
1061: final Pair<Node> v$2 = yyResult.semanticValue();
1062:
1063: yyValue = new Pair<Node>(v$el$1, v$2);
1064:
1065: return yyResult.createValue(yyValue, yyError);
1066: }
1067: }
1068: }
1069:
1070: // Alternative 2.
1071:
1072: yyValue = Pair.empty();
1073:
1074: return new SemanticValue(yyValue, yyStart, yyError);
1075: }
1076:
1077: // =========================================================================
1078:
1079: /**
1080: * Parse nonterminal xtc.lang.Java.ClassBody.
1081: *
1082: * @param yyStart The index.
1083: * @return The result.
1084: * @throws IOException Signals an I/O error.
1085: */
1086: private Result pClassBody(final int yyStart) throws IOException {
1087: Result yyResult;
1088: int yyBase;
1089: int yyRepetition1;
1090: Pair<Node> yyRepValue1;
1091: Node yyValue;
1092: ParseError yyError = ParseError.DUMMY;
1093:
1094: // Alternative <Body>.
1095:
1096: yyResult = pSymbol(yyStart);
1097: yyError = yyResult.select(yyError);
1098: if (yyResult.hasValue("{")) {
1099:
1100: yyRepetition1 = yyResult.index;
1101: yyRepValue1 = Pair.empty();
1102: while (true) {
1103:
1104: yyResult = pDeclaration(yyRepetition1);
1105: yyError = yyResult.select(yyError);
1106: if (yyResult.hasValue()) {
1107: final Node v$el$1 = yyResult.semanticValue();
1108:
1109: yyRepetition1 = yyResult.index;
1110: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
1111: continue;
1112: }
1113: break;
1114: }
1115: { // Start scope for v$g$1.
1116: final Pair<Node> v$g$1 = yyRepValue1.reverse();
1117:
1118: yyBase = yyRepetition1;
1119: yyResult = pSymbol(yyBase);
1120: yyError = yyResult.select(yyError);
1121: if (yyResult.hasValue("}")) {
1122:
1123: yyValue = GNode.createFromPair("ClassBody", v$g$1);
1124: yyValue.setLocation(location(yyStart));
1125:
1126: return yyResult.createValue(yyValue, yyError);
1127: } else {
1128: yyError = yyError.select("\"}\" expected", yyBase);
1129: }
1130: } // End scope for v$g$1.
1131: }
1132:
1133: // Done.
1134: yyError = yyError.select("class body expected", yyStart);
1135: return yyError;
1136: }
1137:
1138: // =========================================================================
1139:
1140: /**
1141: * Parse nonterminal xtc.lang.Java.Declaration.
1142: *
1143: * @param yyStart The index.
1144: * @return The result.
1145: * @throws IOException Signals an I/O error.
1146: */
1147: private Result pDeclaration(final int yyStart) throws IOException {
1148: Result yyResult;
1149: int yyBase;
1150: int yyOption1;
1151: Object yyOpValue1;
1152: Node yyValue;
1153: ParseError yyError = ParseError.DUMMY;
1154:
1155: // Alternative 1.
1156:
1157: yyResult = pModifiers(yyStart);
1158: yyError = yyResult.select(yyError);
1159: if (yyResult.hasValue()) {
1160: final Node v$g$1 = yyResult.semanticValue();
1161:
1162: final int yyChoice1 = yyResult.index;
1163:
1164: // Nested alternative 1.
1165:
1166: yyResult = pType(yyChoice1);
1167: yyError = yyResult.select(yyError);
1168: if (yyResult.hasValue()) {
1169: final Node v$g$2 = yyResult.semanticValue();
1170:
1171: yyResult = pDeclarators(yyResult.index);
1172: yyError = yyResult.select(yyError);
1173: if (yyResult.hasValue()) {
1174: final Node v$g$3 = yyResult.semanticValue();
1175:
1176: yyBase = yyResult.index;
1177: yyResult = pSymbol(yyBase);
1178: yyError = yyResult.select(yyError);
1179: if (yyResult.hasValue(";")) {
1180:
1181: yyValue = GNode.create("FieldDeclaration",
1182: v$g$1, v$g$2, v$g$3);
1183: yyValue.setLocation(location(yyStart));
1184:
1185: return yyResult.createValue(yyValue, yyError);
1186: } else {
1187: yyError = yyError.select("\";\" expected",
1188: yyBase);
1189: }
1190: }
1191: }
1192:
1193: // Nested alternative 2.
1194: { // Start scope for nested choice.
1195:
1196: final int yyChoice2 = yyChoice1;
1197:
1198: // Nested alternative 1.
1199:
1200: yyResult = pResultType(yyChoice2);
1201: yyError = yyResult.select(yyError);
1202: if (yyResult.hasValue()) {
1203: final Node v$g$3 = yyResult.semanticValue();
1204:
1205: yyResult = pIdentifier(yyResult.index);
1206: yyError = yyResult.select(yyError);
1207: if (yyResult.hasValue()) {
1208: final String v$g$4 = yyResult.semanticValue();
1209:
1210: yyResult = pFormalParameters(yyResult.index);
1211: yyError = yyResult.select(yyError);
1212: if (yyResult.hasValue()) {
1213: final Node v$g$5 = yyResult.semanticValue();
1214:
1215: yyOption1 = yyResult.index;
1216: yyOpValue1 = null;
1217:
1218: yyResult = pDimensions(yyOption1);
1219: yyError = yyResult.select(yyError);
1220: if (yyResult.hasValue()) {
1221: final Node v$el$1 = yyResult
1222: .semanticValue();
1223:
1224: yyOption1 = yyResult.index;
1225: yyOpValue1 = v$el$1;
1226: }
1227: { // Start scope for v$g$6.
1228: final Node v$g$6 = cast(yyOpValue1);
1229:
1230: yyOpValue1 = null;
1231:
1232: yyResult = pThrowsClause(yyOption1);
1233: yyError = yyResult.select(yyError);
1234: if (yyResult.hasValue()) {
1235: final Node v$el$2 = yyResult
1236: .semanticValue();
1237:
1238: yyOption1 = yyResult.index;
1239: yyOpValue1 = v$el$2;
1240: }
1241: { // Start scope for v$g$7.
1242: final Node v$g$7 = cast(yyOpValue1);
1243:
1244: final int yyChoice3 = yyOption1;
1245:
1246: // Nested alternative 1.
1247:
1248: yyResult = pBlock(yyChoice3);
1249: yyError = yyResult.select(yyError);
1250: if (yyResult.hasValue()) {
1251: final Node v$g$8 = yyResult
1252: .semanticValue();
1253:
1254: yyValue = GNode.create(
1255: "MethodDeclaration",
1256: v$g$1, null, v$g$3,
1257: v$g$4, v$g$5, v$g$6,
1258: v$g$7, v$g$8);
1259: yyValue
1260: .setLocation(location(yyStart));
1261:
1262: return yyResult.createValue(
1263: yyValue, yyError);
1264: }
1265:
1266: // Nested alternative 2.
1267:
1268: yyBase = yyChoice3;
1269: yyResult = pSymbol(yyBase);
1270: yyError = yyResult.select(yyError);
1271: if (yyResult.hasValue(";")) {
1272:
1273: yyValue = GNode.create(
1274: "MethodDeclaration",
1275: v$g$1, null, v$g$3,
1276: v$g$4, v$g$5, v$g$6,
1277: v$g$7, null);
1278: yyValue
1279: .setLocation(location(yyStart));
1280:
1281: return yyResult.createValue(
1282: yyValue, yyError);
1283: } else {
1284: yyError = yyError.select(
1285: "\";\" expected",
1286: yyBase);
1287: }
1288: } // End scope for v$g$7.
1289: } // End scope for v$g$6.
1290: }
1291: }
1292: }
1293:
1294: // Nested alternative 2.
1295:
1296: yyResult = pIdentifier(yyChoice2);
1297: yyError = yyResult.select(yyError);
1298: if (yyResult.hasValue()) {
1299: final String v$g$3 = yyResult.semanticValue();
1300:
1301: yyResult = pFormalParameters(yyResult.index);
1302: yyError = yyResult.select(yyError);
1303: if (yyResult.hasValue()) {
1304: final Node v$g$4 = yyResult.semanticValue();
1305:
1306: yyOption1 = yyResult.index;
1307: yyOpValue1 = null;
1308:
1309: yyResult = pThrowsClause(yyOption1);
1310: yyError = yyResult.select(yyError);
1311: if (yyResult.hasValue()) {
1312: final Node v$el$1 = yyResult
1313: .semanticValue();
1314:
1315: yyOption1 = yyResult.index;
1316: yyOpValue1 = v$el$1;
1317: }
1318: { // Start scope for v$g$5.
1319: final Node v$g$5 = cast(yyOpValue1);
1320:
1321: yyResult = pBlock(yyOption1);
1322: yyError = yyResult.select(yyError);
1323: if (yyResult.hasValue()) {
1324: final Node v$g$6 = yyResult
1325: .semanticValue();
1326:
1327: yyValue = GNode.create(
1328: "ConstructorDeclaration",
1329: v$g$1, null, v$g$3, v$g$4,
1330: v$g$5, v$g$6);
1331: yyValue.setLocation(location(yyStart));
1332:
1333: return yyResult.createValue(yyValue,
1334: yyError);
1335: }
1336: } // End scope for v$g$5.
1337: }
1338: }
1339: } // End scope for nested choice.
1340:
1341: // Nested alternative 3.
1342:
1343: yyBase = yyChoice1;
1344: yyResult = pWord(yyBase);
1345: yyError = yyResult.select(yyError);
1346: if (yyResult.hasValue("class")) {
1347:
1348: yyResult = pIdentifier(yyResult.index);
1349: yyError = yyResult.select(yyError);
1350: if (yyResult.hasValue()) {
1351: final String v$g$2 = yyResult.semanticValue();
1352:
1353: yyOption1 = yyResult.index;
1354: yyOpValue1 = null;
1355:
1356: yyResult = pExtension(yyOption1);
1357: yyError = yyResult.select(yyError);
1358: if (yyResult.hasValue()) {
1359: final Node v$el$1 = yyResult.semanticValue();
1360:
1361: yyOption1 = yyResult.index;
1362: yyOpValue1 = v$el$1;
1363: }
1364: { // Start scope for v$g$4.
1365: final Node v$g$4 = cast(yyOpValue1);
1366:
1367: yyOpValue1 = null;
1368:
1369: yyResult = pImplementation(yyOption1);
1370: yyError = yyResult.select(yyError);
1371: if (yyResult.hasValue()) {
1372: final Node v$el$2 = yyResult
1373: .semanticValue();
1374:
1375: yyOption1 = yyResult.index;
1376: yyOpValue1 = v$el$2;
1377: }
1378: { // Start scope for v$g$5.
1379: final Node v$g$5 = cast(yyOpValue1);
1380:
1381: yyResult = pClassBody(yyOption1);
1382: yyError = yyResult.select(yyError);
1383: if (yyResult.hasValue()) {
1384: final Node v$g$6 = yyResult
1385: .semanticValue();
1386:
1387: yyValue = GNode.create(
1388: "ClassDeclaration", v$g$1,
1389: v$g$2, null, v$g$4, v$g$5,
1390: v$g$6);
1391: yyValue.setLocation(location(yyStart));
1392:
1393: return yyResult.createValue(yyValue,
1394: yyError);
1395: }
1396: } // End scope for v$g$5.
1397: } // End scope for v$g$4.
1398: }
1399: } else {
1400: yyError = yyError.select("\"class\" expected", yyBase);
1401: }
1402:
1403: // Nested alternative 4.
1404:
1405: yyBase = yyChoice1;
1406: yyResult = pWord(yyBase);
1407: yyError = yyResult.select(yyError);
1408: if (yyResult.hasValue("interface")) {
1409:
1410: yyResult = pIdentifier(yyResult.index);
1411: yyError = yyResult.select(yyError);
1412: if (yyResult.hasValue()) {
1413: final String v$g$2 = yyResult.semanticValue();
1414:
1415: yyOption1 = yyResult.index;
1416: yyOpValue1 = null;
1417:
1418: yyResult = pExtension(yyOption1);
1419: yyError = yyResult.select(yyError);
1420: if (yyResult.hasValue()) {
1421: final Node v$el$1 = yyResult.semanticValue();
1422:
1423: yyOption1 = yyResult.index;
1424: yyOpValue1 = v$el$1;
1425: }
1426: { // Start scope for v$g$4.
1427: final Node v$g$4 = cast(yyOpValue1);
1428:
1429: yyResult = pClassBody(yyOption1);
1430: yyError = yyResult.select(yyError);
1431: if (yyResult.hasValue()) {
1432: final Node v$g$5 = yyResult.semanticValue();
1433:
1434: yyValue = GNode.create(
1435: "InterfaceDeclaration", v$g$1,
1436: v$g$2, null, v$g$4, v$g$5);
1437: yyValue.setLocation(location(yyStart));
1438:
1439: return yyResult.createValue(yyValue,
1440: yyError);
1441: }
1442: } // End scope for v$g$4.
1443: }
1444: } else {
1445: yyError = yyError.select("\"interface\" expected",
1446: yyBase);
1447: }
1448: }
1449:
1450: // Alternative 2.
1451:
1452: yyOption1 = yyStart;
1453: yyOpValue1 = null;
1454:
1455: yyBase = yyOption1;
1456: yyResult = pWord(yyBase);
1457: yyError = yyResult.select(yyError);
1458: if (yyResult.hasValue("static")) {
1459: final String v$el$1 = "static";
1460:
1461: yyOption1 = yyResult.index;
1462: yyOpValue1 = v$el$1;
1463: } else {
1464: yyError = yyError.select("\"static\" expected", yyBase);
1465: }
1466: { // Start scope for v$g$1.
1467: final String v$g$1 = cast(yyOpValue1);
1468:
1469: yyResult = pBlock(yyOption1);
1470: yyError = yyResult.select(yyError);
1471: if (yyResult.hasValue()) {
1472: final Node v$g$2 = yyResult.semanticValue();
1473:
1474: yyValue = GNode
1475: .create("BlockDeclaration", v$g$1, v$g$2);
1476: yyValue.setLocation(location(yyStart));
1477:
1478: return yyResult.createValue(yyValue, yyError);
1479: }
1480: } // End scope for v$g$1.
1481:
1482: // Alternative 3.
1483:
1484: yyResult = pSymbol(yyStart);
1485: yyError = yyResult.select(yyError);
1486: if (yyResult.hasValue(";")) {
1487:
1488: yyValue = GNode.create("EmptyDeclaration", false);
1489: yyValue.setLocation(location(yyStart));
1490:
1491: return yyResult.createValue(yyValue, yyError);
1492: }
1493:
1494: // Done.
1495: yyError = yyError.select("declaration expected", yyStart);
1496: return yyError;
1497: }
1498:
1499: // =========================================================================
1500:
1501: /**
1502: * Parse nonterminal xtc.lang.Java.ThrowsClause.
1503: *
1504: * @param yyStart The index.
1505: * @return The result.
1506: * @throws IOException Signals an I/O error.
1507: */
1508: private Result pThrowsClause(final int yyStart) throws IOException {
1509: Result yyResult;
1510: int yyBase;
1511: int yyRepetition1;
1512: Pair<Node> yyRepValue1;
1513: Node yyValue;
1514: ParseError yyError = ParseError.DUMMY;
1515:
1516: // Alternative 1.
1517:
1518: yyResult = pWord(yyStart);
1519: yyError = yyResult.select(yyError);
1520: if (yyResult.hasValue("throws")) {
1521:
1522: yyResult = pQualifiedIdentifier(yyResult.index);
1523: yyError = yyResult.select(yyError);
1524: if (yyResult.hasValue()) {
1525: final Node v$g$1 = yyResult.semanticValue();
1526:
1527: yyRepetition1 = yyResult.index;
1528: yyRepValue1 = Pair.empty();
1529: while (true) {
1530:
1531: yyBase = yyRepetition1;
1532: yyResult = pSymbol(yyBase);
1533: yyError = yyResult.select(yyError);
1534: if (yyResult.hasValue(",")) {
1535:
1536: yyResult = pQualifiedIdentifier(yyResult.index);
1537: yyError = yyResult.select(yyError);
1538: if (yyResult.hasValue()) {
1539: final Node v$el$1 = yyResult
1540: .semanticValue();
1541:
1542: yyRepetition1 = yyResult.index;
1543: yyRepValue1 = new Pair<Node>(v$el$1,
1544: yyRepValue1);
1545: continue;
1546: }
1547: } else {
1548: yyError = yyError.select("\",\" expected",
1549: yyBase);
1550: }
1551: break;
1552: }
1553: { // Start scope for v$g$2.
1554: final Pair<Node> v$g$2 = yyRepValue1.reverse();
1555:
1556: yyValue = GNode.createFromPair("ThrowsClause",
1557: v$g$1, v$g$2);
1558: yyValue.setLocation(location(yyStart));
1559:
1560: return new SemanticValue(yyValue, yyRepetition1,
1561: yyError);
1562: } // End scope for v$g$2.
1563: }
1564: }
1565:
1566: // Done.
1567: yyError = yyError.select("throws clause expected", yyStart);
1568: return yyError;
1569: }
1570:
1571: // =========================================================================
1572:
1573: /**
1574: * Parse nonterminal xtc.lang.Java.Extension.
1575: *
1576: * @param yyStart The index.
1577: * @return The result.
1578: * @throws IOException Signals an I/O error.
1579: */
1580: private Result pExtension(final int yyStart) throws IOException {
1581: Result yyResult;
1582: int yyBase;
1583: int yyRepetition1;
1584: Pair<Node> yyRepValue1;
1585: Node yyValue;
1586: ParseError yyError = ParseError.DUMMY;
1587:
1588: // Alternative 1.
1589:
1590: yyResult = pWord(yyStart);
1591: yyError = yyResult.select(yyError);
1592: if (yyResult.hasValue("extends")) {
1593:
1594: yyResult = pType(yyResult.index);
1595: yyError = yyResult.select(yyError);
1596: if (yyResult.hasValue()) {
1597: final Node v$g$1 = yyResult.semanticValue();
1598:
1599: yyRepetition1 = yyResult.index;
1600: yyRepValue1 = Pair.empty();
1601: while (true) {
1602:
1603: yyBase = yyRepetition1;
1604: yyResult = pSymbol(yyBase);
1605: yyError = yyResult.select(yyError);
1606: if (yyResult.hasValue(",")) {
1607:
1608: yyResult = pType(yyResult.index);
1609: yyError = yyResult.select(yyError);
1610: if (yyResult.hasValue()) {
1611: final Node v$el$1 = yyResult
1612: .semanticValue();
1613:
1614: yyRepetition1 = yyResult.index;
1615: yyRepValue1 = new Pair<Node>(v$el$1,
1616: yyRepValue1);
1617: continue;
1618: }
1619: } else {
1620: yyError = yyError.select("\",\" expected",
1621: yyBase);
1622: }
1623: break;
1624: }
1625: { // Start scope for v$g$2.
1626: final Pair<Node> v$g$2 = yyRepValue1.reverse();
1627:
1628: yyValue = GNode.createFromPair("Extension", v$g$1,
1629: v$g$2);
1630: yyValue.setLocation(location(yyStart));
1631:
1632: return new SemanticValue(yyValue, yyRepetition1,
1633: yyError);
1634: } // End scope for v$g$2.
1635: }
1636: }
1637:
1638: // Done.
1639: yyError = yyError.select("extension expected", yyStart);
1640: return yyError;
1641: }
1642:
1643: // =========================================================================
1644:
1645: /**
1646: * Parse nonterminal xtc.lang.Java.Implementation.
1647: *
1648: * @param yyStart The index.
1649: * @return The result.
1650: * @throws IOException Signals an I/O error.
1651: */
1652: private Result pImplementation(final int yyStart)
1653: throws IOException {
1654: Result yyResult;
1655: int yyBase;
1656: int yyRepetition1;
1657: Pair<Node> yyRepValue1;
1658: Node yyValue;
1659: ParseError yyError = ParseError.DUMMY;
1660:
1661: // Alternative 1.
1662:
1663: yyResult = pWord(yyStart);
1664: yyError = yyResult.select(yyError);
1665: if (yyResult.hasValue("implements")) {
1666:
1667: yyResult = pType(yyResult.index);
1668: yyError = yyResult.select(yyError);
1669: if (yyResult.hasValue()) {
1670: final Node v$g$1 = yyResult.semanticValue();
1671:
1672: yyRepetition1 = yyResult.index;
1673: yyRepValue1 = Pair.empty();
1674: while (true) {
1675:
1676: yyBase = yyRepetition1;
1677: yyResult = pSymbol(yyBase);
1678: yyError = yyResult.select(yyError);
1679: if (yyResult.hasValue(",")) {
1680:
1681: yyResult = pType(yyResult.index);
1682: yyError = yyResult.select(yyError);
1683: if (yyResult.hasValue()) {
1684: final Node v$el$1 = yyResult
1685: .semanticValue();
1686:
1687: yyRepetition1 = yyResult.index;
1688: yyRepValue1 = new Pair<Node>(v$el$1,
1689: yyRepValue1);
1690: continue;
1691: }
1692: } else {
1693: yyError = yyError.select("\",\" expected",
1694: yyBase);
1695: }
1696: break;
1697: }
1698: { // Start scope for v$g$2.
1699: final Pair<Node> v$g$2 = yyRepValue1.reverse();
1700:
1701: yyValue = GNode.createFromPair("Implementation",
1702: v$g$1, v$g$2);
1703: yyValue.setLocation(location(yyStart));
1704:
1705: return new SemanticValue(yyValue, yyRepetition1,
1706: yyError);
1707: } // End scope for v$g$2.
1708: }
1709: }
1710:
1711: // Done.
1712: yyError = yyError.select("implementation expected", yyStart);
1713: return yyError;
1714: }
1715:
1716: // =========================================================================
1717:
1718: /**
1719: * Parse nonterminal xtc.lang.Java.Block.
1720: *
1721: * @param yyStart The index.
1722: * @return The result.
1723: * @throws IOException Signals an I/O error.
1724: */
1725: private Result pBlock(final int yyStart) throws IOException {
1726: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
1727: if (null == yyColumn.chunk1)
1728: yyColumn.chunk1 = new Chunk1();
1729: if (null == yyColumn.chunk1.fBlock)
1730: yyColumn.chunk1.fBlock = pBlock$1(yyStart);
1731: return yyColumn.chunk1.fBlock;
1732: }
1733:
1734: /** Actually parse xtc.lang.Java.Block. */
1735: private Result pBlock$1(final int yyStart) throws IOException {
1736: Result yyResult;
1737: int yyBase;
1738: Node yyValue;
1739: ParseError yyError = ParseError.DUMMY;
1740:
1741: // Alternative <Block>.
1742:
1743: yyResult = pSymbol(yyStart);
1744: yyError = yyResult.select(yyError);
1745: if (yyResult.hasValue("{")) {
1746:
1747: yyResult = pBlock$$Star1(yyResult.index);
1748: yyError = yyResult.select(yyError);
1749: if (yyResult.hasValue()) {
1750: final Pair<Node> v$g$1 = yyResult.semanticValue();
1751:
1752: yyBase = yyResult.index;
1753: yyResult = pSymbol(yyBase);
1754: yyError = yyResult.select(yyError);
1755: if (yyResult.hasValue("}")) {
1756:
1757: yyValue = GNode.createFromPair("Block", v$g$1);
1758: yyValue.setLocation(location(yyStart));
1759:
1760: return yyResult.createValue(yyValue, yyError);
1761: } else {
1762: yyError = yyError.select("\"}\" expected", yyBase);
1763: }
1764: }
1765: }
1766:
1767: // Done.
1768: yyError = yyError.select("block expected", yyStart);
1769: return yyError;
1770: }
1771:
1772: // =========================================================================
1773:
1774: /**
1775: * Parse synthetic nonterminal xtc.lang.Java.Block$$Star1.
1776: *
1777: * @param yyStart The index.
1778: * @return The result.
1779: * @throws IOException Signals an I/O error.
1780: */
1781: private Result pBlock$$Star1(final int yyStart) throws IOException {
1782: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
1783: if (null == yyColumn.chunk1)
1784: yyColumn.chunk1 = new Chunk1();
1785: if (null == yyColumn.chunk1.fBlock$$Star1)
1786: yyColumn.chunk1.fBlock$$Star1 = pBlock$$Star1$1(yyStart);
1787: return yyColumn.chunk1.fBlock$$Star1;
1788: }
1789:
1790: /** Actually parse xtc.lang.Java.Block$$Star1. */
1791: private Result pBlock$$Star1$1(final int yyStart)
1792: throws IOException {
1793: Result yyResult;
1794: Pair<Node> yyValue;
1795: ParseError yyError = ParseError.DUMMY;
1796:
1797: // Alternative 1.
1798:
1799: yyResult = pDeclarationOrStatement(yyStart);
1800: yyError = yyResult.select(yyError);
1801: if (yyResult.hasValue()) {
1802: final Node v$el$1 = yyResult.semanticValue();
1803:
1804: yyResult = pBlock$$Star1(yyResult.index);
1805: yyError = yyResult.select(yyError);
1806: if (yyResult.hasValue()) {
1807: final Pair<Node> v$2 = yyResult.semanticValue();
1808:
1809: yyValue = new Pair<Node>(v$el$1, v$2);
1810:
1811: return yyResult.createValue(yyValue, yyError);
1812: }
1813: }
1814:
1815: // Alternative 2.
1816:
1817: yyValue = Pair.empty();
1818:
1819: return new SemanticValue(yyValue, yyStart, yyError);
1820: }
1821:
1822: // =========================================================================
1823:
1824: /**
1825: * Parse nonterminal xtc.lang.Java.DeclarationOrStatement.
1826: *
1827: * @param yyStart The index.
1828: * @return The result.
1829: * @throws IOException Signals an I/O error.
1830: */
1831: private Result pDeclarationOrStatement(final int yyStart)
1832: throws IOException {
1833:
1834: Result yyResult;
1835: Node yyValue;
1836: ParseError yyError = ParseError.DUMMY;
1837:
1838: // Alternative <Declaration>.
1839:
1840: yyResult = pInBlockDeclaration(yyStart);
1841: yyError = yyResult.select(yyError);
1842: if (yyResult.hasValue()) {
1843: yyValue = yyResult.semanticValue();
1844:
1845: return yyResult.createValue(yyValue, yyError);
1846: }
1847:
1848: // Alternative <Statement>.
1849:
1850: yyResult = pStatement(yyStart);
1851: yyError = yyResult.select(yyError);
1852: if (yyResult.hasValue()) {
1853: yyValue = yyResult.semanticValue();
1854:
1855: return yyResult.createValue(yyValue, yyError);
1856: }
1857:
1858: // Done.
1859: return yyError;
1860: }
1861:
1862: // =========================================================================
1863:
1864: /**
1865: * Parse nonterminal xtc.lang.Java.InBlockDeclaration.
1866: *
1867: * @param yyStart The index.
1868: * @return The result.
1869: * @throws IOException Signals an I/O error.
1870: */
1871: private Result pInBlockDeclaration(final int yyStart)
1872: throws IOException {
1873: Result yyResult;
1874: int yyBase;
1875: int yyOption1;
1876: Node yyOpValue1;
1877: Node yyValue;
1878: ParseError yyError = ParseError.DUMMY;
1879:
1880: // Alternative <Variable>.
1881:
1882: yyResult = pVariableDeclaration(yyStart);
1883: yyError = yyResult.select(yyError);
1884: if (yyResult.hasValue()) {
1885: yyValue = yyResult.semanticValue();
1886:
1887: return yyResult.createValue(yyValue, yyError);
1888: }
1889:
1890: // Alternative 2.
1891:
1892: yyResult = pModifiers(yyStart);
1893: yyError = yyResult.select(yyError);
1894: if (yyResult.hasValue()) {
1895: final Node v$g$1 = yyResult.semanticValue();
1896:
1897: final int yyChoice1 = yyResult.index;
1898:
1899: // Nested alternative 1.
1900:
1901: yyBase = yyChoice1;
1902: yyResult = pWord(yyBase);
1903: yyError = yyResult.select(yyError);
1904: if (yyResult.hasValue("class")) {
1905:
1906: yyResult = pIdentifier(yyResult.index);
1907: yyError = yyResult.select(yyError);
1908: if (yyResult.hasValue()) {
1909: final String v$g$2 = yyResult.semanticValue();
1910:
1911: yyOption1 = yyResult.index;
1912: yyOpValue1 = null;
1913:
1914: yyResult = pExtension(yyOption1);
1915: yyError = yyResult.select(yyError);
1916: if (yyResult.hasValue()) {
1917: final Node v$el$1 = yyResult.semanticValue();
1918:
1919: yyOption1 = yyResult.index;
1920: yyOpValue1 = v$el$1;
1921: }
1922: { // Start scope for v$g$4.
1923: final Node v$g$4 = yyOpValue1;
1924:
1925: yyOpValue1 = null;
1926:
1927: yyResult = pImplementation(yyOption1);
1928: yyError = yyResult.select(yyError);
1929: if (yyResult.hasValue()) {
1930: final Node v$el$2 = yyResult
1931: .semanticValue();
1932:
1933: yyOption1 = yyResult.index;
1934: yyOpValue1 = v$el$2;
1935: }
1936: { // Start scope for v$g$5.
1937: final Node v$g$5 = yyOpValue1;
1938:
1939: yyResult = pClassBody(yyOption1);
1940: yyError = yyResult.select(yyError);
1941: if (yyResult.hasValue()) {
1942: final Node v$g$6 = yyResult
1943: .semanticValue();
1944:
1945: yyValue = GNode.create(
1946: "ClassDeclaration", v$g$1,
1947: v$g$2, null, v$g$4, v$g$5,
1948: v$g$6);
1949: yyValue.setLocation(location(yyStart));
1950:
1951: return yyResult.createValue(yyValue,
1952: yyError);
1953: }
1954: } // End scope for v$g$5.
1955: } // End scope for v$g$4.
1956: }
1957: } else {
1958: yyError = yyError.select("\"class\" expected", yyBase);
1959: }
1960:
1961: // Nested alternative 2.
1962:
1963: yyBase = yyChoice1;
1964: yyResult = pWord(yyBase);
1965: yyError = yyResult.select(yyError);
1966: if (yyResult.hasValue("interface")) {
1967:
1968: yyResult = pIdentifier(yyResult.index);
1969: yyError = yyResult.select(yyError);
1970: if (yyResult.hasValue()) {
1971: final String v$g$2 = yyResult.semanticValue();
1972:
1973: yyOption1 = yyResult.index;
1974: yyOpValue1 = null;
1975:
1976: yyResult = pExtension(yyOption1);
1977: yyError = yyResult.select(yyError);
1978: if (yyResult.hasValue()) {
1979: final Node v$el$1 = yyResult.semanticValue();
1980:
1981: yyOption1 = yyResult.index;
1982: yyOpValue1 = v$el$1;
1983: }
1984: { // Start scope for v$g$4.
1985: final Node v$g$4 = yyOpValue1;
1986:
1987: yyResult = pClassBody(yyOption1);
1988: yyError = yyResult.select(yyError);
1989: if (yyResult.hasValue()) {
1990: final Node v$g$5 = yyResult.semanticValue();
1991:
1992: yyValue = GNode.create(
1993: "InterfaceDeclaration", v$g$1,
1994: v$g$2, null, v$g$4, v$g$5);
1995: yyValue.setLocation(location(yyStart));
1996:
1997: return yyResult.createValue(yyValue,
1998: yyError);
1999: }
2000: } // End scope for v$g$4.
2001: }
2002: } else {
2003: yyError = yyError.select("\"interface\" expected",
2004: yyBase);
2005: }
2006: }
2007:
2008: // Done.
2009: return yyError;
2010: }
2011:
2012: // =========================================================================
2013:
2014: /**
2015: * Parse nonterminal xtc.lang.Java.VariableDeclaration.
2016: *
2017: * @param yyStart The index.
2018: * @return The result.
2019: * @throws IOException Signals an I/O error.
2020: */
2021: private Result pVariableDeclaration(final int yyStart)
2022: throws IOException {
2023: Result yyResult;
2024: int yyBase;
2025: Node yyValue;
2026: ParseError yyError = ParseError.DUMMY;
2027:
2028: // Alternative <Declaration>.
2029:
2030: yyResult = pVariableModifiers(yyStart);
2031: yyError = yyResult.select(yyError);
2032: if (yyResult.hasValue()) {
2033: final Node v$g$1 = yyResult.semanticValue();
2034:
2035: yyResult = pType(yyResult.index);
2036: yyError = yyResult.select(yyError);
2037: if (yyResult.hasValue()) {
2038: final Node v$g$2 = yyResult.semanticValue();
2039:
2040: yyResult = pDeclarators(yyResult.index);
2041: yyError = yyResult.select(yyError);
2042: if (yyResult.hasValue()) {
2043: final Node v$g$3 = yyResult.semanticValue();
2044:
2045: yyBase = yyResult.index;
2046: yyResult = pSymbol(yyBase);
2047: yyError = yyResult.select(yyError);
2048: if (yyResult.hasValue(";")) {
2049:
2050: yyValue = GNode.create("FieldDeclaration",
2051: v$g$1, v$g$2, v$g$3);
2052: yyValue.setLocation(location(yyStart));
2053:
2054: return yyResult.createValue(yyValue, yyError);
2055: } else {
2056: yyError = yyError.select("\";\" expected",
2057: yyBase);
2058: }
2059: }
2060: }
2061: }
2062:
2063: // Done.
2064: return yyError;
2065: }
2066:
2067: // =========================================================================
2068:
2069: /**
2070: * Parse nonterminal xtc.lang.Java.Statement.
2071: *
2072: * @param yyStart The index.
2073: * @return The result.
2074: * @throws IOException Signals an I/O error.
2075: */
2076: private Result pStatement(final int yyStart) throws IOException {
2077: Result yyResult;
2078: int yyBase;
2079: int yyRepetition1;
2080: boolean yyRepeated1;
2081: Pair<Node> yyRepValue1;
2082: int yyOption1;
2083: Object yyOpValue1;
2084: Node yyValue;
2085: ParseError yyError = ParseError.DUMMY;
2086:
2087: // Alternative <Block>.
2088:
2089: yyResult = pBlock(yyStart);
2090: yyError = yyResult.select(yyError);
2091: if (yyResult.hasValue()) {
2092: yyValue = yyResult.semanticValue();
2093:
2094: return yyResult.createValue(yyValue, yyError);
2095: }
2096:
2097: // Alternative 2.
2098:
2099: yyResult = pWord(yyStart);
2100: yyError = yyResult.select(yyError);
2101: if (yyResult.hasValue("if")) {
2102:
2103: yyResult = pParExpression(yyResult.index);
2104: yyError = yyResult.select(yyError);
2105: if (yyResult.hasValue()) {
2106: final Node v$g$1 = yyResult.semanticValue();
2107:
2108: yyResult = pStatement(yyResult.index);
2109: yyError = yyResult.select(yyError);
2110: if (yyResult.hasValue()) {
2111: final Node v$g$2 = yyResult.semanticValue();
2112:
2113: final int yyChoice1 = yyResult.index;
2114:
2115: // Nested alternative 1.
2116:
2117: yyBase = yyChoice1;
2118: yyResult = pWord(yyBase);
2119: yyError = yyResult.select(yyError);
2120: if (yyResult.hasValue("else")) {
2121:
2122: yyResult = pStatement(yyResult.index);
2123: yyError = yyResult.select(yyError);
2124: if (yyResult.hasValue()) {
2125: final Node v$g$3 = yyResult.semanticValue();
2126:
2127: yyValue = GNode.create(
2128: "ConditionalStatement", v$g$1,
2129: v$g$2, v$g$3);
2130: yyValue.setLocation(location(yyStart));
2131:
2132: return yyResult.createValue(yyValue,
2133: yyError);
2134: }
2135: } else {
2136: yyError = yyError.select("\"else\" expected",
2137: yyBase);
2138: }
2139:
2140: // Nested alternative 2.
2141:
2142: yyValue = GNode.create("ConditionalStatement",
2143: v$g$1, v$g$2, null);
2144: yyValue.setLocation(location(yyStart));
2145:
2146: return new SemanticValue(yyValue, yyChoice1,
2147: yyError);
2148: }
2149: }
2150: }
2151:
2152: // Alternative 3.
2153:
2154: yyResult = pWord(yyStart);
2155: yyError = yyResult.select(yyError);
2156: if (yyResult.hasValue("for")) {
2157:
2158: yyBase = yyResult.index;
2159: yyResult = pSymbol(yyBase);
2160: yyError = yyResult.select(yyError);
2161: if (yyResult.hasValue("(")) {
2162:
2163: yyResult = pBasicForControl(yyResult.index);
2164: yyError = yyResult.select(yyError);
2165: if (yyResult.hasValue()) {
2166: final Node v$g$1 = yyResult.semanticValue();
2167:
2168: yyBase = yyResult.index;
2169: yyResult = pSymbol(yyBase);
2170: yyError = yyResult.select(yyError);
2171: if (yyResult.hasValue(")")) {
2172:
2173: yyResult = pStatement(yyResult.index);
2174: yyError = yyResult.select(yyError);
2175: if (yyResult.hasValue()) {
2176: final Node v$g$2 = yyResult.semanticValue();
2177:
2178: yyValue = GNode.create("ForStatement",
2179: v$g$1, v$g$2);
2180: yyValue.setLocation(location(yyStart));
2181:
2182: return yyResult.createValue(yyValue,
2183: yyError);
2184: }
2185: } else {
2186: yyError = yyError.select("\")\" expected",
2187: yyBase);
2188: }
2189: }
2190: } else {
2191: yyError = yyError.select("\"(\" expected", yyBase);
2192: }
2193: }
2194:
2195: // Alternative 4.
2196:
2197: yyResult = pWord(yyStart);
2198: yyError = yyResult.select(yyError);
2199: if (yyResult.hasValue("while")) {
2200:
2201: yyResult = pParExpression(yyResult.index);
2202: yyError = yyResult.select(yyError);
2203: if (yyResult.hasValue()) {
2204: final Node v$g$1 = yyResult.semanticValue();
2205:
2206: yyResult = pStatement(yyResult.index);
2207: yyError = yyResult.select(yyError);
2208: if (yyResult.hasValue()) {
2209: final Node v$g$2 = yyResult.semanticValue();
2210:
2211: yyValue = GNode.create("WhileStatement", v$g$1,
2212: v$g$2);
2213: yyValue.setLocation(location(yyStart));
2214:
2215: return yyResult.createValue(yyValue, yyError);
2216: }
2217: }
2218: }
2219:
2220: // Alternative 5.
2221:
2222: yyResult = pWord(yyStart);
2223: yyError = yyResult.select(yyError);
2224: if (yyResult.hasValue("do")) {
2225:
2226: yyResult = pStatement(yyResult.index);
2227: yyError = yyResult.select(yyError);
2228: if (yyResult.hasValue()) {
2229: final Node v$g$1 = yyResult.semanticValue();
2230:
2231: yyBase = yyResult.index;
2232: yyResult = pWord(yyBase);
2233: yyError = yyResult.select(yyError);
2234: if (yyResult.hasValue("while")) {
2235:
2236: yyResult = pParExpression(yyResult.index);
2237: yyError = yyResult.select(yyError);
2238: if (yyResult.hasValue()) {
2239: final Node v$g$2 = yyResult.semanticValue();
2240:
2241: yyBase = yyResult.index;
2242: yyResult = pSymbol(yyBase);
2243: yyError = yyResult.select(yyError);
2244: if (yyResult.hasValue(";")) {
2245:
2246: yyValue = GNode.create("DoWhileStatement",
2247: v$g$1, v$g$2);
2248: yyValue.setLocation(location(yyStart));
2249:
2250: return yyResult.createValue(yyValue,
2251: yyError);
2252: } else {
2253: yyError = yyError.select("\";\" expected",
2254: yyBase);
2255: }
2256: }
2257: } else {
2258: yyError = yyError.select("\"while\" expected",
2259: yyBase);
2260: }
2261: }
2262: }
2263:
2264: // Alternative 6.
2265:
2266: yyResult = pWord(yyStart);
2267: yyError = yyResult.select(yyError);
2268: if (yyResult.hasValue("try")) {
2269:
2270: yyResult = pBlock(yyResult.index);
2271: yyError = yyResult.select(yyError);
2272: if (yyResult.hasValue()) {
2273: final Node v$g$1 = yyResult.semanticValue();
2274:
2275: final int yyChoice1 = yyResult.index;
2276:
2277: // Nested alternative 1.
2278:
2279: yyRepetition1 = yyChoice1;
2280: yyRepValue1 = Pair.empty();
2281: while (true) {
2282:
2283: yyResult = pCatchClause(yyRepetition1);
2284: yyError = yyResult.select(yyError);
2285: if (yyResult.hasValue()) {
2286: final Node v$el$1 = yyResult.semanticValue();
2287:
2288: yyRepetition1 = yyResult.index;
2289: yyRepValue1 = new Pair<Node>(v$el$1,
2290: yyRepValue1);
2291: continue;
2292: }
2293: break;
2294: }
2295: { // Start scope for v$g$2.
2296: final Pair<Node> v$g$2 = yyRepValue1.reverse();
2297:
2298: yyBase = yyRepetition1;
2299: yyResult = pWord(yyBase);
2300: yyError = yyResult.select(yyError);
2301: if (yyResult.hasValue("finally")) {
2302:
2303: yyResult = pBlock(yyResult.index);
2304: yyError = yyResult.select(yyError);
2305: if (yyResult.hasValue()) {
2306: final Node v$g$3 = yyResult.semanticValue();
2307:
2308: yyValue = GNode.create(
2309: "TryCatchFinallyStatement",
2310: v$g$2.size() + 2).add(v$g$1)
2311: .addAll(v$g$2).add(v$g$3);
2312: yyValue.setLocation(location(yyStart));
2313:
2314: return yyResult.createValue(yyValue,
2315: yyError);
2316: }
2317: } else {
2318: yyError = yyError.select(
2319: "\"finally\" expected", yyBase);
2320: }
2321: } // End scope for v$g$2.
2322:
2323: // Nested alternative 2.
2324:
2325: yyRepetition1 = yyChoice1;
2326: yyRepeated1 = false;
2327: yyRepValue1 = Pair.empty();
2328: while (true) {
2329:
2330: yyResult = pCatchClause(yyRepetition1);
2331: yyError = yyResult.select(yyError);
2332: if (yyResult.hasValue()) {
2333: final Node v$el$2 = yyResult.semanticValue();
2334:
2335: yyRepetition1 = yyResult.index;
2336: yyRepeated1 = true;
2337: yyRepValue1 = new Pair<Node>(v$el$2,
2338: yyRepValue1);
2339: continue;
2340: }
2341: break;
2342: }
2343:
2344: if (yyRepeated1) {
2345: final Pair<Node> v$g$4 = yyRepValue1.reverse();
2346:
2347: yyValue = GNode.create("TryCatchFinallyStatement",
2348: v$g$4.size() + 2).add(v$g$1).addAll(v$g$4)
2349: .add(null);
2350: yyValue.setLocation(location(yyStart));
2351:
2352: return new SemanticValue(yyValue, yyRepetition1,
2353: yyError);
2354: }
2355: }
2356: }
2357:
2358: // Alternative 7.
2359:
2360: yyResult = pWord(yyStart);
2361: yyError = yyResult.select(yyError);
2362: if (yyResult.hasValue("switch")) {
2363:
2364: yyResult = pParExpression(yyResult.index);
2365: yyError = yyResult.select(yyError);
2366: if (yyResult.hasValue()) {
2367: final Node v$g$1 = yyResult.semanticValue();
2368:
2369: yyBase = yyResult.index;
2370: yyResult = pSymbol(yyBase);
2371: yyError = yyResult.select(yyError);
2372: if (yyResult.hasValue("{")) {
2373:
2374: yyRepetition1 = yyResult.index;
2375: yyRepValue1 = Pair.empty();
2376: while (true) {
2377:
2378: yyResult = pSwitchClause(yyRepetition1);
2379: yyError = yyResult.select(yyError);
2380: if (yyResult.hasValue()) {
2381: final Node v$el$1 = yyResult
2382: .semanticValue();
2383:
2384: yyRepetition1 = yyResult.index;
2385: yyRepValue1 = new Pair<Node>(v$el$1,
2386: yyRepValue1);
2387: continue;
2388: }
2389: break;
2390: }
2391: { // Start scope for v$g$2.
2392: final Pair<Node> v$g$2 = yyRepValue1.reverse();
2393:
2394: yyBase = yyRepetition1;
2395: yyResult = pSymbol(yyBase);
2396: yyError = yyResult.select(yyError);
2397: if (yyResult.hasValue("}")) {
2398:
2399: yyValue = GNode.createFromPair(
2400: "SwitchStatement", v$g$1, v$g$2);
2401: yyValue.setLocation(location(yyStart));
2402:
2403: return yyResult.createValue(yyValue,
2404: yyError);
2405: } else {
2406: yyError = yyError.select("\"}\" expected",
2407: yyBase);
2408: }
2409: } // End scope for v$g$2.
2410: } else {
2411: yyError = yyError.select("\"{\" expected", yyBase);
2412: }
2413: }
2414: }
2415:
2416: // Alternative 8.
2417:
2418: yyResult = pWord(yyStart);
2419: yyError = yyResult.select(yyError);
2420: if (yyResult.hasValue("synchronized")) {
2421:
2422: yyResult = pParExpression(yyResult.index);
2423: yyError = yyResult.select(yyError);
2424: if (yyResult.hasValue()) {
2425: final Node v$g$1 = yyResult.semanticValue();
2426:
2427: yyResult = pBlock(yyResult.index);
2428: yyError = yyResult.select(yyError);
2429: if (yyResult.hasValue()) {
2430: final Node v$g$2 = yyResult.semanticValue();
2431:
2432: yyValue = GNode.create("SynchronizedStatement",
2433: v$g$1, v$g$2);
2434: yyValue.setLocation(location(yyStart));
2435:
2436: return yyResult.createValue(yyValue, yyError);
2437: }
2438: }
2439: }
2440:
2441: // Alternative 9.
2442:
2443: yyResult = pWord(yyStart);
2444: yyError = yyResult.select(yyError);
2445: if (yyResult.hasValue("return")) {
2446:
2447: yyOption1 = yyResult.index;
2448: yyOpValue1 = null;
2449:
2450: yyResult = pExpression(yyOption1);
2451: yyError = yyResult.select(yyError);
2452: if (yyResult.hasValue()) {
2453: final Node v$el$1 = yyResult.semanticValue();
2454:
2455: yyOption1 = yyResult.index;
2456: yyOpValue1 = v$el$1;
2457: }
2458: { // Start scope for v$g$1.
2459: final Node v$g$1 = cast(yyOpValue1);
2460:
2461: yyBase = yyOption1;
2462: yyResult = pSymbol(yyBase);
2463: yyError = yyResult.select(yyError);
2464: if (yyResult.hasValue(";")) {
2465:
2466: yyValue = GNode.create("ReturnStatement", v$g$1);
2467: yyValue.setLocation(location(yyStart));
2468:
2469: return yyResult.createValue(yyValue, yyError);
2470: } else {
2471: yyError = yyError.select("\";\" expected", yyBase);
2472: }
2473: } // End scope for v$g$1.
2474: }
2475:
2476: // Alternative 10.
2477:
2478: yyResult = pWord(yyStart);
2479: yyError = yyResult.select(yyError);
2480: if (yyResult.hasValue("throw")) {
2481:
2482: yyResult = pExpression(yyResult.index);
2483: yyError = yyResult.select(yyError);
2484: if (yyResult.hasValue()) {
2485: final Node v$g$1 = yyResult.semanticValue();
2486:
2487: yyBase = yyResult.index;
2488: yyResult = pSymbol(yyBase);
2489: yyError = yyResult.select(yyError);
2490: if (yyResult.hasValue(";")) {
2491:
2492: yyValue = GNode.create("ThrowStatement", v$g$1);
2493: yyValue.setLocation(location(yyStart));
2494:
2495: return yyResult.createValue(yyValue, yyError);
2496: } else {
2497: yyError = yyError.select("\";\" expected", yyBase);
2498: }
2499: }
2500: }
2501:
2502: // Alternative 11.
2503:
2504: yyResult = pWord(yyStart);
2505: yyError = yyResult.select(yyError);
2506: if (yyResult.hasValue("break")) {
2507:
2508: yyOption1 = yyResult.index;
2509: yyOpValue1 = null;
2510:
2511: yyResult = pIdentifier(yyOption1);
2512: yyError = yyResult.select(yyError);
2513: if (yyResult.hasValue()) {
2514: final String v$el$1 = yyResult.semanticValue();
2515:
2516: yyOption1 = yyResult.index;
2517: yyOpValue1 = v$el$1;
2518: }
2519: { // Start scope for v$g$1.
2520: final String v$g$1 = cast(yyOpValue1);
2521:
2522: yyBase = yyOption1;
2523: yyResult = pSymbol(yyBase);
2524: yyError = yyResult.select(yyError);
2525: if (yyResult.hasValue(";")) {
2526:
2527: yyValue = GNode.create("BreakStatement", v$g$1);
2528: yyValue.setLocation(location(yyStart));
2529:
2530: return yyResult.createValue(yyValue, yyError);
2531: } else {
2532: yyError = yyError.select("\";\" expected", yyBase);
2533: }
2534: } // End scope for v$g$1.
2535: }
2536:
2537: // Alternative 12.
2538:
2539: yyResult = pWord(yyStart);
2540: yyError = yyResult.select(yyError);
2541: if (yyResult.hasValue("continue")) {
2542:
2543: yyOption1 = yyResult.index;
2544: yyOpValue1 = null;
2545:
2546: yyResult = pIdentifier(yyOption1);
2547: yyError = yyResult.select(yyError);
2548: if (yyResult.hasValue()) {
2549: final String v$el$1 = yyResult.semanticValue();
2550:
2551: yyOption1 = yyResult.index;
2552: yyOpValue1 = v$el$1;
2553: }
2554: { // Start scope for v$g$1.
2555: final String v$g$1 = cast(yyOpValue1);
2556:
2557: yyBase = yyOption1;
2558: yyResult = pSymbol(yyBase);
2559: yyError = yyResult.select(yyError);
2560: if (yyResult.hasValue(";")) {
2561:
2562: yyValue = GNode.create("ContinueStatement", v$g$1);
2563: yyValue.setLocation(location(yyStart));
2564:
2565: return yyResult.createValue(yyValue, yyError);
2566: } else {
2567: yyError = yyError.select("\";\" expected", yyBase);
2568: }
2569: } // End scope for v$g$1.
2570: }
2571:
2572: // Alternative 13.
2573:
2574: yyResult = pIdentifier(yyStart);
2575: yyError = yyResult.select(yyError);
2576: if (yyResult.hasValue()) {
2577: final String v$g$1 = yyResult.semanticValue();
2578:
2579: yyBase = yyResult.index;
2580: yyResult = pSymbol(yyBase);
2581: yyError = yyResult.select(yyError);
2582: if (yyResult.hasValue(":")) {
2583:
2584: yyResult = pStatement(yyResult.index);
2585: yyError = yyResult.select(yyError);
2586: if (yyResult.hasValue()) {
2587: final Node v$g$2 = yyResult.semanticValue();
2588:
2589: yyValue = GNode.create("LabeledStatement", v$g$1,
2590: v$g$2);
2591: yyValue.setLocation(location(yyStart));
2592:
2593: return yyResult.createValue(yyValue, yyError);
2594: }
2595: } else {
2596: yyError = yyError.select("\":\" expected", yyBase);
2597: }
2598: }
2599:
2600: // Alternative 14.
2601:
2602: yyResult = pExpression(yyStart);
2603: yyError = yyResult.select(yyError);
2604: if (yyResult.hasValue()) {
2605: final Node v$g$1 = yyResult.semanticValue();
2606:
2607: yyBase = yyResult.index;
2608: yyResult = pSymbol(yyBase);
2609: yyError = yyResult.select(yyError);
2610: if (yyResult.hasValue(";")) {
2611:
2612: yyValue = GNode.create("ExpressionStatement", v$g$1);
2613: yyValue.setLocation(location(yyStart));
2614:
2615: return yyResult.createValue(yyValue, yyError);
2616: } else {
2617: yyError = yyError.select("\";\" expected", yyBase);
2618: }
2619: }
2620:
2621: // Alternative 15.
2622:
2623: yyResult = pWord(yyStart);
2624: yyError = yyResult.select(yyError);
2625: if (yyResult.hasValue("assert")) {
2626:
2627: yyResult = pExpression(yyResult.index);
2628: yyError = yyResult.select(yyError);
2629: if (yyResult.hasValue()) {
2630: final Node v$g$1 = yyResult.semanticValue();
2631:
2632: yyOption1 = yyResult.index;
2633: yyOpValue1 = null;
2634:
2635: yyBase = yyOption1;
2636: yyResult = pSymbol(yyBase);
2637: yyError = yyResult.select(yyError);
2638: if (yyResult.hasValue(":")) {
2639:
2640: yyResult = pExpression(yyResult.index);
2641: yyError = yyResult.select(yyError);
2642: if (yyResult.hasValue()) {
2643: final Node v$el$1 = yyResult.semanticValue();
2644:
2645: yyOption1 = yyResult.index;
2646: yyOpValue1 = v$el$1;
2647: }
2648: } else {
2649: yyError = yyError.select("\":\" expected", yyBase);
2650: }
2651: { // Start scope for v$g$2.
2652: final Node v$g$2 = cast(yyOpValue1);
2653:
2654: yyBase = yyOption1;
2655: yyResult = pSymbol(yyBase);
2656: yyError = yyResult.select(yyError);
2657: if (yyResult.hasValue(";")) {
2658:
2659: yyValue = GNode.create("AssertStatement",
2660: v$g$1, v$g$2);
2661: yyValue.setLocation(location(yyStart));
2662:
2663: return yyResult.createValue(yyValue, yyError);
2664: } else {
2665: yyError = yyError.select("\";\" expected",
2666: yyBase);
2667: }
2668: } // End scope for v$g$2.
2669: }
2670: }
2671:
2672: // Alternative 16.
2673:
2674: yyResult = pSymbol(yyStart);
2675: yyError = yyResult.select(yyError);
2676: if (yyResult.hasValue(";")) {
2677:
2678: yyValue = GNode.create("EmptyStatement", false);
2679: yyValue.setLocation(location(yyStart));
2680:
2681: return yyResult.createValue(yyValue, yyError);
2682: }
2683:
2684: // Done.
2685: yyError = yyError.select("statement expected", yyStart);
2686: return yyError;
2687: }
2688:
2689: // =========================================================================
2690:
2691: /**
2692: * Parse nonterminal xtc.lang.Java.BasicForControl.
2693: *
2694: * @param yyStart The index.
2695: * @return The result.
2696: * @throws IOException Signals an I/O error.
2697: */
2698: private Result pBasicForControl(final int yyStart)
2699: throws IOException {
2700: Result yyResult;
2701: int yyBase;
2702: int yyOption1;
2703: Node yyOpValue1;
2704: Node yyValue;
2705: ParseError yyError = ParseError.DUMMY;
2706:
2707: // Alternative <Declaration>.
2708:
2709: yyResult = pVariableModifiers(yyStart);
2710: yyError = yyResult.select(yyError);
2711: if (yyResult.hasValue()) {
2712: final Node v$g$1 = yyResult.semanticValue();
2713:
2714: yyResult = pType(yyResult.index);
2715: yyError = yyResult.select(yyError);
2716: if (yyResult.hasValue()) {
2717: final Node v$g$2 = yyResult.semanticValue();
2718:
2719: yyResult = pDeclarators(yyResult.index);
2720: yyError = yyResult.select(yyError);
2721: if (yyResult.hasValue()) {
2722: final Node v$g$3 = yyResult.semanticValue();
2723:
2724: yyBase = yyResult.index;
2725: yyResult = pSymbol(yyBase);
2726: yyError = yyResult.select(yyError);
2727: if (yyResult.hasValue(";")) {
2728:
2729: yyOption1 = yyResult.index;
2730: yyOpValue1 = null;
2731:
2732: yyResult = pExpression(yyOption1);
2733: yyError = yyResult.select(yyError);
2734: if (yyResult.hasValue()) {
2735: final Node v$el$1 = yyResult
2736: .semanticValue();
2737:
2738: yyOption1 = yyResult.index;
2739: yyOpValue1 = v$el$1;
2740: }
2741: { // Start scope for v$g$4.
2742: final Node v$g$4 = yyOpValue1;
2743:
2744: yyBase = yyOption1;
2745: yyResult = pSymbol(yyBase);
2746: yyError = yyResult.select(yyError);
2747: if (yyResult.hasValue(";")) {
2748:
2749: yyOption1 = yyResult.index;
2750: yyOpValue1 = null;
2751:
2752: yyResult = pExpressionList(yyOption1);
2753: yyError = yyResult.select(yyError);
2754: if (yyResult.hasValue()) {
2755: final Node v$el$2 = yyResult
2756: .semanticValue();
2757:
2758: yyOption1 = yyResult.index;
2759: yyOpValue1 = v$el$2;
2760: }
2761: { // Start scope for v$g$5.
2762: final Node v$g$5 = yyOpValue1;
2763:
2764: yyValue = GNode.create(
2765: "BasicForControl", v$g$1,
2766: v$g$2, v$g$3, v$g$4, v$g$5);
2767: yyValue
2768: .setLocation(location(yyStart));
2769:
2770: return new SemanticValue(yyValue,
2771: yyOption1, yyError);
2772: } // End scope for v$g$5.
2773: } else {
2774: yyError = yyError.select(
2775: "\";\" expected", yyBase);
2776: }
2777: } // End scope for v$g$4.
2778: } else {
2779: yyError = yyError.select("\";\" expected",
2780: yyBase);
2781: }
2782: }
2783: }
2784: }
2785:
2786: // Alternative <Initialization>.
2787:
2788: yyOption1 = yyStart;
2789: yyOpValue1 = null;
2790:
2791: yyResult = pExpressionList(yyOption1);
2792: yyError = yyResult.select(yyError);
2793: if (yyResult.hasValue()) {
2794: final Node v$el$3 = yyResult.semanticValue();
2795:
2796: yyOption1 = yyResult.index;
2797: yyOpValue1 = v$el$3;
2798: }
2799: { // Start scope for v$g$8.
2800: final Node v$g$8 = yyOpValue1;
2801:
2802: yyBase = yyOption1;
2803: yyResult = pSymbol(yyBase);
2804: yyError = yyResult.select(yyError);
2805: if (yyResult.hasValue(";")) {
2806:
2807: yyOption1 = yyResult.index;
2808: yyOpValue1 = null;
2809:
2810: yyResult = pExpression(yyOption1);
2811: yyError = yyResult.select(yyError);
2812: if (yyResult.hasValue()) {
2813: final Node v$el$4 = yyResult.semanticValue();
2814:
2815: yyOption1 = yyResult.index;
2816: yyOpValue1 = v$el$4;
2817: }
2818: { // Start scope for v$g$9.
2819: final Node v$g$9 = yyOpValue1;
2820:
2821: yyBase = yyOption1;
2822: yyResult = pSymbol(yyBase);
2823: yyError = yyResult.select(yyError);
2824: if (yyResult.hasValue(";")) {
2825:
2826: yyOption1 = yyResult.index;
2827: yyOpValue1 = null;
2828:
2829: yyResult = pExpressionList(yyOption1);
2830: yyError = yyResult.select(yyError);
2831: if (yyResult.hasValue()) {
2832: final Node v$el$5 = yyResult
2833: .semanticValue();
2834:
2835: yyOption1 = yyResult.index;
2836: yyOpValue1 = v$el$5;
2837: }
2838: { // Start scope for v$g$10.
2839: final Node v$g$10 = yyOpValue1;
2840:
2841: yyValue = GNode.create("BasicForControl",
2842: null, null, v$g$8, v$g$9, v$g$10);
2843: yyValue.setLocation(location(yyStart));
2844:
2845: return new SemanticValue(yyValue,
2846: yyOption1, yyError);
2847: } // End scope for v$g$10.
2848: } else {
2849: yyError = yyError.select("\";\" expected",
2850: yyBase);
2851: }
2852: } // End scope for v$g$9.
2853: } else {
2854: yyError = yyError.select("\";\" expected", yyBase);
2855: }
2856: } // End scope for v$g$8.
2857:
2858: // Done.
2859: return yyError;
2860: }
2861:
2862: // =========================================================================
2863:
2864: /**
2865: * Parse nonterminal xtc.lang.Java.ParExpression.
2866: *
2867: * @param yyStart The index.
2868: * @return The result.
2869: * @throws IOException Signals an I/O error.
2870: */
2871: private Result pParExpression(final int yyStart) throws IOException {
2872: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
2873: if (null == yyColumn.chunk1)
2874: yyColumn.chunk1 = new Chunk1();
2875: if (null == yyColumn.chunk1.fParExpression)
2876: yyColumn.chunk1.fParExpression = pParExpression$1(yyStart);
2877: return yyColumn.chunk1.fParExpression;
2878: }
2879:
2880: /** Actually parse xtc.lang.Java.ParExpression. */
2881: private Result pParExpression$1(final int yyStart)
2882: throws IOException {
2883: Result yyResult;
2884: int yyBase;
2885: Node yyValue;
2886: ParseError yyError = ParseError.DUMMY;
2887:
2888: // Alternative 1.
2889:
2890: yyResult = pSymbol(yyStart);
2891: yyError = yyResult.select(yyError);
2892: if (yyResult.hasValue("(")) {
2893:
2894: yyResult = pExpression(yyResult.index);
2895: yyError = yyResult.select(yyError);
2896: if (yyResult.hasValue()) {
2897: yyValue = yyResult.semanticValue();
2898:
2899: yyBase = yyResult.index;
2900: yyResult = pSymbol(yyBase);
2901: yyError = yyResult.select(yyError);
2902: if (yyResult.hasValue(")")) {
2903:
2904: return yyResult.createValue(yyValue, yyError);
2905: } else {
2906: yyError = yyError.select("\")\" expected", yyBase);
2907: }
2908: }
2909: }
2910:
2911: // Done.
2912: yyError = yyError.select("par expression expected", yyStart);
2913: return yyError;
2914: }
2915:
2916: // =========================================================================
2917:
2918: /**
2919: * Parse nonterminal xtc.lang.Java.CatchClause.
2920: *
2921: * @param yyStart The index.
2922: * @return The result.
2923: * @throws IOException Signals an I/O error.
2924: */
2925: private Result pCatchClause(final int yyStart) throws IOException {
2926: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
2927: if (null == yyColumn.chunk1)
2928: yyColumn.chunk1 = new Chunk1();
2929: if (null == yyColumn.chunk1.fCatchClause)
2930: yyColumn.chunk1.fCatchClause = pCatchClause$1(yyStart);
2931: return yyColumn.chunk1.fCatchClause;
2932: }
2933:
2934: /** Actually parse xtc.lang.Java.CatchClause. */
2935: private Result pCatchClause$1(final int yyStart) throws IOException {
2936: Result yyResult;
2937: int yyBase;
2938: Node yyValue;
2939: ParseError yyError = ParseError.DUMMY;
2940:
2941: // Alternative 1.
2942:
2943: yyResult = pWord(yyStart);
2944: yyError = yyResult.select(yyError);
2945: if (yyResult.hasValue("catch")) {
2946:
2947: yyBase = yyResult.index;
2948: yyResult = pSymbol(yyBase);
2949: yyError = yyResult.select(yyError);
2950: if (yyResult.hasValue("(")) {
2951:
2952: yyResult = pFormalParameter(yyResult.index);
2953: yyError = yyResult.select(yyError);
2954: if (yyResult.hasValue()) {
2955: final Node v$g$1 = yyResult.semanticValue();
2956:
2957: yyBase = yyResult.index;
2958: yyResult = pSymbol(yyBase);
2959: yyError = yyResult.select(yyError);
2960: if (yyResult.hasValue(")")) {
2961:
2962: yyResult = pBlock(yyResult.index);
2963: yyError = yyResult.select(yyError);
2964: if (yyResult.hasValue()) {
2965: final Node v$g$2 = yyResult.semanticValue();
2966:
2967: yyValue = GNode.create("CatchClause",
2968: v$g$1, v$g$2);
2969: yyValue.setLocation(location(yyStart));
2970:
2971: return yyResult.createValue(yyValue,
2972: yyError);
2973: }
2974: } else {
2975: yyError = yyError.select("\")\" expected",
2976: yyBase);
2977: }
2978: }
2979: } else {
2980: yyError = yyError.select("\"(\" expected", yyBase);
2981: }
2982: }
2983:
2984: // Done.
2985: yyError = yyError.select("catch clause expected", yyStart);
2986: return yyError;
2987: }
2988:
2989: // =========================================================================
2990:
2991: /**
2992: * Parse nonterminal xtc.lang.Java.SwitchClause.
2993: *
2994: * @param yyStart The index.
2995: * @return The result.
2996: * @throws IOException Signals an I/O error.
2997: */
2998: private Result pSwitchClause(final int yyStart) throws IOException {
2999: Result yyResult;
3000: int yyBase;
3001: int yyRepetition1;
3002: Pair<Node> yyRepValue1;
3003: Node yyValue;
3004: ParseError yyError = ParseError.DUMMY;
3005:
3006: // Alternative 1.
3007:
3008: yyResult = pWord(yyStart);
3009: yyError = yyResult.select(yyError);
3010: if (yyResult.hasValue("case")) {
3011:
3012: yyResult = pExpression(yyResult.index);
3013: yyError = yyResult.select(yyError);
3014: if (yyResult.hasValue()) {
3015: final Node v$g$1 = yyResult.semanticValue();
3016:
3017: yyBase = yyResult.index;
3018: yyResult = pSymbol(yyBase);
3019: yyError = yyResult.select(yyError);
3020: if (yyResult.hasValue(":")) {
3021:
3022: yyRepetition1 = yyResult.index;
3023: yyRepValue1 = Pair.empty();
3024: while (true) {
3025:
3026: yyResult = pDeclarationOrStatement(yyRepetition1);
3027: yyError = yyResult.select(yyError);
3028: if (yyResult.hasValue()) {
3029: final Node v$el$1 = yyResult
3030: .semanticValue();
3031:
3032: yyRepetition1 = yyResult.index;
3033: yyRepValue1 = new Pair<Node>(v$el$1,
3034: yyRepValue1);
3035: continue;
3036: }
3037: break;
3038: }
3039: { // Start scope for v$g$2.
3040: final Pair<Node> v$g$2 = yyRepValue1.reverse();
3041:
3042: yyValue = GNode.createFromPair("CaseClause",
3043: v$g$1, v$g$2);
3044: yyValue.setLocation(location(yyStart));
3045:
3046: return new SemanticValue(yyValue,
3047: yyRepetition1, yyError);
3048: } // End scope for v$g$2.
3049: } else {
3050: yyError = yyError.select("\":\" expected", yyBase);
3051: }
3052: }
3053: }
3054:
3055: // Alternative 2.
3056:
3057: yyResult = pWord(yyStart);
3058: yyError = yyResult.select(yyError);
3059: if (yyResult.hasValue("default")) {
3060:
3061: yyBase = yyResult.index;
3062: yyResult = pSymbol(yyBase);
3063: yyError = yyResult.select(yyError);
3064: if (yyResult.hasValue(":")) {
3065:
3066: yyRepetition1 = yyResult.index;
3067: yyRepValue1 = Pair.empty();
3068: while (true) {
3069:
3070: yyResult = pDeclarationOrStatement(yyRepetition1);
3071: yyError = yyResult.select(yyError);
3072: if (yyResult.hasValue()) {
3073: final Node v$el$1 = yyResult.semanticValue();
3074:
3075: yyRepetition1 = yyResult.index;
3076: yyRepValue1 = new Pair<Node>(v$el$1,
3077: yyRepValue1);
3078: continue;
3079: }
3080: break;
3081: }
3082: { // Start scope for v$g$1.
3083: final Pair<Node> v$g$1 = yyRepValue1.reverse();
3084:
3085: yyValue = GNode.createFromPair("DefaultClause",
3086: v$g$1);
3087: yyValue.setLocation(location(yyStart));
3088:
3089: return new SemanticValue(yyValue, yyRepetition1,
3090: yyError);
3091: } // End scope for v$g$1.
3092: } else {
3093: yyError = yyError.select("\":\" expected", yyBase);
3094: }
3095: }
3096:
3097: // Done.
3098: yyError = yyError.select("switch clause expected", yyStart);
3099: return yyError;
3100: }
3101:
3102: // =========================================================================
3103:
3104: /**
3105: * Parse nonterminal xtc.lang.Java.ExpressionList.
3106: *
3107: * @param yyStart The index.
3108: * @return The result.
3109: * @throws IOException Signals an I/O error.
3110: */
3111: private Result pExpressionList(final int yyStart)
3112: throws IOException {
3113: Result yyResult;
3114: int yyBase;
3115: int yyRepetition1;
3116: Pair<Node> yyRepValue1;
3117: Node yyValue;
3118: ParseError yyError = ParseError.DUMMY;
3119:
3120: // Alternative 1.
3121:
3122: yyResult = pExpression(yyStart);
3123: yyError = yyResult.select(yyError);
3124: if (yyResult.hasValue()) {
3125: final Node v$g$1 = yyResult.semanticValue();
3126:
3127: yyRepetition1 = yyResult.index;
3128: yyRepValue1 = Pair.empty();
3129: while (true) {
3130:
3131: yyBase = yyRepetition1;
3132: yyResult = pSymbol(yyBase);
3133: yyError = yyResult.select(yyError);
3134: if (yyResult.hasValue(",")) {
3135:
3136: yyResult = pExpression(yyResult.index);
3137: yyError = yyResult.select(yyError);
3138: if (yyResult.hasValue()) {
3139: final Node v$el$1 = yyResult.semanticValue();
3140:
3141: yyRepetition1 = yyResult.index;
3142: yyRepValue1 = new Pair<Node>(v$el$1,
3143: yyRepValue1);
3144: continue;
3145: }
3146: } else {
3147: yyError = yyError.select("\",\" expected", yyBase);
3148: }
3149: break;
3150: }
3151: { // Start scope for v$g$2.
3152: final Pair<Node> v$g$2 = yyRepValue1.reverse();
3153:
3154: yyValue = GNode.createFromPair("ExpressionList", v$g$1,
3155: v$g$2);
3156: yyValue.setLocation(location(yyStart));
3157:
3158: return new SemanticValue(yyValue, yyRepetition1,
3159: yyError);
3160: } // End scope for v$g$2.
3161: }
3162:
3163: // Done.
3164: return yyError;
3165: }
3166:
3167: // =========================================================================
3168:
3169: /**
3170: * Parse nonterminal xtc.lang.Java.Expression.
3171: *
3172: * @param yyStart The index.
3173: * @return The result.
3174: * @throws IOException Signals an I/O error.
3175: */
3176: private Result pExpression(final int yyStart) throws IOException {
3177: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
3178: if (null == yyColumn.chunk1)
3179: yyColumn.chunk1 = new Chunk1();
3180: if (null == yyColumn.chunk1.fExpression)
3181: yyColumn.chunk1.fExpression = pExpression$1(yyStart);
3182: return yyColumn.chunk1.fExpression;
3183: }
3184:
3185: /** Actually parse xtc.lang.Java.Expression. */
3186: private Result pExpression$1(final int yyStart) throws IOException {
3187: Result yyResult;
3188: Node yyValue;
3189: ParseError yyError = ParseError.DUMMY;
3190:
3191: // Alternative <Assignment>.
3192:
3193: yyResult = pConditionalExpression(yyStart);
3194: yyError = yyResult.select(yyError);
3195: if (yyResult.hasValue()) {
3196: final Node v$g$1 = yyResult.semanticValue();
3197:
3198: yyResult = pAssignmentOperator(yyResult.index);
3199: yyError = yyResult.select(yyError);
3200: if (yyResult.hasValue()) {
3201: final String v$g$2 = yyResult.semanticValue();
3202:
3203: yyResult = pExpression(yyResult.index);
3204: yyError = yyResult.select(yyError);
3205: if (yyResult.hasValue()) {
3206: final Node v$g$3 = yyResult.semanticValue();
3207:
3208: yyValue = GNode.create("Expression", v$g$1, v$g$2,
3209: v$g$3);
3210: yyValue.setLocation(location(yyStart));
3211:
3212: return yyResult.createValue(yyValue, yyError);
3213: }
3214: }
3215: }
3216:
3217: // Alternative <Base>.
3218:
3219: yyResult = pConditionalExpression(yyStart);
3220: yyError = yyResult.select(yyError);
3221: if (yyResult.hasValue()) {
3222: yyValue = yyResult.semanticValue();
3223:
3224: return yyResult.createValue(yyValue, yyError);
3225: }
3226:
3227: // Done.
3228: return yyError;
3229: }
3230:
3231: // =========================================================================
3232:
3233: /**
3234: * Parse nonterminal xtc.lang.Java.AssignmentOperator.
3235: *
3236: * @param yyStart The index.
3237: * @return The result.
3238: * @throws IOException Signals an I/O error.
3239: */
3240: private Result pAssignmentOperator(final int yyStart)
3241: throws IOException {
3242: Result yyResult;
3243: String yyValue;
3244: ParseError yyError = ParseError.DUMMY;
3245:
3246: // Alternative <Equal>.
3247:
3248: yyResult = pSymbol(yyStart);
3249: yyError = yyResult.select(yyError);
3250: if (yyResult.hasValue("=")) {
3251: yyValue = "=";
3252:
3253: return yyResult.createValue(yyValue, yyError);
3254: }
3255:
3256: // Alternative <PlusEqual>.
3257:
3258: yyResult = pSymbol(yyStart);
3259: yyError = yyResult.select(yyError);
3260: if (yyResult.hasValue("+=")) {
3261: yyValue = "+=";
3262:
3263: return yyResult.createValue(yyValue, yyError);
3264: }
3265:
3266: // Alternative <MinusEqual>.
3267:
3268: yyResult = pSymbol(yyStart);
3269: yyError = yyResult.select(yyError);
3270: if (yyResult.hasValue("-=")) {
3271: yyValue = "-=";
3272:
3273: return yyResult.createValue(yyValue, yyError);
3274: }
3275:
3276: // Alternative <StarEqual>.
3277:
3278: yyResult = pSymbol(yyStart);
3279: yyError = yyResult.select(yyError);
3280: if (yyResult.hasValue("*=")) {
3281: yyValue = "*=";
3282:
3283: return yyResult.createValue(yyValue, yyError);
3284: }
3285:
3286: // Alternative <SlashEqual>.
3287:
3288: yyResult = pSymbol(yyStart);
3289: yyError = yyResult.select(yyError);
3290: if (yyResult.hasValue("/=")) {
3291: yyValue = "/=";
3292:
3293: return yyResult.createValue(yyValue, yyError);
3294: }
3295:
3296: // Alternative <AmpersandEqual>.
3297:
3298: yyResult = pSymbol(yyStart);
3299: yyError = yyResult.select(yyError);
3300: if (yyResult.hasValue("&=")) {
3301: yyValue = "&=";
3302:
3303: return yyResult.createValue(yyValue, yyError);
3304: }
3305:
3306: // Alternative <BarEqual>.
3307:
3308: yyResult = pSymbol(yyStart);
3309: yyError = yyResult.select(yyError);
3310: if (yyResult.hasValue("|=")) {
3311: yyValue = "|=";
3312:
3313: return yyResult.createValue(yyValue, yyError);
3314: }
3315:
3316: // Alternative <CaretEqual>.
3317:
3318: yyResult = pSymbol(yyStart);
3319: yyError = yyResult.select(yyError);
3320: if (yyResult.hasValue("^=")) {
3321: yyValue = "^=";
3322:
3323: return yyResult.createValue(yyValue, yyError);
3324: }
3325:
3326: // Alternative <PercentEqual>.
3327:
3328: yyResult = pSymbol(yyStart);
3329: yyError = yyResult.select(yyError);
3330: if (yyResult.hasValue("%=")) {
3331: yyValue = "%=";
3332:
3333: return yyResult.createValue(yyValue, yyError);
3334: }
3335:
3336: // Alternative <DoubleLessEqual>.
3337:
3338: yyResult = pSymbol(yyStart);
3339: yyError = yyResult.select(yyError);
3340: if (yyResult.hasValue("<<=")) {
3341: yyValue = "<<=";
3342:
3343: return yyResult.createValue(yyValue, yyError);
3344: }
3345:
3346: // Alternative <DoubleGreaterEqual>.
3347:
3348: yyResult = pSymbol(yyStart);
3349: yyError = yyResult.select(yyError);
3350: if (yyResult.hasValue(">>=")) {
3351: yyValue = ">>=";
3352:
3353: return yyResult.createValue(yyValue, yyError);
3354: }
3355:
3356: // Alternative <TripleGreaterEqual>.
3357:
3358: yyResult = pSymbol(yyStart);
3359: yyError = yyResult.select(yyError);
3360: if (yyResult.hasValue(">>>=")) {
3361: yyValue = ">>>=";
3362:
3363: return yyResult.createValue(yyValue, yyError);
3364: }
3365:
3366: // Done.
3367: yyError = yyError.select("assignment operator expected",
3368: yyStart);
3369: return yyError;
3370: }
3371:
3372: // =========================================================================
3373:
3374: /**
3375: * Parse nonterminal xtc.lang.Java.ConditionalExpression.
3376: *
3377: * @param yyStart The index.
3378: * @return The result.
3379: * @throws IOException Signals an I/O error.
3380: */
3381: private Result pConditionalExpression(final int yyStart)
3382: throws IOException {
3383:
3384: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
3385: if (null == yyColumn.chunk2)
3386: yyColumn.chunk2 = new Chunk2();
3387: if (null == yyColumn.chunk2.fConditionalExpression)
3388: yyColumn.chunk2.fConditionalExpression = pConditionalExpression$1(yyStart);
3389: return yyColumn.chunk2.fConditionalExpression;
3390: }
3391:
3392: /** Actually parse xtc.lang.Java.ConditionalExpression. */
3393: private Result pConditionalExpression$1(final int yyStart)
3394: throws IOException {
3395:
3396: Result yyResult;
3397: int yyBase;
3398: Node yyValue;
3399: ParseError yyError = ParseError.DUMMY;
3400:
3401: // Alternative <Conditional>.
3402:
3403: yyResult = pLogicalOrExpression(yyStart);
3404: yyError = yyResult.select(yyError);
3405: if (yyResult.hasValue()) {
3406: final Node v$g$1 = yyResult.semanticValue();
3407:
3408: yyBase = yyResult.index;
3409: yyResult = pSymbol(yyBase);
3410: yyError = yyResult.select(yyError);
3411: if (yyResult.hasValue("?")) {
3412:
3413: yyResult = pExpression(yyResult.index);
3414: yyError = yyResult.select(yyError);
3415: if (yyResult.hasValue()) {
3416: final Node v$g$2 = yyResult.semanticValue();
3417:
3418: yyBase = yyResult.index;
3419: yyResult = pSymbol(yyBase);
3420: yyError = yyResult.select(yyError);
3421: if (yyResult.hasValue(":")) {
3422:
3423: yyResult = pConditionalExpression(yyResult.index);
3424: yyError = yyResult.select(yyError);
3425: if (yyResult.hasValue()) {
3426: final Node v$g$3 = yyResult.semanticValue();
3427:
3428: yyValue = GNode.create(
3429: "ConditionalExpression", v$g$1,
3430: v$g$2, v$g$3);
3431: yyValue.setLocation(location(yyStart));
3432:
3433: return yyResult.createValue(yyValue,
3434: yyError);
3435: }
3436: } else {
3437: yyError = yyError.select("\":\" expected",
3438: yyBase);
3439: }
3440: }
3441: } else {
3442: yyError = yyError.select("\"?\" expected", yyBase);
3443: }
3444: }
3445:
3446: // Alternative <Base>.
3447:
3448: yyResult = pLogicalOrExpression(yyStart);
3449: yyError = yyResult.select(yyError);
3450: if (yyResult.hasValue()) {
3451: yyValue = yyResult.semanticValue();
3452:
3453: return yyResult.createValue(yyValue, yyError);
3454: }
3455:
3456: // Done.
3457: return yyError;
3458: }
3459:
3460: // =========================================================================
3461:
3462: /**
3463: * Parse nonterminal xtc.lang.Java.LogicalOrExpression.
3464: *
3465: * @param yyStart The index.
3466: * @return The result.
3467: * @throws IOException Signals an I/O error.
3468: */
3469: private Result pLogicalOrExpression(final int yyStart)
3470: throws IOException {
3471: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
3472: if (null == yyColumn.chunk2)
3473: yyColumn.chunk2 = new Chunk2();
3474: if (null == yyColumn.chunk2.fLogicalOrExpression)
3475: yyColumn.chunk2.fLogicalOrExpression = pLogicalOrExpression$1(yyStart);
3476: return yyColumn.chunk2.fLogicalOrExpression;
3477: }
3478:
3479: /** Actually parse xtc.lang.Java.LogicalOrExpression. */
3480: private Result pLogicalOrExpression$1(final int yyStart)
3481: throws IOException {
3482:
3483: Result yyResult;
3484: int yyRepetition1;
3485: Pair<Action<Node>> yyRepValue1;
3486: Node yyValue;
3487: ParseError yyError = ParseError.DUMMY;
3488:
3489: // Alternative <Base>.
3490:
3491: yyResult = pLogicalAndExpression(yyStart);
3492: yyError = yyResult.select(yyError);
3493: if (yyResult.hasValue()) {
3494: final Node v$3 = yyResult.semanticValue();
3495:
3496: yyRepetition1 = yyResult.index;
3497: yyRepValue1 = Pair.empty();
3498: while (true) {
3499:
3500: yyResult = pLogicalOrExpression$$Tail1(yyRepetition1);
3501: yyError = yyResult.select(yyError);
3502: if (yyResult.hasValue()) {
3503: final Action<Node> v$4 = yyResult.semanticValue();
3504:
3505: yyRepetition1 = yyResult.index;
3506: yyRepValue1 = new Pair<Action<Node>>(v$4,
3507: yyRepValue1);
3508: continue;
3509: }
3510: break;
3511: }
3512: { // Start scope for v$5.
3513: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
3514:
3515: yyValue = apply(v$5, v$3, yyStart);
3516:
3517: return new SemanticValue(yyValue, yyRepetition1,
3518: yyError);
3519: } // End scope for v$5.
3520: }
3521:
3522: // Done.
3523: return yyError;
3524: }
3525:
3526: // =========================================================================
3527:
3528: /**
3529: * Parse synthetic nonterminal xtc.lang.Java.LogicalOrExpression$$Tail1.
3530: *
3531: * @param yyStart The index.
3532: * @return The result.
3533: * @throws IOException Signals an I/O error.
3534: */
3535: private Result pLogicalOrExpression$$Tail1(final int yyStart)
3536: throws IOException {
3537:
3538: Result yyResult;
3539: Action<Node> yyValue;
3540: ParseError yyError = ParseError.DUMMY;
3541:
3542: // Alternative <Or>.
3543:
3544: yyResult = pSymbol(yyStart);
3545: yyError = yyResult.select(yyError);
3546: if (yyResult.hasValue("||")) {
3547:
3548: yyResult = pLogicalAndExpression(yyResult.index);
3549: yyError = yyResult.select(yyError);
3550: if (yyResult.hasValue()) {
3551: final Node v$g$2 = yyResult.semanticValue();
3552:
3553: yyValue = new Action<Node>() {
3554: public Node run(Node v$1) {
3555: return GNode.create("LogicalOrExpression", v$1,
3556: v$g$2);
3557: }
3558: };
3559:
3560: return yyResult.createValue(yyValue, yyError);
3561: }
3562: }
3563:
3564: // Done.
3565: yyError = yyError.select("logical or expression expected",
3566: yyStart);
3567: return yyError;
3568: }
3569:
3570: // =========================================================================
3571:
3572: /**
3573: * Parse nonterminal xtc.lang.Java.LogicalAndExpression.
3574: *
3575: * @param yyStart The index.
3576: * @return The result.
3577: * @throws IOException Signals an I/O error.
3578: */
3579: private Result pLogicalAndExpression(final int yyStart)
3580: throws IOException {
3581: Result yyResult;
3582: int yyRepetition1;
3583: Pair<Action<Node>> yyRepValue1;
3584: Node yyValue;
3585: ParseError yyError = ParseError.DUMMY;
3586:
3587: // Alternative <Base>.
3588:
3589: yyResult = pBitwiseOrExpression(yyStart);
3590: yyError = yyResult.select(yyError);
3591: if (yyResult.hasValue()) {
3592: final Node v$3 = yyResult.semanticValue();
3593:
3594: yyRepetition1 = yyResult.index;
3595: yyRepValue1 = Pair.empty();
3596: while (true) {
3597:
3598: yyResult = pLogicalAndExpression$$Tail1(yyRepetition1);
3599: yyError = yyResult.select(yyError);
3600: if (yyResult.hasValue()) {
3601: final Action<Node> v$4 = yyResult.semanticValue();
3602:
3603: yyRepetition1 = yyResult.index;
3604: yyRepValue1 = new Pair<Action<Node>>(v$4,
3605: yyRepValue1);
3606: continue;
3607: }
3608: break;
3609: }
3610: { // Start scope for v$5.
3611: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
3612:
3613: yyValue = apply(v$5, v$3, yyStart);
3614:
3615: return new SemanticValue(yyValue, yyRepetition1,
3616: yyError);
3617: } // End scope for v$5.
3618: }
3619:
3620: // Done.
3621: return yyError;
3622: }
3623:
3624: // =========================================================================
3625:
3626: /**
3627: * Parse synthetic nonterminal xtc.lang.Java.LogicalAndExpression$$Tail1.
3628: *
3629: * @param yyStart The index.
3630: * @return The result.
3631: * @throws IOException Signals an I/O error.
3632: */
3633: private Result pLogicalAndExpression$$Tail1(final int yyStart)
3634: throws IOException {
3635:
3636: Result yyResult;
3637: Action<Node> yyValue;
3638: ParseError yyError = ParseError.DUMMY;
3639:
3640: // Alternative <And>.
3641:
3642: yyResult = pSymbol(yyStart);
3643: yyError = yyResult.select(yyError);
3644: if (yyResult.hasValue("&&")) {
3645:
3646: yyResult = pBitwiseOrExpression(yyResult.index);
3647: yyError = yyResult.select(yyError);
3648: if (yyResult.hasValue()) {
3649: final Node v$g$2 = yyResult.semanticValue();
3650:
3651: yyValue = new Action<Node>() {
3652: public Node run(Node v$1) {
3653: return GNode.create("LogicalAndExpression",
3654: v$1, v$g$2);
3655: }
3656: };
3657:
3658: return yyResult.createValue(yyValue, yyError);
3659: }
3660: }
3661:
3662: // Done.
3663: yyError = yyError.select("logical and expression expected",
3664: yyStart);
3665: return yyError;
3666: }
3667:
3668: // =========================================================================
3669:
3670: /**
3671: * Parse nonterminal xtc.lang.Java.BitwiseOrExpression.
3672: *
3673: * @param yyStart The index.
3674: * @return The result.
3675: * @throws IOException Signals an I/O error.
3676: */
3677: private Result pBitwiseOrExpression(final int yyStart)
3678: throws IOException {
3679: Result yyResult;
3680: int yyRepetition1;
3681: Pair<Action<Node>> yyRepValue1;
3682: Node yyValue;
3683: ParseError yyError = ParseError.DUMMY;
3684:
3685: // Alternative <Base>.
3686:
3687: yyResult = pBitwiseXorExpression(yyStart);
3688: yyError = yyResult.select(yyError);
3689: if (yyResult.hasValue()) {
3690: final Node v$3 = yyResult.semanticValue();
3691:
3692: yyRepetition1 = yyResult.index;
3693: yyRepValue1 = Pair.empty();
3694: while (true) {
3695:
3696: yyResult = pBitwiseOrExpression$$Tail1(yyRepetition1);
3697: yyError = yyResult.select(yyError);
3698: if (yyResult.hasValue()) {
3699: final Action<Node> v$4 = yyResult.semanticValue();
3700:
3701: yyRepetition1 = yyResult.index;
3702: yyRepValue1 = new Pair<Action<Node>>(v$4,
3703: yyRepValue1);
3704: continue;
3705: }
3706: break;
3707: }
3708: { // Start scope for v$5.
3709: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
3710:
3711: yyValue = apply(v$5, v$3, yyStart);
3712:
3713: return new SemanticValue(yyValue, yyRepetition1,
3714: yyError);
3715: } // End scope for v$5.
3716: }
3717:
3718: // Done.
3719: return yyError;
3720: }
3721:
3722: // =========================================================================
3723:
3724: /**
3725: * Parse synthetic nonterminal xtc.lang.Java.BitwiseOrExpression$$Tail1.
3726: *
3727: * @param yyStart The index.
3728: * @return The result.
3729: * @throws IOException Signals an I/O error.
3730: */
3731: private Result pBitwiseOrExpression$$Tail1(final int yyStart)
3732: throws IOException {
3733:
3734: Result yyResult;
3735: Action<Node> yyValue;
3736: ParseError yyError = ParseError.DUMMY;
3737:
3738: // Alternative <Or>.
3739:
3740: yyResult = pSymbol(yyStart);
3741: yyError = yyResult.select(yyError);
3742: if (yyResult.hasValue("|")) {
3743:
3744: yyResult = pBitwiseXorExpression(yyResult.index);
3745: yyError = yyResult.select(yyError);
3746: if (yyResult.hasValue()) {
3747: final Node v$g$2 = yyResult.semanticValue();
3748:
3749: yyValue = new Action<Node>() {
3750: public Node run(Node v$1) {
3751: return GNode.create("BitwiseOrExpression", v$1,
3752: v$g$2);
3753: }
3754: };
3755:
3756: return yyResult.createValue(yyValue, yyError);
3757: }
3758: }
3759:
3760: // Done.
3761: yyError = yyError.select("bitwise or expression expected",
3762: yyStart);
3763: return yyError;
3764: }
3765:
3766: // =========================================================================
3767:
3768: /**
3769: * Parse nonterminal xtc.lang.Java.BitwiseXorExpression.
3770: *
3771: * @param yyStart The index.
3772: * @return The result.
3773: * @throws IOException Signals an I/O error.
3774: */
3775: private Result pBitwiseXorExpression(final int yyStart)
3776: throws IOException {
3777: Result yyResult;
3778: int yyRepetition1;
3779: Pair<Action<Node>> yyRepValue1;
3780: Node yyValue;
3781: ParseError yyError = ParseError.DUMMY;
3782:
3783: // Alternative <Base>.
3784:
3785: yyResult = pBitwiseAndExpression(yyStart);
3786: yyError = yyResult.select(yyError);
3787: if (yyResult.hasValue()) {
3788: final Node v$3 = yyResult.semanticValue();
3789:
3790: yyRepetition1 = yyResult.index;
3791: yyRepValue1 = Pair.empty();
3792: while (true) {
3793:
3794: yyResult = pBitwiseXorExpression$$Tail1(yyRepetition1);
3795: yyError = yyResult.select(yyError);
3796: if (yyResult.hasValue()) {
3797: final Action<Node> v$4 = yyResult.semanticValue();
3798:
3799: yyRepetition1 = yyResult.index;
3800: yyRepValue1 = new Pair<Action<Node>>(v$4,
3801: yyRepValue1);
3802: continue;
3803: }
3804: break;
3805: }
3806: { // Start scope for v$5.
3807: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
3808:
3809: yyValue = apply(v$5, v$3, yyStart);
3810:
3811: return new SemanticValue(yyValue, yyRepetition1,
3812: yyError);
3813: } // End scope for v$5.
3814: }
3815:
3816: // Done.
3817: return yyError;
3818: }
3819:
3820: // =========================================================================
3821:
3822: /**
3823: * Parse synthetic nonterminal xtc.lang.Java.BitwiseXorExpression$$Tail1.
3824: *
3825: * @param yyStart The index.
3826: * @return The result.
3827: * @throws IOException Signals an I/O error.
3828: */
3829: private Result pBitwiseXorExpression$$Tail1(final int yyStart)
3830: throws IOException {
3831:
3832: Result yyResult;
3833: Action<Node> yyValue;
3834: ParseError yyError = ParseError.DUMMY;
3835:
3836: // Alternative <Xor>.
3837:
3838: yyResult = pSymbol(yyStart);
3839: yyError = yyResult.select(yyError);
3840: if (yyResult.hasValue("^")) {
3841:
3842: yyResult = pBitwiseAndExpression(yyResult.index);
3843: yyError = yyResult.select(yyError);
3844: if (yyResult.hasValue()) {
3845: final Node v$g$2 = yyResult.semanticValue();
3846:
3847: yyValue = new Action<Node>() {
3848: public Node run(Node v$1) {
3849: return GNode.create("BitwiseXorExpression",
3850: v$1, v$g$2);
3851: }
3852: };
3853:
3854: return yyResult.createValue(yyValue, yyError);
3855: }
3856: }
3857:
3858: // Done.
3859: yyError = yyError.select("bitwise xor expression expected",
3860: yyStart);
3861: return yyError;
3862: }
3863:
3864: // =========================================================================
3865:
3866: /**
3867: * Parse nonterminal xtc.lang.Java.BitwiseAndExpression.
3868: *
3869: * @param yyStart The index.
3870: * @return The result.
3871: * @throws IOException Signals an I/O error.
3872: */
3873: private Result pBitwiseAndExpression(final int yyStart)
3874: throws IOException {
3875: Result yyResult;
3876: int yyRepetition1;
3877: Pair<Action<Node>> yyRepValue1;
3878: Node yyValue;
3879: ParseError yyError = ParseError.DUMMY;
3880:
3881: // Alternative <Base>.
3882:
3883: yyResult = pEqualityExpression(yyStart);
3884: yyError = yyResult.select(yyError);
3885: if (yyResult.hasValue()) {
3886: final Node v$3 = yyResult.semanticValue();
3887:
3888: yyRepetition1 = yyResult.index;
3889: yyRepValue1 = Pair.empty();
3890: while (true) {
3891:
3892: yyResult = pBitwiseAndExpression$$Tail1(yyRepetition1);
3893: yyError = yyResult.select(yyError);
3894: if (yyResult.hasValue()) {
3895: final Action<Node> v$4 = yyResult.semanticValue();
3896:
3897: yyRepetition1 = yyResult.index;
3898: yyRepValue1 = new Pair<Action<Node>>(v$4,
3899: yyRepValue1);
3900: continue;
3901: }
3902: break;
3903: }
3904: { // Start scope for v$5.
3905: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
3906:
3907: yyValue = apply(v$5, v$3, yyStart);
3908:
3909: return new SemanticValue(yyValue, yyRepetition1,
3910: yyError);
3911: } // End scope for v$5.
3912: }
3913:
3914: // Done.
3915: return yyError;
3916: }
3917:
3918: // =========================================================================
3919:
3920: /**
3921: * Parse synthetic nonterminal xtc.lang.Java.BitwiseAndExpression$$Tail1.
3922: *
3923: * @param yyStart The index.
3924: * @return The result.
3925: * @throws IOException Signals an I/O error.
3926: */
3927: private Result pBitwiseAndExpression$$Tail1(final int yyStart)
3928: throws IOException {
3929:
3930: Result yyResult;
3931: Action<Node> yyValue;
3932: ParseError yyError = ParseError.DUMMY;
3933:
3934: // Alternative <And>.
3935:
3936: yyResult = pSymbol(yyStart);
3937: yyError = yyResult.select(yyError);
3938: if (yyResult.hasValue("&")) {
3939:
3940: yyResult = pEqualityExpression(yyResult.index);
3941: yyError = yyResult.select(yyError);
3942: if (yyResult.hasValue()) {
3943: final Node v$g$2 = yyResult.semanticValue();
3944:
3945: yyValue = new Action<Node>() {
3946: public Node run(Node v$1) {
3947: return GNode.create("BitwiseAndExpression",
3948: v$1, v$g$2);
3949: }
3950: };
3951:
3952: return yyResult.createValue(yyValue, yyError);
3953: }
3954: }
3955:
3956: // Done.
3957: yyError = yyError.select("bitwise and expression expected",
3958: yyStart);
3959: return yyError;
3960: }
3961:
3962: // =========================================================================
3963:
3964: /**
3965: * Parse nonterminal xtc.lang.Java.EqualityExpression.
3966: *
3967: * @param yyStart The index.
3968: * @return The result.
3969: * @throws IOException Signals an I/O error.
3970: */
3971: private Result pEqualityExpression(final int yyStart)
3972: throws IOException {
3973: Result yyResult;
3974: int yyRepetition1;
3975: Pair<Action<Node>> yyRepValue1;
3976: Node yyValue;
3977: ParseError yyError = ParseError.DUMMY;
3978:
3979: // Alternative <Base>.
3980:
3981: yyResult = pInstanceOfExpression(yyStart);
3982: yyError = yyResult.select(yyError);
3983: if (yyResult.hasValue()) {
3984: final Node v$4 = yyResult.semanticValue();
3985:
3986: yyRepetition1 = yyResult.index;
3987: yyRepValue1 = Pair.empty();
3988: while (true) {
3989:
3990: yyResult = pEqualityExpression$$Tail1(yyRepetition1);
3991: yyError = yyResult.select(yyError);
3992: if (yyResult.hasValue()) {
3993: final Action<Node> v$5 = yyResult.semanticValue();
3994:
3995: yyRepetition1 = yyResult.index;
3996: yyRepValue1 = new Pair<Action<Node>>(v$5,
3997: yyRepValue1);
3998: continue;
3999: }
4000: break;
4001: }
4002: { // Start scope for v$6.
4003: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
4004:
4005: yyValue = apply(v$6, v$4, yyStart);
4006:
4007: return new SemanticValue(yyValue, yyRepetition1,
4008: yyError);
4009: } // End scope for v$6.
4010: }
4011:
4012: // Done.
4013: return yyError;
4014: }
4015:
4016: // =========================================================================
4017:
4018: /**
4019: * Parse synthetic nonterminal xtc.lang.Java.EqualityExpression$$Tail1.
4020: *
4021: * @param yyStart The index.
4022: * @return The result.
4023: * @throws IOException Signals an I/O error.
4024: */
4025: private Result pEqualityExpression$$Tail1(final int yyStart)
4026: throws IOException {
4027:
4028: Result yyResult;
4029: Action<Node> yyValue;
4030: ParseError yyError = ParseError.DUMMY;
4031:
4032: // Alternative <Recursion>.
4033:
4034: yyResult = pEqualityOperator(yyStart);
4035: yyError = yyResult.select(yyError);
4036: if (yyResult.hasValue()) {
4037: final String v$g$2 = yyResult.semanticValue();
4038:
4039: yyResult = pInstanceOfExpression(yyResult.index);
4040: yyError = yyResult.select(yyError);
4041: if (yyResult.hasValue()) {
4042: final Node v$g$3 = yyResult.semanticValue();
4043:
4044: yyValue = new Action<Node>() {
4045: public Node run(Node v$1) {
4046: return GNode.create("EqualityExpression", v$1,
4047: v$g$2, v$g$3);
4048: }
4049: };
4050:
4051: return yyResult.createValue(yyValue, yyError);
4052: }
4053: }
4054:
4055: // Done.
4056: return yyError;
4057: }
4058:
4059: // =========================================================================
4060:
4061: /**
4062: * Parse nonterminal xtc.lang.Java.EqualityOperator.
4063: *
4064: * @param yyStart The index.
4065: * @return The result.
4066: * @throws IOException Signals an I/O error.
4067: */
4068: private Result pEqualityOperator(final int yyStart)
4069: throws IOException {
4070: Result yyResult;
4071: String yyValue;
4072: ParseError yyError = ParseError.DUMMY;
4073:
4074: // Alternative <Equal>.
4075:
4076: yyResult = pSymbol(yyStart);
4077: yyError = yyResult.select(yyError);
4078: if (yyResult.hasValue("==")) {
4079: yyValue = "==";
4080:
4081: return yyResult.createValue(yyValue, yyError);
4082: }
4083:
4084: // Alternative <NotEqual>.
4085:
4086: yyResult = pSymbol(yyStart);
4087: yyError = yyResult.select(yyError);
4088: if (yyResult.hasValue("!=")) {
4089: yyValue = "!=";
4090:
4091: return yyResult.createValue(yyValue, yyError);
4092: }
4093:
4094: // Done.
4095: yyError = yyError.select("equality operator expected", yyStart);
4096: return yyError;
4097: }
4098:
4099: // =========================================================================
4100:
4101: /**
4102: * Parse nonterminal xtc.lang.Java.InstanceOfExpression.
4103: *
4104: * @param yyStart The index.
4105: * @return The result.
4106: * @throws IOException Signals an I/O error.
4107: */
4108: private Result pInstanceOfExpression(final int yyStart)
4109: throws IOException {
4110: Result yyResult;
4111: int yyBase;
4112: Node yyValue;
4113: ParseError yyError = ParseError.DUMMY;
4114:
4115: // Alternative <Instanceof>.
4116:
4117: yyResult = pRelationalExpression(yyStart);
4118: yyError = yyResult.select(yyError);
4119: if (yyResult.hasValue()) {
4120: final Node v$g$1 = yyResult.semanticValue();
4121:
4122: yyBase = yyResult.index;
4123: yyResult = pWord(yyBase);
4124: yyError = yyResult.select(yyError);
4125: if (yyResult.hasValue("instanceof")) {
4126:
4127: yyResult = pType(yyResult.index);
4128: yyError = yyResult.select(yyError);
4129: if (yyResult.hasValue()) {
4130: final Node v$g$2 = yyResult.semanticValue();
4131:
4132: yyValue = GNode.create("InstanceOfExpression",
4133: v$g$1, v$g$2);
4134: yyValue.setLocation(location(yyStart));
4135:
4136: return yyResult.createValue(yyValue, yyError);
4137: }
4138: } else {
4139: yyError = yyError.select("\"instanceof\" expected",
4140: yyBase);
4141: }
4142: }
4143:
4144: // Alternative <Base>.
4145:
4146: yyResult = pRelationalExpression(yyStart);
4147: yyError = yyResult.select(yyError);
4148: if (yyResult.hasValue()) {
4149: yyValue = yyResult.semanticValue();
4150:
4151: return yyResult.createValue(yyValue, yyError);
4152: }
4153:
4154: // Done.
4155: return yyError;
4156: }
4157:
4158: // =========================================================================
4159:
4160: /**
4161: * Parse nonterminal xtc.lang.Java.RelationalExpression.
4162: *
4163: * @param yyStart The index.
4164: * @return The result.
4165: * @throws IOException Signals an I/O error.
4166: */
4167: private Result pRelationalExpression(final int yyStart)
4168: throws IOException {
4169: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
4170: if (null == yyColumn.chunk2)
4171: yyColumn.chunk2 = new Chunk2();
4172: if (null == yyColumn.chunk2.fRelationalExpression)
4173: yyColumn.chunk2.fRelationalExpression = pRelationalExpression$1(yyStart);
4174: return yyColumn.chunk2.fRelationalExpression;
4175: }
4176:
4177: /** Actually parse xtc.lang.Java.RelationalExpression. */
4178: private Result pRelationalExpression$1(final int yyStart)
4179: throws IOException {
4180:
4181: Result yyResult;
4182: int yyRepetition1;
4183: Pair<Action<Node>> yyRepValue1;
4184: Node yyValue;
4185: ParseError yyError = ParseError.DUMMY;
4186:
4187: // Alternative <Base>.
4188:
4189: yyResult = pShiftExpression(yyStart);
4190: yyError = yyResult.select(yyError);
4191: if (yyResult.hasValue()) {
4192: final Node v$4 = yyResult.semanticValue();
4193:
4194: yyRepetition1 = yyResult.index;
4195: yyRepValue1 = Pair.empty();
4196: while (true) {
4197:
4198: yyResult = pRelationalExpression$$Tail1(yyRepetition1);
4199: yyError = yyResult.select(yyError);
4200: if (yyResult.hasValue()) {
4201: final Action<Node> v$5 = yyResult.semanticValue();
4202:
4203: yyRepetition1 = yyResult.index;
4204: yyRepValue1 = new Pair<Action<Node>>(v$5,
4205: yyRepValue1);
4206: continue;
4207: }
4208: break;
4209: }
4210: { // Start scope for v$6.
4211: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
4212:
4213: yyValue = apply(v$6, v$4, yyStart);
4214:
4215: return new SemanticValue(yyValue, yyRepetition1,
4216: yyError);
4217: } // End scope for v$6.
4218: }
4219:
4220: // Done.
4221: return yyError;
4222: }
4223:
4224: // =========================================================================
4225:
4226: /**
4227: * Parse synthetic nonterminal xtc.lang.Java.RelationalExpression$$Tail1.
4228: *
4229: * @param yyStart The index.
4230: * @return The result.
4231: * @throws IOException Signals an I/O error.
4232: */
4233: private Result pRelationalExpression$$Tail1(final int yyStart)
4234: throws IOException {
4235:
4236: Result yyResult;
4237: Action<Node> yyValue;
4238: ParseError yyError = ParseError.DUMMY;
4239:
4240: // Alternative <Recursion>.
4241:
4242: yyResult = pRelationalOperator(yyStart);
4243: yyError = yyResult.select(yyError);
4244: if (yyResult.hasValue()) {
4245: final String v$g$2 = yyResult.semanticValue();
4246:
4247: yyResult = pShiftExpression(yyResult.index);
4248: yyError = yyResult.select(yyError);
4249: if (yyResult.hasValue()) {
4250: final Node v$g$3 = yyResult.semanticValue();
4251:
4252: yyValue = new Action<Node>() {
4253: public Node run(Node v$1) {
4254: return GNode.create("RelationalExpression",
4255: v$1, v$g$2, v$g$3);
4256: }
4257: };
4258:
4259: return yyResult.createValue(yyValue, yyError);
4260: }
4261: }
4262:
4263: // Done.
4264: return yyError;
4265: }
4266:
4267: // =========================================================================
4268:
4269: /**
4270: * Parse nonterminal xtc.lang.Java.RelationalOperator.
4271: *
4272: * @param yyStart The index.
4273: * @return The result.
4274: * @throws IOException Signals an I/O error.
4275: */
4276: private Result pRelationalOperator(final int yyStart)
4277: throws IOException {
4278: Result yyResult;
4279: String yyValue;
4280: ParseError yyError = ParseError.DUMMY;
4281:
4282: // Alternative <Less>.
4283:
4284: yyResult = pSymbol(yyStart);
4285: yyError = yyResult.select(yyError);
4286: if (yyResult.hasValue("<")) {
4287: yyValue = "<";
4288:
4289: return yyResult.createValue(yyValue, yyError);
4290: }
4291:
4292: // Alternative <Greater>.
4293:
4294: yyResult = pSymbol(yyStart);
4295: yyError = yyResult.select(yyError);
4296: if (yyResult.hasValue(">")) {
4297: yyValue = ">";
4298:
4299: return yyResult.createValue(yyValue, yyError);
4300: }
4301:
4302: // Alternative <LessEqual>.
4303:
4304: yyResult = pSymbol(yyStart);
4305: yyError = yyResult.select(yyError);
4306: if (yyResult.hasValue("<=")) {
4307: yyValue = "<=";
4308:
4309: return yyResult.createValue(yyValue, yyError);
4310: }
4311:
4312: // Alternative <GreaterEqual>.
4313:
4314: yyResult = pSymbol(yyStart);
4315: yyError = yyResult.select(yyError);
4316: if (yyResult.hasValue(">=")) {
4317: yyValue = ">=";
4318:
4319: return yyResult.createValue(yyValue, yyError);
4320: }
4321:
4322: // Done.
4323: yyError = yyError.select("relational operator expected",
4324: yyStart);
4325: return yyError;
4326: }
4327:
4328: // =========================================================================
4329:
4330: /**
4331: * Parse nonterminal xtc.lang.Java.ShiftExpression.
4332: *
4333: * @param yyStart The index.
4334: * @return The result.
4335: * @throws IOException Signals an I/O error.
4336: */
4337: private Result pShiftExpression(final int yyStart)
4338: throws IOException {
4339: Result yyResult;
4340: int yyRepetition1;
4341: Pair<Action<Node>> yyRepValue1;
4342: Node yyValue;
4343: ParseError yyError = ParseError.DUMMY;
4344:
4345: // Alternative <Base>.
4346:
4347: yyResult = pAdditiveExpression(yyStart);
4348: yyError = yyResult.select(yyError);
4349: if (yyResult.hasValue()) {
4350: final Node v$4 = yyResult.semanticValue();
4351:
4352: yyRepetition1 = yyResult.index;
4353: yyRepValue1 = Pair.empty();
4354: while (true) {
4355:
4356: yyResult = pShiftExpression$$Tail1(yyRepetition1);
4357: yyError = yyResult.select(yyError);
4358: if (yyResult.hasValue()) {
4359: final Action<Node> v$5 = yyResult.semanticValue();
4360:
4361: yyRepetition1 = yyResult.index;
4362: yyRepValue1 = new Pair<Action<Node>>(v$5,
4363: yyRepValue1);
4364: continue;
4365: }
4366: break;
4367: }
4368: { // Start scope for v$6.
4369: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
4370:
4371: yyValue = apply(v$6, v$4, yyStart);
4372:
4373: return new SemanticValue(yyValue, yyRepetition1,
4374: yyError);
4375: } // End scope for v$6.
4376: }
4377:
4378: // Done.
4379: return yyError;
4380: }
4381:
4382: // =========================================================================
4383:
4384: /**
4385: * Parse synthetic nonterminal xtc.lang.Java.ShiftExpression$$Tail1.
4386: *
4387: * @param yyStart The index.
4388: * @return The result.
4389: * @throws IOException Signals an I/O error.
4390: */
4391: private Result pShiftExpression$$Tail1(final int yyStart)
4392: throws IOException {
4393:
4394: Result yyResult;
4395: Action<Node> yyValue;
4396: ParseError yyError = ParseError.DUMMY;
4397:
4398: // Alternative <Recursion>.
4399:
4400: yyResult = pShiftOperator(yyStart);
4401: yyError = yyResult.select(yyError);
4402: if (yyResult.hasValue()) {
4403: final String v$g$2 = yyResult.semanticValue();
4404:
4405: yyResult = pAdditiveExpression(yyResult.index);
4406: yyError = yyResult.select(yyError);
4407: if (yyResult.hasValue()) {
4408: final Node v$g$3 = yyResult.semanticValue();
4409:
4410: yyValue = new Action<Node>() {
4411: public Node run(Node v$1) {
4412: return GNode.create("ShiftExpression", v$1,
4413: v$g$2, v$g$3);
4414: }
4415: };
4416:
4417: return yyResult.createValue(yyValue, yyError);
4418: }
4419: }
4420:
4421: // Done.
4422: return yyError;
4423: }
4424:
4425: // =========================================================================
4426:
4427: /**
4428: * Parse nonterminal xtc.lang.Java.ShiftOperator.
4429: *
4430: * @param yyStart The index.
4431: * @return The result.
4432: * @throws IOException Signals an I/O error.
4433: */
4434: private Result pShiftOperator(final int yyStart) throws IOException {
4435: Result yyResult;
4436: String yyValue;
4437: ParseError yyError = ParseError.DUMMY;
4438:
4439: // Alternative <Left>.
4440:
4441: yyResult = pSymbol(yyStart);
4442: yyError = yyResult.select(yyError);
4443: if (yyResult.hasValue("<<")) {
4444: yyValue = "<<";
4445:
4446: return yyResult.createValue(yyValue, yyError);
4447: }
4448:
4449: // Alternative <Right>.
4450:
4451: yyResult = pSymbol(yyStart);
4452: yyError = yyResult.select(yyError);
4453: if (yyResult.hasValue(">>")) {
4454: yyValue = ">>";
4455:
4456: return yyResult.createValue(yyValue, yyError);
4457: }
4458:
4459: // Alternative <UnsignedRight>.
4460:
4461: yyResult = pSymbol(yyStart);
4462: yyError = yyResult.select(yyError);
4463: if (yyResult.hasValue(">>>")) {
4464: yyValue = ">>>";
4465:
4466: return yyResult.createValue(yyValue, yyError);
4467: }
4468:
4469: // Done.
4470: yyError = yyError.select("shift operator expected", yyStart);
4471: return yyError;
4472: }
4473:
4474: // =========================================================================
4475:
4476: /**
4477: * Parse nonterminal xtc.lang.Java.AdditiveExpression.
4478: *
4479: * @param yyStart The index.
4480: * @return The result.
4481: * @throws IOException Signals an I/O error.
4482: */
4483: private Result pAdditiveExpression(final int yyStart)
4484: throws IOException {
4485: Result yyResult;
4486: int yyRepetition1;
4487: Pair<Action<Node>> yyRepValue1;
4488: Node yyValue;
4489: ParseError yyError = ParseError.DUMMY;
4490:
4491: // Alternative <Base>.
4492:
4493: yyResult = pMultiplicativeExpression(yyStart);
4494: yyError = yyResult.select(yyError);
4495: if (yyResult.hasValue()) {
4496: final Node v$4 = yyResult.semanticValue();
4497:
4498: yyRepetition1 = yyResult.index;
4499: yyRepValue1 = Pair.empty();
4500: while (true) {
4501:
4502: yyResult = pAdditiveExpression$$Tail1(yyRepetition1);
4503: yyError = yyResult.select(yyError);
4504: if (yyResult.hasValue()) {
4505: final Action<Node> v$5 = yyResult.semanticValue();
4506:
4507: yyRepetition1 = yyResult.index;
4508: yyRepValue1 = new Pair<Action<Node>>(v$5,
4509: yyRepValue1);
4510: continue;
4511: }
4512: break;
4513: }
4514: { // Start scope for v$6.
4515: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
4516:
4517: yyValue = apply(v$6, v$4, yyStart);
4518:
4519: return new SemanticValue(yyValue, yyRepetition1,
4520: yyError);
4521: } // End scope for v$6.
4522: }
4523:
4524: // Done.
4525: return yyError;
4526: }
4527:
4528: // =========================================================================
4529:
4530: /**
4531: * Parse synthetic nonterminal xtc.lang.Java.AdditiveExpression$$Tail1.
4532: *
4533: * @param yyStart The index.
4534: * @return The result.
4535: * @throws IOException Signals an I/O error.
4536: */
4537: private Result pAdditiveExpression$$Tail1(final int yyStart)
4538: throws IOException {
4539:
4540: Result yyResult;
4541: Action<Node> yyValue;
4542: ParseError yyError = ParseError.DUMMY;
4543:
4544: // Alternative <Recursion>.
4545:
4546: yyResult = pAdditiveOperator(yyStart);
4547: yyError = yyResult.select(yyError);
4548: if (yyResult.hasValue()) {
4549: final String v$g$2 = yyResult.semanticValue();
4550:
4551: yyResult = pMultiplicativeExpression(yyResult.index);
4552: yyError = yyResult.select(yyError);
4553: if (yyResult.hasValue()) {
4554: final Node v$g$3 = yyResult.semanticValue();
4555:
4556: yyValue = new Action<Node>() {
4557: public Node run(Node v$1) {
4558: return GNode.create("AdditiveExpression", v$1,
4559: v$g$2, v$g$3);
4560: }
4561: };
4562:
4563: return yyResult.createValue(yyValue, yyError);
4564: }
4565: }
4566:
4567: // Done.
4568: return yyError;
4569: }
4570:
4571: // =========================================================================
4572:
4573: /**
4574: * Parse nonterminal xtc.lang.Java.AdditiveOperator.
4575: *
4576: * @param yyStart The index.
4577: * @return The result.
4578: * @throws IOException Signals an I/O error.
4579: */
4580: private Result pAdditiveOperator(final int yyStart)
4581: throws IOException {
4582: Result yyResult;
4583: String yyValue;
4584: ParseError yyError = ParseError.DUMMY;
4585:
4586: // Alternative <Plus>.
4587:
4588: yyResult = pSymbol(yyStart);
4589: yyError = yyResult.select(yyError);
4590: if (yyResult.hasValue("+")) {
4591: yyValue = "+";
4592:
4593: return yyResult.createValue(yyValue, yyError);
4594: }
4595:
4596: // Alternative <Minus>.
4597:
4598: yyResult = pSymbol(yyStart);
4599: yyError = yyResult.select(yyError);
4600: if (yyResult.hasValue("-")) {
4601: yyValue = "-";
4602:
4603: return yyResult.createValue(yyValue, yyError);
4604: }
4605:
4606: // Done.
4607: yyError = yyError.select("additive operator expected", yyStart);
4608: return yyError;
4609: }
4610:
4611: // =========================================================================
4612:
4613: /**
4614: * Parse nonterminal xtc.lang.Java.MultiplicativeExpression.
4615: *
4616: * @param yyStart The index.
4617: * @return The result.
4618: * @throws IOException Signals an I/O error.
4619: */
4620: private Result pMultiplicativeExpression(final int yyStart)
4621: throws IOException {
4622:
4623: Result yyResult;
4624: int yyRepetition1;
4625: Pair<Action<Node>> yyRepValue1;
4626: Node yyValue;
4627: ParseError yyError = ParseError.DUMMY;
4628:
4629: // Alternative <Base>.
4630:
4631: yyResult = pUnaryExpression(yyStart);
4632: yyError = yyResult.select(yyError);
4633: if (yyResult.hasValue()) {
4634: final Node v$4 = yyResult.semanticValue();
4635:
4636: yyRepetition1 = yyResult.index;
4637: yyRepValue1 = Pair.empty();
4638: while (true) {
4639:
4640: yyResult = pMultiplicativeExpression$$Tail1(yyRepetition1);
4641: yyError = yyResult.select(yyError);
4642: if (yyResult.hasValue()) {
4643: final Action<Node> v$5 = yyResult.semanticValue();
4644:
4645: yyRepetition1 = yyResult.index;
4646: yyRepValue1 = new Pair<Action<Node>>(v$5,
4647: yyRepValue1);
4648: continue;
4649: }
4650: break;
4651: }
4652: { // Start scope for v$6.
4653: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
4654:
4655: yyValue = apply(v$6, v$4, yyStart);
4656:
4657: return new SemanticValue(yyValue, yyRepetition1,
4658: yyError);
4659: } // End scope for v$6.
4660: }
4661:
4662: // Done.
4663: return yyError;
4664: }
4665:
4666: // =========================================================================
4667:
4668: /**
4669: * Parse synthetic nonterminal
4670: * xtc.lang.Java.MultiplicativeExpression$$Tail1.
4671: *
4672: * @param yyStart The index.
4673: * @return The result.
4674: * @throws IOException Signals an I/O error.
4675: */
4676: private Result pMultiplicativeExpression$$Tail1(final int yyStart)
4677: throws IOException {
4678:
4679: Result yyResult;
4680: Action<Node> yyValue;
4681: ParseError yyError = ParseError.DUMMY;
4682:
4683: // Alternative <Times>.
4684:
4685: yyResult = pMultiplicativeOperator(yyStart);
4686: yyError = yyResult.select(yyError);
4687: if (yyResult.hasValue()) {
4688: final String v$g$2 = yyResult.semanticValue();
4689:
4690: yyResult = pUnaryExpression(yyResult.index);
4691: yyError = yyResult.select(yyError);
4692: if (yyResult.hasValue()) {
4693: final Node v$g$3 = yyResult.semanticValue();
4694:
4695: yyValue = new Action<Node>() {
4696: public Node run(Node v$1) {
4697: return GNode.create("MultiplicativeExpression",
4698: v$1, v$g$2, v$g$3);
4699: }
4700: };
4701:
4702: return yyResult.createValue(yyValue, yyError);
4703: }
4704: }
4705:
4706: // Done.
4707: return yyError;
4708: }
4709:
4710: // =========================================================================
4711:
4712: /**
4713: * Parse nonterminal xtc.lang.Java.MultiplicativeOperator.
4714: *
4715: * @param yyStart The index.
4716: * @return The result.
4717: * @throws IOException Signals an I/O error.
4718: */
4719: private Result pMultiplicativeOperator(final int yyStart)
4720: throws IOException {
4721:
4722: Result yyResult;
4723: String yyValue;
4724: ParseError yyError = ParseError.DUMMY;
4725:
4726: // Alternative <Times>.
4727:
4728: yyResult = pSymbol(yyStart);
4729: yyError = yyResult.select(yyError);
4730: if (yyResult.hasValue("*")) {
4731: yyValue = "*";
4732:
4733: return yyResult.createValue(yyValue, yyError);
4734: }
4735:
4736: // Alternative <Over>.
4737:
4738: yyResult = pSymbol(yyStart);
4739: yyError = yyResult.select(yyError);
4740: if (yyResult.hasValue("/")) {
4741: yyValue = "/";
4742:
4743: return yyResult.createValue(yyValue, yyError);
4744: }
4745:
4746: // Alternative <Modulo>.
4747:
4748: yyResult = pSymbol(yyStart);
4749: yyError = yyResult.select(yyError);
4750: if (yyResult.hasValue("%")) {
4751: yyValue = "%";
4752:
4753: return yyResult.createValue(yyValue, yyError);
4754: }
4755:
4756: // Done.
4757: yyError = yyError.select("multiplicative operator expected",
4758: yyStart);
4759: return yyError;
4760: }
4761:
4762: // =========================================================================
4763:
4764: /**
4765: * Parse nonterminal xtc.lang.Java.UnaryExpression.
4766: *
4767: * @param yyStart The index.
4768: * @return The result.
4769: * @throws IOException Signals an I/O error.
4770: */
4771: private Result pUnaryExpression(final int yyStart)
4772: throws IOException {
4773: Result yyResult;
4774: Node yyValue;
4775: ParseError yyError = ParseError.DUMMY;
4776:
4777: // Alternative <Plus>.
4778:
4779: yyResult = pSymbol(yyStart);
4780: yyError = yyResult.select(yyError);
4781: if (yyResult.hasValue("+")) {
4782: final String v$g$1 = "+";
4783:
4784: yyResult = pUnaryExpression(yyResult.index);
4785: yyError = yyResult.select(yyError);
4786: if (yyResult.hasValue()) {
4787: final Node v$g$2 = yyResult.semanticValue();
4788:
4789: yyValue = GNode.create("UnaryExpression", v$g$1, v$g$2);
4790: yyValue.setLocation(location(yyStart));
4791:
4792: return yyResult.createValue(yyValue, yyError);
4793: }
4794: }
4795:
4796: // Alternative <Minus>.
4797:
4798: yyResult = pSymbol(yyStart);
4799: yyError = yyResult.select(yyError);
4800: if (yyResult.hasValue("-")) {
4801: final String v$g$3 = "-";
4802:
4803: yyResult = pUnaryExpression(yyResult.index);
4804: yyError = yyResult.select(yyError);
4805: if (yyResult.hasValue()) {
4806: final Node v$g$4 = yyResult.semanticValue();
4807:
4808: yyValue = GNode.create("UnaryExpression", v$g$3, v$g$4);
4809: yyValue.setLocation(location(yyStart));
4810:
4811: return yyResult.createValue(yyValue, yyError);
4812: }
4813: }
4814:
4815: // Alternative <Increment>.
4816:
4817: yyResult = pSymbol(yyStart);
4818: yyError = yyResult.select(yyError);
4819: if (yyResult.hasValue("++")) {
4820: final String v$g$5 = "++";
4821:
4822: yyResult = pUnaryExpression(yyResult.index);
4823: yyError = yyResult.select(yyError);
4824: if (yyResult.hasValue()) {
4825: final Node v$g$6 = yyResult.semanticValue();
4826:
4827: yyValue = GNode.create("UnaryExpression", v$g$5, v$g$6);
4828: yyValue.setLocation(location(yyStart));
4829:
4830: return yyResult.createValue(yyValue, yyError);
4831: }
4832: }
4833:
4834: // Alternative <Decrement>.
4835:
4836: yyResult = pSymbol(yyStart);
4837: yyError = yyResult.select(yyError);
4838: if (yyResult.hasValue("--")) {
4839: final String v$g$7 = "--";
4840:
4841: yyResult = pUnaryExpression(yyResult.index);
4842: yyError = yyResult.select(yyError);
4843: if (yyResult.hasValue()) {
4844: final Node v$g$8 = yyResult.semanticValue();
4845:
4846: yyValue = GNode.create("UnaryExpression", v$g$7, v$g$8);
4847: yyValue.setLocation(location(yyStart));
4848:
4849: return yyResult.createValue(yyValue, yyError);
4850: }
4851: }
4852:
4853: // Alternative <Base>.
4854:
4855: yyResult = pUnaryExpressionNotPlusMinus(yyStart);
4856: yyError = yyResult.select(yyError);
4857: if (yyResult.hasValue()) {
4858: yyValue = yyResult.semanticValue();
4859:
4860: return yyResult.createValue(yyValue, yyError);
4861: }
4862:
4863: // Done.
4864: yyError = yyError.select("unary expression expected", yyStart);
4865: return yyError;
4866: }
4867:
4868: // =========================================================================
4869:
4870: /**
4871: * Parse nonterminal xtc.lang.Java.UnaryExpressionNotPlusMinus.
4872: *
4873: * @param yyStart The index.
4874: * @return The result.
4875: * @throws IOException Signals an I/O error.
4876: */
4877: private Result pUnaryExpressionNotPlusMinus(final int yyStart)
4878: throws IOException {
4879:
4880: Result yyResult;
4881: int yyBase;
4882: int yyOption1;
4883: Node yyOpValue1;
4884: Node yyValue;
4885: ParseError yyError = ParseError.DUMMY;
4886:
4887: // Alternative 1.
4888:
4889: yyResult = pSymbol(yyStart);
4890: yyError = yyResult.select(yyError);
4891: if (yyResult.hasValue("~")) {
4892:
4893: yyResult = pUnaryExpression(yyResult.index);
4894: yyError = yyResult.select(yyError);
4895: if (yyResult.hasValue()) {
4896: final Node v$g$1 = yyResult.semanticValue();
4897:
4898: yyValue = GNode.create("BitwiseNegationExpression",
4899: v$g$1);
4900: yyValue.setLocation(location(yyStart));
4901:
4902: return yyResult.createValue(yyValue, yyError);
4903: }
4904: }
4905:
4906: // Alternative 2.
4907:
4908: yyResult = pSymbol(yyStart);
4909: yyError = yyResult.select(yyError);
4910: if (yyResult.hasValue("!")) {
4911:
4912: yyResult = pUnaryExpression(yyResult.index);
4913: yyError = yyResult.select(yyError);
4914: if (yyResult.hasValue()) {
4915: final Node v$g$1 = yyResult.semanticValue();
4916:
4917: yyValue = GNode.create("LogicalNegationExpression",
4918: v$g$1);
4919: yyValue.setLocation(location(yyStart));
4920:
4921: return yyResult.createValue(yyValue, yyError);
4922: }
4923: }
4924:
4925: // Alternative 3.
4926:
4927: yyResult = pSymbol(yyStart);
4928: yyError = yyResult.select(yyError);
4929: if (yyResult.hasValue("(")) {
4930:
4931: final int yyChoice1 = yyResult.index;
4932:
4933: // Nested alternative 1.
4934:
4935: yyResult = pPrimitiveType(yyChoice1);
4936: yyError = yyResult.select(yyError);
4937: if (yyResult.hasValue()) {
4938: final Node v$g$1 = yyResult.semanticValue();
4939:
4940: yyOption1 = yyResult.index;
4941: yyOpValue1 = null;
4942:
4943: yyResult = pDimensions(yyOption1);
4944: yyError = yyResult.select(yyError);
4945: if (yyResult.hasValue()) {
4946: final Node v$el$1 = yyResult.semanticValue();
4947:
4948: yyOption1 = yyResult.index;
4949: yyOpValue1 = v$el$1;
4950: }
4951: { // Start scope for v$g$2.
4952: final Node v$g$2 = yyOpValue1;
4953:
4954: yyBase = yyOption1;
4955: yyResult = pSymbol(yyBase);
4956: yyError = yyResult.select(yyError);
4957: if (yyResult.hasValue(")")) {
4958:
4959: yyResult = pUnaryExpression(yyResult.index);
4960: yyError = yyResult.select(yyError);
4961: if (yyResult.hasValue()) {
4962: final Node v$g$3 = yyResult.semanticValue();
4963:
4964: yyValue = GNode.create(
4965: "BasicCastExpression", v$g$1,
4966: v$g$2, v$g$3);
4967: yyValue.setLocation(location(yyStart));
4968:
4969: return yyResult.createValue(yyValue,
4970: yyError);
4971: }
4972: } else {
4973: yyError = yyError.select("\")\" expected",
4974: yyBase);
4975: }
4976: } // End scope for v$g$2.
4977: }
4978:
4979: // Nested alternative 2.
4980:
4981: yyResult = pType(yyChoice1);
4982: yyError = yyResult.select(yyError);
4983: if (yyResult.hasValue()) {
4984: final Node v$g$1 = yyResult.semanticValue();
4985:
4986: yyBase = yyResult.index;
4987: yyResult = pSymbol(yyBase);
4988: yyError = yyResult.select(yyError);
4989: if (yyResult.hasValue(")")) {
4990:
4991: yyResult = pUnaryExpressionNotPlusMinus(yyResult.index);
4992: yyError = yyResult.select(yyError);
4993: if (yyResult.hasValue()) {
4994: final Node v$g$2 = yyResult.semanticValue();
4995:
4996: yyValue = GNode.create("CastExpression", v$g$1,
4997: v$g$2);
4998: yyValue.setLocation(location(yyStart));
4999:
5000: return yyResult.createValue(yyValue, yyError);
5001: }
5002: } else {
5003: yyError = yyError.select("\")\" expected", yyBase);
5004: }
5005: }
5006: }
5007:
5008: // Alternative <Base>.
5009:
5010: yyResult = pPostfixExpression(yyStart);
5011: yyError = yyResult.select(yyError);
5012: if (yyResult.hasValue()) {
5013: yyValue = yyResult.semanticValue();
5014:
5015: return yyResult.createValue(yyValue, yyError);
5016: }
5017:
5018: // Done.
5019: yyError = yyError.select(
5020: "unary expression not plus minus expected", yyStart);
5021: return yyError;
5022: }
5023:
5024: // =========================================================================
5025:
5026: /**
5027: * Parse nonterminal xtc.lang.Java.PostfixExpression.
5028: *
5029: * @param yyStart The index.
5030: * @return The result.
5031: * @throws IOException Signals an I/O error.
5032: */
5033: private Result pPostfixExpression(final int yyStart)
5034: throws IOException {
5035: Result yyResult;
5036: int yyRepetition1;
5037: Pair<Action<Node>> yyRepValue1;
5038: Node yyValue;
5039: ParseError yyError = ParseError.DUMMY;
5040:
5041: // Alternative <Base>.
5042:
5043: yyResult = pPrimaryExpression(yyStart);
5044: yyError = yyResult.select(yyError);
5045: if (yyResult.hasValue()) {
5046: final Node v$g$15 = yyResult.semanticValue();
5047:
5048: yyRepetition1 = yyResult.index;
5049: yyRepValue1 = Pair.empty();
5050: while (true) {
5051:
5052: yyResult = pPostfixExpression$$Tail1(yyRepetition1);
5053: yyError = yyResult.select(yyError);
5054: if (yyResult.hasValue()) {
5055: final Action<Node> v$16 = yyResult.semanticValue();
5056:
5057: yyRepetition1 = yyResult.index;
5058: yyRepValue1 = new Pair<Action<Node>>(v$16,
5059: yyRepValue1);
5060: continue;
5061: }
5062: break;
5063: }
5064: { // Start scope for v$17.
5065: final Pair<Action<Node>> v$17 = yyRepValue1.reverse();
5066:
5067: yyValue = apply(v$17, v$g$15, yyStart);
5068:
5069: return new SemanticValue(yyValue, yyRepetition1,
5070: yyError);
5071: } // End scope for v$17.
5072: }
5073:
5074: // Done.
5075: return yyError;
5076: }
5077:
5078: // =========================================================================
5079:
5080: /**
5081: * Parse synthetic nonterminal xtc.lang.Java.PostfixExpression$$Tail1.
5082: *
5083: * @param yyStart The index.
5084: * @return The result.
5085: * @throws IOException Signals an I/O error.
5086: */
5087: private Result pPostfixExpression$$Tail1(final int yyStart)
5088: throws IOException {
5089:
5090: Result yyResult;
5091: int yyBase;
5092: int yyOption1;
5093: Node yyOpValue1;
5094: Action<Node> yyValue;
5095: ParseError yyError = ParseError.DUMMY;
5096:
5097: // Alternative 1.
5098:
5099: yyResult = pSymbol(yyStart);
5100: yyError = yyResult.select(yyError);
5101: if (yyResult.hasValue(".")) {
5102:
5103: final int yyChoice1 = yyResult.index;
5104:
5105: // Nested alternative 1.
5106: { // Start scope for nested choice.
5107:
5108: final int yyChoice2 = yyChoice1;
5109:
5110: // Nested alternative 1.
5111:
5112: yyResult = pIdentifier(yyChoice2);
5113: yyError = yyResult.select(yyError);
5114: if (yyResult.hasValue()) {
5115: final String v$g$3 = yyResult.semanticValue();
5116:
5117: yyResult = pArguments(yyResult.index);
5118: yyError = yyResult.select(yyError);
5119: if (yyResult.hasValue()) {
5120: final Node v$g$4 = yyResult.semanticValue();
5121:
5122: yyValue = new Action<Node>() {
5123: public Node run(Node v$1) {
5124: return GNode.create("CallExpression",
5125: v$1, null, v$g$3, v$g$4);
5126: }
5127: };
5128:
5129: return yyResult.createValue(yyValue, yyError);
5130: }
5131: }
5132:
5133: // Nested alternative 2.
5134:
5135: yyBase = yyChoice2;
5136: yyResult = pWord(yyBase);
5137: yyError = yyResult.select(yyError);
5138: if (yyResult.hasValue("super")) {
5139: final String v$g$5 = "super";
5140:
5141: yyResult = pArguments(yyResult.index);
5142: yyError = yyResult.select(yyError);
5143: if (yyResult.hasValue()) {
5144: final Node v$g$6 = yyResult.semanticValue();
5145:
5146: yyValue = new Action<Node>() {
5147: public Node run(Node v$1) {
5148: return GNode.create("CallExpression",
5149: v$1, null, v$g$5, v$g$6);
5150: }
5151: };
5152:
5153: return yyResult.createValue(yyValue, yyError);
5154: }
5155: } else {
5156: yyError = yyError.select("\"super\" expected",
5157: yyBase);
5158: }
5159: } // End scope for nested choice.
5160:
5161: // Nested alternative 2.
5162:
5163: yyBase = yyChoice1;
5164: yyResult = pWord(yyBase);
5165: yyError = yyResult.select(yyError);
5166: if (yyResult.hasValue("super")) {
5167:
5168: yyValue = new Action<Node>() {
5169: public Node run(Node v$1) {
5170: return GNode.create("SuperExpression", v$1);
5171: }
5172: };
5173:
5174: return yyResult.createValue(yyValue, yyError);
5175: } else {
5176: yyError = yyError.select("\"super\" expected", yyBase);
5177: }
5178:
5179: // Nested alternative 3.
5180:
5181: yyResult = pIdentifier(yyChoice1);
5182: yyError = yyResult.select(yyError);
5183: if (yyResult.hasValue()) {
5184: final String v$g$7 = yyResult.semanticValue();
5185:
5186: yyValue = new Action<Node>() {
5187: public Node run(Node v$1) {
5188: return GNode.create("SelectionExpression", v$1,
5189: v$g$7);
5190: }
5191: };
5192:
5193: return yyResult.createValue(yyValue, yyError);
5194: }
5195: }
5196:
5197: // Alternative 2.
5198:
5199: yyResult = pSymbol(yyStart);
5200: yyError = yyResult.select(yyError);
5201: if (yyResult.hasValue("[")) {
5202:
5203: yyResult = pExpression(yyResult.index);
5204: yyError = yyResult.select(yyError);
5205: if (yyResult.hasValue()) {
5206: final Node v$g$8 = yyResult.semanticValue();
5207:
5208: yyBase = yyResult.index;
5209: yyResult = pSymbol(yyBase);
5210: yyError = yyResult.select(yyError);
5211: if (yyResult.hasValue("]")) {
5212:
5213: yyValue = new Action<Node>() {
5214: public Node run(Node v$1) {
5215: return GNode.create("SubscriptExpression",
5216: v$1, v$g$8);
5217: }
5218: };
5219:
5220: return yyResult.createValue(yyValue, yyError);
5221: } else {
5222: yyError = yyError.select("\"]\" expected", yyBase);
5223: }
5224: }
5225: }
5226:
5227: // Alternative 3.
5228:
5229: yyResult = pSymbol(yyStart);
5230: yyError = yyResult.select(yyError);
5231: if (yyResult.hasValue("++")) {
5232: final String v$g$9 = "++";
5233:
5234: yyValue = new Action<Node>() {
5235: public Node run(Node v$1) {
5236: return GNode
5237: .create("PostfixExpression", v$1, v$g$9);
5238: }
5239: };
5240:
5241: return yyResult.createValue(yyValue, yyError);
5242: }
5243:
5244: // Alternative 4.
5245:
5246: yyResult = pSymbol(yyStart);
5247: yyError = yyResult.select(yyError);
5248: if (yyResult.hasValue("--")) {
5249: final String v$g$10 = "--";
5250:
5251: yyValue = new Action<Node>() {
5252: public Node run(Node v$1) {
5253: return GNode.create("PostfixExpression", v$1,
5254: v$g$10);
5255: }
5256: };
5257:
5258: return yyResult.createValue(yyValue, yyError);
5259: }
5260:
5261: // Alternative 5.
5262:
5263: yyResult = pSymbol(yyStart);
5264: yyError = yyResult.select(yyError);
5265: if (yyResult.hasValue(".")) {
5266:
5267: yyBase = yyResult.index;
5268: yyResult = pWord(yyBase);
5269: yyError = yyResult.select(yyError);
5270: if (yyResult.hasValue("new")) {
5271:
5272: yyResult = pTypeName(yyResult.index);
5273: yyError = yyResult.select(yyError);
5274: if (yyResult.hasValue()) {
5275: final Node v$g$12 = yyResult.semanticValue();
5276:
5277: yyResult = pArguments(yyResult.index);
5278: yyError = yyResult.select(yyError);
5279: if (yyResult.hasValue()) {
5280: final Node v$g$13 = yyResult.semanticValue();
5281:
5282: yyOption1 = yyResult.index;
5283: yyOpValue1 = null;
5284:
5285: yyResult = pClassBody(yyOption1);
5286: yyError = yyResult.select(yyError);
5287: if (yyResult.hasValue()) {
5288: final Node v$el$1 = yyResult
5289: .semanticValue();
5290:
5291: yyOption1 = yyResult.index;
5292: yyOpValue1 = v$el$1;
5293: }
5294: { // Start scope for v$g$14.
5295: final Node v$g$14 = yyOpValue1;
5296:
5297: yyValue = new Action<Node>() {
5298: public Node run(Node v$1) {
5299: return GNode.create(
5300: "NewClassExpression", v$1,
5301: null, v$g$12, v$g$13,
5302: v$g$14);
5303: }
5304: };
5305:
5306: return new SemanticValue(yyValue,
5307: yyOption1, yyError);
5308: } // End scope for v$g$14.
5309: }
5310: }
5311: } else {
5312: yyError = yyError.select("\"new\" expected", yyBase);
5313: }
5314: }
5315:
5316: // Done.
5317: yyError = yyError
5318: .select("postfix expression expected", yyStart);
5319: return yyError;
5320: }
5321:
5322: // =========================================================================
5323:
5324: /**
5325: * Parse nonterminal xtc.lang.Java.PrimaryExpression.
5326: *
5327: * @param yyStart The index.
5328: * @return The result.
5329: * @throws IOException Signals an I/O error.
5330: */
5331: private Result pPrimaryExpression(final int yyStart)
5332: throws IOException {
5333: Result yyResult;
5334: int yyBase;
5335: int yyOption1;
5336: Node yyOpValue1;
5337: Node yyValue;
5338: ParseError yyError = ParseError.DUMMY;
5339:
5340: // Alternative <Literal>.
5341:
5342: yyResult = pLiteral(yyStart);
5343: yyError = yyResult.select(yyError);
5344: if (yyResult.hasValue()) {
5345: yyValue = yyResult.semanticValue();
5346:
5347: return yyResult.createValue(yyValue, yyError);
5348: }
5349:
5350: // Alternative <Expression>.
5351:
5352: yyResult = pIdentifier(yyStart);
5353: yyError = yyResult.select(yyError);
5354: if (yyResult.hasValue()) {
5355: final String v$g$3 = yyResult.semanticValue();
5356:
5357: yyResult = pArguments(yyResult.index);
5358: yyError = yyResult.select(yyError);
5359: if (yyResult.hasValue()) {
5360: final Node v$g$4 = yyResult.semanticValue();
5361:
5362: yyValue = GNode.create("CallExpression", null, null,
5363: v$g$3, v$g$4);
5364: yyValue.setLocation(location(yyStart));
5365:
5366: return yyResult.createValue(yyValue, yyError);
5367: }
5368: }
5369:
5370: // Alternative <Expression>.
5371:
5372: yyResult = pResultType(yyStart);
5373: yyError = yyResult.select(yyError);
5374: if (yyResult.hasValue()) {
5375: final Node v$g$1 = yyResult.semanticValue();
5376:
5377: yyBase = yyResult.index;
5378: yyResult = pSymbol(yyBase);
5379: yyError = yyResult.select(yyError);
5380: if (yyResult.hasValue(".")) {
5381:
5382: yyBase = yyResult.index;
5383: yyResult = pWord(yyBase);
5384: yyError = yyResult.select(yyError);
5385: if (yyResult.hasValue("class")) {
5386:
5387: yyValue = GNode.create("ClassLiteralExpression",
5388: v$g$1);
5389: yyValue.setLocation(location(yyStart));
5390:
5391: return yyResult.createValue(yyValue, yyError);
5392: } else {
5393: yyError = yyError.select("\"class\" expected",
5394: yyBase);
5395: }
5396: } else {
5397: yyError = yyError.select("\".\" expected", yyBase);
5398: }
5399: }
5400:
5401: // Alternative <Expression>.
5402:
5403: yyResult = pWord(yyStart);
5404: yyError = yyResult.select(yyError);
5405: if (yyResult.hasValue("this")) {
5406: final String v$g$3 = "this";
5407:
5408: yyResult = pArguments(yyResult.index);
5409: yyError = yyResult.select(yyError);
5410: if (yyResult.hasValue()) {
5411: final Node v$g$4 = yyResult.semanticValue();
5412:
5413: yyValue = GNode.create("CallExpression", null, null,
5414: v$g$3, v$g$4);
5415: yyValue.setLocation(location(yyStart));
5416:
5417: return yyResult.createValue(yyValue, yyError);
5418: }
5419: }
5420:
5421: // Alternative <Expression>.
5422:
5423: yyOption1 = yyStart;
5424: yyOpValue1 = null;
5425:
5426: yyResult = pQualifiedIdentifier(yyOption1);
5427: yyError = yyResult.select(yyError);
5428: if (yyResult.hasValue()) {
5429: final Node v$el$1 = yyResult.semanticValue();
5430:
5431: yyBase = yyResult.index;
5432: yyResult = pSymbol(yyBase);
5433: yyError = yyResult.select(yyError);
5434: if (yyResult.hasValue(".")) {
5435:
5436: yyOption1 = yyResult.index;
5437: yyOpValue1 = v$el$1;
5438: } else {
5439: yyError = yyError.select("\".\" expected", yyBase);
5440: }
5441: }
5442: { // Start scope for v$g$1.
5443: final Node v$g$1 = yyOpValue1;
5444:
5445: yyBase = yyOption1;
5446: yyResult = pWord(yyBase);
5447: yyError = yyResult.select(yyError);
5448: if (yyResult.hasValue("this")) {
5449:
5450: yyValue = GNode.create("ThisExpression", v$g$1);
5451: yyValue.setLocation(location(yyStart));
5452:
5453: return yyResult.createValue(yyValue, yyError);
5454: } else {
5455: yyError = yyError.select("\"this\" expected", yyBase);
5456: }
5457: } // End scope for v$g$1.
5458:
5459: // Alternative 6.
5460: { // Start scope for nested choice.
5461:
5462: final int yyChoice1 = yyStart;
5463:
5464: // Nested alternative 1.
5465:
5466: yyResult = pWord(yyChoice1);
5467: yyError = yyResult.select(yyError);
5468: if (yyResult.hasValue("super")) {
5469: final String v$g$3 = "super";
5470:
5471: yyResult = pArguments(yyResult.index);
5472: yyError = yyResult.select(yyError);
5473: if (yyResult.hasValue()) {
5474: final Node v$g$4 = yyResult.semanticValue();
5475:
5476: yyValue = GNode.create("CallExpression", null,
5477: null, v$g$3, v$g$4);
5478: yyValue.setLocation(location(yyStart));
5479:
5480: return yyResult.createValue(yyValue, yyError);
5481: }
5482: }
5483:
5484: // Nested alternative 2.
5485:
5486: yyBase = yyChoice1;
5487: yyResult = pWord(yyBase);
5488: yyError = yyResult.select(yyError);
5489: if (yyResult.hasValue("super")) {
5490:
5491: yyValue = GNode.create("SuperExpression", null);
5492: yyValue.setLocation(location(yyStart));
5493:
5494: return yyResult.createValue(yyValue, yyError);
5495: } else {
5496: yyError = yyError.select("\"super\" expected", yyBase);
5497: }
5498: } // End scope for nested choice.
5499:
5500: // Alternative 7.
5501:
5502: yyResult = pIdentifier(yyStart);
5503: yyError = yyResult.select(yyError);
5504: if (yyResult.hasValue()) {
5505: final String v$g$1 = yyResult.semanticValue();
5506:
5507: yyValue = GNode.create("PrimaryIdentifier", v$g$1);
5508: yyValue.setLocation(location(yyStart));
5509:
5510: return yyResult.createValue(yyValue, yyError);
5511: }
5512:
5513: // Alternative <Expression>.
5514:
5515: yyResult = pWord(yyStart);
5516: yyError = yyResult.select(yyError);
5517: if (yyResult.hasValue("new")) {
5518:
5519: yyResult = pTypeName(yyResult.index);
5520: yyError = yyResult.select(yyError);
5521: if (yyResult.hasValue()) {
5522: final Node v$g$3 = yyResult.semanticValue();
5523:
5524: yyResult = pArguments(yyResult.index);
5525: yyError = yyResult.select(yyError);
5526: if (yyResult.hasValue()) {
5527: final Node v$g$4 = yyResult.semanticValue();
5528:
5529: yyOption1 = yyResult.index;
5530: yyOpValue1 = null;
5531:
5532: yyResult = pClassBody(yyOption1);
5533: yyError = yyResult.select(yyError);
5534: if (yyResult.hasValue()) {
5535: final Node v$el$1 = yyResult.semanticValue();
5536:
5537: yyOption1 = yyResult.index;
5538: yyOpValue1 = v$el$1;
5539: }
5540: { // Start scope for v$g$5.
5541: final Node v$g$5 = yyOpValue1;
5542:
5543: yyValue = GNode.create("NewClassExpression",
5544: null, null, v$g$3, v$g$4, v$g$5);
5545: yyValue.setLocation(location(yyStart));
5546:
5547: return new SemanticValue(yyValue, yyOption1,
5548: yyError);
5549: } // End scope for v$g$5.
5550: }
5551: }
5552: }
5553:
5554: // Alternative 9.
5555:
5556: yyResult = pWord(yyStart);
5557: yyError = yyResult.select(yyError);
5558: if (yyResult.hasValue("new")) {
5559:
5560: yyResult = pTypeName(yyResult.index);
5561: yyError = yyResult.select(yyError);
5562: if (yyResult.hasValue()) {
5563: final Node v$g$1 = yyResult.semanticValue();
5564:
5565: final int yyChoice1 = yyResult.index;
5566:
5567: // Nested alternative 1.
5568:
5569: yyResult = pConcreteDimensions(yyChoice1);
5570: yyError = yyResult.select(yyError);
5571: if (yyResult.hasValue()) {
5572: final Node v$g$2 = yyResult.semanticValue();
5573:
5574: yyOption1 = yyResult.index;
5575: yyOpValue1 = null;
5576:
5577: yyResult = pDimensions(yyOption1);
5578: yyError = yyResult.select(yyError);
5579: if (yyResult.hasValue()) {
5580: final Node v$el$1 = yyResult.semanticValue();
5581:
5582: yyOption1 = yyResult.index;
5583: yyOpValue1 = v$el$1;
5584: }
5585: { // Start scope for v$g$3.
5586: final Node v$g$3 = yyOpValue1;
5587:
5588: yyValue = GNode.create("NewArrayExpression",
5589: v$g$1, v$g$2, v$g$3, null);
5590: yyValue.setLocation(location(yyStart));
5591:
5592: return new SemanticValue(yyValue, yyOption1,
5593: yyError);
5594: } // End scope for v$g$3.
5595: }
5596:
5597: // Nested alternative 2.
5598:
5599: yyOption1 = yyChoice1;
5600: yyOpValue1 = null;
5601:
5602: yyResult = pDimensions(yyOption1);
5603: yyError = yyResult.select(yyError);
5604: if (yyResult.hasValue()) {
5605: final Node v$el$2 = yyResult.semanticValue();
5606:
5607: yyOption1 = yyResult.index;
5608: yyOpValue1 = v$el$2;
5609: }
5610: { // Start scope for v$g$6.
5611: final Node v$g$6 = yyOpValue1;
5612:
5613: yyResult = pArrayInitializer(yyOption1);
5614: yyError = yyResult.select(yyError);
5615: if (yyResult.hasValue()) {
5616: final Node v$g$7 = yyResult.semanticValue();
5617:
5618: yyValue = GNode.create("NewArrayExpression",
5619: v$g$1, null, v$g$6, v$g$7);
5620: yyValue.setLocation(location(yyStart));
5621:
5622: return yyResult.createValue(yyValue, yyError);
5623: }
5624: } // End scope for v$g$6.
5625: }
5626: }
5627:
5628: // Alternative <Nested>.
5629:
5630: yyResult = pSymbol(yyStart);
5631: yyError = yyResult.select(yyError);
5632: if (yyResult.hasValue("(")) {
5633:
5634: yyResult = pExpression(yyResult.index);
5635: yyError = yyResult.select(yyError);
5636: if (yyResult.hasValue()) {
5637: yyValue = yyResult.semanticValue();
5638:
5639: yyBase = yyResult.index;
5640: yyResult = pSymbol(yyBase);
5641: yyError = yyResult.select(yyError);
5642: if (yyResult.hasValue(")")) {
5643:
5644: return yyResult.createValue(yyValue, yyError);
5645: } else {
5646: yyError = yyError.select("\")\" expected", yyBase);
5647: }
5648: }
5649: }
5650:
5651: // Done.
5652: yyError = yyError
5653: .select("primary expression expected", yyStart);
5654: return yyError;
5655: }
5656:
5657: // =========================================================================
5658:
5659: /**
5660: * Parse nonterminal xtc.lang.Java.ConcreteDimensions.
5661: *
5662: * @param yyStart The index.
5663: * @return The result.
5664: * @throws IOException Signals an I/O error.
5665: */
5666: private Result pConcreteDimensions(final int yyStart)
5667: throws IOException {
5668: Result yyResult;
5669: int yyRepetition1;
5670: boolean yyRepeated1;
5671: Pair<Node> yyRepValue1;
5672: Node yyValue;
5673: ParseError yyError = ParseError.DUMMY;
5674:
5675: // Alternative 1.
5676:
5677: yyRepetition1 = yyStart;
5678: yyRepeated1 = false;
5679: yyRepValue1 = Pair.empty();
5680: while (true) {
5681:
5682: yyResult = pConcreteDimension(yyRepetition1);
5683: yyError = yyResult.select(yyError);
5684: if (yyResult.hasValue()) {
5685: final Node v$el$1 = yyResult.semanticValue();
5686:
5687: yyRepetition1 = yyResult.index;
5688: yyRepeated1 = true;
5689: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
5690: continue;
5691: }
5692: break;
5693: }
5694:
5695: if (yyRepeated1) {
5696: final Pair<Node> v$g$1 = yyRepValue1.reverse();
5697:
5698: yyValue = GNode.createFromPair("ConcreteDimensions", v$g$1);
5699: yyValue.setLocation(location(yyStart));
5700:
5701: return new SemanticValue(yyValue, yyRepetition1, yyError);
5702: }
5703:
5704: // Done.
5705: return yyError;
5706: }
5707:
5708: // =========================================================================
5709:
5710: /**
5711: * Parse nonterminal xtc.lang.Java.ConcreteDimension.
5712: *
5713: * @param yyStart The index.
5714: * @return The result.
5715: * @throws IOException Signals an I/O error.
5716: */
5717: private Result pConcreteDimension(final int yyStart)
5718: throws IOException {
5719: Result yyResult;
5720: int yyBase;
5721: Node yyValue;
5722: ParseError yyError = ParseError.DUMMY;
5723:
5724: // Alternative 1.
5725:
5726: yyResult = pSymbol(yyStart);
5727: yyError = yyResult.select(yyError);
5728: if (yyResult.hasValue("[")) {
5729:
5730: yyResult = pExpression(yyResult.index);
5731: yyError = yyResult.select(yyError);
5732: if (yyResult.hasValue()) {
5733: yyValue = yyResult.semanticValue();
5734:
5735: yyBase = yyResult.index;
5736: yyResult = pSymbol(yyBase);
5737: yyError = yyResult.select(yyError);
5738: if (yyResult.hasValue("]")) {
5739:
5740: return yyResult.createValue(yyValue, yyError);
5741: } else {
5742: yyError = yyError.select("\"]\" expected", yyBase);
5743: }
5744: }
5745: }
5746:
5747: // Done.
5748: yyError = yyError
5749: .select("concrete dimension expected", yyStart);
5750: return yyError;
5751: }
5752:
5753: // =========================================================================
5754:
5755: /**
5756: * Parse nonterminal xtc.lang.Java.ArrayInitializer.
5757: *
5758: * @param yyStart The index.
5759: * @return The result.
5760: * @throws IOException Signals an I/O error.
5761: */
5762: private Result pArrayInitializer(final int yyStart)
5763: throws IOException {
5764: Result yyResult;
5765: int yyBase;
5766: int yyRepetition1;
5767: Pair<Node> yyRepValue1;
5768: int yyOption1;
5769: Node yyValue;
5770: ParseError yyError = ParseError.DUMMY;
5771:
5772: // Alternative 1.
5773:
5774: yyResult = pSymbol(yyStart);
5775: yyError = yyResult.select(yyError);
5776: if (yyResult.hasValue("{")) {
5777:
5778: final int yyChoice1 = yyResult.index;
5779:
5780: // Nested alternative 1.
5781:
5782: yyResult = pVariableInitializer(yyChoice1);
5783: yyError = yyResult.select(yyError);
5784: if (yyResult.hasValue()) {
5785: final Node v$g$1 = yyResult.semanticValue();
5786:
5787: yyRepetition1 = yyResult.index;
5788: yyRepValue1 = Pair.empty();
5789: while (true) {
5790:
5791: yyBase = yyRepetition1;
5792: yyResult = pSymbol(yyBase);
5793: yyError = yyResult.select(yyError);
5794: if (yyResult.hasValue(",")) {
5795:
5796: yyResult = pVariableInitializer(yyResult.index);
5797: yyError = yyResult.select(yyError);
5798: if (yyResult.hasValue()) {
5799: final Node v$el$1 = yyResult
5800: .semanticValue();
5801:
5802: yyRepetition1 = yyResult.index;
5803: yyRepValue1 = new Pair<Node>(v$el$1,
5804: yyRepValue1);
5805: continue;
5806: }
5807: } else {
5808: yyError = yyError.select("\",\" expected",
5809: yyBase);
5810: }
5811: break;
5812: }
5813: { // Start scope for v$g$2.
5814: final Pair<Node> v$g$2 = yyRepValue1.reverse();
5815:
5816: yyOption1 = yyRepetition1;
5817:
5818: yyBase = yyOption1;
5819: yyResult = pSymbol(yyBase);
5820: yyError = yyResult.select(yyError);
5821: if (yyResult.hasValue(",")) {
5822:
5823: yyOption1 = yyResult.index;
5824: } else {
5825: yyError = yyError.select("\",\" expected",
5826: yyBase);
5827: }
5828:
5829: yyBase = yyOption1;
5830: yyResult = pSymbol(yyBase);
5831: yyError = yyResult.select(yyError);
5832: if (yyResult.hasValue("}")) {
5833:
5834: yyValue = GNode.createFromPair(
5835: "ArrayInitializer", v$g$1, v$g$2);
5836: yyValue.setLocation(location(yyStart));
5837:
5838: return yyResult.createValue(yyValue, yyError);
5839: } else {
5840: yyError = yyError.select("\"}\" expected",
5841: yyBase);
5842: }
5843: } // End scope for v$g$2.
5844: }
5845:
5846: // Nested alternative 2.
5847:
5848: yyOption1 = yyChoice1;
5849:
5850: yyBase = yyOption1;
5851: yyResult = pSymbol(yyBase);
5852: yyError = yyResult.select(yyError);
5853: if (yyResult.hasValue(",")) {
5854:
5855: yyOption1 = yyResult.index;
5856: } else {
5857: yyError = yyError.select("\",\" expected", yyBase);
5858: }
5859:
5860: yyBase = yyOption1;
5861: yyResult = pSymbol(yyBase);
5862: yyError = yyResult.select(yyError);
5863: if (yyResult.hasValue("}")) {
5864:
5865: yyValue = GNode.create("ArrayInitializer", false);
5866: yyValue.setLocation(location(yyStart));
5867:
5868: return yyResult.createValue(yyValue, yyError);
5869: } else {
5870: yyError = yyError.select("\"}\" expected", yyBase);
5871: }
5872: }
5873:
5874: // Done.
5875: yyError = yyError.select("array initializer expected", yyStart);
5876: return yyError;
5877: }
5878:
5879: // =========================================================================
5880:
5881: /**
5882: * Parse nonterminal xtc.lang.Java.VariableInitializer.
5883: *
5884: * @param yyStart The index.
5885: * @return The result.
5886: * @throws IOException Signals an I/O error.
5887: */
5888: private Result pVariableInitializer(final int yyStart)
5889: throws IOException {
5890: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
5891: if (null == yyColumn.chunk2)
5892: yyColumn.chunk2 = new Chunk2();
5893: if (null == yyColumn.chunk2.fVariableInitializer)
5894: yyColumn.chunk2.fVariableInitializer = pVariableInitializer$1(yyStart);
5895: return yyColumn.chunk2.fVariableInitializer;
5896: }
5897:
5898: /** Actually parse xtc.lang.Java.VariableInitializer. */
5899: private Result pVariableInitializer$1(final int yyStart)
5900: throws IOException {
5901:
5902: Result yyResult;
5903: Node yyValue;
5904: ParseError yyError = ParseError.DUMMY;
5905:
5906: // Alternative <Array>.
5907:
5908: yyResult = pArrayInitializer(yyStart);
5909: yyError = yyResult.select(yyError);
5910: if (yyResult.hasValue()) {
5911: yyValue = yyResult.semanticValue();
5912:
5913: return yyResult.createValue(yyValue, yyError);
5914: }
5915:
5916: // Alternative <Expression>.
5917:
5918: yyResult = pExpression(yyStart);
5919: yyError = yyResult.select(yyError);
5920: if (yyResult.hasValue()) {
5921: yyValue = yyResult.semanticValue();
5922:
5923: return yyResult.createValue(yyValue, yyError);
5924: }
5925:
5926: // Done.
5927: return yyError;
5928: }
5929:
5930: // =========================================================================
5931:
5932: /**
5933: * Parse nonterminal xtc.lang.Java.Arguments.
5934: *
5935: * @param yyStart The index.
5936: * @return The result.
5937: * @throws IOException Signals an I/O error.
5938: */
5939: private Result pArguments(final int yyStart) throws IOException {
5940: Result yyResult;
5941: int yyBase;
5942: int yyRepetition1;
5943: Pair<Node> yyRepValue1;
5944: Node yyValue;
5945: ParseError yyError = ParseError.DUMMY;
5946:
5947: // Alternative 1.
5948:
5949: yyResult = pSymbol(yyStart);
5950: yyError = yyResult.select(yyError);
5951: if (yyResult.hasValue("(")) {
5952:
5953: final int yyChoice1 = yyResult.index;
5954:
5955: // Nested alternative 1.
5956:
5957: yyResult = pExpression(yyChoice1);
5958: yyError = yyResult.select(yyError);
5959: if (yyResult.hasValue()) {
5960: final Node v$g$1 = yyResult.semanticValue();
5961:
5962: yyRepetition1 = yyResult.index;
5963: yyRepValue1 = Pair.empty();
5964: while (true) {
5965:
5966: yyBase = yyRepetition1;
5967: yyResult = pSymbol(yyBase);
5968: yyError = yyResult.select(yyError);
5969: if (yyResult.hasValue(",")) {
5970:
5971: yyResult = pExpression(yyResult.index);
5972: yyError = yyResult.select(yyError);
5973: if (yyResult.hasValue()) {
5974: final Node v$el$1 = yyResult
5975: .semanticValue();
5976:
5977: yyRepetition1 = yyResult.index;
5978: yyRepValue1 = new Pair<Node>(v$el$1,
5979: yyRepValue1);
5980: continue;
5981: }
5982: } else {
5983: yyError = yyError.select("\",\" expected",
5984: yyBase);
5985: }
5986: break;
5987: }
5988: { // Start scope for v$g$2.
5989: final Pair<Node> v$g$2 = yyRepValue1.reverse();
5990:
5991: yyBase = yyRepetition1;
5992: yyResult = pSymbol(yyBase);
5993: yyError = yyResult.select(yyError);
5994: if (yyResult.hasValue(")")) {
5995:
5996: yyValue = GNode.createFromPair("Arguments",
5997: v$g$1, v$g$2);
5998: yyValue.setLocation(location(yyStart));
5999:
6000: return yyResult.createValue(yyValue, yyError);
6001: } else {
6002: yyError = yyError.select("\")\" expected",
6003: yyBase);
6004: }
6005: } // End scope for v$g$2.
6006: }
6007:
6008: // Nested alternative 2.
6009:
6010: yyBase = yyChoice1;
6011: yyResult = pSymbol(yyBase);
6012: yyError = yyResult.select(yyError);
6013: if (yyResult.hasValue(")")) {
6014:
6015: yyValue = GNode.create("Arguments", false);
6016: yyValue.setLocation(location(yyStart));
6017:
6018: return yyResult.createValue(yyValue, yyError);
6019: } else {
6020: yyError = yyError.select("\")\" expected", yyBase);
6021: }
6022: }
6023:
6024: // Done.
6025: yyError = yyError.select("arguments expected", yyStart);
6026: return yyError;
6027: }
6028:
6029: // =========================================================================
6030:
6031: /**
6032: * Parse nonterminal xtc.lang.JavaType.ResultType.
6033: *
6034: * @param yyStart The index.
6035: * @return The result.
6036: * @throws IOException Signals an I/O error.
6037: */
6038: private Result pResultType(final int yyStart) throws IOException {
6039: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
6040: if (null == yyColumn.chunk2)
6041: yyColumn.chunk2 = new Chunk2();
6042: if (null == yyColumn.chunk2.fResultType)
6043: yyColumn.chunk2.fResultType = pResultType$1(yyStart);
6044: return yyColumn.chunk2.fResultType;
6045: }
6046:
6047: /** Actually parse xtc.lang.JavaType.ResultType. */
6048: private Result pResultType$1(final int yyStart) throws IOException {
6049: Result yyResult;
6050: Node yyValue;
6051: ParseError yyError = ParseError.DUMMY;
6052:
6053: // Alternative <Void>.
6054:
6055: yyResult = pVoidType(yyStart);
6056: yyError = yyResult.select(yyError);
6057: if (yyResult.hasValue()) {
6058: yyValue = yyResult.semanticValue();
6059:
6060: return yyResult.createValue(yyValue, yyError);
6061: }
6062:
6063: // Alternative <Regular>.
6064:
6065: yyResult = pType(yyStart);
6066: yyError = yyResult.select(yyError);
6067: if (yyResult.hasValue()) {
6068: yyValue = yyResult.semanticValue();
6069:
6070: return yyResult.createValue(yyValue, yyError);
6071: }
6072:
6073: // Done.
6074: return yyError;
6075: }
6076:
6077: // =========================================================================
6078:
6079: /**
6080: * Parse nonterminal xtc.lang.JavaType.VoidType.
6081: *
6082: * @param yyStart The index.
6083: * @return The result.
6084: * @throws IOException Signals an I/O error.
6085: */
6086: private Result pVoidType(final int yyStart) throws IOException {
6087: Result yyResult;
6088: Node yyValue;
6089: ParseError yyError = ParseError.DUMMY;
6090:
6091: // Alternative <Void>.
6092:
6093: yyResult = pWord(yyStart);
6094: yyError = yyResult.select(yyError);
6095: if (yyResult.hasValue("void")) {
6096:
6097: yyValue = GNode.create("VoidType", false);
6098: yyValue.setLocation(location(yyStart));
6099:
6100: return yyResult.createValue(yyValue, yyError);
6101: }
6102:
6103: // Done.
6104: yyError = yyError.select("void type expected", yyStart);
6105: return yyError;
6106: }
6107:
6108: // =========================================================================
6109:
6110: /**
6111: * Parse nonterminal xtc.lang.JavaType.Type.
6112: *
6113: * @param yyStart The index.
6114: * @return The result.
6115: * @throws IOException Signals an I/O error.
6116: */
6117: private Result pType(final int yyStart) throws IOException {
6118: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
6119: if (null == yyColumn.chunk2)
6120: yyColumn.chunk2 = new Chunk2();
6121: if (null == yyColumn.chunk2.fType)
6122: yyColumn.chunk2.fType = pType$1(yyStart);
6123: return yyColumn.chunk2.fType;
6124: }
6125:
6126: /** Actually parse xtc.lang.JavaType.Type. */
6127: private Result pType$1(final int yyStart) throws IOException {
6128: Result yyResult;
6129: int yyOption1;
6130: Node yyOpValue1;
6131: Node yyValue;
6132: ParseError yyError = ParseError.DUMMY;
6133:
6134: // Alternative <Type>.
6135:
6136: yyResult = pTypeName(yyStart);
6137: yyError = yyResult.select(yyError);
6138: if (yyResult.hasValue()) {
6139: final Node v$g$1 = yyResult.semanticValue();
6140:
6141: yyOption1 = yyResult.index;
6142: yyOpValue1 = null;
6143:
6144: yyResult = pDimensions(yyOption1);
6145: yyError = yyResult.select(yyError);
6146: if (yyResult.hasValue()) {
6147: final Node v$el$1 = yyResult.semanticValue();
6148:
6149: yyOption1 = yyResult.index;
6150: yyOpValue1 = v$el$1;
6151: }
6152: { // Start scope for v$g$2.
6153: final Node v$g$2 = yyOpValue1;
6154:
6155: yyValue = GNode.create("Type", v$g$1, v$g$2);
6156: yyValue.setLocation(location(yyStart));
6157:
6158: return new SemanticValue(yyValue, yyOption1, yyError);
6159: } // End scope for v$g$2.
6160: }
6161:
6162: // Done.
6163: return yyError;
6164: }
6165:
6166: // =========================================================================
6167:
6168: /**
6169: * Parse nonterminal xtc.lang.JavaType.TypeName.
6170: *
6171: * @param yyStart The index.
6172: * @return The result.
6173: * @throws IOException Signals an I/O error.
6174: */
6175: private Result pTypeName(final int yyStart) throws IOException {
6176: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
6177: if (null == yyColumn.chunk2)
6178: yyColumn.chunk2 = new Chunk2();
6179: if (null == yyColumn.chunk2.fTypeName)
6180: yyColumn.chunk2.fTypeName = pTypeName$1(yyStart);
6181: return yyColumn.chunk2.fTypeName;
6182: }
6183:
6184: /** Actually parse xtc.lang.JavaType.TypeName. */
6185: private Result pTypeName$1(final int yyStart) throws IOException {
6186: Result yyResult;
6187: Node yyValue;
6188: ParseError yyError = ParseError.DUMMY;
6189:
6190: // Alternative <Basic>.
6191:
6192: yyResult = pPrimitiveType(yyStart);
6193: yyError = yyResult.select(yyError);
6194: if (yyResult.hasValue()) {
6195: yyValue = yyResult.semanticValue();
6196:
6197: return yyResult.createValue(yyValue, yyError);
6198: }
6199:
6200: // Alternative <Class>.
6201:
6202: yyResult = pQualifiedIdentifier(yyStart);
6203: yyError = yyResult.select(yyError);
6204: if (yyResult.hasValue()) {
6205: yyValue = yyResult.semanticValue();
6206:
6207: return yyResult.createValue(yyValue, yyError);
6208: }
6209:
6210: // Done.
6211: return yyError;
6212: }
6213:
6214: // =========================================================================
6215:
6216: /**
6217: * Parse nonterminal xtc.lang.JavaType.PrimitiveType.
6218: *
6219: * @param yyStart The index.
6220: * @return The result.
6221: * @throws IOException Signals an I/O error.
6222: */
6223: private Result pPrimitiveType(final int yyStart) throws IOException {
6224: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
6225: if (null == yyColumn.chunk2)
6226: yyColumn.chunk2 = new Chunk2();
6227: if (null == yyColumn.chunk2.fPrimitiveType)
6228: yyColumn.chunk2.fPrimitiveType = pPrimitiveType$1(yyStart);
6229: return yyColumn.chunk2.fPrimitiveType;
6230: }
6231:
6232: /** Actually parse xtc.lang.JavaType.PrimitiveType. */
6233: private Result pPrimitiveType$1(final int yyStart)
6234: throws IOException {
6235: Result yyResult;
6236: Node yyValue;
6237: ParseError yyError = ParseError.DUMMY;
6238:
6239: // Alternative <Byte>.
6240:
6241: yyResult = pWord(yyStart);
6242: yyError = yyResult.select(yyError);
6243: if (yyResult.hasValue("byte")) {
6244: final String v$g$1 = "byte";
6245:
6246: yyValue = GNode.create("PrimitiveType", v$g$1);
6247: yyValue.setLocation(location(yyStart));
6248:
6249: return yyResult.createValue(yyValue, yyError);
6250: }
6251:
6252: // Alternative <Short>.
6253:
6254: yyResult = pWord(yyStart);
6255: yyError = yyResult.select(yyError);
6256: if (yyResult.hasValue("short")) {
6257: final String v$g$2 = "short";
6258:
6259: yyValue = GNode.create("PrimitiveType", v$g$2);
6260: yyValue.setLocation(location(yyStart));
6261:
6262: return yyResult.createValue(yyValue, yyError);
6263: }
6264:
6265: // Alternative <Char>.
6266:
6267: yyResult = pWord(yyStart);
6268: yyError = yyResult.select(yyError);
6269: if (yyResult.hasValue("char")) {
6270: final String v$g$3 = "char";
6271:
6272: yyValue = GNode.create("PrimitiveType", v$g$3);
6273: yyValue.setLocation(location(yyStart));
6274:
6275: return yyResult.createValue(yyValue, yyError);
6276: }
6277:
6278: // Alternative <Int>.
6279:
6280: yyResult = pWord(yyStart);
6281: yyError = yyResult.select(yyError);
6282: if (yyResult.hasValue("int")) {
6283: final String v$g$4 = "int";
6284:
6285: yyValue = GNode.create("PrimitiveType", v$g$4);
6286: yyValue.setLocation(location(yyStart));
6287:
6288: return yyResult.createValue(yyValue, yyError);
6289: }
6290:
6291: // Alternative <Long>.
6292:
6293: yyResult = pWord(yyStart);
6294: yyError = yyResult.select(yyError);
6295: if (yyResult.hasValue("long")) {
6296: final String v$g$5 = "long";
6297:
6298: yyValue = GNode.create("PrimitiveType", v$g$5);
6299: yyValue.setLocation(location(yyStart));
6300:
6301: return yyResult.createValue(yyValue, yyError);
6302: }
6303:
6304: // Alternative <Float>.
6305:
6306: yyResult = pWord(yyStart);
6307: yyError = yyResult.select(yyError);
6308: if (yyResult.hasValue("float")) {
6309: final String v$g$6 = "float";
6310:
6311: yyValue = GNode.create("PrimitiveType", v$g$6);
6312: yyValue.setLocation(location(yyStart));
6313:
6314: return yyResult.createValue(yyValue, yyError);
6315: }
6316:
6317: // Alternative <Double>.
6318:
6319: yyResult = pWord(yyStart);
6320: yyError = yyResult.select(yyError);
6321: if (yyResult.hasValue("double")) {
6322: final String v$g$7 = "double";
6323:
6324: yyValue = GNode.create("PrimitiveType", v$g$7);
6325: yyValue.setLocation(location(yyStart));
6326:
6327: return yyResult.createValue(yyValue, yyError);
6328: }
6329:
6330: // Alternative <Boolean>.
6331:
6332: yyResult = pWord(yyStart);
6333: yyError = yyResult.select(yyError);
6334: if (yyResult.hasValue("boolean")) {
6335: final String v$g$8 = "boolean";
6336:
6337: yyValue = GNode.create("PrimitiveType", v$g$8);
6338: yyValue.setLocation(location(yyStart));
6339:
6340: return yyResult.createValue(yyValue, yyError);
6341: }
6342:
6343: // Done.
6344: yyError = yyError.select("primitive type expected", yyStart);
6345: return yyError;
6346: }
6347:
6348: // =========================================================================
6349:
6350: /**
6351: * Parse nonterminal xtc.lang.JavaType.Dimensions.
6352: *
6353: * @param yyStart The index.
6354: * @return The result.
6355: * @throws IOException Signals an I/O error.
6356: */
6357: private Result pDimensions(final int yyStart) throws IOException {
6358: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
6359: if (null == yyColumn.chunk2)
6360: yyColumn.chunk2 = new Chunk2();
6361: if (null == yyColumn.chunk2.fDimensions)
6362: yyColumn.chunk2.fDimensions = pDimensions$1(yyStart);
6363: return yyColumn.chunk2.fDimensions;
6364: }
6365:
6366: /** Actually parse xtc.lang.JavaType.Dimensions. */
6367: private Result pDimensions$1(final int yyStart) throws IOException {
6368: Result yyResult;
6369: Node yyValue;
6370: ParseError yyError = ParseError.DUMMY;
6371:
6372: // Alternative 1.
6373:
6374: yyResult = pDimensions$$Plus1(yyStart);
6375: yyError = yyResult.select(yyError);
6376: if (yyResult.hasValue()) {
6377: final Pair<String> v$g$1 = yyResult.semanticValue();
6378:
6379: yyValue = GNode.createFromPair("Dimensions", v$g$1);
6380: yyValue.setLocation(location(yyStart));
6381:
6382: return yyResult.createValue(yyValue, yyError);
6383: }
6384:
6385: // Done.
6386: return yyError;
6387: }
6388:
6389: // =========================================================================
6390:
6391: /**
6392: * Parse synthetic nonterminal xtc.lang.Java.Dimensions$$Plus1.
6393: *
6394: * @param yyStart The index.
6395: * @return The result.
6396: * @throws IOException Signals an I/O error.
6397: */
6398: private Result pDimensions$$Plus1(final int yyStart)
6399: throws IOException {
6400: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
6401: if (null == yyColumn.chunk2)
6402: yyColumn.chunk2 = new Chunk2();
6403: if (null == yyColumn.chunk2.fDimensions$$Plus1)
6404: yyColumn.chunk2.fDimensions$$Plus1 = pDimensions$$Plus1$1(yyStart);
6405: return yyColumn.chunk2.fDimensions$$Plus1;
6406: }
6407:
6408: /** Actually parse xtc.lang.Java.Dimensions$$Plus1. */
6409: private Result pDimensions$$Plus1$1(final int yyStart)
6410: throws IOException {
6411: Result yyResult;
6412: int yyBase;
6413: Pair<String> yyValue;
6414: ParseError yyError = ParseError.DUMMY;
6415:
6416: // Alternative 1.
6417:
6418: yyResult = pSymbol(yyStart);
6419: yyError = yyResult.select(yyError);
6420: if (yyResult.hasValue("[")) {
6421: final String v$el$1 = "[";
6422:
6423: yyBase = yyResult.index;
6424: yyResult = pSymbol(yyBase);
6425: yyError = yyResult.select(yyError);
6426: if (yyResult.hasValue("]")) {
6427:
6428: final int yyChoice1 = yyResult.index;
6429:
6430: // Nested alternative 1.
6431:
6432: yyResult = pDimensions$$Plus1(yyChoice1);
6433: yyError = yyResult.select(yyError);
6434: if (yyResult.hasValue()) {
6435: final Pair<String> v$2 = yyResult.semanticValue();
6436:
6437: yyValue = new Pair<String>(v$el$1, v$2);
6438:
6439: return yyResult.createValue(yyValue, yyError);
6440: }
6441:
6442: // Nested alternative 2.
6443:
6444: yyValue = new Pair<String>(v$el$1);
6445:
6446: return new SemanticValue(yyValue, yyChoice1, yyError);
6447: } else {
6448: yyError = yyError.select("\"]\" expected", yyBase);
6449: }
6450: }
6451:
6452: // Done.
6453: yyError = yyError.select("dimensions expected", yyStart);
6454: return yyError;
6455: }
6456:
6457: // =========================================================================
6458:
6459: /**
6460: * Parse nonterminal xtc.lang.JavaConstant.Literal.
6461: *
6462: * @param yyStart The index.
6463: * @return The result.
6464: * @throws IOException Signals an I/O error.
6465: */
6466: private Result pLiteral(final int yyStart) throws IOException {
6467: Result yyResult;
6468: Node yyValue;
6469: ParseError yyError = ParseError.DUMMY;
6470:
6471: // Alternative 1.
6472:
6473: yyResult = pFloatingPointLiteral(yyStart);
6474: yyError = yyResult.select(yyError);
6475: if (yyResult.hasValue()) {
6476: yyValue = yyResult.semanticValue();
6477:
6478: yyResult = pSpacing(yyResult.index);
6479: yyError = yyResult.select(yyError);
6480: if (yyResult.hasValue()) {
6481:
6482: return yyResult.createValue(yyValue, yyError);
6483: }
6484: }
6485:
6486: // Alternative 2.
6487:
6488: yyResult = pIntegerLiteral(yyStart);
6489: yyError = yyResult.select(yyError);
6490: if (yyResult.hasValue()) {
6491: yyValue = yyResult.semanticValue();
6492:
6493: yyResult = pSpacing(yyResult.index);
6494: yyError = yyResult.select(yyError);
6495: if (yyResult.hasValue()) {
6496:
6497: return yyResult.createValue(yyValue, yyError);
6498: }
6499: }
6500:
6501: // Alternative 3.
6502:
6503: yyResult = pCharacterLiteral(yyStart);
6504: yyError = yyResult.select(yyError);
6505: if (yyResult.hasValue()) {
6506: yyValue = yyResult.semanticValue();
6507:
6508: yyResult = pSpacing(yyResult.index);
6509: yyError = yyResult.select(yyError);
6510: if (yyResult.hasValue()) {
6511:
6512: return yyResult.createValue(yyValue, yyError);
6513: }
6514: }
6515:
6516: // Alternative 4.
6517:
6518: yyResult = pStringLiteral(yyStart);
6519: yyError = yyResult.select(yyError);
6520: if (yyResult.hasValue()) {
6521: yyValue = yyResult.semanticValue();
6522:
6523: yyResult = pSpacing(yyResult.index);
6524: yyError = yyResult.select(yyError);
6525: if (yyResult.hasValue()) {
6526:
6527: return yyResult.createValue(yyValue, yyError);
6528: }
6529: }
6530:
6531: // Alternative 5.
6532:
6533: yyResult = pWord(yyStart);
6534: yyError = yyResult.select(yyError);
6535: if (yyResult.hasValue("true")) {
6536: final String v$g$1 = "true";
6537:
6538: yyValue = GNode.create("BooleanLiteral", v$g$1);
6539: yyValue.setLocation(location(yyStart));
6540:
6541: return yyResult.createValue(yyValue, yyError);
6542: }
6543:
6544: // Alternative 6.
6545:
6546: yyResult = pWord(yyStart);
6547: yyError = yyResult.select(yyError);
6548: if (yyResult.hasValue("false")) {
6549: final String v$g$2 = "false";
6550:
6551: yyValue = GNode.create("BooleanLiteral", v$g$2);
6552: yyValue.setLocation(location(yyStart));
6553:
6554: return yyResult.createValue(yyValue, yyError);
6555: }
6556:
6557: // Alternative 7.
6558:
6559: yyResult = pWord(yyStart);
6560: yyError = yyResult.select(yyError);
6561: if (yyResult.hasValue("null")) {
6562:
6563: yyValue = GNode.create("NullLiteral", false);
6564: yyValue.setLocation(location(yyStart));
6565:
6566: return yyResult.createValue(yyValue, yyError);
6567: }
6568:
6569: // Done.
6570: yyError = yyError.select("literal expected", yyStart);
6571: return yyError;
6572: }
6573:
6574: // =========================================================================
6575:
6576: /**
6577: * Parse nonterminal xtc.lang.JavaConstant.IntegerLiteral.
6578: *
6579: * @param yyStart The index.
6580: * @return The result.
6581: * @throws IOException Signals an I/O error.
6582: */
6583: private Result pIntegerLiteral(final int yyStart)
6584: throws IOException {
6585: Result yyResult;
6586: Node yyValue;
6587: ParseError yyError = ParseError.DUMMY;
6588:
6589: // Alternative <Hex>.
6590:
6591: yyResult = pHexLiteral(yyStart);
6592: yyError = yyResult.select(yyError);
6593: if (yyResult.hasValue()) {
6594: final String v$g$1 = yyResult.semanticValue();
6595:
6596: yyValue = GNode.create("IntegerLiteral", v$g$1);
6597: yyValue.setLocation(location(yyStart));
6598:
6599: return yyResult.createValue(yyValue, yyError);
6600: }
6601:
6602: // Alternative <Octal>.
6603:
6604: yyResult = pOctalLiteral(yyStart);
6605: yyError = yyResult.select(yyError);
6606: if (yyResult.hasValue()) {
6607: final String v$g$2 = yyResult.semanticValue();
6608:
6609: yyValue = GNode.create("IntegerLiteral", v$g$2);
6610: yyValue.setLocation(location(yyStart));
6611:
6612: return yyResult.createValue(yyValue, yyError);
6613: }
6614:
6615: // Alternative <Decimal>.
6616:
6617: yyResult = pDecimalLiteral(yyStart);
6618: yyError = yyResult.select(yyError);
6619: if (yyResult.hasValue()) {
6620: final String v$g$3 = yyResult.semanticValue();
6621:
6622: yyValue = GNode.create("IntegerLiteral", v$g$3);
6623: yyValue.setLocation(location(yyStart));
6624:
6625: return yyResult.createValue(yyValue, yyError);
6626: }
6627:
6628: // Done.
6629: return yyError;
6630: }
6631:
6632: // =========================================================================
6633:
6634: /**
6635: * Parse nonterminal xtc.lang.JavaConstant.HexLiteral.
6636: *
6637: * @param yyStart The index.
6638: * @return The result.
6639: * @throws IOException Signals an I/O error.
6640: */
6641: private Result pHexLiteral(final int yyStart) throws IOException {
6642: int yyC;
6643: int yyIndex;
6644: Result yyResult;
6645: int yyOption1;
6646: String yyValue;
6647: ParseError yyError = ParseError.DUMMY;
6648:
6649: // Alternative 1.
6650:
6651: yyResult = pHexNumeral(yyStart);
6652: yyError = yyResult.select(yyError);
6653: if (yyResult.hasValue()) {
6654:
6655: yyOption1 = yyResult.index;
6656:
6657: yyC = character(yyOption1);
6658: if (-1 != yyC) {
6659: yyIndex = yyOption1 + 1;
6660:
6661: switch (yyC) {
6662: case 'L':
6663: case 'l': {
6664: yyOption1 = yyIndex;
6665: }
6666:
6667: default:
6668: /* No match. */
6669: }
6670: }
6671:
6672: yyValue = difference(yyStart, yyOption1);
6673:
6674: return new SemanticValue(yyValue, yyOption1, yyError);
6675: }
6676:
6677: // Done.
6678: yyError = yyError.select("hex literal expected", yyStart);
6679: return yyError;
6680: }
6681:
6682: // =========================================================================
6683:
6684: /**
6685: * Parse nonterminal xtc.lang.JavaConstant.OctalLiteral.
6686: *
6687: * @param yyStart The index.
6688: * @return The result.
6689: * @throws IOException Signals an I/O error.
6690: */
6691: private Result pOctalLiteral(final int yyStart) throws IOException {
6692: int yyC;
6693: int yyIndex;
6694: Result yyResult;
6695: int yyOption1;
6696: String yyValue;
6697: ParseError yyError = ParseError.DUMMY;
6698:
6699: // Alternative 1.
6700:
6701: yyResult = pOctalNumeral(yyStart);
6702: yyError = yyResult.select(yyError);
6703: if (yyResult.hasValue()) {
6704:
6705: yyOption1 = yyResult.index;
6706:
6707: yyC = character(yyOption1);
6708: if (-1 != yyC) {
6709: yyIndex = yyOption1 + 1;
6710:
6711: switch (yyC) {
6712: case 'L':
6713: case 'l': {
6714: yyOption1 = yyIndex;
6715: }
6716:
6717: default:
6718: /* No match. */
6719: }
6720: }
6721:
6722: yyValue = difference(yyStart, yyOption1);
6723:
6724: return new SemanticValue(yyValue, yyOption1, yyError);
6725: }
6726:
6727: // Done.
6728: yyError = yyError.select("octal literal expected", yyStart);
6729: return yyError;
6730: }
6731:
6732: // =========================================================================
6733:
6734: /**
6735: * Parse nonterminal xtc.lang.JavaConstant.DecimalLiteral.
6736: *
6737: * @param yyStart The index.
6738: * @return The result.
6739: * @throws IOException Signals an I/O error.
6740: */
6741: private Result pDecimalLiteral(final int yyStart)
6742: throws IOException {
6743: int yyC;
6744: int yyIndex;
6745: Result yyResult;
6746: int yyOption1;
6747: String yyValue;
6748: ParseError yyError = ParseError.DUMMY;
6749:
6750: // Alternative 1.
6751:
6752: yyResult = pDecimalNumeral(yyStart);
6753: yyError = yyResult.select(yyError);
6754: if (yyResult.hasValue()) {
6755:
6756: yyOption1 = yyResult.index;
6757:
6758: yyC = character(yyOption1);
6759: if (-1 != yyC) {
6760: yyIndex = yyOption1 + 1;
6761:
6762: switch (yyC) {
6763: case 'L':
6764: case 'l': {
6765: yyOption1 = yyIndex;
6766: }
6767:
6768: default:
6769: /* No match. */
6770: }
6771: }
6772:
6773: yyValue = difference(yyStart, yyOption1);
6774:
6775: return new SemanticValue(yyValue, yyOption1, yyError);
6776: }
6777:
6778: // Done.
6779: yyError = yyError.select("decimal literal expected", yyStart);
6780: return yyError;
6781: }
6782:
6783: // =========================================================================
6784:
6785: /**
6786: * Parse nonterminal xtc.lang.JavaConstant.DecimalNumeral.
6787: *
6788: * @param yyStart The index.
6789: * @return The result.
6790: * @throws IOException Signals an I/O error.
6791: */
6792: private Result pDecimalNumeral(final int yyStart)
6793: throws IOException {
6794: int yyC;
6795: int yyIndex;
6796: int yyRepetition1;
6797: Void yyValue;
6798: ParseError yyError = ParseError.DUMMY;
6799:
6800: // Alternative 1.
6801:
6802: yyC = character(yyStart);
6803: if (-1 != yyC) {
6804: yyIndex = yyStart + 1;
6805:
6806: switch (yyC) {
6807: case '0': {
6808: yyValue = null;
6809:
6810: return new SemanticValue(yyValue, yyIndex, yyError);
6811: }
6812:
6813: case '1':
6814: case '2':
6815: case '3':
6816: case '4':
6817: case '5':
6818: case '6':
6819: case '7':
6820: case '8':
6821: case '9': {
6822: yyRepetition1 = yyIndex;
6823: while (true) {
6824:
6825: yyC = character(yyRepetition1);
6826: if (-1 != yyC) {
6827: yyIndex = yyRepetition1 + 1;
6828:
6829: switch (yyC) {
6830: case '0':
6831: case '1':
6832: case '2':
6833: case '3':
6834: case '4':
6835: case '5':
6836: case '6':
6837: case '7':
6838: case '8':
6839: case '9': {
6840: yyRepetition1 = yyIndex;
6841: continue;
6842: }
6843:
6844: default:
6845: /* No match. */
6846: }
6847: }
6848: break;
6849: }
6850:
6851: yyValue = null;
6852:
6853: return new SemanticValue(yyValue, yyRepetition1,
6854: yyError);
6855: }
6856:
6857: default:
6858: /* No match. */
6859: }
6860: }
6861:
6862: // Done.
6863: yyError = yyError.select("decimal numeral expected", yyStart);
6864: return yyError;
6865: }
6866:
6867: // =========================================================================
6868:
6869: /**
6870: * Parse nonterminal xtc.lang.JavaConstant.HexNumeral.
6871: *
6872: * @param yyStart The index.
6873: * @return The result.
6874: * @throws IOException Signals an I/O error.
6875: */
6876: private Result pHexNumeral(final int yyStart) throws IOException {
6877: int yyC;
6878: int yyIndex;
6879: int yyRepetition1;
6880: boolean yyRepeated1;
6881: Void yyValue;
6882: ParseError yyError = ParseError.DUMMY;
6883:
6884: // Alternative 1.
6885:
6886: yyC = character(yyStart);
6887: if ('0' == yyC) {
6888: yyIndex = yyStart + 1;
6889:
6890: yyC = character(yyIndex);
6891: if (-1 != yyC) {
6892: yyIndex = yyIndex + 1;
6893:
6894: switch (yyC) {
6895: case 'X':
6896: case 'x': {
6897: yyRepetition1 = yyIndex;
6898: yyRepeated1 = false;
6899: while (true) {
6900:
6901: yyC = character(yyRepetition1);
6902: if (-1 != yyC) {
6903: yyIndex = yyRepetition1 + 1;
6904:
6905: switch (yyC) {
6906: case '0':
6907: case '1':
6908: case '2':
6909: case '3':
6910: case '4':
6911: case '5':
6912: case '6':
6913: case '7':
6914: case '8':
6915: case '9':
6916: case 'A':
6917: case 'B':
6918: case 'C':
6919: case 'D':
6920: case 'E':
6921: case 'F':
6922: case 'a':
6923: case 'b':
6924: case 'c':
6925: case 'd':
6926: case 'e':
6927: case 'f': {
6928: yyRepetition1 = yyIndex;
6929: yyRepeated1 = true;
6930: continue;
6931: }
6932:
6933: default:
6934: /* No match. */
6935: }
6936: }
6937: break;
6938: }
6939:
6940: if (yyRepeated1) {
6941:
6942: yyValue = null;
6943:
6944: return new SemanticValue(yyValue,
6945: yyRepetition1, yyError);
6946: }
6947: }
6948: break;
6949:
6950: default:
6951: /* No match. */
6952: }
6953: }
6954: }
6955:
6956: // Done.
6957: yyError = yyError.select("hex numeral expected", yyStart);
6958: return yyError;
6959: }
6960:
6961: // =========================================================================
6962:
6963: /**
6964: * Parse nonterminal xtc.lang.JavaConstant.OctalNumeral.
6965: *
6966: * @param yyStart The index.
6967: * @return The result.
6968: * @throws IOException Signals an I/O error.
6969: */
6970: private Result pOctalNumeral(final int yyStart) throws IOException {
6971: int yyC;
6972: int yyIndex;
6973: int yyRepetition1;
6974: boolean yyRepeated1;
6975: Void yyValue;
6976: ParseError yyError = ParseError.DUMMY;
6977:
6978: // Alternative 1.
6979:
6980: yyC = character(yyStart);
6981: if ('0' == yyC) {
6982: yyIndex = yyStart + 1;
6983:
6984: yyRepetition1 = yyIndex;
6985: yyRepeated1 = false;
6986: while (true) {
6987:
6988: yyC = character(yyRepetition1);
6989: if (-1 != yyC) {
6990: yyIndex = yyRepetition1 + 1;
6991:
6992: switch (yyC) {
6993: case '0':
6994: case '1':
6995: case '2':
6996: case '3':
6997: case '4':
6998: case '5':
6999: case '6':
7000: case '7': {
7001: yyRepetition1 = yyIndex;
7002: yyRepeated1 = true;
7003: continue;
7004: }
7005:
7006: default:
7007: /* No match. */
7008: }
7009: }
7010: break;
7011: }
7012:
7013: if (yyRepeated1) {
7014:
7015: yyValue = null;
7016:
7017: return new SemanticValue(yyValue, yyRepetition1,
7018: yyError);
7019: }
7020: }
7021:
7022: // Done.
7023: yyError = yyError.select("octal numeral expected", yyStart);
7024: return yyError;
7025: }
7026:
7027: // =========================================================================
7028:
7029: /**
7030: * Parse nonterminal xtc.lang.JavaConstant.FloatingPointLiteral.
7031: *
7032: * @param yyStart The index.
7033: * @return The result.
7034: * @throws IOException Signals an I/O error.
7035: */
7036: private Result pFloatingPointLiteral(final int yyStart)
7037: throws IOException {
7038: Result yyResult;
7039: Node yyValue;
7040: ParseError yyError = ParseError.DUMMY;
7041:
7042: // Alternative 1.
7043:
7044: yyResult = pFloatingPointString(yyStart);
7045: yyError = yyResult.select(yyError);
7046: if (yyResult.hasValue()) {
7047: final String v$g$1 = yyResult.semanticValue();
7048:
7049: yyValue = GNode.create("FloatingPointLiteral", v$g$1);
7050: yyValue.setLocation(location(yyStart));
7051:
7052: return yyResult.createValue(yyValue, yyError);
7053: }
7054:
7055: // Done.
7056: return yyError;
7057: }
7058:
7059: // =========================================================================
7060:
7061: /**
7062: * Parse nonterminal xtc.lang.JavaConstant.FloatingPointString.
7063: *
7064: * @param yyStart The index.
7065: * @return The result.
7066: * @throws IOException Signals an I/O error.
7067: */
7068: private Result pFloatingPointString(final int yyStart)
7069: throws IOException {
7070: int yyC;
7071: int yyIndex;
7072: Result yyResult;
7073: int yyRepetition1;
7074: boolean yyRepeated1;
7075: int yyOption1;
7076: String yyValue;
7077: ParseError yyError = ParseError.DUMMY;
7078:
7079: // Alternative 1.
7080:
7081: yyRepetition1 = yyStart;
7082: yyRepeated1 = false;
7083: while (true) {
7084:
7085: yyC = character(yyRepetition1);
7086: if (-1 != yyC) {
7087: yyIndex = yyRepetition1 + 1;
7088:
7089: switch (yyC) {
7090: case '0':
7091: case '1':
7092: case '2':
7093: case '3':
7094: case '4':
7095: case '5':
7096: case '6':
7097: case '7':
7098: case '8':
7099: case '9': {
7100: yyRepetition1 = yyIndex;
7101: yyRepeated1 = true;
7102: continue;
7103: }
7104:
7105: default:
7106: /* No match. */
7107: }
7108: }
7109: break;
7110: }
7111:
7112: if (yyRepeated1) {
7113:
7114: yyC = character(yyRepetition1);
7115: if ('.' == yyC) {
7116: yyIndex = yyRepetition1 + 1;
7117:
7118: yyRepetition1 = yyIndex;
7119: while (true) {
7120:
7121: yyC = character(yyRepetition1);
7122: if (-1 != yyC) {
7123: yyIndex = yyRepetition1 + 1;
7124:
7125: switch (yyC) {
7126: case '0':
7127: case '1':
7128: case '2':
7129: case '3':
7130: case '4':
7131: case '5':
7132: case '6':
7133: case '7':
7134: case '8':
7135: case '9': {
7136: yyRepetition1 = yyIndex;
7137: continue;
7138: }
7139:
7140: default:
7141: /* No match. */
7142: }
7143: }
7144: break;
7145: }
7146:
7147: yyOption1 = yyRepetition1;
7148:
7149: yyResult = pExponent(yyOption1);
7150: yyError = yyResult.select(yyError);
7151: if (yyResult.hasValue()) {
7152:
7153: yyOption1 = yyResult.index;
7154: }
7155:
7156: yyC = character(yyOption1);
7157: if (-1 != yyC) {
7158: yyIndex = yyOption1 + 1;
7159:
7160: switch (yyC) {
7161: case 'D':
7162: case 'F':
7163: case 'd':
7164: case 'f': {
7165: yyOption1 = yyIndex;
7166: }
7167:
7168: default:
7169: /* No match. */
7170: }
7171: }
7172:
7173: yyValue = difference(yyStart, yyOption1);
7174:
7175: return new SemanticValue(yyValue, yyOption1, yyError);
7176: }
7177: }
7178:
7179: // Alternative 2.
7180:
7181: yyC = character(yyStart);
7182: if ('.' == yyC) {
7183: yyIndex = yyStart + 1;
7184:
7185: yyRepetition1 = yyIndex;
7186: yyRepeated1 = false;
7187: while (true) {
7188:
7189: yyC = character(yyRepetition1);
7190: if (-1 != yyC) {
7191: yyIndex = yyRepetition1 + 1;
7192:
7193: switch (yyC) {
7194: case '0':
7195: case '1':
7196: case '2':
7197: case '3':
7198: case '4':
7199: case '5':
7200: case '6':
7201: case '7':
7202: case '8':
7203: case '9': {
7204: yyRepetition1 = yyIndex;
7205: yyRepeated1 = true;
7206: continue;
7207: }
7208:
7209: default:
7210: /* No match. */
7211: }
7212: }
7213: break;
7214: }
7215:
7216: if (yyRepeated1) {
7217:
7218: yyOption1 = yyRepetition1;
7219:
7220: yyResult = pExponent(yyOption1);
7221: yyError = yyResult.select(yyError);
7222: if (yyResult.hasValue()) {
7223:
7224: yyOption1 = yyResult.index;
7225: }
7226:
7227: yyC = character(yyOption1);
7228: if (-1 != yyC) {
7229: yyIndex = yyOption1 + 1;
7230:
7231: switch (yyC) {
7232: case 'D':
7233: case 'F':
7234: case 'd':
7235: case 'f': {
7236: yyOption1 = yyIndex;
7237: }
7238:
7239: default:
7240: /* No match. */
7241: }
7242: }
7243:
7244: yyValue = difference(yyStart, yyOption1);
7245:
7246: return new SemanticValue(yyValue, yyOption1, yyError);
7247: }
7248: }
7249:
7250: // Alternative 3.
7251:
7252: yyRepetition1 = yyStart;
7253: yyRepeated1 = false;
7254: while (true) {
7255:
7256: yyC = character(yyRepetition1);
7257: if (-1 != yyC) {
7258: yyIndex = yyRepetition1 + 1;
7259:
7260: switch (yyC) {
7261: case '0':
7262: case '1':
7263: case '2':
7264: case '3':
7265: case '4':
7266: case '5':
7267: case '6':
7268: case '7':
7269: case '8':
7270: case '9': {
7271: yyRepetition1 = yyIndex;
7272: yyRepeated1 = true;
7273: continue;
7274: }
7275:
7276: default:
7277: /* No match. */
7278: }
7279: }
7280: break;
7281: }
7282:
7283: if (yyRepeated1) {
7284:
7285: final int yyChoice1 = yyRepetition1;
7286:
7287: // Nested alternative 1.
7288:
7289: yyResult = pExponent(yyChoice1);
7290: yyError = yyResult.select(yyError);
7291: if (yyResult.hasValue()) {
7292:
7293: yyOption1 = yyResult.index;
7294:
7295: yyC = character(yyOption1);
7296: if (-1 != yyC) {
7297: yyIndex = yyOption1 + 1;
7298:
7299: switch (yyC) {
7300: case 'D':
7301: case 'F':
7302: case 'd':
7303: case 'f': {
7304: yyOption1 = yyIndex;
7305: }
7306:
7307: default:
7308: /* No match. */
7309: }
7310: }
7311:
7312: yyValue = difference(yyStart, yyOption1);
7313:
7314: return new SemanticValue(yyValue, yyOption1, yyError);
7315: }
7316:
7317: // Nested alternative 2.
7318:
7319: yyOption1 = yyChoice1;
7320:
7321: yyResult = pExponent(yyOption1);
7322: yyError = yyResult.select(yyError);
7323: if (yyResult.hasValue()) {
7324:
7325: yyOption1 = yyResult.index;
7326: }
7327:
7328: yyC = character(yyOption1);
7329: if (-1 != yyC) {
7330: yyIndex = yyOption1 + 1;
7331:
7332: switch (yyC) {
7333: case 'D':
7334: case 'F':
7335: case 'd':
7336: case 'f': {
7337: yyValue = difference(yyStart, yyIndex);
7338:
7339: return new SemanticValue(yyValue, yyIndex, yyError);
7340: }
7341:
7342: default:
7343: /* No match. */
7344: }
7345: }
7346: }
7347:
7348: // Done.
7349: yyError = yyError.select("floating point string expected",
7350: yyStart);
7351: return yyError;
7352: }
7353:
7354: // =========================================================================
7355:
7356: /**
7357: * Parse nonterminal xtc.lang.JavaConstant.Exponent.
7358: *
7359: * @param yyStart The index.
7360: * @return The result.
7361: * @throws IOException Signals an I/O error.
7362: */
7363: private Result pExponent(final int yyStart) throws IOException {
7364: int yyC;
7365: int yyIndex;
7366: int yyRepetition1;
7367: boolean yyRepeated1;
7368: int yyOption1;
7369: Void yyValue;
7370: ParseError yyError = ParseError.DUMMY;
7371:
7372: // Alternative 1.
7373:
7374: yyC = character(yyStart);
7375: if (-1 != yyC) {
7376: yyIndex = yyStart + 1;
7377:
7378: switch (yyC) {
7379: case 'E':
7380: case 'e': {
7381: yyOption1 = yyIndex;
7382:
7383: yyC = character(yyOption1);
7384: if (-1 != yyC) {
7385: yyIndex = yyOption1 + 1;
7386:
7387: switch (yyC) {
7388: case '+':
7389: case '-': {
7390: yyOption1 = yyIndex;
7391: }
7392:
7393: default:
7394: /* No match. */
7395: }
7396: }
7397:
7398: yyRepetition1 = yyOption1;
7399: yyRepeated1 = false;
7400: while (true) {
7401:
7402: yyC = character(yyRepetition1);
7403: if (-1 != yyC) {
7404: yyIndex = yyRepetition1 + 1;
7405:
7406: switch (yyC) {
7407: case '0':
7408: case '1':
7409: case '2':
7410: case '3':
7411: case '4':
7412: case '5':
7413: case '6':
7414: case '7':
7415: case '8':
7416: case '9': {
7417: yyRepetition1 = yyIndex;
7418: yyRepeated1 = true;
7419: continue;
7420: }
7421:
7422: default:
7423: /* No match. */
7424: }
7425: }
7426: break;
7427: }
7428:
7429: if (yyRepeated1) {
7430:
7431: yyValue = null;
7432:
7433: return new SemanticValue(yyValue, yyRepetition1,
7434: yyError);
7435: }
7436: }
7437: break;
7438:
7439: default:
7440: /* No match. */
7441: }
7442: }
7443:
7444: // Done.
7445: yyError = yyError.select("exponent expected", yyStart);
7446: return yyError;
7447: }
7448:
7449: // =========================================================================
7450:
7451: /**
7452: * Parse nonterminal xtc.lang.JavaConstant.CharacterLiteral.
7453: *
7454: * @param yyStart The index.
7455: * @return The result.
7456: * @throws IOException Signals an I/O error.
7457: */
7458: private Result pCharacterLiteral(final int yyStart)
7459: throws IOException {
7460: Result yyResult;
7461: Node yyValue;
7462: ParseError yyError = ParseError.DUMMY;
7463:
7464: // Alternative 1.
7465:
7466: yyResult = pCharacterConstant(yyStart);
7467: yyError = yyResult.select(yyError);
7468: if (yyResult.hasValue()) {
7469: final String v$g$1 = yyResult.semanticValue();
7470:
7471: yyValue = GNode.create("CharacterLiteral", v$g$1);
7472: yyValue.setLocation(location(yyStart));
7473:
7474: return yyResult.createValue(yyValue, yyError);
7475: }
7476:
7477: // Done.
7478: return yyError;
7479: }
7480:
7481: // =========================================================================
7482:
7483: /**
7484: * Parse nonterminal xtc.lang.JavaConstant.StringLiteral.
7485: *
7486: * @param yyStart The index.
7487: * @return The result.
7488: * @throws IOException Signals an I/O error.
7489: */
7490: private Result pStringLiteral(final int yyStart) throws IOException {
7491: Result yyResult;
7492: Node yyValue;
7493: ParseError yyError = ParseError.DUMMY;
7494:
7495: // Alternative 1.
7496:
7497: yyResult = pStringConstant(yyStart);
7498: yyError = yyResult.select(yyError);
7499: if (yyResult.hasValue()) {
7500: final String v$g$1 = yyResult.semanticValue();
7501:
7502: yyValue = GNode.create("StringLiteral", v$g$1);
7503: yyValue.setLocation(location(yyStart));
7504:
7505: return yyResult.createValue(yyValue, yyError);
7506: }
7507:
7508: // Done.
7509: return yyError;
7510: }
7511:
7512: // =========================================================================
7513:
7514: /**
7515: * Parse nonterminal xtc.lang.JavaConstant.CharacterConstant.
7516: *
7517: * @param yyStart The index.
7518: * @return The result.
7519: * @throws IOException Signals an I/O error.
7520: */
7521: private Result pCharacterConstant(final int yyStart)
7522: throws IOException {
7523: int yyC;
7524: int yyIndex;
7525: Result yyResult;
7526: String yyValue;
7527: ParseError yyError = ParseError.DUMMY;
7528:
7529: // Alternative 1.
7530:
7531: yyC = character(yyStart);
7532: if ('\'' == yyC) {
7533: yyIndex = yyStart + 1;
7534:
7535: yyResult = pCharacterConstant$$Choice1(yyIndex);
7536: yyError = yyResult.select(yyError);
7537: if (yyResult.hasValue()) {
7538:
7539: yyC = character(yyResult.index);
7540: if ('\'' == yyC) {
7541: yyIndex = yyResult.index + 1;
7542:
7543: yyValue = difference(yyStart, yyIndex);
7544:
7545: return new SemanticValue(yyValue, yyIndex, yyError);
7546: }
7547: }
7548: }
7549:
7550: // Done.
7551: yyError = yyError
7552: .select("character constant expected", yyStart);
7553: return yyError;
7554: }
7555:
7556: // =========================================================================
7557:
7558: /**
7559: * Parse synthetic nonterminal xtc.lang.Java.CharacterConstant$$Choice1.
7560: *
7561: * @param yyStart The index.
7562: * @return The result.
7563: * @throws IOException Signals an I/O error.
7564: */
7565: private Result pCharacterConstant$$Choice1(final int yyStart)
7566: throws IOException {
7567:
7568: int yyC;
7569: int yyIndex;
7570: Void yyValue;
7571: ParseError yyError = ParseError.DUMMY;
7572:
7573: // Alternative 1.
7574:
7575: yyC = character(yyStart);
7576: if (-1 != yyC) {
7577: yyIndex = yyStart + 1;
7578:
7579: switch (yyC) {
7580: case '\\': {
7581: final int yyChoice1 = yyIndex;
7582:
7583: // Nested alternative 1.
7584:
7585: yyC = character(yyChoice1);
7586: if (-1 != yyC) {
7587: yyIndex = yyChoice1 + 1;
7588:
7589: switch (yyC) {
7590: case '\"':
7591: case '\'':
7592: case '\\':
7593: case 'b':
7594: case 'f':
7595: case 'n':
7596: case 'r':
7597: case 't': {
7598: yyValue = null;
7599:
7600: return new SemanticValue(yyValue, yyIndex,
7601: yyError);
7602: }
7603:
7604: case 'u': {
7605: yyC = character(yyIndex);
7606: if (-1 != yyC) {
7607: yyIndex = yyIndex + 1;
7608:
7609: switch (yyC) {
7610: case '0':
7611: case '1':
7612: case '2':
7613: case '3':
7614: case '4':
7615: case '5':
7616: case '6':
7617: case '7':
7618: case '8':
7619: case '9':
7620: case 'A':
7621: case 'B':
7622: case 'C':
7623: case 'D':
7624: case 'E':
7625: case 'F':
7626: case 'a':
7627: case 'b':
7628: case 'c':
7629: case 'd':
7630: case 'e':
7631: case 'f': {
7632: yyC = character(yyIndex);
7633: if (-1 != yyC) {
7634: yyIndex = yyIndex + 1;
7635:
7636: switch (yyC) {
7637: case '0':
7638: case '1':
7639: case '2':
7640: case '3':
7641: case '4':
7642: case '5':
7643: case '6':
7644: case '7':
7645: case '8':
7646: case '9':
7647: case 'A':
7648: case 'B':
7649: case 'C':
7650: case 'D':
7651: case 'E':
7652: case 'F':
7653: case 'a':
7654: case 'b':
7655: case 'c':
7656: case 'd':
7657: case 'e':
7658: case 'f': {
7659: yyC = character(yyIndex);
7660: if (-1 != yyC) {
7661: yyIndex = yyIndex + 1;
7662:
7663: switch (yyC) {
7664: case '0':
7665: case '1':
7666: case '2':
7667: case '3':
7668: case '4':
7669: case '5':
7670: case '6':
7671: case '7':
7672: case '8':
7673: case '9':
7674: case 'A':
7675: case 'B':
7676: case 'C':
7677: case 'D':
7678: case 'E':
7679: case 'F':
7680: case 'a':
7681: case 'b':
7682: case 'c':
7683: case 'd':
7684: case 'e':
7685: case 'f': {
7686: yyC = character(yyIndex);
7687: if (-1 != yyC) {
7688: yyIndex = yyIndex + 1;
7689:
7690: switch (yyC) {
7691: case '0':
7692: case '1':
7693: case '2':
7694: case '3':
7695: case '4':
7696: case '5':
7697: case '6':
7698: case '7':
7699: case '8':
7700: case '9':
7701: case 'A':
7702: case 'B':
7703: case 'C':
7704: case 'D':
7705: case 'E':
7706: case 'F':
7707: case 'a':
7708: case 'b':
7709: case 'c':
7710: case 'd':
7711: case 'e':
7712: case 'f': {
7713: yyValue = null;
7714:
7715: return new SemanticValue(
7716: yyValue,
7717: yyIndex,
7718: yyError);
7719: }
7720:
7721: default:
7722: /* No match. */
7723: }
7724: }
7725: }
7726: break;
7727:
7728: default:
7729: /* No match. */
7730: }
7731: }
7732: }
7733: break;
7734:
7735: default:
7736: /* No match. */
7737: }
7738: }
7739: }
7740: break;
7741:
7742: default:
7743: /* No match. */
7744: }
7745: }
7746: }
7747: break;
7748:
7749: default:
7750: /* No match. */
7751: }
7752: }
7753:
7754: // Nested alternative 2.
7755: { // Start scope for nested choice.
7756:
7757: final int yyChoice2 = yyChoice1;
7758:
7759: // Nested alternative 1.
7760:
7761: yyC = character(yyChoice2);
7762: if (-1 != yyC) {
7763: yyIndex = yyChoice2 + 1;
7764:
7765: switch (yyC) {
7766: case '0':
7767: case '1':
7768: case '2':
7769: case '3': {
7770: yyC = character(yyIndex);
7771: if (-1 != yyC) {
7772: yyIndex = yyIndex + 1;
7773:
7774: switch (yyC) {
7775: case '0':
7776: case '1':
7777: case '2':
7778: case '3':
7779: case '4':
7780: case '5':
7781: case '6':
7782: case '7': {
7783: yyC = character(yyIndex);
7784: if (-1 != yyC) {
7785: yyIndex = yyIndex + 1;
7786:
7787: switch (yyC) {
7788: case '0':
7789: case '1':
7790: case '2':
7791: case '3':
7792: case '4':
7793: case '5':
7794: case '6':
7795: case '7': {
7796: yyValue = null;
7797:
7798: return new SemanticValue(
7799: yyValue, yyIndex,
7800: yyError);
7801: }
7802:
7803: default:
7804: /* No match. */
7805: }
7806: }
7807: }
7808: break;
7809:
7810: default:
7811: /* No match. */
7812: }
7813: }
7814: }
7815: break;
7816:
7817: default:
7818: /* No match. */
7819: }
7820: }
7821:
7822: // Nested alternative 2.
7823:
7824: yyC = character(yyChoice2);
7825: if (-1 != yyC) {
7826: yyIndex = yyChoice2 + 1;
7827:
7828: switch (yyC) {
7829: case '0':
7830: case '1':
7831: case '2':
7832: case '3':
7833: case '4':
7834: case '5':
7835: case '6':
7836: case '7': {
7837: final int yyChoice3 = yyIndex;
7838:
7839: // Nested alternative 1.
7840:
7841: yyC = character(yyChoice3);
7842: if (-1 != yyC) {
7843: yyIndex = yyChoice3 + 1;
7844:
7845: switch (yyC) {
7846: case '0':
7847: case '1':
7848: case '2':
7849: case '3':
7850: case '4':
7851: case '5':
7852: case '6':
7853: case '7': {
7854: yyValue = null;
7855:
7856: return new SemanticValue(yyValue,
7857: yyIndex, yyError);
7858: }
7859:
7860: default:
7861: /* No match. */
7862: }
7863: }
7864:
7865: // Nested alternative 2.
7866:
7867: yyValue = null;
7868:
7869: return new SemanticValue(yyValue,
7870: yyChoice3, yyError);
7871: }
7872:
7873: default:
7874: /* No match. */
7875: }
7876: }
7877: } // End scope for nested choice.
7878: }
7879: break;
7880:
7881: default:
7882: /* No match. */
7883: }
7884: }
7885:
7886: // Alternative 2.
7887:
7888: yyC = character(yyStart);
7889: if (-1 != yyC) {
7890: yyIndex = yyStart + 1;
7891:
7892: switch (yyC) {
7893: case '\'':
7894: case '\\':
7895: /* No match. */
7896: break;
7897:
7898: default: {
7899: yyValue = null;
7900:
7901: return new SemanticValue(yyValue, yyIndex, yyError);
7902: }
7903: }
7904: }
7905:
7906: // Done.
7907: yyError = yyError
7908: .select("character constant expected", yyStart);
7909: return yyError;
7910: }
7911:
7912: // =========================================================================
7913:
7914: /**
7915: * Parse nonterminal xtc.lang.JavaConstant.StringConstant.
7916: *
7917: * @param yyStart The index.
7918: * @return The result.
7919: * @throws IOException Signals an I/O error.
7920: */
7921: private Result pStringConstant(final int yyStart)
7922: throws IOException {
7923: int yyC;
7924: int yyIndex;
7925: int yyRepetition1;
7926: String yyValue;
7927: ParseError yyError = ParseError.DUMMY;
7928:
7929: // Alternative 1.
7930:
7931: yyC = character(yyStart);
7932: if ('\"' == yyC) {
7933: yyIndex = yyStart + 1;
7934:
7935: yyRepetition1 = yyIndex;
7936: while (true) {
7937:
7938: final int yyChoice1 = yyRepetition1;
7939:
7940: // Nested alternative 1.
7941:
7942: yyC = character(yyChoice1);
7943: if (-1 != yyC) {
7944: yyIndex = yyChoice1 + 1;
7945:
7946: switch (yyC) {
7947: case '\\': {
7948: final int yyChoice2 = yyIndex;
7949:
7950: // Nested alternative 1.
7951:
7952: yyC = character(yyChoice2);
7953: if (-1 != yyC) {
7954: yyIndex = yyChoice2 + 1;
7955:
7956: switch (yyC) {
7957: case '\"':
7958: case '\'':
7959: case '\\':
7960: case 'b':
7961: case 'f':
7962: case 'n':
7963: case 'r':
7964: case 't': {
7965: yyRepetition1 = yyIndex;
7966: continue;
7967: }
7968:
7969: case 'u': {
7970: yyC = character(yyIndex);
7971: if (-1 != yyC) {
7972: yyIndex = yyIndex + 1;
7973:
7974: switch (yyC) {
7975: case '0':
7976: case '1':
7977: case '2':
7978: case '3':
7979: case '4':
7980: case '5':
7981: case '6':
7982: case '7':
7983: case '8':
7984: case '9':
7985: case 'A':
7986: case 'B':
7987: case 'C':
7988: case 'D':
7989: case 'E':
7990: case 'F':
7991: case 'a':
7992: case 'b':
7993: case 'c':
7994: case 'd':
7995: case 'e':
7996: case 'f': {
7997: yyC = character(yyIndex);
7998: if (-1 != yyC) {
7999: yyIndex = yyIndex + 1;
8000:
8001: switch (yyC) {
8002: case '0':
8003: case '1':
8004: case '2':
8005: case '3':
8006: case '4':
8007: case '5':
8008: case '6':
8009: case '7':
8010: case '8':
8011: case '9':
8012: case 'A':
8013: case 'B':
8014: case 'C':
8015: case 'D':
8016: case 'E':
8017: case 'F':
8018: case 'a':
8019: case 'b':
8020: case 'c':
8021: case 'd':
8022: case 'e':
8023: case 'f': {
8024: yyC = character(yyIndex);
8025: if (-1 != yyC) {
8026: yyIndex = yyIndex + 1;
8027:
8028: switch (yyC) {
8029: case '0':
8030: case '1':
8031: case '2':
8032: case '3':
8033: case '4':
8034: case '5':
8035: case '6':
8036: case '7':
8037: case '8':
8038: case '9':
8039: case 'A':
8040: case 'B':
8041: case 'C':
8042: case 'D':
8043: case 'E':
8044: case 'F':
8045: case 'a':
8046: case 'b':
8047: case 'c':
8048: case 'd':
8049: case 'e':
8050: case 'f': {
8051: yyC = character(yyIndex);
8052: if (-1 != yyC) {
8053: yyIndex = yyIndex + 1;
8054:
8055: switch (yyC) {
8056: case '0':
8057: case '1':
8058: case '2':
8059: case '3':
8060: case '4':
8061: case '5':
8062: case '6':
8063: case '7':
8064: case '8':
8065: case '9':
8066: case 'A':
8067: case 'B':
8068: case 'C':
8069: case 'D':
8070: case 'E':
8071: case 'F':
8072: case 'a':
8073: case 'b':
8074: case 'c':
8075: case 'd':
8076: case 'e':
8077: case 'f': {
8078: yyRepetition1 = yyIndex;
8079: continue;
8080: }
8081:
8082: default:
8083: /* No match. */
8084: }
8085: }
8086: }
8087: break;
8088:
8089: default:
8090: /* No match. */
8091: }
8092: }
8093: }
8094: break;
8095:
8096: default:
8097: /* No match. */
8098: }
8099: }
8100: }
8101: break;
8102:
8103: default:
8104: /* No match. */
8105: }
8106: }
8107: }
8108: break;
8109:
8110: default:
8111: /* No match. */
8112: }
8113: }
8114:
8115: // Nested alternative 2.
8116: { // Start scope for nested choice.
8117:
8118: final int yyChoice3 = yyChoice2;
8119:
8120: // Nested alternative 1.
8121:
8122: yyC = character(yyChoice3);
8123: if (-1 != yyC) {
8124: yyIndex = yyChoice3 + 1;
8125:
8126: switch (yyC) {
8127: case '0':
8128: case '1':
8129: case '2':
8130: case '3': {
8131: yyC = character(yyIndex);
8132: if (-1 != yyC) {
8133: yyIndex = yyIndex + 1;
8134:
8135: switch (yyC) {
8136: case '0':
8137: case '1':
8138: case '2':
8139: case '3':
8140: case '4':
8141: case '5':
8142: case '6':
8143: case '7': {
8144: yyC = character(yyIndex);
8145: if (-1 != yyC) {
8146: yyIndex = yyIndex + 1;
8147:
8148: switch (yyC) {
8149: case '0':
8150: case '1':
8151: case '2':
8152: case '3':
8153: case '4':
8154: case '5':
8155: case '6':
8156: case '7': {
8157: yyRepetition1 = yyIndex;
8158: continue;
8159: }
8160:
8161: default:
8162: /* No match. */
8163: }
8164: }
8165: }
8166: break;
8167:
8168: default:
8169: /* No match. */
8170: }
8171: }
8172: }
8173: break;
8174:
8175: default:
8176: /* No match. */
8177: }
8178: }
8179:
8180: // Nested alternative 2.
8181:
8182: yyC = character(yyChoice3);
8183: if (-1 != yyC) {
8184: yyIndex = yyChoice3 + 1;
8185:
8186: switch (yyC) {
8187: case '0':
8188: case '1':
8189: case '2':
8190: case '3':
8191: case '4':
8192: case '5':
8193: case '6':
8194: case '7': {
8195: final int yyChoice4 = yyIndex;
8196:
8197: // Nested alternative 1.
8198:
8199: yyC = character(yyChoice4);
8200: if (-1 != yyC) {
8201: yyIndex = yyChoice4 + 1;
8202:
8203: switch (yyC) {
8204: case '0':
8205: case '1':
8206: case '2':
8207: case '3':
8208: case '4':
8209: case '5':
8210: case '6':
8211: case '7': {
8212: yyRepetition1 = yyIndex;
8213: continue;
8214: }
8215:
8216: default:
8217: /* No match. */
8218: }
8219: }
8220:
8221: // Nested alternative 2.
8222:
8223: yyRepetition1 = yyChoice4;
8224: continue;
8225: }
8226:
8227: default:
8228: /* No match. */
8229: }
8230: }
8231: } // End scope for nested choice.
8232: }
8233: break;
8234:
8235: default:
8236: /* No match. */
8237: }
8238: }
8239:
8240: // Nested alternative 2.
8241:
8242: yyC = character(yyChoice1);
8243: if (-1 != yyC) {
8244: yyIndex = yyChoice1 + 1;
8245:
8246: switch (yyC) {
8247: case '\"':
8248: case '\\':
8249: /* No match. */
8250: break;
8251:
8252: default: {
8253: yyRepetition1 = yyIndex;
8254: continue;
8255: }
8256: }
8257: }
8258: break;
8259: }
8260:
8261: yyC = character(yyRepetition1);
8262: if ('\"' == yyC) {
8263: yyIndex = yyRepetition1 + 1;
8264:
8265: yyValue = difference(yyStart, yyIndex);
8266:
8267: return new SemanticValue(yyValue, yyIndex, yyError);
8268: }
8269: }
8270:
8271: // Done.
8272: yyError = yyError.select("string constant expected", yyStart);
8273: return yyError;
8274: }
8275:
8276: // =========================================================================
8277:
8278: /**
8279: * Parse nonterminal xtc.lang.JavaIdentifier.QualifiedIdentifier.
8280: *
8281: * @param yyStart The index.
8282: * @return The result.
8283: * @throws IOException Signals an I/O error.
8284: */
8285: private Result pQualifiedIdentifier(final int yyStart)
8286: throws IOException {
8287: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
8288: if (null == yyColumn.chunk3)
8289: yyColumn.chunk3 = new Chunk3();
8290: if (null == yyColumn.chunk3.fQualifiedIdentifier)
8291: yyColumn.chunk3.fQualifiedIdentifier = pQualifiedIdentifier$1(yyStart);
8292: return yyColumn.chunk3.fQualifiedIdentifier;
8293: }
8294:
8295: /** Actually parse xtc.lang.JavaIdentifier.QualifiedIdentifier. */
8296: private Result pQualifiedIdentifier$1(final int yyStart)
8297: throws IOException {
8298:
8299: Result yyResult;
8300: Node yyValue;
8301: ParseError yyError = ParseError.DUMMY;
8302:
8303: // Alternative 1.
8304:
8305: yyResult = pIdentifier(yyStart);
8306: yyError = yyResult.select(yyError);
8307: if (yyResult.hasValue()) {
8308: final String v$g$1 = yyResult.semanticValue();
8309:
8310: yyResult = pQualifiedIdentifier$$Star1(yyResult.index);
8311: yyError = yyResult.select(yyError);
8312: if (yyResult.hasValue()) {
8313: final Pair<String> v$g$2 = yyResult.semanticValue();
8314:
8315: yyValue = GNode.createFromPair("QualifiedIdentifier",
8316: v$g$1, v$g$2);
8317: yyValue.setLocation(location(yyStart));
8318:
8319: return yyResult.createValue(yyValue, yyError);
8320: }
8321: }
8322:
8323: // Done.
8324: return yyError;
8325: }
8326:
8327: // =========================================================================
8328:
8329: /**
8330: * Parse synthetic nonterminal xtc.lang.Java.QualifiedIdentifier$$Star1.
8331: *
8332: * @param yyStart The index.
8333: * @return The result.
8334: * @throws IOException Signals an I/O error.
8335: */
8336: private Result pQualifiedIdentifier$$Star1(final int yyStart)
8337: throws IOException {
8338:
8339: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
8340: if (null == yyColumn.chunk3)
8341: yyColumn.chunk3 = new Chunk3();
8342: if (null == yyColumn.chunk3.fQualifiedIdentifier$$Star1)
8343: yyColumn.chunk3.fQualifiedIdentifier$$Star1 = pQualifiedIdentifier$$Star1$1(yyStart);
8344: return yyColumn.chunk3.fQualifiedIdentifier$$Star1;
8345: }
8346:
8347: /** Actually parse xtc.lang.Java.QualifiedIdentifier$$Star1. */
8348: private Result pQualifiedIdentifier$$Star1$1(final int yyStart)
8349: throws IOException {
8350:
8351: Result yyResult;
8352: Pair<String> yyValue;
8353: ParseError yyError = ParseError.DUMMY;
8354:
8355: // Alternative 1.
8356:
8357: yyResult = pSymbol(yyStart);
8358: yyError = yyResult.select(yyError);
8359: if (yyResult.hasValue(".")) {
8360:
8361: yyResult = pIdentifier(yyResult.index);
8362: yyError = yyResult.select(yyError);
8363: if (yyResult.hasValue()) {
8364: final String v$el$1 = yyResult.semanticValue();
8365:
8366: yyResult = pQualifiedIdentifier$$Star1(yyResult.index);
8367: yyError = yyResult.select(yyError);
8368: if (yyResult.hasValue()) {
8369: final Pair<String> v$2 = yyResult.semanticValue();
8370:
8371: yyValue = new Pair<String>(v$el$1, v$2);
8372:
8373: return yyResult.createValue(yyValue, yyError);
8374: }
8375: }
8376: }
8377:
8378: // Alternative 2.
8379:
8380: yyValue = Pair.empty();
8381:
8382: return new SemanticValue(yyValue, yyStart, yyError);
8383: }
8384:
8385: // =========================================================================
8386:
8387: /**
8388: * Parse nonterminal xtc.lang.JavaIdentifier.Identifier.
8389: *
8390: * @param yyStart The index.
8391: * @return The result.
8392: * @throws IOException Signals an I/O error.
8393: */
8394: private Result pIdentifier(final int yyStart) throws IOException {
8395: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
8396: if (null == yyColumn.chunk3)
8397: yyColumn.chunk3 = new Chunk3();
8398: if (null == yyColumn.chunk3.fIdentifier)
8399: yyColumn.chunk3.fIdentifier = pIdentifier$1(yyStart);
8400: return yyColumn.chunk3.fIdentifier;
8401: }
8402:
8403: /** Actually parse xtc.lang.JavaIdentifier.Identifier. */
8404: private Result pIdentifier$1(final int yyStart) throws IOException {
8405: Result yyResult;
8406: String yyValue;
8407: ParseError yyError = ParseError.DUMMY;
8408:
8409: // Alternative 1.
8410:
8411: yyResult = pWord(yyStart);
8412: yyError = yyResult.select(yyError);
8413: if (yyResult.hasValue()) {
8414: yyValue = yyResult.semanticValue();
8415:
8416: if (!contains(JAVA_KEYWORDS, toText(yyValue))) {
8417:
8418: return yyResult.createValue(yyValue, yyError);
8419: }
8420: }
8421:
8422: // Done.
8423: yyError = yyError.select("identifier expected", yyStart);
8424: return yyError;
8425: }
8426:
8427: // =========================================================================
8428:
8429: /**
8430: * Parse nonterminal xtc.lang.JavaIdentifier.Word.
8431: *
8432: * @param yyStart The index.
8433: * @return The result.
8434: * @throws IOException Signals an I/O error.
8435: */
8436: private Result pWord(final int yyStart) throws IOException {
8437: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
8438: if (null == yyColumn.chunk3)
8439: yyColumn.chunk3 = new Chunk3();
8440: if (null == yyColumn.chunk3.fWord)
8441: yyColumn.chunk3.fWord = pWord$1(yyStart);
8442: return yyColumn.chunk3.fWord;
8443: }
8444:
8445: /** Actually parse xtc.lang.JavaIdentifier.Word. */
8446: private Result pWord$1(final int yyStart) throws IOException {
8447: Result yyResult;
8448: String yyValue;
8449: ParseError yyError = ParseError.DUMMY;
8450:
8451: // Alternative 1.
8452:
8453: yyResult = pWordCharacters(yyStart);
8454: yyError = yyResult.select(yyError);
8455: if (yyResult.hasValue()) {
8456: yyValue = yyResult.semanticValue();
8457:
8458: yyResult = pSpacing(yyResult.index);
8459: yyError = yyResult.select(yyError);
8460: if (yyResult.hasValue()) {
8461:
8462: return yyResult.createValue(yyValue, yyError);
8463: }
8464: }
8465:
8466: // Done.
8467: return yyError;
8468: }
8469:
8470: // =========================================================================
8471:
8472: /**
8473: * Parse nonterminal xtc.lang.JavaIdentifier.WordCharacters.
8474: *
8475: * @param yyStart The index.
8476: * @return The result.
8477: * @throws IOException Signals an I/O error.
8478: */
8479: private Result pWordCharacters(final int yyStart)
8480: throws IOException {
8481: int yyC;
8482: int yyIndex;
8483: int yyRepetition1;
8484: String yyValue;
8485: ParseError yyError = ParseError.DUMMY;
8486:
8487: // Alternative 1.
8488:
8489: yyC = character(yyStart);
8490: if (-1 != yyC) {
8491: yyIndex = yyStart + 1;
8492: final char start = (char) yyC;
8493:
8494: if (Character.isJavaIdentifierStart(start)) {
8495:
8496: yyRepetition1 = yyIndex;
8497: while (true) {
8498:
8499: yyC = character(yyRepetition1);
8500: if (-1 != yyC) {
8501: yyIndex = yyRepetition1 + 1;
8502: final char part = (char) yyC;
8503:
8504: if (Character.isJavaIdentifierPart(part)) {
8505:
8506: yyRepetition1 = yyIndex;
8507: continue;
8508: }
8509: }
8510: break;
8511: }
8512:
8513: yyValue = difference(yyStart, yyRepetition1);
8514:
8515: return new SemanticValue(yyValue, yyRepetition1,
8516: yyError);
8517: }
8518: }
8519:
8520: // Done.
8521: yyError = yyError.select("word characters expected", yyStart);
8522: return yyError;
8523: }
8524:
8525: // =========================================================================
8526:
8527: /**
8528: * Parse nonterminal xtc.lang.JavaSymbol.Symbol.
8529: *
8530: * @param yyStart The index.
8531: * @return The result.
8532: * @throws IOException Signals an I/O error.
8533: */
8534: private Result pSymbol(final int yyStart) throws IOException {
8535: JavaParserColumn yyColumn = (JavaParserColumn) column(yyStart);
8536: if (null == yyColumn.chunk3)
8537: yyColumn.chunk3 = new Chunk3();
8538: if (null == yyColumn.chunk3.fSymbol)
8539: yyColumn.chunk3.fSymbol = pSymbol$1(yyStart);
8540: return yyColumn.chunk3.fSymbol;
8541: }
8542:
8543: /** Actually parse xtc.lang.JavaSymbol.Symbol. */
8544: private Result pSymbol$1(final int yyStart) throws IOException {
8545: Result yyResult;
8546: String yyValue;
8547: ParseError yyError = ParseError.DUMMY;
8548:
8549: // Alternative 1.
8550:
8551: yyResult = pSymbolCharacters(yyStart);
8552: yyError = yyResult.select(yyError);
8553: if (yyResult.hasValue()) {
8554: yyValue = yyResult.semanticValue();
8555:
8556: yyResult = pSpacing(yyResult.index);
8557: yyError = yyResult.select(yyError);
8558: if (yyResult.hasValue()) {
8559:
8560: return yyResult.createValue(yyValue, yyError);
8561: }
8562: }
8563:
8564: // Done.
8565: return yyError;
8566: }
8567:
8568: // =========================================================================
8569:
8570: /**
8571: * Parse nonterminal xtc.lang.JavaSymbol.SymbolCharacters.
8572: *
8573: * @param yyStart The index.
8574: * @return The result.
8575: * @throws IOException Signals an I/O error.
8576: */
8577: private Result pSymbolCharacters(final int yyStart)
8578: throws IOException {
8579: int yyC;
8580: int yyIndex;
8581: String yyValue;
8582: ParseError yyError = ParseError.DUMMY;
8583:
8584: // Alternative 1.
8585:
8586: yyC = character(yyStart);
8587: if (-1 != yyC) {
8588: yyIndex = yyStart + 1;
8589:
8590: switch (yyC) {
8591: case '>': {
8592: final int yyChoice1 = yyIndex;
8593:
8594: // Nested alternative 1.
8595:
8596: yyC = character(yyChoice1);
8597: if (-1 != yyC) {
8598: yyIndex = yyChoice1 + 1;
8599:
8600: switch (yyC) {
8601: case '>': {
8602: final int yyChoice2 = yyIndex;
8603:
8604: // Nested alternative 1.
8605:
8606: yyC = character(yyChoice2);
8607: if (-1 != yyC) {
8608: yyIndex = yyChoice2 + 1;
8609:
8610: switch (yyC) {
8611: case '>': {
8612: final int yyChoice3 = yyIndex;
8613:
8614: // Nested alternative 1.
8615:
8616: yyC = character(yyChoice3);
8617: if (-1 != yyC) {
8618: yyIndex = yyChoice3 + 1;
8619: if ('=' == yyC) {
8620:
8621: yyValue = ">>>=";
8622:
8623: return new SemanticValue(
8624: yyValue, yyIndex,
8625: yyError);
8626: }
8627: }
8628:
8629: // Nested alternative 2.
8630:
8631: yyValue = ">>>";
8632:
8633: return new SemanticValue(yyValue,
8634: yyChoice3, yyError);
8635: }
8636:
8637: case '=': {
8638: yyValue = ">>=";
8639:
8640: return new SemanticValue(yyValue,
8641: yyIndex, yyError);
8642: }
8643:
8644: default:
8645: /* No match. */
8646: }
8647: }
8648:
8649: // Nested alternative 2.
8650:
8651: yyValue = ">>";
8652:
8653: return new SemanticValue(yyValue, yyChoice2,
8654: yyError);
8655: }
8656:
8657: case '=': {
8658: yyValue = ">=";
8659:
8660: return new SemanticValue(yyValue, yyIndex,
8661: yyError);
8662: }
8663:
8664: default:
8665: /* No match. */
8666: }
8667: }
8668:
8669: // Nested alternative 2.
8670:
8671: yyValue = ">";
8672:
8673: return new SemanticValue(yyValue, yyChoice1, yyError);
8674: }
8675:
8676: case '<': {
8677: final int yyChoice1 = yyIndex;
8678:
8679: // Nested alternative 1.
8680:
8681: yyC = character(yyChoice1);
8682: if (-1 != yyC) {
8683: yyIndex = yyChoice1 + 1;
8684:
8685: switch (yyC) {
8686: case '<': {
8687: final int yyChoice2 = yyIndex;
8688:
8689: // Nested alternative 1.
8690:
8691: yyC = character(yyChoice2);
8692: if (-1 != yyC) {
8693: yyIndex = yyChoice2 + 1;
8694: if ('=' == yyC) {
8695:
8696: yyValue = "<<=";
8697:
8698: return new SemanticValue(yyValue,
8699: yyIndex, yyError);
8700: }
8701: }
8702:
8703: // Nested alternative 2.
8704:
8705: yyValue = "<<";
8706:
8707: return new SemanticValue(yyValue, yyChoice2,
8708: yyError);
8709: }
8710:
8711: case '=': {
8712: yyValue = "<=";
8713:
8714: return new SemanticValue(yyValue, yyIndex,
8715: yyError);
8716: }
8717:
8718: default:
8719: /* No match. */
8720: }
8721: }
8722:
8723: // Nested alternative 2.
8724:
8725: yyValue = "<";
8726:
8727: return new SemanticValue(yyValue, yyChoice1, yyError);
8728: }
8729:
8730: case '+': {
8731: final int yyChoice1 = yyIndex;
8732:
8733: // Nested alternative 1.
8734:
8735: yyC = character(yyChoice1);
8736: if (-1 != yyC) {
8737: yyIndex = yyChoice1 + 1;
8738:
8739: switch (yyC) {
8740: case '=': {
8741: yyValue = "+=";
8742:
8743: return new SemanticValue(yyValue, yyIndex,
8744: yyError);
8745: }
8746:
8747: case '+': {
8748: yyValue = "++";
8749:
8750: return new SemanticValue(yyValue, yyIndex,
8751: yyError);
8752: }
8753:
8754: default:
8755: /* No match. */
8756: }
8757: }
8758:
8759: // Nested alternative 2.
8760:
8761: yyValue = "+";
8762:
8763: return new SemanticValue(yyValue, yyChoice1, yyError);
8764: }
8765:
8766: case '-': {
8767: final int yyChoice1 = yyIndex;
8768:
8769: // Nested alternative 1.
8770:
8771: yyC = character(yyChoice1);
8772: if (-1 != yyC) {
8773: yyIndex = yyChoice1 + 1;
8774:
8775: switch (yyC) {
8776: case '=': {
8777: yyValue = "-=";
8778:
8779: return new SemanticValue(yyValue, yyIndex,
8780: yyError);
8781: }
8782:
8783: case '-': {
8784: yyValue = "--";
8785:
8786: return new SemanticValue(yyValue, yyIndex,
8787: yyError);
8788: }
8789:
8790: default:
8791: /* No match. */
8792: }
8793: }
8794:
8795: // Nested alternative 2.
8796:
8797: yyValue = "-";
8798:
8799: return new SemanticValue(yyValue, yyChoice1, yyError);
8800: }
8801:
8802: case '*': {
8803: final int yyChoice1 = yyIndex;
8804:
8805: // Nested alternative 1.
8806:
8807: yyC = character(yyChoice1);
8808: if (-1 != yyC) {
8809: yyIndex = yyChoice1 + 1;
8810: if ('=' == yyC) {
8811:
8812: yyValue = "*=";
8813:
8814: return new SemanticValue(yyValue, yyIndex,
8815: yyError);
8816: }
8817: }
8818:
8819: // Nested alternative 2.
8820:
8821: yyValue = "*";
8822:
8823: return new SemanticValue(yyValue, yyChoice1, yyError);
8824: }
8825:
8826: case '/': {
8827: final int yyChoice1 = yyIndex;
8828:
8829: // Nested alternative 1.
8830:
8831: yyC = character(yyChoice1);
8832: if (-1 != yyC) {
8833: yyIndex = yyChoice1 + 1;
8834: if ('=' == yyC) {
8835:
8836: yyValue = "/=";
8837:
8838: return new SemanticValue(yyValue, yyIndex,
8839: yyError);
8840: }
8841: }
8842:
8843: // Nested alternative 2.
8844:
8845: yyValue = "/";
8846:
8847: return new SemanticValue(yyValue, yyChoice1, yyError);
8848: }
8849:
8850: case '%': {
8851: final int yyChoice1 = yyIndex;
8852:
8853: // Nested alternative 1.
8854:
8855: yyC = character(yyChoice1);
8856: if (-1 != yyC) {
8857: yyIndex = yyChoice1 + 1;
8858: if ('=' == yyC) {
8859:
8860: yyValue = "%=";
8861:
8862: return new SemanticValue(yyValue, yyIndex,
8863: yyError);
8864: }
8865: }
8866:
8867: // Nested alternative 2.
8868:
8869: yyValue = "%";
8870:
8871: return new SemanticValue(yyValue, yyChoice1, yyError);
8872: }
8873:
8874: case '&': {
8875: final int yyChoice1 = yyIndex;
8876:
8877: // Nested alternative 1.
8878:
8879: yyC = character(yyChoice1);
8880: if (-1 != yyC) {
8881: yyIndex = yyChoice1 + 1;
8882:
8883: switch (yyC) {
8884: case '=': {
8885: yyValue = "&=";
8886:
8887: return new SemanticValue(yyValue, yyIndex,
8888: yyError);
8889: }
8890:
8891: case '&': {
8892: yyValue = "&&";
8893:
8894: return new SemanticValue(yyValue, yyIndex,
8895: yyError);
8896: }
8897:
8898: default:
8899: /* No match. */
8900: }
8901: }
8902:
8903: // Nested alternative 2.
8904:
8905: yyValue = "&";
8906:
8907: return new SemanticValue(yyValue, yyChoice1, yyError);
8908: }
8909:
8910: case '^': {
8911: final int yyChoice1 = yyIndex;
8912:
8913: // Nested alternative 1.
8914:
8915: yyC = character(yyChoice1);
8916: if (-1 != yyC) {
8917: yyIndex = yyChoice1 + 1;
8918: if ('=' == yyC) {
8919:
8920: yyValue = "^=";
8921:
8922: return new SemanticValue(yyValue, yyIndex,
8923: yyError);
8924: }
8925: }
8926:
8927: // Nested alternative 2.
8928:
8929: yyValue = "^";
8930:
8931: return new SemanticValue(yyValue, yyChoice1, yyError);
8932: }
8933:
8934: case '|': {
8935: final int yyChoice1 = yyIndex;
8936:
8937: // Nested alternative 1.
8938:
8939: yyC = character(yyChoice1);
8940: if (-1 != yyC) {
8941: yyIndex = yyChoice1 + 1;
8942:
8943: switch (yyC) {
8944: case '=': {
8945: yyValue = "|=";
8946:
8947: return new SemanticValue(yyValue, yyIndex,
8948: yyError);
8949: }
8950:
8951: case '|': {
8952: yyValue = "||";
8953:
8954: return new SemanticValue(yyValue, yyIndex,
8955: yyError);
8956: }
8957:
8958: default:
8959: /* No match. */
8960: }
8961: }
8962:
8963: // Nested alternative 2.
8964:
8965: yyValue = "|";
8966:
8967: return new SemanticValue(yyValue, yyChoice1, yyError);
8968: }
8969:
8970: case '=': {
8971: final int yyChoice1 = yyIndex;
8972:
8973: // Nested alternative 1.
8974:
8975: yyC = character(yyChoice1);
8976: if (-1 != yyC) {
8977: yyIndex = yyChoice1 + 1;
8978: if ('=' == yyC) {
8979:
8980: yyValue = "==";
8981:
8982: return new SemanticValue(yyValue, yyIndex,
8983: yyError);
8984: }
8985: }
8986:
8987: // Nested alternative 2.
8988:
8989: yyValue = "=";
8990:
8991: return new SemanticValue(yyValue, yyChoice1, yyError);
8992: }
8993:
8994: case '!': {
8995: final int yyChoice1 = yyIndex;
8996:
8997: // Nested alternative 1.
8998:
8999: yyC = character(yyChoice1);
9000: if (-1 != yyC) {
9001: yyIndex = yyChoice1 + 1;
9002: if ('=' == yyC) {
9003:
9004: yyValue = "!=";
9005:
9006: return new SemanticValue(yyValue, yyIndex,
9007: yyError);
9008: }
9009: }
9010:
9011: // Nested alternative 2.
9012:
9013: yyValue = "!";
9014:
9015: return new SemanticValue(yyValue, yyChoice1, yyError);
9016: }
9017:
9018: case ';': {
9019: yyValue = ";";
9020:
9021: return new SemanticValue(yyValue, yyIndex, yyError);
9022: }
9023:
9024: case ':': {
9025: yyValue = ":";
9026:
9027: return new SemanticValue(yyValue, yyIndex, yyError);
9028: }
9029:
9030: case ',': {
9031: yyValue = ",";
9032:
9033: return new SemanticValue(yyValue, yyIndex, yyError);
9034: }
9035:
9036: case '.': {
9037: yyValue = ".";
9038:
9039: return new SemanticValue(yyValue, yyIndex, yyError);
9040: }
9041:
9042: case '{': {
9043: yyValue = "{";
9044:
9045: return new SemanticValue(yyValue, yyIndex, yyError);
9046: }
9047:
9048: case '}': {
9049: yyValue = "}";
9050:
9051: return new SemanticValue(yyValue, yyIndex, yyError);
9052: }
9053:
9054: case '(': {
9055: yyValue = "(";
9056:
9057: return new SemanticValue(yyValue, yyIndex, yyError);
9058: }
9059:
9060: case ')': {
9061: yyValue = ")";
9062:
9063: return new SemanticValue(yyValue, yyIndex, yyError);
9064: }
9065:
9066: case '[': {
9067: yyValue = "[";
9068:
9069: return new SemanticValue(yyValue, yyIndex, yyError);
9070: }
9071:
9072: case ']': {
9073: yyValue = "]";
9074:
9075: return new SemanticValue(yyValue, yyIndex, yyError);
9076: }
9077:
9078: case '~': {
9079: yyValue = "~";
9080:
9081: return new SemanticValue(yyValue, yyIndex, yyError);
9082: }
9083:
9084: case '?': {
9085: yyValue = "?";
9086:
9087: return new SemanticValue(yyValue, yyIndex, yyError);
9088: }
9089:
9090: default:
9091: /* No match. */
9092: }
9093: }
9094:
9095: // Done.
9096: yyError = yyError.select("symbol characters expected", yyStart);
9097: return yyError;
9098: }
9099:
9100: // =========================================================================
9101:
9102: /**
9103: * Parse nonterminal xtc.util.Spacing.Spacing.
9104: *
9105: * @param yyStart The index.
9106: * @return The result.
9107: * @throws IOException Signals an I/O error.
9108: */
9109: private Result pSpacing(final int yyStart) throws IOException {
9110: int yyC;
9111: int yyIndex;
9112: Result yyPredResult;
9113: boolean yyPredMatched;
9114: int yyBase;
9115: int yyRepetition1;
9116: int yyRepetition2;
9117: Void yyValue;
9118: ParseError yyError = ParseError.DUMMY;
9119:
9120: // Alternative 1.
9121:
9122: yyRepetition1 = yyStart;
9123: while (true) {
9124:
9125: final int yyChoice1 = yyRepetition1;
9126:
9127: // Nested alternative 1.
9128:
9129: yyC = character(yyChoice1);
9130: if (-1 != yyC) {
9131: yyIndex = yyChoice1 + 1;
9132:
9133: switch (yyC) {
9134: case ' ': {
9135: yyRepetition1 = yyIndex;
9136: continue;
9137: }
9138:
9139: case '\t': {
9140: yyRepetition1 = yyIndex;
9141: continue;
9142: }
9143:
9144: case '\f': {
9145: yyRepetition1 = yyIndex;
9146: continue;
9147: }
9148:
9149: case '\r': {
9150: final int yyChoice2 = yyIndex;
9151:
9152: // Nested alternative 1.
9153:
9154: yyC = character(yyChoice2);
9155: if ('\n' == yyC) {
9156: yyIndex = yyChoice2 + 1;
9157:
9158: yyRepetition1 = yyIndex;
9159: continue;
9160: }
9161:
9162: // Nested alternative 2.
9163:
9164: yyRepetition1 = yyChoice2;
9165: continue;
9166: }
9167:
9168: case '\n': {
9169: yyRepetition1 = yyIndex;
9170: continue;
9171: }
9172:
9173: case '/': {
9174: yyC = character(yyIndex);
9175: if (-1 != yyC) {
9176: yyIndex = yyIndex + 1;
9177:
9178: switch (yyC) {
9179: case '*': {
9180: yyRepetition2 = yyIndex;
9181: while (true) {
9182:
9183: final int yyChoice2 = yyRepetition2;
9184:
9185: // Nested alternative 1.
9186:
9187: yyC = character(yyChoice2);
9188: if (-1 != yyC) {
9189: yyIndex = yyChoice2 + 1;
9190:
9191: switch (yyC) {
9192: case '*': {
9193: yyPredMatched = false;
9194:
9195: yyC = character(yyIndex);
9196: if ('/' == yyC) {
9197:
9198: yyPredMatched = true;
9199: }
9200:
9201: if (!yyPredMatched) {
9202:
9203: yyRepetition2 = yyIndex;
9204: continue;
9205: } else {
9206: yyError = yyError.select(
9207: "spacing expected",
9208: yyStart);
9209: }
9210: }
9211: break;
9212:
9213: default: {
9214: yyRepetition2 = yyIndex;
9215: continue;
9216: }
9217: }
9218: }
9219: break;
9220: }
9221:
9222: yyBase = yyRepetition2;
9223: yyC = character(yyBase);
9224: if ('*' == yyC) {
9225: yyIndex = yyRepetition2 + 1;
9226:
9227: yyC = character(yyIndex);
9228: if ('/' == yyC) {
9229: yyIndex = yyIndex + 1;
9230:
9231: yyRepetition1 = yyIndex;
9232: continue;
9233: } else {
9234: yyError = yyError.select(
9235: "\"*/\" expected", yyBase);
9236: }
9237: } else {
9238: yyError = yyError.select(
9239: "\"*/\" expected", yyBase);
9240: }
9241: }
9242: break;
9243:
9244: case '/': {
9245: yyRepetition2 = yyIndex;
9246: while (true) {
9247:
9248: yyC = character(yyRepetition2);
9249: if (-1 != yyC) {
9250: yyIndex = yyRepetition2 + 1;
9251:
9252: switch (yyC) {
9253: case '\n':
9254: case '\r':
9255: /* No match. */
9256: break;
9257:
9258: default: {
9259: yyRepetition2 = yyIndex;
9260: continue;
9261: }
9262: }
9263: }
9264: break;
9265: }
9266:
9267: final int yyChoice2 = yyRepetition2;
9268:
9269: // Nested alternative 1.
9270:
9271: yyC = character(yyChoice2);
9272: if (-1 != yyC) {
9273: yyIndex = yyChoice2 + 1;
9274:
9275: switch (yyC) {
9276: case '\r': {
9277: final int yyChoice3 = yyIndex;
9278:
9279: // Nested alternative 1.
9280:
9281: yyC = character(yyChoice3);
9282: if ('\n' == yyC) {
9283: yyIndex = yyChoice3 + 1;
9284:
9285: yyRepetition1 = yyIndex;
9286: continue;
9287: }
9288:
9289: // Nested alternative 2.
9290:
9291: yyRepetition1 = yyChoice3;
9292: continue;
9293: }
9294:
9295: case '\n': {
9296: yyRepetition1 = yyIndex;
9297: continue;
9298: }
9299:
9300: default:
9301: /* No match. */
9302: }
9303: }
9304:
9305: // Nested alternative 2.
9306:
9307: yyPredResult = pEndOfFile(yyChoice2);
9308: yyError = yyPredResult.select(yyError);
9309: if (yyPredResult.hasValue()) {
9310:
9311: yyRepetition1 = yyChoice2;
9312: continue;
9313: }
9314: }
9315: break;
9316:
9317: default:
9318: /* No match. */
9319: }
9320: }
9321: }
9322: break;
9323:
9324: default:
9325: /* No match. */
9326: }
9327: }
9328: break;
9329: }
9330:
9331: yyValue = null;
9332:
9333: return new SemanticValue(yyValue, yyRepetition1, yyError);
9334: }
9335:
9336: // =========================================================================
9337:
9338: /**
9339: * Parse nonterminal xtc.util.Spacing.EndOfFile.
9340: *
9341: * @param yyStart The index.
9342: * @return The result.
9343: * @throws IOException Signals an I/O error.
9344: */
9345: private Result pEndOfFile(final int yyStart) throws IOException {
9346: int yyC;
9347: boolean yyPredMatched;
9348: Void yyValue;
9349: ParseError yyError = ParseError.DUMMY;
9350:
9351: // Alternative 1.
9352:
9353: yyPredMatched = false;
9354:
9355: yyC = character(yyStart);
9356: if (-1 != yyC) {
9357:
9358: yyPredMatched = true;
9359: }
9360:
9361: if (!yyPredMatched) {
9362:
9363: yyValue = null;
9364:
9365: return new SemanticValue(yyValue, yyStart, yyError);
9366: } else {
9367: yyError = yyError.select("end of file expected", yyStart);
9368: }
9369:
9370: // Done.
9371: return yyError;
9372: }
9373:
9374: // =========================================================================
9375:
9376: static {
9377: add(JAVA_KEYWORDS, new String[] { "abstract", "continue",
9378: "for", "new", "switch", "assert", "default", "if",
9379: "package", "synchronized", "boolean", "do", "goto",
9380: "private", "this", "break", "double", "implements",
9381: "protected", "throw", "byte", "else", "import",
9382: "public", "throws", "case", "instanceof", "return",
9383: "transient", "catch", "extends", "int", "short", "try",
9384: "char", "final", "interface", "static", "void",
9385: "class", "finally", "long", "strictfp", "volatile",
9386: "const", "float", "native", "super", "while" });
9387: }
9388:
9389: // =========================================================================
9390:
9391: /**
9392: * Get the specified text.
9393: *
9394: * @param s The text.
9395: * @return The text.
9396: */
9397: protected static final String toText(String s) {
9398: return s;
9399: }
9400:
9401: // =========================================================================
9402:
9403: /**
9404: * Add the specified values to the specified set.
9405: *
9406: * @param set The set.
9407: * @param values The new values.
9408: */
9409: protected static final <T> void add(Set<T> set, T[] values) {
9410: for (T v : values)
9411: set.add(v);
9412: }
9413:
9414: /**
9415: * Check whether the specified set contains the specified value.
9416: *
9417: * @param set The set.
9418: * @param value The value.
9419: * @return <code>true</code> if the set contains the value.
9420: */
9421: protected static final <T> boolean contains(Set<T> set, T value) {
9422: return set.contains(value);
9423: }
9424:
9425: }
|