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