00001: // ===========================================================================
00002: // This file has been generated by
00003: // Rats! Parser Generator, version 1.13.1,
00004: // (C) 2004-2007 Robert Grimm,
00005: // on Monday, October 8, 2007 at 5:40:09 PM.
00006: // Edit at your own risk.
00007: // ===========================================================================
00008:
00009: package xtc.lang;
00010:
00011: import java.io.Reader;
00012: import java.io.IOException;
00013:
00014: import java.util.HashSet;
00015: import java.util.Set;
00016:
00017: import xtc.util.Action;
00018: import xtc.util.Pair;
00019:
00020: import xtc.tree.Node;
00021: import xtc.tree.GNode;
00022: import xtc.tree.Token;
00023: import xtc.tree.Formatting;
00024:
00025: import xtc.parser.ParserBase;
00026: import xtc.parser.Column;
00027: import xtc.parser.Result;
00028: import xtc.parser.SemanticValue;
00029: import xtc.parser.ParseError;
00030:
00031: /**
00032: * Packrat parser for grammar <code>xtc.lang.Java</code>.
00033: *
00034: * <p />This class has been generated by the <i>Rats!</i> parser
00035: * generator, version 1.13.1, (C) 2004-2007 Robert Grimm.
00036: */
00037: public final class JavaReader extends ParserBase {
00038:
00039: /** The JAVA_KEYWORDS set. */
00040: public static final Set<String> JAVA_KEYWORDS = new HashSet<String>();
00041:
00042: // =========================================================================
00043:
00044: /** Chunk 1 of memoized results. */
00045: static final class Chunk1 {
00046: Result fModifiers;
00047: Result fFormalParameters;
00048: Result fDeclarators;
00049: Result fDeclarators$$Star1;
00050: Result fBlock;
00051: Result fParExpression;
00052: Result fCatchClause;
00053: Result fExpression;
00054: Result fConditionalExpression;
00055: Result fLogicalOrExpression;
00056: }
00057:
00058: /** Chunk 2 of memoized results. */
00059: static final class Chunk2 {
00060: Result fRelationalExpression;
00061: Result fVariableInitializer;
00062: Result fResultType;
00063: Result fType;
00064: Result fTypeName;
00065: Result fPrimitiveType;
00066: Result fDimensions;
00067: Result fDimensions$$Plus1;
00068: Result fQualifiedIdentifier;
00069: Result fQualifiedIdentifier$$Star1;
00070: }
00071:
00072: /** Chunk 3 of memoized results. */
00073: static final class Chunk3 {
00074: Result fIdentifier;
00075: Result fWord;
00076: Result fSymbol;
00077: }
00078:
00079: // =========================================================================
00080:
00081: /** Memoization table column. */
00082: static final class JavaReaderColumn extends Column {
00083: Chunk1 chunk1;
00084: Chunk2 chunk2;
00085: Chunk3 chunk3;
00086: }
00087:
00088: // =========================================================================
00089:
00090: /**
00091: * Create a new packrat parser.
00092: *
00093: * @param reader The reader.
00094: * @param file The file name.
00095: */
00096: public JavaReader(final Reader reader, final String file) {
00097: super (reader, file);
00098: }
00099:
00100: /**
00101: * Create a new packrat parser.
00102: *
00103: * @param reader The file reader.
00104: * @param file The file name.
00105: * @param size The file size.
00106: */
00107: public JavaReader(final Reader reader, final String file,
00108: final int size) {
00109: super (reader, file, size);
00110: }
00111:
00112: // =========================================================================
00113:
00114: protected Column newColumn() {
00115: return new JavaReaderColumn();
00116: }
00117:
00118: // =========================================================================
00119:
00120: /**
00121: * Parse nonterminal xtc.lang.Java.CompilationUnit.
00122: *
00123: * @param yyStart The index.
00124: * @return The result.
00125: * @throws IOException Signals an I/O error.
00126: */
00127: public Result pCompilationUnit(final int yyStart)
00128: throws IOException {
00129: int yyC;
00130: int yyIndex;
00131: Result yyResult;
00132: int yyOption1;
00133: Character yyOpValue1;
00134: Node yyValue;
00135: ParseError yyError = ParseError.DUMMY;
00136:
00137: // Alternative 1.
00138:
00139: yyResult = pCompilationUnit$$Split1(yyStart);
00140: yyError = yyResult.select(yyError);
00141: if (yyResult.hasValue()) {
00142: final Node v$pt$1 = yyResult.semanticValue();
00143:
00144: yyOption1 = yyResult.index;
00145: yyOpValue1 = null;
00146:
00147: yyC = character(yyOption1);
00148: if ('\u001a' == yyC) {
00149: yyIndex = yyOption1 + 1;
00150: final char v$el$1 = (char) yyC;
00151:
00152: yyOption1 = yyIndex;
00153: yyOpValue1 = v$el$1;
00154: }
00155: { // Start scope for v$pt$2.
00156: final Character v$pt$2 = yyOpValue1;
00157:
00158: yyResult = pEndOfFile(yyOption1);
00159: yyError = yyResult.select(yyError);
00160: if (yyResult.hasValue()) {
00161: yyValue = Formatting.after1(v$pt$1, v$pt$2);
00162:
00163: return yyResult.createValue(yyValue, yyError);
00164: }
00165: } // End scope for v$pt$2.
00166: }
00167:
00168: // Done.
00169: yyError = yyError.select("compilation unit expected", yyStart);
00170: return yyError;
00171: }
00172:
00173: // =========================================================================
00174:
00175: /**
00176: * Parse synthetic nonterminal xtc.lang.Java.CompilationUnit$$Split1.
00177: *
00178: * @param yyStart The index.
00179: * @return The result.
00180: * @throws IOException Signals an I/O error.
00181: */
00182: public Result pCompilationUnit$$Split1(final int yyStart)
00183: throws IOException {
00184:
00185: Result yyResult;
00186: int yyRepetition1;
00187: Pair<Node> yyRepValue1;
00188: int yyOption1;
00189: Node yyOpValue1;
00190: Node yyValue;
00191: ParseError yyError = ParseError.DUMMY;
00192:
00193: // Alternative 1.
00194:
00195: yyResult = pSpacing(yyStart);
00196: yyError = yyResult.select(yyError);
00197: if (yyResult.hasValue()) {
00198: final Token v$pt$1 = yyResult.semanticValue();
00199:
00200: yyOption1 = yyResult.index;
00201: yyOpValue1 = null;
00202:
00203: yyResult = pPackageDeclaration(yyOption1);
00204: yyError = yyResult.select(yyError);
00205: if (yyResult.hasValue()) {
00206: final Node v$el$1 = yyResult.semanticValue();
00207:
00208: yyOption1 = yyResult.index;
00209: yyOpValue1 = v$el$1;
00210: }
00211: { // Start scope for v$pt$2.
00212: final Node v$pt$2 = yyOpValue1;
00213: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
00214:
00215: yyRepetition1 = yyOption1;
00216: yyRepValue1 = Pair.empty();
00217: while (true) {
00218:
00219: yyResult = pImportDeclaration(yyRepetition1);
00220: yyError = yyResult.select(yyError);
00221: if (yyResult.hasValue()) {
00222: final Node v$el$2 = yyResult.semanticValue();
00223:
00224: yyRepetition1 = yyResult.index;
00225: yyRepValue1 = new Pair<Node>(v$el$2,
00226: yyRepValue1);
00227: continue;
00228: }
00229: break;
00230: }
00231: { // Start scope for v$g$2.
00232: final Pair<Node> v$g$2 = yyRepValue1.reverse();
00233:
00234: yyRepValue1 = Pair.empty();
00235: while (true) {
00236:
00237: yyResult = pDeclaration(yyRepetition1);
00238: yyError = yyResult.select(yyError);
00239: if (yyResult.hasValue()) {
00240: final Node v$el$3 = yyResult
00241: .semanticValue();
00242:
00243: yyRepetition1 = yyResult.index;
00244: yyRepValue1 = new Pair<Node>(v$el$3,
00245: yyRepValue1);
00246: continue;
00247: }
00248: break;
00249: }
00250: { // Start scope for v$g$3.
00251: final Pair<Node> v$g$3 = yyRepValue1.reverse();
00252:
00253: yyValue = GNode.create("CompilationUnit",
00254: v$g$2.size() + v$g$3.size() + 1).add(
00255: v$g$1).addAll(v$g$2).addAll(v$g$3);
00256: yyValue.setLocation(location(yyStart));
00257:
00258: return new SemanticValue(yyValue,
00259: yyRepetition1, yyError);
00260: } // End scope for v$g$3.
00261: } // End scope for v$g$2.
00262: } // End scope for v$pt$2.
00263: }
00264:
00265: // Done.
00266: return yyError;
00267: }
00268:
00269: // =========================================================================
00270:
00271: /**
00272: * Parse nonterminal xtc.lang.Java.PackageDeclaration.
00273: *
00274: * @param yyStart The index.
00275: * @return The result.
00276: * @throws IOException Signals an I/O error.
00277: */
00278: private Result pPackageDeclaration(final int yyStart)
00279: throws IOException {
00280: Result yyResult;
00281: int yyBase;
00282: Node yyValue;
00283: ParseError yyError = ParseError.DUMMY;
00284:
00285: // Alternative <Declaration>.
00286:
00287: yyResult = pWord(yyStart);
00288: yyError = yyResult.select(yyError);
00289: if (yyResult.hasValue()
00290: && ((Node) yyResult.semanticValue()).getTokenText()
00291: .equals("package")) {
00292: final Node v$pt$1 = yyResult.semanticValue();
00293: final Node v$g$1 = Formatting.after1(null, v$pt$1);
00294:
00295: yyResult = pQualifiedIdentifier(yyResult.index);
00296: yyError = yyResult.select(yyError);
00297: if (yyResult.hasValue()) {
00298: final Node v$pt$4 = yyResult.semanticValue();
00299:
00300: yyBase = yyResult.index;
00301: yyResult = pSymbol(yyBase);
00302: yyError = yyResult.select(yyError);
00303: if (yyResult.hasValue()
00304: && ((Node) yyResult.semanticValue())
00305: .getTokenText().equals(";")) {
00306: final Node v$pt$3 = yyResult.semanticValue();
00307: final Node v$g$2 = Formatting
00308: .after1(v$pt$4, v$pt$3);
00309:
00310: yyValue = GNode.create("PackageDeclaration", v$g$1,
00311: v$g$2);
00312: yyValue.setLocation(location(yyStart));
00313:
00314: return yyResult.createValue(yyValue, yyError);
00315: } else {
00316: yyError = yyError.select("\";\" expected", yyBase);
00317: }
00318: }
00319: }
00320:
00321: // Done.
00322: yyError = yyError.select("package declaration expected",
00323: yyStart);
00324: return yyError;
00325: }
00326:
00327: // =========================================================================
00328:
00329: /**
00330: * Parse nonterminal xtc.lang.Java.ImportDeclaration.
00331: *
00332: * @param yyStart The index.
00333: * @return The result.
00334: * @throws IOException Signals an I/O error.
00335: */
00336: private Result pImportDeclaration(final int yyStart)
00337: throws IOException {
00338: Result yyResult;
00339: int yyBase;
00340: int yyOption1;
00341: Node yyOpValue1;
00342: Node yyValue;
00343: ParseError yyError = ParseError.DUMMY;
00344:
00345: // Alternative <Declaration>.
00346:
00347: yyResult = pWord(yyStart);
00348: yyError = yyResult.select(yyError);
00349: if (yyResult.hasValue()
00350: && ((Node) yyResult.semanticValue()).getTokenText()
00351: .equals("import")) {
00352: final Node v$pt$1 = yyResult.semanticValue();
00353: final Node v$g$1 = Formatting.before1(v$pt$1, null);
00354:
00355: yyResult = pQualifiedIdentifier(yyResult.index);
00356: yyError = yyResult.select(yyError);
00357: if (yyResult.hasValue()) {
00358: final Node v$g$2 = yyResult.semanticValue();
00359:
00360: yyOption1 = yyResult.index;
00361: yyOpValue1 = null;
00362:
00363: yyResult = pDotStarTail(yyOption1);
00364: yyError = yyResult.select(yyError);
00365: if (yyResult.hasValue()) {
00366: final Node v$el$1 = yyResult.semanticValue();
00367:
00368: yyOption1 = yyResult.index;
00369: yyOpValue1 = v$el$1;
00370: }
00371: { // Start scope for v$pt$4.
00372: final Node v$pt$4 = yyOpValue1;
00373:
00374: yyBase = yyOption1;
00375: yyResult = pSymbol(yyBase);
00376: yyError = yyResult.select(yyError);
00377: if (yyResult.hasValue()
00378: && ((Node) yyResult.semanticValue())
00379: .getTokenText().equals(";")) {
00380: final Node v$pt$3 = yyResult.semanticValue();
00381: final Node v$g$3 = Formatting.after1(v$pt$4,
00382: v$pt$3);
00383:
00384: yyValue = GNode.create("ImportDeclaration",
00385: v$g$1, v$g$2, v$g$3);
00386: yyValue.setLocation(location(yyStart));
00387:
00388: return yyResult.createValue(yyValue, yyError);
00389: } else {
00390: yyError = yyError.select("\";\" expected",
00391: yyBase);
00392: }
00393: } // End scope for v$pt$4.
00394: }
00395: }
00396:
00397: // Done.
00398: yyError = yyError
00399: .select("import declaration expected", yyStart);
00400: return yyError;
00401: }
00402:
00403: // =========================================================================
00404:
00405: /**
00406: * Parse nonterminal xtc.lang.Java.DotStarTail.
00407: *
00408: * @param yyStart The index.
00409: * @return The result.
00410: * @throws IOException Signals an I/O error.
00411: */
00412: private Result pDotStarTail(final int yyStart) throws IOException {
00413: Result yyResult;
00414: int yyBase;
00415: Node yyValue;
00416: ParseError yyError = ParseError.DUMMY;
00417:
00418: // Alternative 1.
00419:
00420: yyResult = pSymbol(yyStart);
00421: yyError = yyResult.select(yyError);
00422: if (yyResult.hasValue()
00423: && ((Node) yyResult.semanticValue()).getTokenText()
00424: .equals(".")) {
00425: final Node v$pt$1 = yyResult.semanticValue();
00426:
00427: yyBase = yyResult.index;
00428: yyResult = pSymbol(yyBase);
00429: yyError = yyResult.select(yyError);
00430: if (yyResult.hasValue()
00431: && ((Node) yyResult.semanticValue()).getTokenText()
00432: .equals("*")) {
00433: final Node v$pt$2 = yyResult.semanticValue();
00434: yyValue = Formatting.before1(v$pt$1, v$pt$2);
00435:
00436: return yyResult.createValue(yyValue, yyError);
00437: } else {
00438: yyError = yyError.select("\"*\" expected", yyBase);
00439: }
00440: }
00441:
00442: // Done.
00443: yyError = yyError.select("dot star tail expected", yyStart);
00444: return yyError;
00445: }
00446:
00447: // =========================================================================
00448:
00449: /**
00450: * Parse nonterminal xtc.lang.Java.Modifiers.
00451: *
00452: * @param yyStart The index.
00453: * @return The result.
00454: * @throws IOException Signals an I/O error.
00455: */
00456: private Result pModifiers(final int yyStart) throws IOException {
00457: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
00458: if (null == yyColumn.chunk1)
00459: yyColumn.chunk1 = new Chunk1();
00460: if (null == yyColumn.chunk1.fModifiers)
00461: yyColumn.chunk1.fModifiers = pModifiers$1(yyStart);
00462: return yyColumn.chunk1.fModifiers;
00463: }
00464:
00465: /** Actually parse xtc.lang.Java.Modifiers. */
00466: private Result pModifiers$1(final int yyStart) throws IOException {
00467: Result yyResult;
00468: Node yyValue;
00469: ParseError yyError = ParseError.DUMMY;
00470:
00471: // Alternative 1.
00472:
00473: yyResult = pModifierList(yyStart);
00474: yyError = yyResult.select(yyError);
00475: if (yyResult.hasValue()) {
00476: final Pair<Node> v$g$1 = yyResult.semanticValue();
00477:
00478: yyValue = GNode.createFromPair("Modifiers", v$g$1);
00479: yyValue.setLocation(location(yyStart));
00480:
00481: return yyResult.createValue(yyValue, yyError);
00482: }
00483:
00484: // Done.
00485: return yyError;
00486: }
00487:
00488: // =========================================================================
00489:
00490: /**
00491: * Parse nonterminal xtc.lang.Java.ModifierList.
00492: *
00493: * @param yyStart The index.
00494: * @return The result.
00495: * @throws IOException Signals an I/O error.
00496: */
00497: private Result pModifierList(final int yyStart) throws IOException {
00498: Result yyResult;
00499: int yyRepetition1;
00500: Pair<Node> yyRepValue1;
00501: Pair<Node> yyValue;
00502: ParseError yyError = ParseError.DUMMY;
00503:
00504: // Alternative 1.
00505:
00506: yyRepetition1 = yyStart;
00507: yyRepValue1 = Pair.empty();
00508: while (true) {
00509:
00510: yyResult = pModifier(yyRepetition1);
00511: yyError = yyResult.select(yyError);
00512: if (yyResult.hasValue()) {
00513: final Node v$el$1 = yyResult.semanticValue();
00514:
00515: yyRepetition1 = yyResult.index;
00516: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
00517: continue;
00518: }
00519: break;
00520: }
00521: { // Start scope for yyValue.
00522: yyValue = yyRepValue1.reverse();
00523:
00524: return new SemanticValue(yyValue, yyRepetition1, yyError);
00525: } // End scope for yyValue.
00526: }
00527:
00528: // =========================================================================
00529:
00530: /**
00531: * Parse nonterminal xtc.lang.Java.Modifier.
00532: *
00533: * @param yyStart The index.
00534: * @return The result.
00535: * @throws IOException Signals an I/O error.
00536: */
00537: private Result pModifier(final int yyStart) throws IOException {
00538: Result yyResult;
00539: Node yyValue;
00540: ParseError yyError = ParseError.DUMMY;
00541:
00542: // Alternative <Public>.
00543:
00544: yyResult = pWord(yyStart);
00545: yyError = yyResult.select(yyError);
00546: if (yyResult.hasValue()
00547: && ((Node) yyResult.semanticValue()).getTokenText()
00548: .equals("public")) {
00549: final Node v$g$1 = yyResult.semanticValue();
00550:
00551: yyValue = GNode.create("Modifier", v$g$1);
00552: yyValue.setLocation(location(yyStart));
00553:
00554: return yyResult.createValue(yyValue, yyError);
00555: }
00556:
00557: // Alternative <Protected>.
00558:
00559: yyResult = pWord(yyStart);
00560: yyError = yyResult.select(yyError);
00561: if (yyResult.hasValue()
00562: && ((Node) yyResult.semanticValue()).getTokenText()
00563: .equals("protected")) {
00564: final Node v$g$2 = yyResult.semanticValue();
00565:
00566: yyValue = GNode.create("Modifier", v$g$2);
00567: yyValue.setLocation(location(yyStart));
00568:
00569: return yyResult.createValue(yyValue, yyError);
00570: }
00571:
00572: // Alternative <Private>.
00573:
00574: yyResult = pWord(yyStart);
00575: yyError = yyResult.select(yyError);
00576: if (yyResult.hasValue()
00577: && ((Node) yyResult.semanticValue()).getTokenText()
00578: .equals("private")) {
00579: final Node v$g$3 = yyResult.semanticValue();
00580:
00581: yyValue = GNode.create("Modifier", v$g$3);
00582: yyValue.setLocation(location(yyStart));
00583:
00584: return yyResult.createValue(yyValue, yyError);
00585: }
00586:
00587: // Alternative <Static>.
00588:
00589: yyResult = pWord(yyStart);
00590: yyError = yyResult.select(yyError);
00591: if (yyResult.hasValue()
00592: && ((Node) yyResult.semanticValue()).getTokenText()
00593: .equals("static")) {
00594: final Node v$g$4 = yyResult.semanticValue();
00595:
00596: yyValue = GNode.create("Modifier", v$g$4);
00597: yyValue.setLocation(location(yyStart));
00598:
00599: return yyResult.createValue(yyValue, yyError);
00600: }
00601:
00602: // Alternative <Abstract>.
00603:
00604: yyResult = pWord(yyStart);
00605: yyError = yyResult.select(yyError);
00606: if (yyResult.hasValue()
00607: && ((Node) yyResult.semanticValue()).getTokenText()
00608: .equals("abstract")) {
00609: final Node v$g$5 = yyResult.semanticValue();
00610:
00611: yyValue = GNode.create("Modifier", v$g$5);
00612: yyValue.setLocation(location(yyStart));
00613:
00614: return yyResult.createValue(yyValue, yyError);
00615: }
00616:
00617: // Alternative <Final>.
00618:
00619: yyResult = pWord(yyStart);
00620: yyError = yyResult.select(yyError);
00621: if (yyResult.hasValue()
00622: && ((Node) yyResult.semanticValue()).getTokenText()
00623: .equals("final")) {
00624: final Node v$g$6 = yyResult.semanticValue();
00625:
00626: yyValue = GNode.create("Modifier", v$g$6);
00627: yyValue.setLocation(location(yyStart));
00628:
00629: return yyResult.createValue(yyValue, yyError);
00630: }
00631:
00632: // Alternative <Native>.
00633:
00634: yyResult = pWord(yyStart);
00635: yyError = yyResult.select(yyError);
00636: if (yyResult.hasValue()
00637: && ((Node) yyResult.semanticValue()).getTokenText()
00638: .equals("native")) {
00639: final Node v$g$7 = yyResult.semanticValue();
00640:
00641: yyValue = GNode.create("Modifier", v$g$7);
00642: yyValue.setLocation(location(yyStart));
00643:
00644: return yyResult.createValue(yyValue, yyError);
00645: }
00646:
00647: // Alternative <Synchronized>.
00648:
00649: yyResult = pWord(yyStart);
00650: yyError = yyResult.select(yyError);
00651: if (yyResult.hasValue()
00652: && ((Node) yyResult.semanticValue()).getTokenText()
00653: .equals("synchronized")) {
00654: final Node v$g$8 = yyResult.semanticValue();
00655:
00656: yyValue = GNode.create("Modifier", v$g$8);
00657: yyValue.setLocation(location(yyStart));
00658:
00659: return yyResult.createValue(yyValue, yyError);
00660: }
00661:
00662: // Alternative <Transient>.
00663:
00664: yyResult = pWord(yyStart);
00665: yyError = yyResult.select(yyError);
00666: if (yyResult.hasValue()
00667: && ((Node) yyResult.semanticValue()).getTokenText()
00668: .equals("transient")) {
00669: final Node v$g$9 = yyResult.semanticValue();
00670:
00671: yyValue = GNode.create("Modifier", v$g$9);
00672: yyValue.setLocation(location(yyStart));
00673:
00674: return yyResult.createValue(yyValue, yyError);
00675: }
00676:
00677: // Alternative <Volatile>.
00678:
00679: yyResult = pWord(yyStart);
00680: yyError = yyResult.select(yyError);
00681: if (yyResult.hasValue()
00682: && ((Node) yyResult.semanticValue()).getTokenText()
00683: .equals("volatile")) {
00684: final Node v$g$10 = yyResult.semanticValue();
00685:
00686: yyValue = GNode.create("Modifier", v$g$10);
00687: yyValue.setLocation(location(yyStart));
00688:
00689: return yyResult.createValue(yyValue, yyError);
00690: }
00691:
00692: // Alternative <Strictfp>.
00693:
00694: yyResult = pWord(yyStart);
00695: yyError = yyResult.select(yyError);
00696: if (yyResult.hasValue()
00697: && ((Node) yyResult.semanticValue()).getTokenText()
00698: .equals("strictfp")) {
00699: final Node v$g$11 = yyResult.semanticValue();
00700:
00701: yyValue = GNode.create("Modifier", v$g$11);
00702: yyValue.setLocation(location(yyStart));
00703:
00704: return yyResult.createValue(yyValue, yyError);
00705: }
00706:
00707: // Done.
00708: yyError = yyError.select("modifier expected", yyStart);
00709: return yyError;
00710: }
00711:
00712: // =========================================================================
00713:
00714: /**
00715: * Parse nonterminal xtc.lang.Java.FormalParameter.
00716: *
00717: * @param yyStart The index.
00718: * @return The result.
00719: * @throws IOException Signals an I/O error.
00720: */
00721: private Result pFormalParameter(final int yyStart)
00722: throws IOException {
00723: Result yyResult;
00724: int yyOption1;
00725: Node yyOpValue1;
00726: Node yyValue;
00727: ParseError yyError = ParseError.DUMMY;
00728:
00729: // Alternative <Parameter>.
00730:
00731: yyResult = pVariableModifiers(yyStart);
00732: yyError = yyResult.select(yyError);
00733: if (yyResult.hasValue()) {
00734: final Node v$g$1 = yyResult.semanticValue();
00735:
00736: yyResult = pType(yyResult.index);
00737: yyError = yyResult.select(yyError);
00738: if (yyResult.hasValue()) {
00739: final Node v$g$2 = yyResult.semanticValue();
00740:
00741: yyResult = pIdentifier(yyResult.index);
00742: yyError = yyResult.select(yyError);
00743: if (yyResult.hasValue()) {
00744: final Node v$g$4 = yyResult.semanticValue();
00745:
00746: yyOption1 = yyResult.index;
00747: yyOpValue1 = null;
00748:
00749: yyResult = pDimensions(yyOption1);
00750: yyError = yyResult.select(yyError);
00751: if (yyResult.hasValue()) {
00752: final Node v$el$1 = yyResult.semanticValue();
00753:
00754: yyOption1 = yyResult.index;
00755: yyOpValue1 = v$el$1;
00756: }
00757: { // Start scope for v$g$5.
00758: final Node v$g$5 = yyOpValue1;
00759:
00760: yyValue = GNode.create("FormalParameter",
00761: v$g$1, v$g$2, null, v$g$4, v$g$5);
00762: yyValue.setLocation(location(yyStart));
00763:
00764: return new SemanticValue(yyValue, yyOption1,
00765: yyError);
00766: } // End scope for v$g$5.
00767: }
00768: }
00769: }
00770:
00771: // Done.
00772: return yyError;
00773: }
00774:
00775: // =========================================================================
00776:
00777: /**
00778: * Parse nonterminal xtc.lang.Java.VariableModifiers.
00779: *
00780: * @param yyStart The index.
00781: * @return The result.
00782: * @throws IOException Signals an I/O error.
00783: */
00784: private Result pVariableModifiers(final int yyStart)
00785: throws IOException {
00786: Result yyResult;
00787: Node yyValue;
00788: ParseError yyError = ParseError.DUMMY;
00789:
00790: // Alternative <Final>.
00791:
00792: yyResult = pFinalModifier(yyStart);
00793: yyError = yyResult.select(yyError);
00794: if (yyResult.hasValue()) {
00795: final Node v$g$1 = yyResult.semanticValue();
00796:
00797: yyValue = GNode.create("Modifiers", v$g$1);
00798: yyValue.setLocation(location(yyStart));
00799:
00800: return yyResult.createValue(yyValue, yyError);
00801: }
00802:
00803: // Alternative <Nonfinal>.
00804:
00805: yyValue = GNode.create("Modifiers", false);
00806: yyValue.setLocation(location(yyStart));
00807:
00808: return new SemanticValue(yyValue, yyStart, yyError);
00809: }
00810:
00811: // =========================================================================
00812:
00813: /**
00814: * Parse nonterminal xtc.lang.Java.FinalModifier.
00815: *
00816: * @param yyStart The index.
00817: * @return The result.
00818: * @throws IOException Signals an I/O error.
00819: */
00820: private Result pFinalModifier(final int yyStart) throws IOException {
00821: Result yyResult;
00822: Node yyValue;
00823: ParseError yyError = ParseError.DUMMY;
00824:
00825: // Alternative 1.
00826:
00827: yyResult = pWord(yyStart);
00828: yyError = yyResult.select(yyError);
00829: if (yyResult.hasValue()
00830: && ((Node) yyResult.semanticValue()).getTokenText()
00831: .equals("final")) {
00832: final Node v$g$1 = yyResult.semanticValue();
00833:
00834: yyValue = GNode.create("Modifier", v$g$1);
00835: yyValue.setLocation(location(yyStart));
00836:
00837: return yyResult.createValue(yyValue, yyError);
00838: }
00839:
00840: // Done.
00841: yyError = yyError.select("final modifier expected", yyStart);
00842: return yyError;
00843: }
00844:
00845: // =========================================================================
00846:
00847: /**
00848: * Parse nonterminal xtc.lang.Java.FormalParameters.
00849: *
00850: * @param yyStart The index.
00851: * @return The result.
00852: * @throws IOException Signals an I/O error.
00853: */
00854: private Result pFormalParameters(final int yyStart)
00855: throws IOException {
00856: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
00857: if (null == yyColumn.chunk1)
00858: yyColumn.chunk1 = new Chunk1();
00859: if (null == yyColumn.chunk1.fFormalParameters)
00860: yyColumn.chunk1.fFormalParameters = pFormalParameters$1(yyStart);
00861: return yyColumn.chunk1.fFormalParameters;
00862: }
00863:
00864: /** Actually parse xtc.lang.Java.FormalParameters. */
00865: private Result pFormalParameters$1(final int yyStart)
00866: throws IOException {
00867: Result yyResult;
00868: int yyBase;
00869: Node yyValue;
00870: ParseError yyError = ParseError.DUMMY;
00871:
00872: // Alternative 1.
00873:
00874: yyResult = pFormalParameters$$Split1(yyStart);
00875: yyError = yyResult.select(yyError);
00876: if (yyResult.hasValue()) {
00877: final Node v$pt$1 = yyResult.semanticValue();
00878:
00879: yyBase = yyResult.index;
00880: yyResult = pSymbol(yyBase);
00881: yyError = yyResult.select(yyError);
00882: if (yyResult.hasValue()
00883: && ((Node) yyResult.semanticValue()).getTokenText()
00884: .equals(")")) {
00885: final Node v$pt$2 = yyResult.semanticValue();
00886: yyValue = Formatting.after1(v$pt$1, v$pt$2);
00887:
00888: return yyResult.createValue(yyValue, yyError);
00889: } else {
00890: yyError = yyError.select("\")\" expected", yyBase);
00891: }
00892: }
00893:
00894: // Alternative 2.
00895:
00896: yyResult = pSymbol(yyStart);
00897: yyError = yyResult.select(yyError);
00898: if (yyResult.hasValue()
00899: && ((Node) yyResult.semanticValue()).getTokenText()
00900: .equals("(")) {
00901: final Node v$pt$3 = yyResult.semanticValue();
00902:
00903: yyBase = yyResult.index;
00904: yyResult = pSymbol(yyBase);
00905: yyError = yyResult.select(yyError);
00906: if (yyResult.hasValue()
00907: && ((Node) yyResult.semanticValue()).getTokenText()
00908: .equals(")")) {
00909: final Node v$pt$4 = yyResult.semanticValue();
00910:
00911: yyValue = GNode.create("FormalParameters", false);
00912: yyValue.setLocation(location(yyStart));
00913: yyValue = Formatting.variable().addNode(yyValue).add(
00914: v$pt$3).add(v$pt$4);
00915:
00916: return yyResult.createValue(yyValue, yyError);
00917: } else {
00918: yyError = yyError.select("\")\" expected", yyBase);
00919: }
00920: }
00921:
00922: // Done.
00923: yyError = yyError.select("formal parameters expected", yyStart);
00924: return yyError;
00925: }
00926:
00927: // =========================================================================
00928:
00929: /**
00930: * Parse synthetic nonterminal xtc.lang.Java.FormalParameters$$Split1.
00931: *
00932: * @param yyStart The index.
00933: * @return The result.
00934: * @throws IOException Signals an I/O error.
00935: */
00936: private Result pFormalParameters$$Split1(final int yyStart)
00937: throws IOException {
00938:
00939: Result yyResult;
00940: int yyBase;
00941: int yyRepetition1;
00942: Pair<Node> yyRepValue1;
00943: Node yyValue;
00944: ParseError yyError = ParseError.DUMMY;
00945:
00946: // Alternative 1.
00947:
00948: yyResult = pSymbol(yyStart);
00949: yyError = yyResult.select(yyError);
00950: if (yyResult.hasValue()
00951: && ((Node) yyResult.semanticValue()).getTokenText()
00952: .equals("(")) {
00953: final Node v$pt$3 = yyResult.semanticValue();
00954:
00955: yyResult = pFormalParameter(yyResult.index);
00956: yyError = yyResult.select(yyError);
00957: if (yyResult.hasValue()) {
00958: final Node v$pt$4 = yyResult.semanticValue();
00959: final Node v$g$1 = Formatting.before1(v$pt$3, v$pt$4);
00960:
00961: yyRepetition1 = yyResult.index;
00962: yyRepValue1 = Pair.empty();
00963: while (true) {
00964:
00965: yyBase = yyRepetition1;
00966: yyResult = pSymbol(yyBase);
00967: yyError = yyResult.select(yyError);
00968: if (yyResult.hasValue()
00969: && ((Node) yyResult.semanticValue())
00970: .getTokenText().equals(",")) {
00971: final Node v$pt$1 = yyResult.semanticValue();
00972:
00973: yyResult = pFormalParameter(yyResult.index);
00974: yyError = yyResult.select(yyError);
00975: if (yyResult.hasValue()) {
00976: final Node v$pt$2 = yyResult
00977: .semanticValue();
00978: final Node v$el$1 = Formatting.before1(
00979: v$pt$1, v$pt$2);
00980:
00981: yyRepetition1 = yyResult.index;
00982: yyRepValue1 = new Pair<Node>(v$el$1,
00983: yyRepValue1);
00984: continue;
00985: }
00986: } else {
00987: yyError = yyError.select("\",\" expected",
00988: yyBase);
00989: }
00990: break;
00991: }
00992: { // Start scope for v$g$2.
00993: final Pair<Node> v$g$2 = yyRepValue1.reverse();
00994:
00995: yyValue = GNode.createFromPair("FormalParameters",
00996: v$g$1, v$g$2);
00997: yyValue.setLocation(location(yyStart));
00998:
00999: return new SemanticValue(yyValue, yyRepetition1,
01000: yyError);
01001: } // End scope for v$g$2.
01002: }
01003: }
01004:
01005: // Done.
01006: yyError = yyError.select("formal parameters expected", yyStart);
01007: return yyError;
01008: }
01009:
01010: // =========================================================================
01011:
01012: /**
01013: * Parse nonterminal xtc.lang.Java.Declarator.
01014: *
01015: * @param yyStart The index.
01016: * @return The result.
01017: * @throws IOException Signals an I/O error.
01018: */
01019: private Result pDeclarator(final int yyStart) throws IOException {
01020: Result yyResult;
01021: int yyBase;
01022: int yyOption1;
01023: Node yyOpValue1;
01024: Node yyValue;
01025: ParseError yyError = ParseError.DUMMY;
01026:
01027: // Alternative <Declarator>.
01028:
01029: yyResult = pIdentifier(yyStart);
01030: yyError = yyResult.select(yyError);
01031: if (yyResult.hasValue()) {
01032: final Node v$g$1 = yyResult.semanticValue();
01033:
01034: yyOption1 = yyResult.index;
01035: yyOpValue1 = null;
01036:
01037: yyResult = pDimensions(yyOption1);
01038: yyError = yyResult.select(yyError);
01039: if (yyResult.hasValue()) {
01040: final Node v$el$1 = yyResult.semanticValue();
01041:
01042: yyOption1 = yyResult.index;
01043: yyOpValue1 = v$el$1;
01044: }
01045: { // Start scope for v$g$2.
01046: final Node v$g$2 = yyOpValue1;
01047:
01048: yyOpValue1 = null;
01049:
01050: yyBase = yyOption1;
01051: yyResult = pSymbol(yyBase);
01052: yyError = yyResult.select(yyError);
01053: if (yyResult.hasValue()
01054: && ((Node) yyResult.semanticValue())
01055: .getTokenText().equals("=")) {
01056: final Node v$pt$1 = yyResult.semanticValue();
01057:
01058: yyResult = pVariableInitializer(yyResult.index);
01059: yyError = yyResult.select(yyError);
01060: if (yyResult.hasValue()) {
01061: final Node v$pt$2 = yyResult.semanticValue();
01062: final Node v$el$2 = Formatting.before1(v$pt$1,
01063: v$pt$2);
01064:
01065: yyOption1 = yyResult.index;
01066: yyOpValue1 = v$el$2;
01067: }
01068: } else {
01069: yyError = yyError.select("\"=\" expected", yyBase);
01070: }
01071: { // Start scope for v$g$3.
01072: final Node v$g$3 = yyOpValue1;
01073:
01074: yyValue = GNode.create("Declarator", v$g$1, v$g$2,
01075: v$g$3);
01076: yyValue.setLocation(location(yyStart));
01077:
01078: return new SemanticValue(yyValue, yyOption1,
01079: yyError);
01080: } // End scope for v$g$3.
01081: } // End scope for v$g$2.
01082: }
01083:
01084: // Done.
01085: return yyError;
01086: }
01087:
01088: // =========================================================================
01089:
01090: /**
01091: * Parse nonterminal xtc.lang.Java.Declarators.
01092: *
01093: * @param yyStart The index.
01094: * @return The result.
01095: * @throws IOException Signals an I/O error.
01096: */
01097: private Result pDeclarators(final int yyStart) throws IOException {
01098: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
01099: if (null == yyColumn.chunk1)
01100: yyColumn.chunk1 = new Chunk1();
01101: if (null == yyColumn.chunk1.fDeclarators)
01102: yyColumn.chunk1.fDeclarators = pDeclarators$1(yyStart);
01103: return yyColumn.chunk1.fDeclarators;
01104: }
01105:
01106: /** Actually parse xtc.lang.Java.Declarators. */
01107: private Result pDeclarators$1(final int yyStart) throws IOException {
01108: Result yyResult;
01109: Node yyValue;
01110: ParseError yyError = ParseError.DUMMY;
01111:
01112: // Alternative 1.
01113:
01114: yyResult = pDeclarator(yyStart);
01115: yyError = yyResult.select(yyError);
01116: if (yyResult.hasValue()) {
01117: final Node v$g$1 = yyResult.semanticValue();
01118:
01119: yyResult = pDeclarators$$Star1(yyResult.index);
01120: yyError = yyResult.select(yyError);
01121: if (yyResult.hasValue()) {
01122: final Pair<Node> v$g$2 = yyResult.semanticValue();
01123:
01124: yyValue = GNode.createFromPair("Declarators", v$g$1,
01125: v$g$2);
01126: yyValue.setLocation(location(yyStart));
01127:
01128: return yyResult.createValue(yyValue, yyError);
01129: }
01130: }
01131:
01132: // Done.
01133: return yyError;
01134: }
01135:
01136: // =========================================================================
01137:
01138: /**
01139: * Parse synthetic nonterminal xtc.lang.Java.Declarators$$Star1.
01140: *
01141: * @param yyStart The index.
01142: * @return The result.
01143: * @throws IOException Signals an I/O error.
01144: */
01145: private Result pDeclarators$$Star1(final int yyStart)
01146: throws IOException {
01147: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
01148: if (null == yyColumn.chunk1)
01149: yyColumn.chunk1 = new Chunk1();
01150: if (null == yyColumn.chunk1.fDeclarators$$Star1)
01151: yyColumn.chunk1.fDeclarators$$Star1 = pDeclarators$$Star1$1(yyStart);
01152: return yyColumn.chunk1.fDeclarators$$Star1;
01153: }
01154:
01155: /** Actually parse xtc.lang.Java.Declarators$$Star1. */
01156: private Result pDeclarators$$Star1$1(final int yyStart)
01157: throws IOException {
01158: Result yyResult;
01159: Pair<Node> yyValue;
01160: ParseError yyError = ParseError.DUMMY;
01161:
01162: // Alternative 1.
01163:
01164: yyResult = pSymbol(yyStart);
01165: yyError = yyResult.select(yyError);
01166: if (yyResult.hasValue()
01167: && ((Node) yyResult.semanticValue()).getTokenText()
01168: .equals(",")) {
01169: final Node v$pt$1 = yyResult.semanticValue();
01170:
01171: yyResult = pDeclarator(yyResult.index);
01172: yyError = yyResult.select(yyError);
01173: if (yyResult.hasValue()) {
01174: final Node v$pt$2 = yyResult.semanticValue();
01175: final Node v$el$1 = Formatting.before1(v$pt$1, v$pt$2);
01176:
01177: yyResult = pDeclarators$$Star1(yyResult.index);
01178: yyError = yyResult.select(yyError);
01179: if (yyResult.hasValue()) {
01180: final Pair<Node> v$2 = yyResult.semanticValue();
01181:
01182: yyValue = new Pair<Node>(v$el$1, v$2);
01183:
01184: return yyResult.createValue(yyValue, yyError);
01185: }
01186: }
01187: }
01188:
01189: // Alternative 2.
01190:
01191: yyValue = Pair.empty();
01192:
01193: return new SemanticValue(yyValue, yyStart, yyError);
01194: }
01195:
01196: // =========================================================================
01197:
01198: /**
01199: * Parse nonterminal xtc.lang.Java.ClassBody.
01200: *
01201: * @param yyStart The index.
01202: * @return The result.
01203: * @throws IOException Signals an I/O error.
01204: */
01205: private Result pClassBody(final int yyStart) throws IOException {
01206: Result yyResult;
01207: int yyBase;
01208: Node yyValue;
01209: ParseError yyError = ParseError.DUMMY;
01210:
01211: // Alternative <Body>.
01212:
01213: yyResult = pSymbol(yyStart);
01214: yyError = yyResult.select(yyError);
01215: if (yyResult.hasValue()
01216: && ((Node) yyResult.semanticValue()).getTokenText()
01217: .equals("{")) {
01218: final Node v$pt$1 = yyResult.semanticValue();
01219:
01220: yyResult = pClassBody$$Split1(yyResult.index);
01221: yyError = yyResult.select(yyError);
01222: if (yyResult.hasValue()) {
01223: final Node v$pt$2 = yyResult.semanticValue();
01224:
01225: yyBase = yyResult.index;
01226: yyResult = pSymbol(yyBase);
01227: yyError = yyResult.select(yyError);
01228: if (yyResult.hasValue()
01229: && ((Node) yyResult.semanticValue())
01230: .getTokenText().equals("}")) {
01231: final Node v$pt$3 = yyResult.semanticValue();
01232: yyValue = Formatting.round1(v$pt$1, v$pt$2, v$pt$3);
01233:
01234: return yyResult.createValue(yyValue, yyError);
01235: } else {
01236: yyError = yyError.select("\"}\" expected", yyBase);
01237: }
01238: }
01239: }
01240:
01241: // Done.
01242: yyError = yyError.select("class body expected", yyStart);
01243: return yyError;
01244: }
01245:
01246: // =========================================================================
01247:
01248: /**
01249: * Parse synthetic nonterminal xtc.lang.Java.ClassBody$$Split1.
01250: *
01251: * @param yyStart The index.
01252: * @return The result.
01253: * @throws IOException Signals an I/O error.
01254: */
01255: private Result pClassBody$$Split1(final int yyStart)
01256: throws IOException {
01257: Result yyResult;
01258: int yyRepetition1;
01259: Pair<Node> yyRepValue1;
01260: Node yyValue;
01261: ParseError yyError = ParseError.DUMMY;
01262:
01263: // Alternative <Body>.
01264:
01265: yyRepetition1 = yyStart;
01266: yyRepValue1 = Pair.empty();
01267: while (true) {
01268:
01269: yyResult = pDeclaration(yyRepetition1);
01270: yyError = yyResult.select(yyError);
01271: if (yyResult.hasValue()) {
01272: final Node v$el$1 = yyResult.semanticValue();
01273:
01274: yyRepetition1 = yyResult.index;
01275: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
01276: continue;
01277: }
01278: break;
01279: }
01280: { // Start scope for v$g$1.
01281: final Pair<Node> v$g$1 = yyRepValue1.reverse();
01282:
01283: yyValue = GNode.createFromPair("ClassBody", v$g$1);
01284: yyValue.setLocation(location(yyStart));
01285:
01286: return new SemanticValue(yyValue, yyRepetition1, yyError);
01287: } // End scope for v$g$1.
01288: }
01289:
01290: // =========================================================================
01291:
01292: /**
01293: * Parse nonterminal xtc.lang.Java.Declaration.
01294: *
01295: * @param yyStart The index.
01296: * @return The result.
01297: * @throws IOException Signals an I/O error.
01298: */
01299: private Result pDeclaration(final int yyStart) throws IOException {
01300: Result yyResult;
01301: int yyBase;
01302: int yyOption1;
01303: Node yyOpValue1;
01304: Node yyValue;
01305: ParseError yyError = ParseError.DUMMY;
01306:
01307: // Alternative 1.
01308:
01309: yyResult = pModifiers(yyStart);
01310: yyError = yyResult.select(yyError);
01311: if (yyResult.hasValue()) {
01312: final Node v$g$1 = yyResult.semanticValue();
01313:
01314: final int yyChoice1 = yyResult.index;
01315:
01316: // Nested alternative 1.
01317:
01318: yyResult = pType(yyChoice1);
01319: yyError = yyResult.select(yyError);
01320: if (yyResult.hasValue()) {
01321: final Node v$g$2 = yyResult.semanticValue();
01322:
01323: yyResult = pDeclarators(yyResult.index);
01324: yyError = yyResult.select(yyError);
01325: if (yyResult.hasValue()) {
01326: final Node v$pt$2 = yyResult.semanticValue();
01327:
01328: yyBase = yyResult.index;
01329: yyResult = pSymbol(yyBase);
01330: yyError = yyResult.select(yyError);
01331: if (yyResult.hasValue()
01332: && ((Node) yyResult.semanticValue())
01333: .getTokenText().equals(";")) {
01334: final Node v$pt$1 = yyResult.semanticValue();
01335: final Node v$g$3 = Formatting.after1(v$pt$2,
01336: v$pt$1);
01337:
01338: yyValue = GNode.create("FieldDeclaration",
01339: v$g$1, v$g$2, v$g$3);
01340: yyValue.setLocation(location(yyStart));
01341:
01342: return yyResult.createValue(yyValue, yyError);
01343: } else {
01344: yyError = yyError.select("\";\" expected",
01345: yyBase);
01346: }
01347: }
01348: }
01349:
01350: // Nested alternative 2.
01351: { // Start scope for nested choice.
01352:
01353: final int yyChoice2 = yyChoice1;
01354:
01355: // Nested alternative 1.
01356:
01357: yyResult = pResultType(yyChoice2);
01358: yyError = yyResult.select(yyError);
01359: if (yyResult.hasValue()) {
01360: final Node v$g$3 = yyResult.semanticValue();
01361:
01362: yyResult = pIdentifier(yyResult.index);
01363: yyError = yyResult.select(yyError);
01364: if (yyResult.hasValue()) {
01365: final Node v$g$4 = yyResult.semanticValue();
01366:
01367: yyResult = pFormalParameters(yyResult.index);
01368: yyError = yyResult.select(yyError);
01369: if (yyResult.hasValue()) {
01370: final Node v$g$5 = yyResult.semanticValue();
01371:
01372: yyOption1 = yyResult.index;
01373: yyOpValue1 = null;
01374:
01375: yyResult = pDimensions(yyOption1);
01376: yyError = yyResult.select(yyError);
01377: if (yyResult.hasValue()) {
01378: final Node v$el$1 = yyResult
01379: .semanticValue();
01380:
01381: yyOption1 = yyResult.index;
01382: yyOpValue1 = v$el$1;
01383: }
01384: { // Start scope for v$g$6.
01385: final Node v$g$6 = yyOpValue1;
01386:
01387: yyOpValue1 = null;
01388:
01389: yyResult = pThrowsClause(yyOption1);
01390: yyError = yyResult.select(yyError);
01391: if (yyResult.hasValue()) {
01392: final Node v$el$2 = yyResult
01393: .semanticValue();
01394:
01395: yyOption1 = yyResult.index;
01396: yyOpValue1 = v$el$2;
01397: }
01398: { // Start scope for v$g$7.
01399: final Node v$g$7 = yyOpValue1;
01400:
01401: final int yyChoice3 = yyOption1;
01402:
01403: // Nested alternative 1.
01404:
01405: yyResult = pBlock(yyChoice3);
01406: yyError = yyResult.select(yyError);
01407: if (yyResult.hasValue()) {
01408: final Node v$g$8 = yyResult
01409: .semanticValue();
01410:
01411: yyValue = GNode.create(
01412: "MethodDeclaration",
01413: v$g$1, null, v$g$3,
01414: v$g$4, v$g$5, v$g$6,
01415: v$g$7, v$g$8);
01416: yyValue
01417: .setLocation(location(yyStart));
01418:
01419: return yyResult.createValue(
01420: yyValue, yyError);
01421: }
01422:
01423: // Nested alternative 2.
01424:
01425: yyBase = yyChoice3;
01426: yyResult = pSymbol(yyBase);
01427: yyError = yyResult.select(yyError);
01428: if (yyResult.hasValue()
01429: && ((Node) yyResult
01430: .semanticValue())
01431: .getTokenText()
01432: .equals(";")) {
01433: final Node v$pt$1 = yyResult
01434: .semanticValue();
01435: final Node v$g$9 = Formatting
01436: .after1(null, v$pt$1);
01437:
01438: yyValue = GNode.create(
01439: "MethodDeclaration",
01440: v$g$1, null, v$g$3,
01441: v$g$4, v$g$5, v$g$6,
01442: v$g$7, v$g$9);
01443: yyValue
01444: .setLocation(location(yyStart));
01445:
01446: return yyResult.createValue(
01447: yyValue, yyError);
01448: } else {
01449: yyError = yyError.select(
01450: "\";\" expected",
01451: yyBase);
01452: }
01453: } // End scope for v$g$7.
01454: } // End scope for v$g$6.
01455: }
01456: }
01457: }
01458:
01459: // Nested alternative 2.
01460:
01461: yyResult = pIdentifier(yyChoice2);
01462: yyError = yyResult.select(yyError);
01463: if (yyResult.hasValue()) {
01464: final Node v$g$3 = yyResult.semanticValue();
01465:
01466: yyResult = pFormalParameters(yyResult.index);
01467: yyError = yyResult.select(yyError);
01468: if (yyResult.hasValue()) {
01469: final Node v$g$4 = yyResult.semanticValue();
01470:
01471: yyOption1 = yyResult.index;
01472: yyOpValue1 = null;
01473:
01474: yyResult = pThrowsClause(yyOption1);
01475: yyError = yyResult.select(yyError);
01476: if (yyResult.hasValue()) {
01477: final Node v$el$1 = yyResult
01478: .semanticValue();
01479:
01480: yyOption1 = yyResult.index;
01481: yyOpValue1 = v$el$1;
01482: }
01483: { // Start scope for v$g$5.
01484: final Node v$g$5 = yyOpValue1;
01485:
01486: yyResult = pBlock(yyOption1);
01487: yyError = yyResult.select(yyError);
01488: if (yyResult.hasValue()) {
01489: final Node v$g$6 = yyResult
01490: .semanticValue();
01491:
01492: yyValue = GNode.create(
01493: "ConstructorDeclaration",
01494: v$g$1, null, v$g$3, v$g$4,
01495: v$g$5, v$g$6);
01496: yyValue.setLocation(location(yyStart));
01497:
01498: return yyResult.createValue(yyValue,
01499: yyError);
01500: }
01501: } // End scope for v$g$5.
01502: }
01503: }
01504: } // End scope for nested choice.
01505: }
01506:
01507: // Alternative 2.
01508:
01509: yyResult = pModifiers(yyStart);
01510: yyError = yyResult.select(yyError);
01511: if (yyResult.hasValue()) {
01512: final Node v$pt$2 = yyResult.semanticValue();
01513:
01514: final int yyChoice1 = yyResult.index;
01515:
01516: // Nested alternative 1.
01517:
01518: yyBase = yyChoice1;
01519: yyResult = pWord(yyBase);
01520: yyError = yyResult.select(yyError);
01521: if (yyResult.hasValue()
01522: && ((Node) yyResult.semanticValue()).getTokenText()
01523: .equals("class")) {
01524: final Node v$pt$1 = yyResult.semanticValue();
01525: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
01526:
01527: yyResult = pIdentifier(yyResult.index);
01528: yyError = yyResult.select(yyError);
01529: if (yyResult.hasValue()) {
01530: final Node v$g$2 = yyResult.semanticValue();
01531:
01532: yyOption1 = yyResult.index;
01533: yyOpValue1 = null;
01534:
01535: yyResult = pExtension(yyOption1);
01536: yyError = yyResult.select(yyError);
01537: if (yyResult.hasValue()) {
01538: final Node v$el$1 = yyResult.semanticValue();
01539:
01540: yyOption1 = yyResult.index;
01541: yyOpValue1 = v$el$1;
01542: }
01543: { // Start scope for v$g$4.
01544: final Node v$g$4 = yyOpValue1;
01545:
01546: yyOpValue1 = null;
01547:
01548: yyResult = pImplementation(yyOption1);
01549: yyError = yyResult.select(yyError);
01550: if (yyResult.hasValue()) {
01551: final Node v$el$2 = yyResult
01552: .semanticValue();
01553:
01554: yyOption1 = yyResult.index;
01555: yyOpValue1 = v$el$2;
01556: }
01557: { // Start scope for v$g$5.
01558: final Node v$g$5 = yyOpValue1;
01559:
01560: yyResult = pClassBody(yyOption1);
01561: yyError = yyResult.select(yyError);
01562: if (yyResult.hasValue()) {
01563: final Node v$g$6 = yyResult
01564: .semanticValue();
01565:
01566: yyValue = GNode.create(
01567: "ClassDeclaration", v$g$1,
01568: v$g$2, null, v$g$4, v$g$5,
01569: v$g$6);
01570: yyValue.setLocation(location(yyStart));
01571:
01572: return yyResult.createValue(yyValue,
01573: yyError);
01574: }
01575: } // End scope for v$g$5.
01576: } // End scope for v$g$4.
01577: }
01578: } else {
01579: yyError = yyError.select("\"class\" expected", yyBase);
01580: }
01581:
01582: // Nested alternative 2.
01583:
01584: yyBase = yyChoice1;
01585: yyResult = pWord(yyBase);
01586: yyError = yyResult.select(yyError);
01587: if (yyResult.hasValue()
01588: && ((Node) yyResult.semanticValue()).getTokenText()
01589: .equals("interface")) {
01590: final Node v$pt$1 = yyResult.semanticValue();
01591: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
01592:
01593: yyResult = pIdentifier(yyResult.index);
01594: yyError = yyResult.select(yyError);
01595: if (yyResult.hasValue()) {
01596: final Node v$g$2 = yyResult.semanticValue();
01597:
01598: yyOption1 = yyResult.index;
01599: yyOpValue1 = null;
01600:
01601: yyResult = pExtension(yyOption1);
01602: yyError = yyResult.select(yyError);
01603: if (yyResult.hasValue()) {
01604: final Node v$el$1 = yyResult.semanticValue();
01605:
01606: yyOption1 = yyResult.index;
01607: yyOpValue1 = v$el$1;
01608: }
01609: { // Start scope for v$g$4.
01610: final Node v$g$4 = yyOpValue1;
01611:
01612: yyResult = pClassBody(yyOption1);
01613: yyError = yyResult.select(yyError);
01614: if (yyResult.hasValue()) {
01615: final Node v$g$5 = yyResult.semanticValue();
01616:
01617: yyValue = GNode.create(
01618: "InterfaceDeclaration", v$g$1,
01619: v$g$2, null, v$g$4, v$g$5);
01620: yyValue.setLocation(location(yyStart));
01621:
01622: return yyResult.createValue(yyValue,
01623: yyError);
01624: }
01625: } // End scope for v$g$4.
01626: }
01627: } else {
01628: yyError = yyError.select("\"interface\" expected",
01629: yyBase);
01630: }
01631: }
01632:
01633: // Alternative 3.
01634:
01635: yyOption1 = yyStart;
01636: yyOpValue1 = null;
01637:
01638: yyBase = yyOption1;
01639: yyResult = pWord(yyBase);
01640: yyError = yyResult.select(yyError);
01641: if (yyResult.hasValue()
01642: && ((Node) yyResult.semanticValue()).getTokenText()
01643: .equals("static")) {
01644: final Node v$el$1 = yyResult.semanticValue();
01645:
01646: yyOption1 = yyResult.index;
01647: yyOpValue1 = v$el$1;
01648: } else {
01649: yyError = yyError.select("\"static\" expected", yyBase);
01650: }
01651: { // Start scope for v$g$1.
01652: final Node v$g$1 = yyOpValue1;
01653:
01654: yyResult = pBlock(yyOption1);
01655: yyError = yyResult.select(yyError);
01656: if (yyResult.hasValue()) {
01657: final Node v$g$2 = yyResult.semanticValue();
01658:
01659: yyValue = GNode
01660: .create("BlockDeclaration", v$g$1, v$g$2);
01661: yyValue.setLocation(location(yyStart));
01662:
01663: return yyResult.createValue(yyValue, yyError);
01664: }
01665: } // End scope for v$g$1.
01666:
01667: // Alternative 4.
01668:
01669: yyResult = pSymbol(yyStart);
01670: yyError = yyResult.select(yyError);
01671: if (yyResult.hasValue()
01672: && ((Node) yyResult.semanticValue()).getTokenText()
01673: .equals(";")) {
01674: final Node v$pt$1 = yyResult.semanticValue();
01675:
01676: yyValue = GNode.create("EmptyDeclaration", false);
01677: yyValue.setLocation(location(yyStart));
01678: yyValue = Formatting.after1(yyValue, v$pt$1);
01679:
01680: return yyResult.createValue(yyValue, yyError);
01681: }
01682:
01683: // Done.
01684: yyError = yyError.select("declaration expected", yyStart);
01685: return yyError;
01686: }
01687:
01688: // =========================================================================
01689:
01690: /**
01691: * Parse nonterminal xtc.lang.Java.ThrowsClause.
01692: *
01693: * @param yyStart The index.
01694: * @return The result.
01695: * @throws IOException Signals an I/O error.
01696: */
01697: private Result pThrowsClause(final int yyStart) throws IOException {
01698: Result yyResult;
01699: int yyBase;
01700: int yyRepetition1;
01701: Pair<Node> yyRepValue1;
01702: Node yyValue;
01703: ParseError yyError = ParseError.DUMMY;
01704:
01705: // Alternative 1.
01706:
01707: yyResult = pWord(yyStart);
01708: yyError = yyResult.select(yyError);
01709: if (yyResult.hasValue()
01710: && ((Node) yyResult.semanticValue()).getTokenText()
01711: .equals("throws")) {
01712: final Node v$pt$3 = yyResult.semanticValue();
01713:
01714: yyResult = pQualifiedIdentifier(yyResult.index);
01715: yyError = yyResult.select(yyError);
01716: if (yyResult.hasValue()) {
01717: final Node v$pt$4 = yyResult.semanticValue();
01718: final Node v$g$1 = Formatting.before1(v$pt$3, v$pt$4);
01719:
01720: yyRepetition1 = yyResult.index;
01721: yyRepValue1 = Pair.empty();
01722: while (true) {
01723:
01724: yyBase = yyRepetition1;
01725: yyResult = pSymbol(yyBase);
01726: yyError = yyResult.select(yyError);
01727: if (yyResult.hasValue()
01728: && ((Node) yyResult.semanticValue())
01729: .getTokenText().equals(",")) {
01730: final Node v$pt$1 = yyResult.semanticValue();
01731:
01732: yyResult = pQualifiedIdentifier(yyResult.index);
01733: yyError = yyResult.select(yyError);
01734: if (yyResult.hasValue()) {
01735: final Node v$pt$2 = yyResult
01736: .semanticValue();
01737: final Node v$el$1 = Formatting.before1(
01738: v$pt$1, v$pt$2);
01739:
01740: yyRepetition1 = yyResult.index;
01741: yyRepValue1 = new Pair<Node>(v$el$1,
01742: yyRepValue1);
01743: continue;
01744: }
01745: } else {
01746: yyError = yyError.select("\",\" expected",
01747: yyBase);
01748: }
01749: break;
01750: }
01751: { // Start scope for v$g$2.
01752: final Pair<Node> v$g$2 = yyRepValue1.reverse();
01753:
01754: yyValue = GNode.createFromPair("ThrowsClause",
01755: v$g$1, v$g$2);
01756: yyValue.setLocation(location(yyStart));
01757:
01758: return new SemanticValue(yyValue, yyRepetition1,
01759: yyError);
01760: } // End scope for v$g$2.
01761: }
01762: }
01763:
01764: // Done.
01765: yyError = yyError.select("throws clause expected", yyStart);
01766: return yyError;
01767: }
01768:
01769: // =========================================================================
01770:
01771: /**
01772: * Parse nonterminal xtc.lang.Java.Extension.
01773: *
01774: * @param yyStart The index.
01775: * @return The result.
01776: * @throws IOException Signals an I/O error.
01777: */
01778: private Result pExtension(final int yyStart) throws IOException {
01779: Result yyResult;
01780: int yyBase;
01781: int yyRepetition1;
01782: Pair<Node> yyRepValue1;
01783: Node yyValue;
01784: ParseError yyError = ParseError.DUMMY;
01785:
01786: // Alternative 1.
01787:
01788: yyResult = pWord(yyStart);
01789: yyError = yyResult.select(yyError);
01790: if (yyResult.hasValue()
01791: && ((Node) yyResult.semanticValue()).getTokenText()
01792: .equals("extends")) {
01793: final Node v$pt$3 = yyResult.semanticValue();
01794:
01795: yyResult = pType(yyResult.index);
01796: yyError = yyResult.select(yyError);
01797: if (yyResult.hasValue()) {
01798: final Node v$pt$4 = yyResult.semanticValue();
01799: final Node v$g$1 = Formatting.before1(v$pt$3, v$pt$4);
01800:
01801: yyRepetition1 = yyResult.index;
01802: yyRepValue1 = Pair.empty();
01803: while (true) {
01804:
01805: yyBase = yyRepetition1;
01806: yyResult = pSymbol(yyBase);
01807: yyError = yyResult.select(yyError);
01808: if (yyResult.hasValue()
01809: && ((Node) yyResult.semanticValue())
01810: .getTokenText().equals(",")) {
01811: final Node v$pt$1 = yyResult.semanticValue();
01812:
01813: yyResult = pType(yyResult.index);
01814: yyError = yyResult.select(yyError);
01815: if (yyResult.hasValue()) {
01816: final Node v$pt$2 = yyResult
01817: .semanticValue();
01818: final Node v$el$1 = Formatting.before1(
01819: v$pt$1, v$pt$2);
01820:
01821: yyRepetition1 = yyResult.index;
01822: yyRepValue1 = new Pair<Node>(v$el$1,
01823: yyRepValue1);
01824: continue;
01825: }
01826: } else {
01827: yyError = yyError.select("\",\" expected",
01828: yyBase);
01829: }
01830: break;
01831: }
01832: { // Start scope for v$g$2.
01833: final Pair<Node> v$g$2 = yyRepValue1.reverse();
01834:
01835: yyValue = GNode.createFromPair("Extension", v$g$1,
01836: v$g$2);
01837: yyValue.setLocation(location(yyStart));
01838:
01839: return new SemanticValue(yyValue, yyRepetition1,
01840: yyError);
01841: } // End scope for v$g$2.
01842: }
01843: }
01844:
01845: // Done.
01846: yyError = yyError.select("extension expected", yyStart);
01847: return yyError;
01848: }
01849:
01850: // =========================================================================
01851:
01852: /**
01853: * Parse nonterminal xtc.lang.Java.Implementation.
01854: *
01855: * @param yyStart The index.
01856: * @return The result.
01857: * @throws IOException Signals an I/O error.
01858: */
01859: private Result pImplementation(final int yyStart)
01860: throws IOException {
01861: Result yyResult;
01862: int yyBase;
01863: int yyRepetition1;
01864: Pair<Node> yyRepValue1;
01865: Node yyValue;
01866: ParseError yyError = ParseError.DUMMY;
01867:
01868: // Alternative 1.
01869:
01870: yyResult = pWord(yyStart);
01871: yyError = yyResult.select(yyError);
01872: if (yyResult.hasValue()
01873: && ((Node) yyResult.semanticValue()).getTokenText()
01874: .equals("implements")) {
01875: final Node v$pt$3 = yyResult.semanticValue();
01876:
01877: yyResult = pType(yyResult.index);
01878: yyError = yyResult.select(yyError);
01879: if (yyResult.hasValue()) {
01880: final Node v$pt$4 = yyResult.semanticValue();
01881: final Node v$g$1 = Formatting.before1(v$pt$3, v$pt$4);
01882:
01883: yyRepetition1 = yyResult.index;
01884: yyRepValue1 = Pair.empty();
01885: while (true) {
01886:
01887: yyBase = yyRepetition1;
01888: yyResult = pSymbol(yyBase);
01889: yyError = yyResult.select(yyError);
01890: if (yyResult.hasValue()
01891: && ((Node) yyResult.semanticValue())
01892: .getTokenText().equals(",")) {
01893: final Node v$pt$1 = yyResult.semanticValue();
01894:
01895: yyResult = pType(yyResult.index);
01896: yyError = yyResult.select(yyError);
01897: if (yyResult.hasValue()) {
01898: final Node v$pt$2 = yyResult
01899: .semanticValue();
01900: final Node v$el$1 = Formatting.before1(
01901: v$pt$1, v$pt$2);
01902:
01903: yyRepetition1 = yyResult.index;
01904: yyRepValue1 = new Pair<Node>(v$el$1,
01905: yyRepValue1);
01906: continue;
01907: }
01908: } else {
01909: yyError = yyError.select("\",\" expected",
01910: yyBase);
01911: }
01912: break;
01913: }
01914: { // Start scope for v$g$2.
01915: final Pair<Node> v$g$2 = yyRepValue1.reverse();
01916:
01917: yyValue = GNode.createFromPair("Implementation",
01918: v$g$1, v$g$2);
01919: yyValue.setLocation(location(yyStart));
01920:
01921: return new SemanticValue(yyValue, yyRepetition1,
01922: yyError);
01923: } // End scope for v$g$2.
01924: }
01925: }
01926:
01927: // Done.
01928: yyError = yyError.select("implementation expected", yyStart);
01929: return yyError;
01930: }
01931:
01932: // =========================================================================
01933:
01934: /**
01935: * Parse nonterminal xtc.lang.Java.Block.
01936: *
01937: * @param yyStart The index.
01938: * @return The result.
01939: * @throws IOException Signals an I/O error.
01940: */
01941: private Result pBlock(final int yyStart) throws IOException {
01942: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
01943: if (null == yyColumn.chunk1)
01944: yyColumn.chunk1 = new Chunk1();
01945: if (null == yyColumn.chunk1.fBlock)
01946: yyColumn.chunk1.fBlock = pBlock$1(yyStart);
01947: return yyColumn.chunk1.fBlock;
01948: }
01949:
01950: /** Actually parse xtc.lang.Java.Block. */
01951: private Result pBlock$1(final int yyStart) throws IOException {
01952: Result yyResult;
01953: int yyBase;
01954: Node yyValue;
01955: ParseError yyError = ParseError.DUMMY;
01956:
01957: // Alternative <Block>.
01958:
01959: yyResult = pSymbol(yyStart);
01960: yyError = yyResult.select(yyError);
01961: if (yyResult.hasValue()
01962: && ((Node) yyResult.semanticValue()).getTokenText()
01963: .equals("{")) {
01964: final Node v$pt$1 = yyResult.semanticValue();
01965:
01966: yyResult = pBlock$$Split1(yyResult.index);
01967: yyError = yyResult.select(yyError);
01968: if (yyResult.hasValue()) {
01969: final Node v$pt$2 = yyResult.semanticValue();
01970:
01971: yyBase = yyResult.index;
01972: yyResult = pSymbol(yyBase);
01973: yyError = yyResult.select(yyError);
01974: if (yyResult.hasValue()
01975: && ((Node) yyResult.semanticValue())
01976: .getTokenText().equals("}")) {
01977: final Node v$pt$3 = yyResult.semanticValue();
01978: yyValue = Formatting.round1(v$pt$1, v$pt$2, v$pt$3);
01979:
01980: return yyResult.createValue(yyValue, yyError);
01981: } else {
01982: yyError = yyError.select("\"}\" expected", yyBase);
01983: }
01984: }
01985: }
01986:
01987: // Done.
01988: yyError = yyError.select("block expected", yyStart);
01989: return yyError;
01990: }
01991:
01992: // =========================================================================
01993:
01994: /**
01995: * Parse synthetic nonterminal xtc.lang.Java.Block$$Split1.
01996: *
01997: * @param yyStart The index.
01998: * @return The result.
01999: * @throws IOException Signals an I/O error.
02000: */
02001: private Result pBlock$$Split1(final int yyStart) throws IOException {
02002: Result yyResult;
02003: int yyRepetition1;
02004: Pair<Node> yyRepValue1;
02005: Node yyValue;
02006: ParseError yyError = ParseError.DUMMY;
02007:
02008: // Alternative <Block>.
02009:
02010: yyRepetition1 = yyStart;
02011: yyRepValue1 = Pair.empty();
02012: while (true) {
02013:
02014: yyResult = pDeclarationOrStatement(yyRepetition1);
02015: yyError = yyResult.select(yyError);
02016: if (yyResult.hasValue()) {
02017: final Node v$el$1 = yyResult.semanticValue();
02018:
02019: yyRepetition1 = yyResult.index;
02020: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
02021: continue;
02022: }
02023: break;
02024: }
02025: { // Start scope for v$g$1.
02026: final Pair<Node> v$g$1 = yyRepValue1.reverse();
02027:
02028: yyValue = GNode.createFromPair("Block", v$g$1);
02029: yyValue.setLocation(location(yyStart));
02030:
02031: return new SemanticValue(yyValue, yyRepetition1, yyError);
02032: } // End scope for v$g$1.
02033: }
02034:
02035: // =========================================================================
02036:
02037: /**
02038: * Parse nonterminal xtc.lang.Java.DeclarationOrStatement.
02039: *
02040: * @param yyStart The index.
02041: * @return The result.
02042: * @throws IOException Signals an I/O error.
02043: */
02044: private Result pDeclarationOrStatement(final int yyStart)
02045: throws IOException {
02046:
02047: Result yyResult;
02048: Node yyValue;
02049: ParseError yyError = ParseError.DUMMY;
02050:
02051: // Alternative <Declaration>.
02052:
02053: yyResult = pInBlockDeclaration(yyStart);
02054: yyError = yyResult.select(yyError);
02055: if (yyResult.hasValue()) {
02056: yyValue = yyResult.semanticValue();
02057:
02058: return yyResult.createValue(yyValue, yyError);
02059: }
02060:
02061: // Alternative <Statement>.
02062:
02063: yyResult = pStatement(yyStart);
02064: yyError = yyResult.select(yyError);
02065: if (yyResult.hasValue()) {
02066: yyValue = yyResult.semanticValue();
02067:
02068: return yyResult.createValue(yyValue, yyError);
02069: }
02070:
02071: // Done.
02072: return yyError;
02073: }
02074:
02075: // =========================================================================
02076:
02077: /**
02078: * Parse nonterminal xtc.lang.Java.InBlockDeclaration.
02079: *
02080: * @param yyStart The index.
02081: * @return The result.
02082: * @throws IOException Signals an I/O error.
02083: */
02084: private Result pInBlockDeclaration(final int yyStart)
02085: throws IOException {
02086: Result yyResult;
02087: int yyBase;
02088: int yyOption1;
02089: Node yyOpValue1;
02090: Node yyValue;
02091: ParseError yyError = ParseError.DUMMY;
02092:
02093: // Alternative <Variable>.
02094:
02095: yyResult = pVariableDeclaration(yyStart);
02096: yyError = yyResult.select(yyError);
02097: if (yyResult.hasValue()) {
02098: yyValue = yyResult.semanticValue();
02099:
02100: return yyResult.createValue(yyValue, yyError);
02101: }
02102:
02103: // Alternative 2.
02104:
02105: yyResult = pModifiers(yyStart);
02106: yyError = yyResult.select(yyError);
02107: if (yyResult.hasValue()) {
02108: final Node v$pt$2 = yyResult.semanticValue();
02109:
02110: final int yyChoice1 = yyResult.index;
02111:
02112: // Nested alternative 1.
02113:
02114: yyBase = yyChoice1;
02115: yyResult = pWord(yyBase);
02116: yyError = yyResult.select(yyError);
02117: if (yyResult.hasValue()
02118: && ((Node) yyResult.semanticValue()).getTokenText()
02119: .equals("class")) {
02120: final Node v$pt$1 = yyResult.semanticValue();
02121: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
02122:
02123: yyResult = pIdentifier(yyResult.index);
02124: yyError = yyResult.select(yyError);
02125: if (yyResult.hasValue()) {
02126: final Node v$g$2 = yyResult.semanticValue();
02127:
02128: yyOption1 = yyResult.index;
02129: yyOpValue1 = null;
02130:
02131: yyResult = pExtension(yyOption1);
02132: yyError = yyResult.select(yyError);
02133: if (yyResult.hasValue()) {
02134: final Node v$el$1 = yyResult.semanticValue();
02135:
02136: yyOption1 = yyResult.index;
02137: yyOpValue1 = v$el$1;
02138: }
02139: { // Start scope for v$g$4.
02140: final Node v$g$4 = yyOpValue1;
02141:
02142: yyOpValue1 = null;
02143:
02144: yyResult = pImplementation(yyOption1);
02145: yyError = yyResult.select(yyError);
02146: if (yyResult.hasValue()) {
02147: final Node v$el$2 = yyResult
02148: .semanticValue();
02149:
02150: yyOption1 = yyResult.index;
02151: yyOpValue1 = v$el$2;
02152: }
02153: { // Start scope for v$g$5.
02154: final Node v$g$5 = yyOpValue1;
02155:
02156: yyResult = pClassBody(yyOption1);
02157: yyError = yyResult.select(yyError);
02158: if (yyResult.hasValue()) {
02159: final Node v$g$6 = yyResult
02160: .semanticValue();
02161:
02162: yyValue = GNode.create(
02163: "ClassDeclaration", v$g$1,
02164: v$g$2, null, v$g$4, v$g$5,
02165: v$g$6);
02166: yyValue.setLocation(location(yyStart));
02167:
02168: return yyResult.createValue(yyValue,
02169: yyError);
02170: }
02171: } // End scope for v$g$5.
02172: } // End scope for v$g$4.
02173: }
02174: } else {
02175: yyError = yyError.select("\"class\" expected", yyBase);
02176: }
02177:
02178: // Nested alternative 2.
02179:
02180: yyBase = yyChoice1;
02181: yyResult = pWord(yyBase);
02182: yyError = yyResult.select(yyError);
02183: if (yyResult.hasValue()
02184: && ((Node) yyResult.semanticValue()).getTokenText()
02185: .equals("interface")) {
02186: final Node v$pt$1 = yyResult.semanticValue();
02187: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
02188:
02189: yyResult = pIdentifier(yyResult.index);
02190: yyError = yyResult.select(yyError);
02191: if (yyResult.hasValue()) {
02192: final Node v$g$2 = yyResult.semanticValue();
02193:
02194: yyOption1 = yyResult.index;
02195: yyOpValue1 = null;
02196:
02197: yyResult = pExtension(yyOption1);
02198: yyError = yyResult.select(yyError);
02199: if (yyResult.hasValue()) {
02200: final Node v$el$1 = yyResult.semanticValue();
02201:
02202: yyOption1 = yyResult.index;
02203: yyOpValue1 = v$el$1;
02204: }
02205: { // Start scope for v$g$4.
02206: final Node v$g$4 = yyOpValue1;
02207:
02208: yyResult = pClassBody(yyOption1);
02209: yyError = yyResult.select(yyError);
02210: if (yyResult.hasValue()) {
02211: final Node v$g$5 = yyResult.semanticValue();
02212:
02213: yyValue = GNode.create(
02214: "InterfaceDeclaration", v$g$1,
02215: v$g$2, null, v$g$4, v$g$5);
02216: yyValue.setLocation(location(yyStart));
02217:
02218: return yyResult.createValue(yyValue,
02219: yyError);
02220: }
02221: } // End scope for v$g$4.
02222: }
02223: } else {
02224: yyError = yyError.select("\"interface\" expected",
02225: yyBase);
02226: }
02227: }
02228:
02229: // Done.
02230: return yyError;
02231: }
02232:
02233: // =========================================================================
02234:
02235: /**
02236: * Parse nonterminal xtc.lang.Java.VariableDeclaration.
02237: *
02238: * @param yyStart The index.
02239: * @return The result.
02240: * @throws IOException Signals an I/O error.
02241: */
02242: private Result pVariableDeclaration(final int yyStart)
02243: throws IOException {
02244: Result yyResult;
02245: int yyBase;
02246: Node yyValue;
02247: ParseError yyError = ParseError.DUMMY;
02248:
02249: // Alternative <Declaration>.
02250:
02251: yyResult = pVariableModifiers(yyStart);
02252: yyError = yyResult.select(yyError);
02253: if (yyResult.hasValue()) {
02254: final Node v$g$1 = yyResult.semanticValue();
02255:
02256: yyResult = pType(yyResult.index);
02257: yyError = yyResult.select(yyError);
02258: if (yyResult.hasValue()) {
02259: final Node v$g$2 = yyResult.semanticValue();
02260:
02261: yyResult = pDeclarators(yyResult.index);
02262: yyError = yyResult.select(yyError);
02263: if (yyResult.hasValue()) {
02264: final Node v$pt$2 = yyResult.semanticValue();
02265:
02266: yyBase = yyResult.index;
02267: yyResult = pSymbol(yyBase);
02268: yyError = yyResult.select(yyError);
02269: if (yyResult.hasValue()
02270: && ((Node) yyResult.semanticValue())
02271: .getTokenText().equals(";")) {
02272: final Node v$pt$1 = yyResult.semanticValue();
02273: final Node v$g$3 = Formatting.after1(v$pt$2,
02274: v$pt$1);
02275:
02276: yyValue = GNode.create("FieldDeclaration",
02277: v$g$1, v$g$2, v$g$3);
02278: yyValue.setLocation(location(yyStart));
02279:
02280: return yyResult.createValue(yyValue, yyError);
02281: } else {
02282: yyError = yyError.select("\";\" expected",
02283: yyBase);
02284: }
02285: }
02286: }
02287: }
02288:
02289: // Done.
02290: return yyError;
02291: }
02292:
02293: // =========================================================================
02294:
02295: /**
02296: * Parse nonterminal xtc.lang.Java.Statement.
02297: *
02298: * @param yyStart The index.
02299: * @return The result.
02300: * @throws IOException Signals an I/O error.
02301: */
02302: private Result pStatement(final int yyStart) throws IOException {
02303: Result yyResult;
02304: int yyBase;
02305: int yyRepetition1;
02306: boolean yyRepeated1;
02307: Pair<Node> yyRepValue1;
02308: int yyOption1;
02309: Node yyOpValue1;
02310: Node yyValue;
02311: ParseError yyError = ParseError.DUMMY;
02312:
02313: // Alternative <Block>.
02314:
02315: yyResult = pBlock(yyStart);
02316: yyError = yyResult.select(yyError);
02317: if (yyResult.hasValue()) {
02318: yyValue = yyResult.semanticValue();
02319:
02320: return yyResult.createValue(yyValue, yyError);
02321: }
02322:
02323: // Alternative 2.
02324:
02325: yyResult = pWord(yyStart);
02326: yyError = yyResult.select(yyError);
02327: if (yyResult.hasValue()
02328: && ((Node) yyResult.semanticValue()).getTokenText()
02329: .equals("if")) {
02330: final Node v$pt$1 = yyResult.semanticValue();
02331:
02332: yyResult = pParExpression(yyResult.index);
02333: yyError = yyResult.select(yyError);
02334: if (yyResult.hasValue()) {
02335: final Node v$pt$2 = yyResult.semanticValue();
02336: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
02337:
02338: yyResult = pStatement(yyResult.index);
02339: yyError = yyResult.select(yyError);
02340: if (yyResult.hasValue()) {
02341: final Node v$g$2 = yyResult.semanticValue();
02342:
02343: final int yyChoice1 = yyResult.index;
02344:
02345: // Nested alternative 1.
02346:
02347: yyBase = yyChoice1;
02348: yyResult = pWord(yyBase);
02349: yyError = yyResult.select(yyError);
02350: if (yyResult.hasValue()
02351: && ((Node) yyResult.semanticValue())
02352: .getTokenText().equals("else")) {
02353: final Node v$pt$3 = yyResult.semanticValue();
02354:
02355: yyResult = pStatement(yyResult.index);
02356: yyError = yyResult.select(yyError);
02357: if (yyResult.hasValue()) {
02358: final Node v$pt$4 = yyResult
02359: .semanticValue();
02360: final Node v$g$3 = Formatting.before1(
02361: v$pt$3, v$pt$4);
02362:
02363: yyValue = GNode.create(
02364: "ConditionalStatement", v$g$1,
02365: v$g$2, v$g$3);
02366: yyValue.setLocation(location(yyStart));
02367:
02368: return yyResult.createValue(yyValue,
02369: yyError);
02370: }
02371: } else {
02372: yyError = yyError.select("\"else\" expected",
02373: yyBase);
02374: }
02375:
02376: // Nested alternative 2.
02377:
02378: yyValue = GNode.create("ConditionalStatement",
02379: v$g$1, v$g$2, null);
02380: yyValue.setLocation(location(yyStart));
02381:
02382: return new SemanticValue(yyValue, yyChoice1,
02383: yyError);
02384: }
02385: }
02386: }
02387:
02388: // Alternative 3.
02389:
02390: yyResult = pWord(yyStart);
02391: yyError = yyResult.select(yyError);
02392: if (yyResult.hasValue()
02393: && ((Node) yyResult.semanticValue()).getTokenText()
02394: .equals("for")) {
02395: final Node v$pt$1 = yyResult.semanticValue();
02396:
02397: yyBase = yyResult.index;
02398: yyResult = pSymbol(yyBase);
02399: yyError = yyResult.select(yyError);
02400: if (yyResult.hasValue()
02401: && ((Node) yyResult.semanticValue()).getTokenText()
02402: .equals("(")) {
02403: final Node v$pt$2 = yyResult.semanticValue();
02404:
02405: yyResult = pBasicForControl(yyResult.index);
02406: yyError = yyResult.select(yyError);
02407: if (yyResult.hasValue()) {
02408: final Node v$pt$4 = yyResult.semanticValue();
02409:
02410: yyBase = yyResult.index;
02411: yyResult = pSymbol(yyBase);
02412: yyError = yyResult.select(yyError);
02413: if (yyResult.hasValue()
02414: && ((Node) yyResult.semanticValue())
02415: .getTokenText().equals(")")) {
02416: final Node v$pt$3 = yyResult.semanticValue();
02417: final Node v$g$1 = Formatting.variable().add(
02418: v$pt$1).add(v$pt$2).addNode(v$pt$4)
02419: .add(v$pt$3);
02420:
02421: yyResult = pStatement(yyResult.index);
02422: yyError = yyResult.select(yyError);
02423: if (yyResult.hasValue()) {
02424: final Node v$g$2 = yyResult.semanticValue();
02425:
02426: yyValue = GNode.create("ForStatement",
02427: v$g$1, v$g$2);
02428: yyValue.setLocation(location(yyStart));
02429:
02430: return yyResult.createValue(yyValue,
02431: yyError);
02432: }
02433: } else {
02434: yyError = yyError.select("\")\" expected",
02435: yyBase);
02436: }
02437: }
02438: } else {
02439: yyError = yyError.select("\"(\" expected", yyBase);
02440: }
02441: }
02442:
02443: // Alternative 4.
02444:
02445: yyResult = pWord(yyStart);
02446: yyError = yyResult.select(yyError);
02447: if (yyResult.hasValue()
02448: && ((Node) yyResult.semanticValue()).getTokenText()
02449: .equals("while")) {
02450: final Node v$pt$1 = yyResult.semanticValue();
02451:
02452: yyResult = pParExpression(yyResult.index);
02453: yyError = yyResult.select(yyError);
02454: if (yyResult.hasValue()) {
02455: final Node v$pt$2 = yyResult.semanticValue();
02456: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
02457:
02458: yyResult = pStatement(yyResult.index);
02459: yyError = yyResult.select(yyError);
02460: if (yyResult.hasValue()) {
02461: final Node v$g$2 = yyResult.semanticValue();
02462:
02463: yyValue = GNode.create("WhileStatement", v$g$1,
02464: v$g$2);
02465: yyValue.setLocation(location(yyStart));
02466:
02467: return yyResult.createValue(yyValue, yyError);
02468: }
02469: }
02470: }
02471:
02472: // Alternative 5.
02473:
02474: yyResult = pWord(yyStart);
02475: yyError = yyResult.select(yyError);
02476: if (yyResult.hasValue()
02477: && ((Node) yyResult.semanticValue()).getTokenText()
02478: .equals("do")) {
02479: final Node v$pt$1 = yyResult.semanticValue();
02480:
02481: yyResult = pStatement(yyResult.index);
02482: yyError = yyResult.select(yyError);
02483: if (yyResult.hasValue()) {
02484: final Node v$pt$3 = yyResult.semanticValue();
02485:
02486: yyBase = yyResult.index;
02487: yyResult = pWord(yyBase);
02488: yyError = yyResult.select(yyError);
02489: if (yyResult.hasValue()
02490: && ((Node) yyResult.semanticValue())
02491: .getTokenText().equals("while")) {
02492: final Node v$pt$2 = yyResult.semanticValue();
02493: final Node v$g$1 = Formatting.round1(v$pt$1,
02494: v$pt$3, v$pt$2);
02495:
02496: yyResult = pParExpression(yyResult.index);
02497: yyError = yyResult.select(yyError);
02498: if (yyResult.hasValue()) {
02499: final Node v$pt$5 = yyResult.semanticValue();
02500:
02501: yyBase = yyResult.index;
02502: yyResult = pSymbol(yyBase);
02503: yyError = yyResult.select(yyError);
02504: if (yyResult.hasValue()
02505: && ((Node) yyResult.semanticValue())
02506: .getTokenText().equals(";")) {
02507: final Node v$pt$4 = yyResult
02508: .semanticValue();
02509: final Node v$g$2 = Formatting.after1(
02510: v$pt$5, v$pt$4);
02511:
02512: yyValue = GNode.create("DoWhileStatement",
02513: v$g$1, v$g$2);
02514: yyValue.setLocation(location(yyStart));
02515:
02516: return yyResult.createValue(yyValue,
02517: yyError);
02518: } else {
02519: yyError = yyError.select("\";\" expected",
02520: yyBase);
02521: }
02522: }
02523: } else {
02524: yyError = yyError.select("\"while\" expected",
02525: yyBase);
02526: }
02527: }
02528: }
02529:
02530: // Alternative 6.
02531:
02532: yyResult = pWord(yyStart);
02533: yyError = yyResult.select(yyError);
02534: if (yyResult.hasValue()
02535: && ((Node) yyResult.semanticValue()).getTokenText()
02536: .equals("try")) {
02537: final Node v$pt$1 = yyResult.semanticValue();
02538:
02539: yyResult = pBlock(yyResult.index);
02540: yyError = yyResult.select(yyError);
02541: if (yyResult.hasValue()) {
02542: final Node v$pt$2 = yyResult.semanticValue();
02543: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
02544:
02545: final int yyChoice1 = yyResult.index;
02546:
02547: // Nested alternative 1.
02548:
02549: yyRepetition1 = yyChoice1;
02550: yyRepValue1 = Pair.empty();
02551: while (true) {
02552:
02553: yyResult = pCatchClause(yyRepetition1);
02554: yyError = yyResult.select(yyError);
02555: if (yyResult.hasValue()) {
02556: final Node v$el$1 = yyResult.semanticValue();
02557:
02558: yyRepetition1 = yyResult.index;
02559: yyRepValue1 = new Pair<Node>(v$el$1,
02560: yyRepValue1);
02561: continue;
02562: }
02563: break;
02564: }
02565: { // Start scope for v$g$2.
02566: final Pair<Node> v$g$2 = yyRepValue1.reverse();
02567:
02568: yyBase = yyRepetition1;
02569: yyResult = pWord(yyBase);
02570: yyError = yyResult.select(yyError);
02571: if (yyResult.hasValue()
02572: && ((Node) yyResult.semanticValue())
02573: .getTokenText().equals("finally")) {
02574: final Node v$pt$3 = yyResult.semanticValue();
02575:
02576: yyResult = pBlock(yyResult.index);
02577: yyError = yyResult.select(yyError);
02578: if (yyResult.hasValue()) {
02579: final Node v$pt$4 = yyResult
02580: .semanticValue();
02581: final Node v$g$3 = Formatting.before1(
02582: v$pt$3, v$pt$4);
02583:
02584: yyValue = GNode.create(
02585: "TryCatchFinallyStatement",
02586: v$g$2.size() + 2).add(v$g$1)
02587: .addAll(v$g$2).add(v$g$3);
02588: yyValue.setLocation(location(yyStart));
02589:
02590: return yyResult.createValue(yyValue,
02591: yyError);
02592: }
02593: } else {
02594: yyError = yyError.select(
02595: "\"finally\" expected", yyBase);
02596: }
02597: } // End scope for v$g$2.
02598:
02599: // Nested alternative 2.
02600:
02601: yyRepetition1 = yyChoice1;
02602: yyRepeated1 = false;
02603: yyRepValue1 = Pair.empty();
02604: while (true) {
02605:
02606: yyResult = pCatchClause(yyRepetition1);
02607: yyError = yyResult.select(yyError);
02608: if (yyResult.hasValue()) {
02609: final Node v$el$2 = yyResult.semanticValue();
02610:
02611: yyRepetition1 = yyResult.index;
02612: yyRepeated1 = true;
02613: yyRepValue1 = new Pair<Node>(v$el$2,
02614: yyRepValue1);
02615: continue;
02616: }
02617: break;
02618: }
02619:
02620: if (yyRepeated1) {
02621: final Pair<Node> v$g$4 = yyRepValue1.reverse();
02622:
02623: yyValue = GNode.create("TryCatchFinallyStatement",
02624: v$g$4.size() + 2).add(v$g$1).addAll(v$g$4)
02625: .add(null);
02626: yyValue.setLocation(location(yyStart));
02627:
02628: return new SemanticValue(yyValue, yyRepetition1,
02629: yyError);
02630: }
02631: }
02632: }
02633:
02634: // Alternative 7.
02635:
02636: yyResult = pSwitchStatement$$Split1(yyStart);
02637: yyError = yyResult.select(yyError);
02638: if (yyResult.hasValue()) {
02639: final Node v$pt$1 = yyResult.semanticValue();
02640:
02641: yyBase = yyResult.index;
02642: yyResult = pSymbol(yyBase);
02643: yyError = yyResult.select(yyError);
02644: if (yyResult.hasValue()
02645: && ((Node) yyResult.semanticValue()).getTokenText()
02646: .equals("}")) {
02647: final Node v$pt$2 = yyResult.semanticValue();
02648: yyValue = Formatting.after1(v$pt$1, v$pt$2);
02649:
02650: return yyResult.createValue(yyValue, yyError);
02651: } else {
02652: yyError = yyError.select("\"}\" expected", yyBase);
02653: }
02654: }
02655:
02656: // Alternative 8.
02657:
02658: yyResult = pWord(yyStart);
02659: yyError = yyResult.select(yyError);
02660: if (yyResult.hasValue()
02661: && ((Node) yyResult.semanticValue()).getTokenText()
02662: .equals("synchronized")) {
02663: final Node v$pt$1 = yyResult.semanticValue();
02664:
02665: yyResult = pParExpression(yyResult.index);
02666: yyError = yyResult.select(yyError);
02667: if (yyResult.hasValue()) {
02668: final Node v$pt$2 = yyResult.semanticValue();
02669: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
02670:
02671: yyResult = pBlock(yyResult.index);
02672: yyError = yyResult.select(yyError);
02673: if (yyResult.hasValue()) {
02674: final Node v$g$2 = yyResult.semanticValue();
02675:
02676: yyValue = GNode.create("SynchronizedStatement",
02677: v$g$1, v$g$2);
02678: yyValue.setLocation(location(yyStart));
02679:
02680: return yyResult.createValue(yyValue, yyError);
02681: }
02682: }
02683: }
02684:
02685: // Alternative 9.
02686:
02687: yyResult = pWord(yyStart);
02688: yyError = yyResult.select(yyError);
02689: if (yyResult.hasValue()
02690: && ((Node) yyResult.semanticValue()).getTokenText()
02691: .equals("return")) {
02692: final Node v$pt$1 = yyResult.semanticValue();
02693:
02694: yyOption1 = yyResult.index;
02695: yyOpValue1 = null;
02696:
02697: yyResult = pExpression(yyOption1);
02698: yyError = yyResult.select(yyError);
02699: if (yyResult.hasValue()) {
02700: final Node v$el$1 = yyResult.semanticValue();
02701:
02702: yyOption1 = yyResult.index;
02703: yyOpValue1 = v$el$1;
02704: }
02705: { // Start scope for v$pt$3.
02706: final Node v$pt$3 = yyOpValue1;
02707:
02708: yyBase = yyOption1;
02709: yyResult = pSymbol(yyBase);
02710: yyError = yyResult.select(yyError);
02711: if (yyResult.hasValue()
02712: && ((Node) yyResult.semanticValue())
02713: .getTokenText().equals(";")) {
02714: final Node v$pt$2 = yyResult.semanticValue();
02715: final Node v$g$1 = Formatting.round1(v$pt$1,
02716: v$pt$3, v$pt$2);
02717:
02718: yyValue = GNode.create("ReturnStatement", v$g$1);
02719: yyValue.setLocation(location(yyStart));
02720:
02721: return yyResult.createValue(yyValue, yyError);
02722: } else {
02723: yyError = yyError.select("\";\" expected", yyBase);
02724: }
02725: } // End scope for v$pt$3.
02726: }
02727:
02728: // Alternative 10.
02729:
02730: yyResult = pWord(yyStart);
02731: yyError = yyResult.select(yyError);
02732: if (yyResult.hasValue()
02733: && ((Node) yyResult.semanticValue()).getTokenText()
02734: .equals("throw")) {
02735: final Node v$pt$1 = yyResult.semanticValue();
02736:
02737: yyResult = pExpression(yyResult.index);
02738: yyError = yyResult.select(yyError);
02739: if (yyResult.hasValue()) {
02740: final Node v$pt$3 = yyResult.semanticValue();
02741:
02742: yyBase = yyResult.index;
02743: yyResult = pSymbol(yyBase);
02744: yyError = yyResult.select(yyError);
02745: if (yyResult.hasValue()
02746: && ((Node) yyResult.semanticValue())
02747: .getTokenText().equals(";")) {
02748: final Node v$pt$2 = yyResult.semanticValue();
02749: final Node v$g$1 = Formatting.round1(v$pt$1,
02750: v$pt$3, v$pt$2);
02751:
02752: yyValue = GNode.create("ThrowStatement", v$g$1);
02753: yyValue.setLocation(location(yyStart));
02754:
02755: return yyResult.createValue(yyValue, yyError);
02756: } else {
02757: yyError = yyError.select("\";\" expected", yyBase);
02758: }
02759: }
02760: }
02761:
02762: // Alternative 11.
02763:
02764: yyResult = pWord(yyStart);
02765: yyError = yyResult.select(yyError);
02766: if (yyResult.hasValue()
02767: && ((Node) yyResult.semanticValue()).getTokenText()
02768: .equals("break")) {
02769: final Node v$pt$1 = yyResult.semanticValue();
02770:
02771: yyOption1 = yyResult.index;
02772: yyOpValue1 = null;
02773:
02774: yyResult = pIdentifier(yyOption1);
02775: yyError = yyResult.select(yyError);
02776: if (yyResult.hasValue()) {
02777: final Node v$el$1 = yyResult.semanticValue();
02778:
02779: yyOption1 = yyResult.index;
02780: yyOpValue1 = v$el$1;
02781: }
02782: { // Start scope for v$pt$3.
02783: final Node v$pt$3 = yyOpValue1;
02784:
02785: yyBase = yyOption1;
02786: yyResult = pSymbol(yyBase);
02787: yyError = yyResult.select(yyError);
02788: if (yyResult.hasValue()
02789: && ((Node) yyResult.semanticValue())
02790: .getTokenText().equals(";")) {
02791: final Node v$pt$2 = yyResult.semanticValue();
02792: final Node v$g$1 = Formatting.round1(v$pt$1,
02793: v$pt$3, v$pt$2);
02794:
02795: yyValue = GNode.create("BreakStatement", v$g$1);
02796: yyValue.setLocation(location(yyStart));
02797:
02798: return yyResult.createValue(yyValue, yyError);
02799: } else {
02800: yyError = yyError.select("\";\" expected", yyBase);
02801: }
02802: } // End scope for v$pt$3.
02803: }
02804:
02805: // Alternative 12.
02806:
02807: yyResult = pWord(yyStart);
02808: yyError = yyResult.select(yyError);
02809: if (yyResult.hasValue()
02810: && ((Node) yyResult.semanticValue()).getTokenText()
02811: .equals("continue")) {
02812: final Node v$pt$1 = yyResult.semanticValue();
02813:
02814: yyOption1 = yyResult.index;
02815: yyOpValue1 = null;
02816:
02817: yyResult = pIdentifier(yyOption1);
02818: yyError = yyResult.select(yyError);
02819: if (yyResult.hasValue()) {
02820: final Node v$el$1 = yyResult.semanticValue();
02821:
02822: yyOption1 = yyResult.index;
02823: yyOpValue1 = v$el$1;
02824: }
02825: { // Start scope for v$pt$3.
02826: final Node v$pt$3 = yyOpValue1;
02827:
02828: yyBase = yyOption1;
02829: yyResult = pSymbol(yyBase);
02830: yyError = yyResult.select(yyError);
02831: if (yyResult.hasValue()
02832: && ((Node) yyResult.semanticValue())
02833: .getTokenText().equals(";")) {
02834: final Node v$pt$2 = yyResult.semanticValue();
02835: final Node v$g$1 = Formatting.round1(v$pt$1,
02836: v$pt$3, v$pt$2);
02837:
02838: yyValue = GNode.create("ContinueStatement", v$g$1);
02839: yyValue.setLocation(location(yyStart));
02840:
02841: return yyResult.createValue(yyValue, yyError);
02842: } else {
02843: yyError = yyError.select("\";\" expected", yyBase);
02844: }
02845: } // End scope for v$pt$3.
02846: }
02847:
02848: // Alternative 13.
02849:
02850: yyResult = pIdentifier(yyStart);
02851: yyError = yyResult.select(yyError);
02852: if (yyResult.hasValue()) {
02853: final Node v$pt$2 = yyResult.semanticValue();
02854:
02855: yyBase = yyResult.index;
02856: yyResult = pSymbol(yyBase);
02857: yyError = yyResult.select(yyError);
02858: if (yyResult.hasValue()
02859: && ((Node) yyResult.semanticValue()).getTokenText()
02860: .equals(":")) {
02861: final Node v$pt$1 = yyResult.semanticValue();
02862: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
02863:
02864: yyResult = pStatement(yyResult.index);
02865: yyError = yyResult.select(yyError);
02866: if (yyResult.hasValue()) {
02867: final Node v$g$2 = yyResult.semanticValue();
02868:
02869: yyValue = GNode.create("LabeledStatement", v$g$1,
02870: v$g$2);
02871: yyValue.setLocation(location(yyStart));
02872:
02873: return yyResult.createValue(yyValue, yyError);
02874: }
02875: } else {
02876: yyError = yyError.select("\":\" expected", yyBase);
02877: }
02878: }
02879:
02880: // Alternative 14.
02881:
02882: yyResult = pExpression(yyStart);
02883: yyError = yyResult.select(yyError);
02884: if (yyResult.hasValue()) {
02885: final Node v$pt$2 = yyResult.semanticValue();
02886:
02887: yyBase = yyResult.index;
02888: yyResult = pSymbol(yyBase);
02889: yyError = yyResult.select(yyError);
02890: if (yyResult.hasValue()
02891: && ((Node) yyResult.semanticValue()).getTokenText()
02892: .equals(";")) {
02893: final Node v$pt$1 = yyResult.semanticValue();
02894: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
02895:
02896: yyValue = GNode.create("ExpressionStatement", v$g$1);
02897: yyValue.setLocation(location(yyStart));
02898:
02899: return yyResult.createValue(yyValue, yyError);
02900: } else {
02901: yyError = yyError.select("\";\" expected", yyBase);
02902: }
02903: }
02904:
02905: // Alternative 15.
02906:
02907: yyResult = pWord(yyStart);
02908: yyError = yyResult.select(yyError);
02909: if (yyResult.hasValue()
02910: && ((Node) yyResult.semanticValue()).getTokenText()
02911: .equals("assert")) {
02912: final Node v$pt$3 = yyResult.semanticValue();
02913:
02914: yyResult = pExpression(yyResult.index);
02915: yyError = yyResult.select(yyError);
02916: if (yyResult.hasValue()) {
02917: final Node v$pt$4 = yyResult.semanticValue();
02918: final Node v$g$1 = Formatting.before1(v$pt$3, v$pt$4);
02919:
02920: yyOption1 = yyResult.index;
02921: yyOpValue1 = null;
02922:
02923: yyBase = yyOption1;
02924: yyResult = pSymbol(yyBase);
02925: yyError = yyResult.select(yyError);
02926: if (yyResult.hasValue()
02927: && ((Node) yyResult.semanticValue())
02928: .getTokenText().equals(":")) {
02929: final Node v$pt$1 = yyResult.semanticValue();
02930:
02931: yyResult = pExpression(yyResult.index);
02932: yyError = yyResult.select(yyError);
02933: if (yyResult.hasValue()) {
02934: final Node v$pt$2 = yyResult.semanticValue();
02935: final Node v$el$1 = Formatting.before1(v$pt$1,
02936: v$pt$2);
02937:
02938: yyOption1 = yyResult.index;
02939: yyOpValue1 = v$el$1;
02940: }
02941: } else {
02942: yyError = yyError.select("\":\" expected", yyBase);
02943: }
02944: { // Start scope for v$pt$6.
02945: final Node v$pt$6 = yyOpValue1;
02946:
02947: yyBase = yyOption1;
02948: yyResult = pSymbol(yyBase);
02949: yyError = yyResult.select(yyError);
02950: if (yyResult.hasValue()
02951: && ((Node) yyResult.semanticValue())
02952: .getTokenText().equals(";")) {
02953: final Node v$pt$5 = yyResult.semanticValue();
02954: final Node v$g$2 = Formatting.after1(v$pt$6,
02955: v$pt$5);
02956:
02957: yyValue = GNode.create("AssertStatement",
02958: v$g$1, v$g$2);
02959: yyValue.setLocation(location(yyStart));
02960:
02961: return yyResult.createValue(yyValue, yyError);
02962: } else {
02963: yyError = yyError.select("\";\" expected",
02964: yyBase);
02965: }
02966: } // End scope for v$pt$6.
02967: }
02968: }
02969:
02970: // Alternative 16.
02971:
02972: yyResult = pSymbol(yyStart);
02973: yyError = yyResult.select(yyError);
02974: if (yyResult.hasValue()
02975: && ((Node) yyResult.semanticValue()).getTokenText()
02976: .equals(";")) {
02977: final Node v$pt$1 = yyResult.semanticValue();
02978:
02979: yyValue = GNode.create("EmptyStatement", false);
02980: yyValue.setLocation(location(yyStart));
02981: yyValue = Formatting.after1(yyValue, v$pt$1);
02982:
02983: return yyResult.createValue(yyValue, yyError);
02984: }
02985:
02986: // Done.
02987: yyError = yyError.select("statement expected", yyStart);
02988: return yyError;
02989: }
02990:
02991: // =========================================================================
02992:
02993: /**
02994: * Parse nonterminal xtc.lang.Java.BasicForControl.
02995: *
02996: * @param yyStart The index.
02997: * @return The result.
02998: * @throws IOException Signals an I/O error.
02999: */
03000: private Result pBasicForControl(final int yyStart)
03001: throws IOException {
03002: Result yyResult;
03003: int yyBase;
03004: int yyOption1;
03005: Node yyOpValue1;
03006: Node yyValue;
03007: ParseError yyError = ParseError.DUMMY;
03008:
03009: // Alternative <Declaration>.
03010:
03011: yyResult = pVariableModifiers(yyStart);
03012: yyError = yyResult.select(yyError);
03013: if (yyResult.hasValue()) {
03014: final Node v$g$1 = yyResult.semanticValue();
03015:
03016: yyResult = pType(yyResult.index);
03017: yyError = yyResult.select(yyError);
03018: if (yyResult.hasValue()) {
03019: final Node v$g$2 = yyResult.semanticValue();
03020:
03021: yyResult = pDeclarators(yyResult.index);
03022: yyError = yyResult.select(yyError);
03023: if (yyResult.hasValue()) {
03024: final Node v$pt$2 = yyResult.semanticValue();
03025:
03026: yyBase = yyResult.index;
03027: yyResult = pSymbol(yyBase);
03028: yyError = yyResult.select(yyError);
03029: if (yyResult.hasValue()
03030: && ((Node) yyResult.semanticValue())
03031: .getTokenText().equals(";")) {
03032: final Node v$pt$1 = yyResult.semanticValue();
03033: final Node v$g$3 = Formatting.after1(v$pt$2,
03034: v$pt$1);
03035:
03036: yyOption1 = yyResult.index;
03037: yyOpValue1 = null;
03038:
03039: yyResult = pExpression(yyOption1);
03040: yyError = yyResult.select(yyError);
03041: if (yyResult.hasValue()) {
03042: final Node v$el$1 = yyResult
03043: .semanticValue();
03044:
03045: yyOption1 = yyResult.index;
03046: yyOpValue1 = v$el$1;
03047: }
03048: { // Start scope for v$pt$4.
03049: final Node v$pt$4 = yyOpValue1;
03050:
03051: yyBase = yyOption1;
03052: yyResult = pSymbol(yyBase);
03053: yyError = yyResult.select(yyError);
03054: if (yyResult.hasValue()
03055: && ((Node) yyResult.semanticValue())
03056: .getTokenText().equals(";")) {
03057: final Node v$pt$3 = yyResult
03058: .semanticValue();
03059: final Node v$g$4 = Formatting.after1(
03060: v$pt$4, v$pt$3);
03061:
03062: yyOption1 = yyResult.index;
03063: yyOpValue1 = null;
03064:
03065: yyResult = pExpressionList(yyOption1);
03066: yyError = yyResult.select(yyError);
03067: if (yyResult.hasValue()) {
03068: final Node v$el$2 = yyResult
03069: .semanticValue();
03070:
03071: yyOption1 = yyResult.index;
03072: yyOpValue1 = v$el$2;
03073: }
03074: { // Start scope for v$g$5.
03075: final Node v$g$5 = yyOpValue1;
03076:
03077: yyValue = GNode.create(
03078: "BasicForControl", v$g$1,
03079: v$g$2, v$g$3, v$g$4, v$g$5);
03080: yyValue
03081: .setLocation(location(yyStart));
03082:
03083: return new SemanticValue(yyValue,
03084: yyOption1, yyError);
03085: } // End scope for v$g$5.
03086: } else {
03087: yyError = yyError.select(
03088: "\";\" expected", yyBase);
03089: }
03090: } // End scope for v$pt$4.
03091: } else {
03092: yyError = yyError.select("\";\" expected",
03093: yyBase);
03094: }
03095: }
03096: }
03097: }
03098:
03099: // Alternative <Initialization>.
03100:
03101: yyOption1 = yyStart;
03102: yyOpValue1 = null;
03103:
03104: yyResult = pExpressionList(yyOption1);
03105: yyError = yyResult.select(yyError);
03106: if (yyResult.hasValue()) {
03107: final Node v$el$3 = yyResult.semanticValue();
03108:
03109: yyOption1 = yyResult.index;
03110: yyOpValue1 = v$el$3;
03111: }
03112: { // Start scope for v$pt$6.
03113: final Node v$pt$6 = yyOpValue1;
03114:
03115: yyBase = yyOption1;
03116: yyResult = pSymbol(yyBase);
03117: yyError = yyResult.select(yyError);
03118: if (yyResult.hasValue()
03119: && ((Node) yyResult.semanticValue()).getTokenText()
03120: .equals(";")) {
03121: final Node v$pt$5 = yyResult.semanticValue();
03122: final Node v$g$8 = Formatting.after1(v$pt$6, v$pt$5);
03123:
03124: yyOption1 = yyResult.index;
03125: yyOpValue1 = null;
03126:
03127: yyResult = pExpression(yyOption1);
03128: yyError = yyResult.select(yyError);
03129: if (yyResult.hasValue()) {
03130: final Node v$el$4 = yyResult.semanticValue();
03131:
03132: yyOption1 = yyResult.index;
03133: yyOpValue1 = v$el$4;
03134: }
03135: { // Start scope for v$pt$8.
03136: final Node v$pt$8 = yyOpValue1;
03137:
03138: yyBase = yyOption1;
03139: yyResult = pSymbol(yyBase);
03140: yyError = yyResult.select(yyError);
03141: if (yyResult.hasValue()
03142: && ((Node) yyResult.semanticValue())
03143: .getTokenText().equals(";")) {
03144: final Node v$pt$7 = yyResult.semanticValue();
03145: final Node v$g$9 = Formatting.after1(v$pt$8,
03146: v$pt$7);
03147:
03148: yyOption1 = yyResult.index;
03149: yyOpValue1 = null;
03150:
03151: yyResult = pExpressionList(yyOption1);
03152: yyError = yyResult.select(yyError);
03153: if (yyResult.hasValue()) {
03154: final Node v$el$5 = yyResult
03155: .semanticValue();
03156:
03157: yyOption1 = yyResult.index;
03158: yyOpValue1 = v$el$5;
03159: }
03160: { // Start scope for v$g$10.
03161: final Node v$g$10 = yyOpValue1;
03162:
03163: yyValue = GNode.create("BasicForControl",
03164: null, null, v$g$8, v$g$9, v$g$10);
03165: yyValue.setLocation(location(yyStart));
03166:
03167: return new SemanticValue(yyValue,
03168: yyOption1, yyError);
03169: } // End scope for v$g$10.
03170: } else {
03171: yyError = yyError.select("\";\" expected",
03172: yyBase);
03173: }
03174: } // End scope for v$pt$8.
03175: } else {
03176: yyError = yyError.select("\";\" expected", yyBase);
03177: }
03178: } // End scope for v$pt$6.
03179:
03180: // Done.
03181: return yyError;
03182: }
03183:
03184: // =========================================================================
03185:
03186: /**
03187: * Parse nonterminal xtc.lang.Java.ParExpression.
03188: *
03189: * @param yyStart The index.
03190: * @return The result.
03191: * @throws IOException Signals an I/O error.
03192: */
03193: private Result pParExpression(final int yyStart) throws IOException {
03194: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
03195: if (null == yyColumn.chunk1)
03196: yyColumn.chunk1 = new Chunk1();
03197: if (null == yyColumn.chunk1.fParExpression)
03198: yyColumn.chunk1.fParExpression = pParExpression$1(yyStart);
03199: return yyColumn.chunk1.fParExpression;
03200: }
03201:
03202: /** Actually parse xtc.lang.Java.ParExpression. */
03203: private Result pParExpression$1(final int yyStart)
03204: throws IOException {
03205: Result yyResult;
03206: int yyBase;
03207: Node yyValue;
03208: ParseError yyError = ParseError.DUMMY;
03209:
03210: // Alternative 1.
03211:
03212: yyResult = pSymbol(yyStart);
03213: yyError = yyResult.select(yyError);
03214: if (yyResult.hasValue()
03215: && ((Node) yyResult.semanticValue()).getTokenText()
03216: .equals("(")) {
03217: final Node v$pt$1 = yyResult.semanticValue();
03218:
03219: yyResult = pExpression(yyResult.index);
03220: yyError = yyResult.select(yyError);
03221: if (yyResult.hasValue()) {
03222: final Node v$pt$3 = yyResult.semanticValue();
03223:
03224: yyBase = yyResult.index;
03225: yyResult = pSymbol(yyBase);
03226: yyError = yyResult.select(yyError);
03227: if (yyResult.hasValue()
03228: && ((Node) yyResult.semanticValue())
03229: .getTokenText().equals(")")) {
03230: final Node v$pt$2 = yyResult.semanticValue();
03231: yyValue = Formatting.round1(v$pt$1, v$pt$3, v$pt$2);
03232:
03233: return yyResult.createValue(yyValue, yyError);
03234: } else {
03235: yyError = yyError.select("\")\" expected", yyBase);
03236: }
03237: }
03238: }
03239:
03240: // Done.
03241: yyError = yyError.select("par expression expected", yyStart);
03242: return yyError;
03243: }
03244:
03245: // =========================================================================
03246:
03247: /**
03248: * Parse nonterminal xtc.lang.Java.CatchClause.
03249: *
03250: * @param yyStart The index.
03251: * @return The result.
03252: * @throws IOException Signals an I/O error.
03253: */
03254: private Result pCatchClause(final int yyStart) throws IOException {
03255: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
03256: if (null == yyColumn.chunk1)
03257: yyColumn.chunk1 = new Chunk1();
03258: if (null == yyColumn.chunk1.fCatchClause)
03259: yyColumn.chunk1.fCatchClause = pCatchClause$1(yyStart);
03260: return yyColumn.chunk1.fCatchClause;
03261: }
03262:
03263: /** Actually parse xtc.lang.Java.CatchClause. */
03264: private Result pCatchClause$1(final int yyStart) throws IOException {
03265: Result yyResult;
03266: int yyBase;
03267: Node yyValue;
03268: ParseError yyError = ParseError.DUMMY;
03269:
03270: // Alternative 1.
03271:
03272: yyResult = pWord(yyStart);
03273: yyError = yyResult.select(yyError);
03274: if (yyResult.hasValue()
03275: && ((Node) yyResult.semanticValue()).getTokenText()
03276: .equals("catch")) {
03277: final Node v$pt$1 = yyResult.semanticValue();
03278:
03279: yyBase = yyResult.index;
03280: yyResult = pSymbol(yyBase);
03281: yyError = yyResult.select(yyError);
03282: if (yyResult.hasValue()
03283: && ((Node) yyResult.semanticValue()).getTokenText()
03284: .equals("(")) {
03285: final Node v$pt$2 = yyResult.semanticValue();
03286:
03287: yyResult = pFormalParameter(yyResult.index);
03288: yyError = yyResult.select(yyError);
03289: if (yyResult.hasValue()) {
03290: final Node v$pt$4 = yyResult.semanticValue();
03291:
03292: yyBase = yyResult.index;
03293: yyResult = pSymbol(yyBase);
03294: yyError = yyResult.select(yyError);
03295: if (yyResult.hasValue()
03296: && ((Node) yyResult.semanticValue())
03297: .getTokenText().equals(")")) {
03298: final Node v$pt$3 = yyResult.semanticValue();
03299: final Node v$g$1 = Formatting.variable().add(
03300: v$pt$1).add(v$pt$2).addNode(v$pt$4)
03301: .add(v$pt$3);
03302:
03303: yyResult = pBlock(yyResult.index);
03304: yyError = yyResult.select(yyError);
03305: if (yyResult.hasValue()) {
03306: final Node v$g$2 = yyResult.semanticValue();
03307:
03308: yyValue = GNode.create("CatchClause",
03309: v$g$1, v$g$2);
03310: yyValue.setLocation(location(yyStart));
03311:
03312: return yyResult.createValue(yyValue,
03313: yyError);
03314: }
03315: } else {
03316: yyError = yyError.select("\")\" expected",
03317: yyBase);
03318: }
03319: }
03320: } else {
03321: yyError = yyError.select("\"(\" expected", yyBase);
03322: }
03323: }
03324:
03325: // Done.
03326: yyError = yyError.select("catch clause expected", yyStart);
03327: return yyError;
03328: }
03329:
03330: // =========================================================================
03331:
03332: /**
03333: * Parse synthetic nonterminal xtc.lang.Java.SwitchStatement$$Split1.
03334: *
03335: * @param yyStart The index.
03336: * @return The result.
03337: * @throws IOException Signals an I/O error.
03338: */
03339: private Result pSwitchStatement$$Split1(final int yyStart)
03340: throws IOException {
03341:
03342: Result yyResult;
03343: int yyBase;
03344: int yyRepetition1;
03345: Pair<Node> yyRepValue1;
03346: Node yyValue;
03347: ParseError yyError = ParseError.DUMMY;
03348:
03349: // Alternative 1.
03350:
03351: yyResult = pWord(yyStart);
03352: yyError = yyResult.select(yyError);
03353: if (yyResult.hasValue()
03354: && ((Node) yyResult.semanticValue()).getTokenText()
03355: .equals("switch")) {
03356: final Node v$pt$1 = yyResult.semanticValue();
03357:
03358: yyResult = pParExpression(yyResult.index);
03359: yyError = yyResult.select(yyError);
03360: if (yyResult.hasValue()) {
03361: final Node v$pt$3 = yyResult.semanticValue();
03362:
03363: yyBase = yyResult.index;
03364: yyResult = pSymbol(yyBase);
03365: yyError = yyResult.select(yyError);
03366: if (yyResult.hasValue()
03367: && ((Node) yyResult.semanticValue())
03368: .getTokenText().equals("{")) {
03369: final Node v$pt$2 = yyResult.semanticValue();
03370: final Node v$g$1 = Formatting.round1(v$pt$1,
03371: v$pt$3, v$pt$2);
03372:
03373: yyRepetition1 = yyResult.index;
03374: yyRepValue1 = Pair.empty();
03375: while (true) {
03376:
03377: yyResult = pSwitchClause(yyRepetition1);
03378: yyError = yyResult.select(yyError);
03379: if (yyResult.hasValue()) {
03380: final Node v$el$1 = yyResult
03381: .semanticValue();
03382:
03383: yyRepetition1 = yyResult.index;
03384: yyRepValue1 = new Pair<Node>(v$el$1,
03385: yyRepValue1);
03386: continue;
03387: }
03388: break;
03389: }
03390: { // Start scope for v$g$2.
03391: final Pair<Node> v$g$2 = yyRepValue1.reverse();
03392:
03393: yyValue = GNode.createFromPair(
03394: "SwitchStatement", v$g$1, v$g$2);
03395: yyValue.setLocation(location(yyStart));
03396:
03397: return new SemanticValue(yyValue,
03398: yyRepetition1, yyError);
03399: } // End scope for v$g$2.
03400: } else {
03401: yyError = yyError.select("\"{\" expected", yyBase);
03402: }
03403: }
03404: }
03405:
03406: // Done.
03407: yyError = yyError.select("switch statement expected", yyStart);
03408: return yyError;
03409: }
03410:
03411: // =========================================================================
03412:
03413: /**
03414: * Parse nonterminal xtc.lang.Java.SwitchClause.
03415: *
03416: * @param yyStart The index.
03417: * @return The result.
03418: * @throws IOException Signals an I/O error.
03419: */
03420: private Result pSwitchClause(final int yyStart) throws IOException {
03421: Result yyResult;
03422: int yyBase;
03423: int yyRepetition1;
03424: Pair<Node> yyRepValue1;
03425: Node yyValue;
03426: ParseError yyError = ParseError.DUMMY;
03427:
03428: // Alternative 1.
03429:
03430: yyResult = pWord(yyStart);
03431: yyError = yyResult.select(yyError);
03432: if (yyResult.hasValue()
03433: && ((Node) yyResult.semanticValue()).getTokenText()
03434: .equals("case")) {
03435: final Node v$pt$1 = yyResult.semanticValue();
03436:
03437: yyResult = pExpression(yyResult.index);
03438: yyError = yyResult.select(yyError);
03439: if (yyResult.hasValue()) {
03440: final Node v$pt$3 = yyResult.semanticValue();
03441:
03442: yyBase = yyResult.index;
03443: yyResult = pSymbol(yyBase);
03444: yyError = yyResult.select(yyError);
03445: if (yyResult.hasValue()
03446: && ((Node) yyResult.semanticValue())
03447: .getTokenText().equals(":")) {
03448: final Node v$pt$2 = yyResult.semanticValue();
03449: final Node v$g$1 = Formatting.round1(v$pt$1,
03450: v$pt$3, v$pt$2);
03451:
03452: yyRepetition1 = yyResult.index;
03453: yyRepValue1 = Pair.empty();
03454: while (true) {
03455:
03456: yyResult = pDeclarationOrStatement(yyRepetition1);
03457: yyError = yyResult.select(yyError);
03458: if (yyResult.hasValue()) {
03459: final Node v$el$1 = yyResult
03460: .semanticValue();
03461:
03462: yyRepetition1 = yyResult.index;
03463: yyRepValue1 = new Pair<Node>(v$el$1,
03464: yyRepValue1);
03465: continue;
03466: }
03467: break;
03468: }
03469: { // Start scope for v$g$2.
03470: final Pair<Node> v$g$2 = yyRepValue1.reverse();
03471:
03472: yyValue = GNode.createFromPair("CaseClause",
03473: v$g$1, v$g$2);
03474: yyValue.setLocation(location(yyStart));
03475:
03476: return new SemanticValue(yyValue,
03477: yyRepetition1, yyError);
03478: } // End scope for v$g$2.
03479: } else {
03480: yyError = yyError.select("\":\" expected", yyBase);
03481: }
03482: }
03483: }
03484:
03485: // Alternative 2.
03486:
03487: yyResult = pWord(yyStart);
03488: yyError = yyResult.select(yyError);
03489: if (yyResult.hasValue()
03490: && ((Node) yyResult.semanticValue()).getTokenText()
03491: .equals("default")) {
03492: final Node v$pt$1 = yyResult.semanticValue();
03493:
03494: yyBase = yyResult.index;
03495: yyResult = pSymbol(yyBase);
03496: yyError = yyResult.select(yyError);
03497: if (yyResult.hasValue()
03498: && ((Node) yyResult.semanticValue()).getTokenText()
03499: .equals(":")) {
03500: final Node v$pt$2 = yyResult.semanticValue();
03501:
03502: yyResult = pDefaultClause$$Split1(yyResult.index);
03503: yyError = yyResult.select(yyError);
03504: if (yyResult.hasValue()) {
03505: final Node v$pt$3 = yyResult.semanticValue();
03506: yyValue = Formatting.variable().add(v$pt$1).add(
03507: v$pt$2).addNode(v$pt$3);
03508:
03509: return yyResult.createValue(yyValue, yyError);
03510: }
03511: } else {
03512: yyError = yyError.select("\":\" expected", yyBase);
03513: }
03514: }
03515:
03516: // Done.
03517: yyError = yyError.select("switch clause expected", yyStart);
03518: return yyError;
03519: }
03520:
03521: // =========================================================================
03522:
03523: /**
03524: * Parse synthetic nonterminal xtc.lang.Java.DefaultClause$$Split1.
03525: *
03526: * @param yyStart The index.
03527: * @return The result.
03528: * @throws IOException Signals an I/O error.
03529: */
03530: private Result pDefaultClause$$Split1(final int yyStart)
03531: throws IOException {
03532:
03533: Result yyResult;
03534: int yyRepetition1;
03535: Pair<Node> yyRepValue1;
03536: Node yyValue;
03537: ParseError yyError = ParseError.DUMMY;
03538:
03539: // Alternative 1.
03540:
03541: yyRepetition1 = yyStart;
03542: yyRepValue1 = Pair.empty();
03543: while (true) {
03544:
03545: yyResult = pDeclarationOrStatement(yyRepetition1);
03546: yyError = yyResult.select(yyError);
03547: if (yyResult.hasValue()) {
03548: final Node v$el$1 = yyResult.semanticValue();
03549:
03550: yyRepetition1 = yyResult.index;
03551: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
03552: continue;
03553: }
03554: break;
03555: }
03556: { // Start scope for v$g$1.
03557: final Pair<Node> v$g$1 = yyRepValue1.reverse();
03558:
03559: yyValue = GNode.createFromPair("DefaultClause", v$g$1);
03560: yyValue.setLocation(location(yyStart));
03561:
03562: return new SemanticValue(yyValue, yyRepetition1, yyError);
03563: } // End scope for v$g$1.
03564: }
03565:
03566: // =========================================================================
03567:
03568: /**
03569: * Parse nonterminal xtc.lang.Java.ExpressionList.
03570: *
03571: * @param yyStart The index.
03572: * @return The result.
03573: * @throws IOException Signals an I/O error.
03574: */
03575: private Result pExpressionList(final int yyStart)
03576: throws IOException {
03577: Result yyResult;
03578: int yyBase;
03579: int yyRepetition1;
03580: Pair<Node> yyRepValue1;
03581: Node yyValue;
03582: ParseError yyError = ParseError.DUMMY;
03583:
03584: // Alternative 1.
03585:
03586: yyResult = pExpression(yyStart);
03587: yyError = yyResult.select(yyError);
03588: if (yyResult.hasValue()) {
03589: final Node v$g$1 = yyResult.semanticValue();
03590:
03591: yyRepetition1 = yyResult.index;
03592: yyRepValue1 = Pair.empty();
03593: while (true) {
03594:
03595: yyBase = yyRepetition1;
03596: yyResult = pSymbol(yyBase);
03597: yyError = yyResult.select(yyError);
03598: if (yyResult.hasValue()
03599: && ((Node) yyResult.semanticValue())
03600: .getTokenText().equals(",")) {
03601: final Node v$pt$1 = yyResult.semanticValue();
03602:
03603: yyResult = pExpression(yyResult.index);
03604: yyError = yyResult.select(yyError);
03605: if (yyResult.hasValue()) {
03606: final Node v$pt$2 = yyResult.semanticValue();
03607: final Node v$el$1 = Formatting.before1(v$pt$1,
03608: v$pt$2);
03609:
03610: yyRepetition1 = yyResult.index;
03611: yyRepValue1 = new Pair<Node>(v$el$1,
03612: yyRepValue1);
03613: continue;
03614: }
03615: } else {
03616: yyError = yyError.select("\",\" expected", yyBase);
03617: }
03618: break;
03619: }
03620: { // Start scope for v$g$2.
03621: final Pair<Node> v$g$2 = yyRepValue1.reverse();
03622:
03623: yyValue = GNode.createFromPair("ExpressionList", v$g$1,
03624: v$g$2);
03625: yyValue.setLocation(location(yyStart));
03626:
03627: return new SemanticValue(yyValue, yyRepetition1,
03628: yyError);
03629: } // End scope for v$g$2.
03630: }
03631:
03632: // Done.
03633: return yyError;
03634: }
03635:
03636: // =========================================================================
03637:
03638: /**
03639: * Parse nonterminal xtc.lang.Java.Expression.
03640: *
03641: * @param yyStart The index.
03642: * @return The result.
03643: * @throws IOException Signals an I/O error.
03644: */
03645: private Result pExpression(final int yyStart) throws IOException {
03646: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
03647: if (null == yyColumn.chunk1)
03648: yyColumn.chunk1 = new Chunk1();
03649: if (null == yyColumn.chunk1.fExpression)
03650: yyColumn.chunk1.fExpression = pExpression$1(yyStart);
03651: return yyColumn.chunk1.fExpression;
03652: }
03653:
03654: /** Actually parse xtc.lang.Java.Expression. */
03655: private Result pExpression$1(final int yyStart) throws IOException {
03656: Result yyResult;
03657: Node yyValue;
03658: ParseError yyError = ParseError.DUMMY;
03659:
03660: // Alternative <Assignment>.
03661:
03662: yyResult = pConditionalExpression(yyStart);
03663: yyError = yyResult.select(yyError);
03664: if (yyResult.hasValue()) {
03665: final Node v$g$1 = yyResult.semanticValue();
03666:
03667: yyResult = pAssignmentOperator(yyResult.index);
03668: yyError = yyResult.select(yyError);
03669: if (yyResult.hasValue()) {
03670: final Node v$g$2 = yyResult.semanticValue();
03671:
03672: yyResult = pExpression(yyResult.index);
03673: yyError = yyResult.select(yyError);
03674: if (yyResult.hasValue()) {
03675: final Node v$g$3 = yyResult.semanticValue();
03676:
03677: yyValue = GNode.create("Expression", v$g$1, v$g$2,
03678: v$g$3);
03679: yyValue.setLocation(location(yyStart));
03680:
03681: return yyResult.createValue(yyValue, yyError);
03682: }
03683: }
03684: }
03685:
03686: // Alternative <Base>.
03687:
03688: yyResult = pConditionalExpression(yyStart);
03689: yyError = yyResult.select(yyError);
03690: if (yyResult.hasValue()) {
03691: yyValue = yyResult.semanticValue();
03692:
03693: return yyResult.createValue(yyValue, yyError);
03694: }
03695:
03696: // Done.
03697: return yyError;
03698: }
03699:
03700: // =========================================================================
03701:
03702: /**
03703: * Parse nonterminal xtc.lang.Java.AssignmentOperator.
03704: *
03705: * @param yyStart The index.
03706: * @return The result.
03707: * @throws IOException Signals an I/O error.
03708: */
03709: private Result pAssignmentOperator(final int yyStart)
03710: throws IOException {
03711: Result yyResult;
03712: Node yyValue;
03713: ParseError yyError = ParseError.DUMMY;
03714:
03715: // Alternative <Equal>.
03716:
03717: yyResult = pSymbol(yyStart);
03718: yyError = yyResult.select(yyError);
03719: if (yyResult.hasValue()
03720: && ((Node) yyResult.semanticValue()).getTokenText()
03721: .equals("=")) {
03722: yyValue = yyResult.semanticValue();
03723:
03724: return yyResult.createValue(yyValue, yyError);
03725: }
03726:
03727: // Alternative <PlusEqual>.
03728:
03729: yyResult = pSymbol(yyStart);
03730: yyError = yyResult.select(yyError);
03731: if (yyResult.hasValue()
03732: && ((Node) yyResult.semanticValue()).getTokenText()
03733: .equals("+=")) {
03734: yyValue = yyResult.semanticValue();
03735:
03736: return yyResult.createValue(yyValue, yyError);
03737: }
03738:
03739: // Alternative <MinusEqual>.
03740:
03741: yyResult = pSymbol(yyStart);
03742: yyError = yyResult.select(yyError);
03743: if (yyResult.hasValue()
03744: && ((Node) yyResult.semanticValue()).getTokenText()
03745: .equals("-=")) {
03746: yyValue = yyResult.semanticValue();
03747:
03748: return yyResult.createValue(yyValue, yyError);
03749: }
03750:
03751: // Alternative <StarEqual>.
03752:
03753: yyResult = pSymbol(yyStart);
03754: yyError = yyResult.select(yyError);
03755: if (yyResult.hasValue()
03756: && ((Node) yyResult.semanticValue()).getTokenText()
03757: .equals("*=")) {
03758: yyValue = yyResult.semanticValue();
03759:
03760: return yyResult.createValue(yyValue, yyError);
03761: }
03762:
03763: // Alternative <SlashEqual>.
03764:
03765: yyResult = pSymbol(yyStart);
03766: yyError = yyResult.select(yyError);
03767: if (yyResult.hasValue()
03768: && ((Node) yyResult.semanticValue()).getTokenText()
03769: .equals("/=")) {
03770: yyValue = yyResult.semanticValue();
03771:
03772: return yyResult.createValue(yyValue, yyError);
03773: }
03774:
03775: // Alternative <AmpersandEqual>.
03776:
03777: yyResult = pSymbol(yyStart);
03778: yyError = yyResult.select(yyError);
03779: if (yyResult.hasValue()
03780: && ((Node) yyResult.semanticValue()).getTokenText()
03781: .equals("&=")) {
03782: yyValue = yyResult.semanticValue();
03783:
03784: return yyResult.createValue(yyValue, yyError);
03785: }
03786:
03787: // Alternative <BarEqual>.
03788:
03789: yyResult = pSymbol(yyStart);
03790: yyError = yyResult.select(yyError);
03791: if (yyResult.hasValue()
03792: && ((Node) yyResult.semanticValue()).getTokenText()
03793: .equals("|=")) {
03794: yyValue = yyResult.semanticValue();
03795:
03796: return yyResult.createValue(yyValue, yyError);
03797: }
03798:
03799: // Alternative <CaretEqual>.
03800:
03801: yyResult = pSymbol(yyStart);
03802: yyError = yyResult.select(yyError);
03803: if (yyResult.hasValue()
03804: && ((Node) yyResult.semanticValue()).getTokenText()
03805: .equals("^=")) {
03806: yyValue = yyResult.semanticValue();
03807:
03808: return yyResult.createValue(yyValue, yyError);
03809: }
03810:
03811: // Alternative <PercentEqual>.
03812:
03813: yyResult = pSymbol(yyStart);
03814: yyError = yyResult.select(yyError);
03815: if (yyResult.hasValue()
03816: && ((Node) yyResult.semanticValue()).getTokenText()
03817: .equals("%=")) {
03818: yyValue = yyResult.semanticValue();
03819:
03820: return yyResult.createValue(yyValue, yyError);
03821: }
03822:
03823: // Alternative <DoubleLessEqual>.
03824:
03825: yyResult = pSymbol(yyStart);
03826: yyError = yyResult.select(yyError);
03827: if (yyResult.hasValue()
03828: && ((Node) yyResult.semanticValue()).getTokenText()
03829: .equals("<<=")) {
03830: yyValue = yyResult.semanticValue();
03831:
03832: return yyResult.createValue(yyValue, yyError);
03833: }
03834:
03835: // Alternative <DoubleGreaterEqual>.
03836:
03837: yyResult = pSymbol(yyStart);
03838: yyError = yyResult.select(yyError);
03839: if (yyResult.hasValue()
03840: && ((Node) yyResult.semanticValue()).getTokenText()
03841: .equals(">>=")) {
03842: yyValue = yyResult.semanticValue();
03843:
03844: return yyResult.createValue(yyValue, yyError);
03845: }
03846:
03847: // Alternative <TripleGreaterEqual>.
03848:
03849: yyResult = pSymbol(yyStart);
03850: yyError = yyResult.select(yyError);
03851: if (yyResult.hasValue()
03852: && ((Node) yyResult.semanticValue()).getTokenText()
03853: .equals(">>>=")) {
03854: yyValue = yyResult.semanticValue();
03855:
03856: return yyResult.createValue(yyValue, yyError);
03857: }
03858:
03859: // Done.
03860: yyError = yyError.select("assignment operator expected",
03861: yyStart);
03862: return yyError;
03863: }
03864:
03865: // =========================================================================
03866:
03867: /**
03868: * Parse nonterminal xtc.lang.Java.ConditionalExpression.
03869: *
03870: * @param yyStart The index.
03871: * @return The result.
03872: * @throws IOException Signals an I/O error.
03873: */
03874: private Result pConditionalExpression(final int yyStart)
03875: throws IOException {
03876:
03877: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
03878: if (null == yyColumn.chunk1)
03879: yyColumn.chunk1 = new Chunk1();
03880: if (null == yyColumn.chunk1.fConditionalExpression)
03881: yyColumn.chunk1.fConditionalExpression = pConditionalExpression$1(yyStart);
03882: return yyColumn.chunk1.fConditionalExpression;
03883: }
03884:
03885: /** Actually parse xtc.lang.Java.ConditionalExpression. */
03886: private Result pConditionalExpression$1(final int yyStart)
03887: throws IOException {
03888:
03889: Result yyResult;
03890: int yyBase;
03891: Node yyValue;
03892: ParseError yyError = ParseError.DUMMY;
03893:
03894: // Alternative <Conditional>.
03895:
03896: yyResult = pLogicalOrExpression(yyStart);
03897: yyError = yyResult.select(yyError);
03898: if (yyResult.hasValue()) {
03899: final Node v$pt$2 = yyResult.semanticValue();
03900:
03901: yyBase = yyResult.index;
03902: yyResult = pSymbol(yyBase);
03903: yyError = yyResult.select(yyError);
03904: if (yyResult.hasValue()
03905: && ((Node) yyResult.semanticValue()).getTokenText()
03906: .equals("?")) {
03907: final Node v$pt$1 = yyResult.semanticValue();
03908: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
03909:
03910: yyResult = pExpression(yyResult.index);
03911: yyError = yyResult.select(yyError);
03912: if (yyResult.hasValue()) {
03913: final Node v$pt$4 = yyResult.semanticValue();
03914:
03915: yyBase = yyResult.index;
03916: yyResult = pSymbol(yyBase);
03917: yyError = yyResult.select(yyError);
03918: if (yyResult.hasValue()
03919: && ((Node) yyResult.semanticValue())
03920: .getTokenText().equals(":")) {
03921: final Node v$pt$3 = yyResult.semanticValue();
03922: final Node v$g$2 = Formatting.after1(v$pt$4,
03923: v$pt$3);
03924:
03925: yyResult = pConditionalExpression(yyResult.index);
03926: yyError = yyResult.select(yyError);
03927: if (yyResult.hasValue()) {
03928: final Node v$g$3 = yyResult.semanticValue();
03929:
03930: yyValue = GNode.create(
03931: "ConditionalExpression", v$g$1,
03932: v$g$2, v$g$3);
03933: yyValue.setLocation(location(yyStart));
03934:
03935: return yyResult.createValue(yyValue,
03936: yyError);
03937: }
03938: } else {
03939: yyError = yyError.select("\":\" expected",
03940: yyBase);
03941: }
03942: }
03943: } else {
03944: yyError = yyError.select("\"?\" expected", yyBase);
03945: }
03946: }
03947:
03948: // Alternative <Base>.
03949:
03950: yyResult = pLogicalOrExpression(yyStart);
03951: yyError = yyResult.select(yyError);
03952: if (yyResult.hasValue()) {
03953: yyValue = yyResult.semanticValue();
03954:
03955: return yyResult.createValue(yyValue, yyError);
03956: }
03957:
03958: // Done.
03959: return yyError;
03960: }
03961:
03962: // =========================================================================
03963:
03964: /**
03965: * Parse nonterminal xtc.lang.Java.LogicalOrExpression.
03966: *
03967: * @param yyStart The index.
03968: * @return The result.
03969: * @throws IOException Signals an I/O error.
03970: */
03971: private Result pLogicalOrExpression(final int yyStart)
03972: throws IOException {
03973: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
03974: if (null == yyColumn.chunk1)
03975: yyColumn.chunk1 = new Chunk1();
03976: if (null == yyColumn.chunk1.fLogicalOrExpression)
03977: yyColumn.chunk1.fLogicalOrExpression = pLogicalOrExpression$1(yyStart);
03978: return yyColumn.chunk1.fLogicalOrExpression;
03979: }
03980:
03981: /** Actually parse xtc.lang.Java.LogicalOrExpression. */
03982: private Result pLogicalOrExpression$1(final int yyStart)
03983: throws IOException {
03984:
03985: Result yyResult;
03986: int yyRepetition1;
03987: Pair<Action<Node>> yyRepValue1;
03988: Node yyValue;
03989: ParseError yyError = ParseError.DUMMY;
03990:
03991: // Alternative <Base>.
03992:
03993: yyResult = pLogicalAndExpression(yyStart);
03994: yyError = yyResult.select(yyError);
03995: if (yyResult.hasValue()) {
03996: final Node v$3 = yyResult.semanticValue();
03997:
03998: yyRepetition1 = yyResult.index;
03999: yyRepValue1 = Pair.empty();
04000: while (true) {
04001:
04002: yyResult = pLogicalOrExpression$$Tail1(yyRepetition1);
04003: yyError = yyResult.select(yyError);
04004: if (yyResult.hasValue()) {
04005: final Action<Node> v$4 = yyResult.semanticValue();
04006:
04007: yyRepetition1 = yyResult.index;
04008: yyRepValue1 = new Pair<Action<Node>>(v$4,
04009: yyRepValue1);
04010: continue;
04011: }
04012: break;
04013: }
04014: { // Start scope for v$5.
04015: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
04016:
04017: yyValue = apply(v$5, v$3, yyStart);
04018:
04019: return new SemanticValue(yyValue, yyRepetition1,
04020: yyError);
04021: } // End scope for v$5.
04022: }
04023:
04024: // Done.
04025: return yyError;
04026: }
04027:
04028: // =========================================================================
04029:
04030: /**
04031: * Parse synthetic nonterminal xtc.lang.Java.LogicalOrExpression$$Tail1.
04032: *
04033: * @param yyStart The index.
04034: * @return The result.
04035: * @throws IOException Signals an I/O error.
04036: */
04037: private Result pLogicalOrExpression$$Tail1(final int yyStart)
04038: throws IOException {
04039:
04040: Result yyResult;
04041: Action<Node> yyValue;
04042: ParseError yyError = ParseError.DUMMY;
04043:
04044: // Alternative <Or>.
04045:
04046: yyResult = pSymbol(yyStart);
04047: yyError = yyResult.select(yyError);
04048: if (yyResult.hasValue()
04049: && ((Node) yyResult.semanticValue()).getTokenText()
04050: .equals("||")) {
04051: final Node v$pt$1 = yyResult.semanticValue();
04052:
04053: yyResult = pLogicalAndExpression(yyResult.index);
04054: yyError = yyResult.select(yyError);
04055: if (yyResult.hasValue()) {
04056: final Node v$pt$2 = yyResult.semanticValue();
04057: final Node v$g$2 = Formatting.before1(v$pt$1, v$pt$2);
04058:
04059: yyValue = new Action<Node>() {
04060: public Node run(Node v$1) {
04061: return GNode.create("LogicalOrExpression", v$1,
04062: v$g$2);
04063: }
04064: };
04065:
04066: return yyResult.createValue(yyValue, yyError);
04067: }
04068: }
04069:
04070: // Done.
04071: yyError = yyError.select("logical or expression expected",
04072: yyStart);
04073: return yyError;
04074: }
04075:
04076: // =========================================================================
04077:
04078: /**
04079: * Parse nonterminal xtc.lang.Java.LogicalAndExpression.
04080: *
04081: * @param yyStart The index.
04082: * @return The result.
04083: * @throws IOException Signals an I/O error.
04084: */
04085: private Result pLogicalAndExpression(final int yyStart)
04086: throws IOException {
04087: Result yyResult;
04088: int yyRepetition1;
04089: Pair<Action<Node>> yyRepValue1;
04090: Node yyValue;
04091: ParseError yyError = ParseError.DUMMY;
04092:
04093: // Alternative <Base>.
04094:
04095: yyResult = pBitwiseOrExpression(yyStart);
04096: yyError = yyResult.select(yyError);
04097: if (yyResult.hasValue()) {
04098: final Node v$3 = yyResult.semanticValue();
04099:
04100: yyRepetition1 = yyResult.index;
04101: yyRepValue1 = Pair.empty();
04102: while (true) {
04103:
04104: yyResult = pLogicalAndExpression$$Tail1(yyRepetition1);
04105: yyError = yyResult.select(yyError);
04106: if (yyResult.hasValue()) {
04107: final Action<Node> v$4 = yyResult.semanticValue();
04108:
04109: yyRepetition1 = yyResult.index;
04110: yyRepValue1 = new Pair<Action<Node>>(v$4,
04111: yyRepValue1);
04112: continue;
04113: }
04114: break;
04115: }
04116: { // Start scope for v$5.
04117: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
04118:
04119: yyValue = apply(v$5, v$3, yyStart);
04120:
04121: return new SemanticValue(yyValue, yyRepetition1,
04122: yyError);
04123: } // End scope for v$5.
04124: }
04125:
04126: // Done.
04127: return yyError;
04128: }
04129:
04130: // =========================================================================
04131:
04132: /**
04133: * Parse synthetic nonterminal xtc.lang.Java.LogicalAndExpression$$Tail1.
04134: *
04135: * @param yyStart The index.
04136: * @return The result.
04137: * @throws IOException Signals an I/O error.
04138: */
04139: private Result pLogicalAndExpression$$Tail1(final int yyStart)
04140: throws IOException {
04141:
04142: Result yyResult;
04143: Action<Node> yyValue;
04144: ParseError yyError = ParseError.DUMMY;
04145:
04146: // Alternative <And>.
04147:
04148: yyResult = pSymbol(yyStart);
04149: yyError = yyResult.select(yyError);
04150: if (yyResult.hasValue()
04151: && ((Node) yyResult.semanticValue()).getTokenText()
04152: .equals("&&")) {
04153: final Node v$pt$1 = yyResult.semanticValue();
04154:
04155: yyResult = pBitwiseOrExpression(yyResult.index);
04156: yyError = yyResult.select(yyError);
04157: if (yyResult.hasValue()) {
04158: final Node v$pt$2 = yyResult.semanticValue();
04159: final Node v$g$2 = Formatting.before1(v$pt$1, v$pt$2);
04160:
04161: yyValue = new Action<Node>() {
04162: public Node run(Node v$1) {
04163: return GNode.create("LogicalAndExpression",
04164: v$1, v$g$2);
04165: }
04166: };
04167:
04168: return yyResult.createValue(yyValue, yyError);
04169: }
04170: }
04171:
04172: // Done.
04173: yyError = yyError.select("logical and expression expected",
04174: yyStart);
04175: return yyError;
04176: }
04177:
04178: // =========================================================================
04179:
04180: /**
04181: * Parse nonterminal xtc.lang.Java.BitwiseOrExpression.
04182: *
04183: * @param yyStart The index.
04184: * @return The result.
04185: * @throws IOException Signals an I/O error.
04186: */
04187: private Result pBitwiseOrExpression(final int yyStart)
04188: throws IOException {
04189: Result yyResult;
04190: int yyRepetition1;
04191: Pair<Action<Node>> yyRepValue1;
04192: Node yyValue;
04193: ParseError yyError = ParseError.DUMMY;
04194:
04195: // Alternative <Base>.
04196:
04197: yyResult = pBitwiseXorExpression(yyStart);
04198: yyError = yyResult.select(yyError);
04199: if (yyResult.hasValue()) {
04200: final Node v$3 = yyResult.semanticValue();
04201:
04202: yyRepetition1 = yyResult.index;
04203: yyRepValue1 = Pair.empty();
04204: while (true) {
04205:
04206: yyResult = pBitwiseOrExpression$$Tail1(yyRepetition1);
04207: yyError = yyResult.select(yyError);
04208: if (yyResult.hasValue()) {
04209: final Action<Node> v$4 = yyResult.semanticValue();
04210:
04211: yyRepetition1 = yyResult.index;
04212: yyRepValue1 = new Pair<Action<Node>>(v$4,
04213: yyRepValue1);
04214: continue;
04215: }
04216: break;
04217: }
04218: { // Start scope for v$5.
04219: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
04220:
04221: yyValue = apply(v$5, v$3, yyStart);
04222:
04223: return new SemanticValue(yyValue, yyRepetition1,
04224: yyError);
04225: } // End scope for v$5.
04226: }
04227:
04228: // Done.
04229: return yyError;
04230: }
04231:
04232: // =========================================================================
04233:
04234: /**
04235: * Parse synthetic nonterminal xtc.lang.Java.BitwiseOrExpression$$Tail1.
04236: *
04237: * @param yyStart The index.
04238: * @return The result.
04239: * @throws IOException Signals an I/O error.
04240: */
04241: private Result pBitwiseOrExpression$$Tail1(final int yyStart)
04242: throws IOException {
04243:
04244: Result yyResult;
04245: Action<Node> yyValue;
04246: ParseError yyError = ParseError.DUMMY;
04247:
04248: // Alternative <Or>.
04249:
04250: yyResult = pSymbol(yyStart);
04251: yyError = yyResult.select(yyError);
04252: if (yyResult.hasValue()
04253: && ((Node) yyResult.semanticValue()).getTokenText()
04254: .equals("|")) {
04255: final Node v$pt$1 = yyResult.semanticValue();
04256:
04257: yyResult = pBitwiseXorExpression(yyResult.index);
04258: yyError = yyResult.select(yyError);
04259: if (yyResult.hasValue()) {
04260: final Node v$pt$2 = yyResult.semanticValue();
04261: final Node v$g$2 = Formatting.before1(v$pt$1, v$pt$2);
04262:
04263: yyValue = new Action<Node>() {
04264: public Node run(Node v$1) {
04265: return GNode.create("BitwiseOrExpression", v$1,
04266: v$g$2);
04267: }
04268: };
04269:
04270: return yyResult.createValue(yyValue, yyError);
04271: }
04272: }
04273:
04274: // Done.
04275: yyError = yyError.select("bitwise or expression expected",
04276: yyStart);
04277: return yyError;
04278: }
04279:
04280: // =========================================================================
04281:
04282: /**
04283: * Parse nonterminal xtc.lang.Java.BitwiseXorExpression.
04284: *
04285: * @param yyStart The index.
04286: * @return The result.
04287: * @throws IOException Signals an I/O error.
04288: */
04289: private Result pBitwiseXorExpression(final int yyStart)
04290: throws IOException {
04291: Result yyResult;
04292: int yyRepetition1;
04293: Pair<Action<Node>> yyRepValue1;
04294: Node yyValue;
04295: ParseError yyError = ParseError.DUMMY;
04296:
04297: // Alternative <Base>.
04298:
04299: yyResult = pBitwiseAndExpression(yyStart);
04300: yyError = yyResult.select(yyError);
04301: if (yyResult.hasValue()) {
04302: final Node v$3 = yyResult.semanticValue();
04303:
04304: yyRepetition1 = yyResult.index;
04305: yyRepValue1 = Pair.empty();
04306: while (true) {
04307:
04308: yyResult = pBitwiseXorExpression$$Tail1(yyRepetition1);
04309: yyError = yyResult.select(yyError);
04310: if (yyResult.hasValue()) {
04311: final Action<Node> v$4 = yyResult.semanticValue();
04312:
04313: yyRepetition1 = yyResult.index;
04314: yyRepValue1 = new Pair<Action<Node>>(v$4,
04315: yyRepValue1);
04316: continue;
04317: }
04318: break;
04319: }
04320: { // Start scope for v$5.
04321: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
04322:
04323: yyValue = apply(v$5, v$3, yyStart);
04324:
04325: return new SemanticValue(yyValue, yyRepetition1,
04326: yyError);
04327: } // End scope for v$5.
04328: }
04329:
04330: // Done.
04331: return yyError;
04332: }
04333:
04334: // =========================================================================
04335:
04336: /**
04337: * Parse synthetic nonterminal xtc.lang.Java.BitwiseXorExpression$$Tail1.
04338: *
04339: * @param yyStart The index.
04340: * @return The result.
04341: * @throws IOException Signals an I/O error.
04342: */
04343: private Result pBitwiseXorExpression$$Tail1(final int yyStart)
04344: throws IOException {
04345:
04346: Result yyResult;
04347: Action<Node> yyValue;
04348: ParseError yyError = ParseError.DUMMY;
04349:
04350: // Alternative <Xor>.
04351:
04352: yyResult = pSymbol(yyStart);
04353: yyError = yyResult.select(yyError);
04354: if (yyResult.hasValue()
04355: && ((Node) yyResult.semanticValue()).getTokenText()
04356: .equals("^")) {
04357: final Node v$pt$1 = yyResult.semanticValue();
04358:
04359: yyResult = pBitwiseAndExpression(yyResult.index);
04360: yyError = yyResult.select(yyError);
04361: if (yyResult.hasValue()) {
04362: final Node v$pt$2 = yyResult.semanticValue();
04363: final Node v$g$2 = Formatting.before1(v$pt$1, v$pt$2);
04364:
04365: yyValue = new Action<Node>() {
04366: public Node run(Node v$1) {
04367: return GNode.create("BitwiseXorExpression",
04368: v$1, v$g$2);
04369: }
04370: };
04371:
04372: return yyResult.createValue(yyValue, yyError);
04373: }
04374: }
04375:
04376: // Done.
04377: yyError = yyError.select("bitwise xor expression expected",
04378: yyStart);
04379: return yyError;
04380: }
04381:
04382: // =========================================================================
04383:
04384: /**
04385: * Parse nonterminal xtc.lang.Java.BitwiseAndExpression.
04386: *
04387: * @param yyStart The index.
04388: * @return The result.
04389: * @throws IOException Signals an I/O error.
04390: */
04391: private Result pBitwiseAndExpression(final int yyStart)
04392: throws IOException {
04393: Result yyResult;
04394: int yyRepetition1;
04395: Pair<Action<Node>> yyRepValue1;
04396: Node yyValue;
04397: ParseError yyError = ParseError.DUMMY;
04398:
04399: // Alternative <Base>.
04400:
04401: yyResult = pEqualityExpression(yyStart);
04402: yyError = yyResult.select(yyError);
04403: if (yyResult.hasValue()) {
04404: final Node v$3 = yyResult.semanticValue();
04405:
04406: yyRepetition1 = yyResult.index;
04407: yyRepValue1 = Pair.empty();
04408: while (true) {
04409:
04410: yyResult = pBitwiseAndExpression$$Tail1(yyRepetition1);
04411: yyError = yyResult.select(yyError);
04412: if (yyResult.hasValue()) {
04413: final Action<Node> v$4 = yyResult.semanticValue();
04414:
04415: yyRepetition1 = yyResult.index;
04416: yyRepValue1 = new Pair<Action<Node>>(v$4,
04417: yyRepValue1);
04418: continue;
04419: }
04420: break;
04421: }
04422: { // Start scope for v$5.
04423: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
04424:
04425: yyValue = apply(v$5, v$3, yyStart);
04426:
04427: return new SemanticValue(yyValue, yyRepetition1,
04428: yyError);
04429: } // End scope for v$5.
04430: }
04431:
04432: // Done.
04433: return yyError;
04434: }
04435:
04436: // =========================================================================
04437:
04438: /**
04439: * Parse synthetic nonterminal xtc.lang.Java.BitwiseAndExpression$$Tail1.
04440: *
04441: * @param yyStart The index.
04442: * @return The result.
04443: * @throws IOException Signals an I/O error.
04444: */
04445: private Result pBitwiseAndExpression$$Tail1(final int yyStart)
04446: throws IOException {
04447:
04448: Result yyResult;
04449: Action<Node> yyValue;
04450: ParseError yyError = ParseError.DUMMY;
04451:
04452: // Alternative <And>.
04453:
04454: yyResult = pSymbol(yyStart);
04455: yyError = yyResult.select(yyError);
04456: if (yyResult.hasValue()
04457: && ((Node) yyResult.semanticValue()).getTokenText()
04458: .equals("&")) {
04459: final Node v$pt$1 = yyResult.semanticValue();
04460:
04461: yyResult = pEqualityExpression(yyResult.index);
04462: yyError = yyResult.select(yyError);
04463: if (yyResult.hasValue()) {
04464: final Node v$pt$2 = yyResult.semanticValue();
04465: final Node v$g$2 = Formatting.before1(v$pt$1, v$pt$2);
04466:
04467: yyValue = new Action<Node>() {
04468: public Node run(Node v$1) {
04469: return GNode.create("BitwiseAndExpression",
04470: v$1, v$g$2);
04471: }
04472: };
04473:
04474: return yyResult.createValue(yyValue, yyError);
04475: }
04476: }
04477:
04478: // Done.
04479: yyError = yyError.select("bitwise and expression expected",
04480: yyStart);
04481: return yyError;
04482: }
04483:
04484: // =========================================================================
04485:
04486: /**
04487: * Parse nonterminal xtc.lang.Java.EqualityExpression.
04488: *
04489: * @param yyStart The index.
04490: * @return The result.
04491: * @throws IOException Signals an I/O error.
04492: */
04493: private Result pEqualityExpression(final int yyStart)
04494: throws IOException {
04495: Result yyResult;
04496: int yyRepetition1;
04497: Pair<Action<Node>> yyRepValue1;
04498: Node yyValue;
04499: ParseError yyError = ParseError.DUMMY;
04500:
04501: // Alternative <Base>.
04502:
04503: yyResult = pInstanceOfExpression(yyStart);
04504: yyError = yyResult.select(yyError);
04505: if (yyResult.hasValue()) {
04506: final Node v$4 = yyResult.semanticValue();
04507:
04508: yyRepetition1 = yyResult.index;
04509: yyRepValue1 = Pair.empty();
04510: while (true) {
04511:
04512: yyResult = pEqualityExpression$$Tail1(yyRepetition1);
04513: yyError = yyResult.select(yyError);
04514: if (yyResult.hasValue()) {
04515: final Action<Node> v$5 = yyResult.semanticValue();
04516:
04517: yyRepetition1 = yyResult.index;
04518: yyRepValue1 = new Pair<Action<Node>>(v$5,
04519: yyRepValue1);
04520: continue;
04521: }
04522: break;
04523: }
04524: { // Start scope for v$6.
04525: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
04526:
04527: yyValue = apply(v$6, v$4, yyStart);
04528:
04529: return new SemanticValue(yyValue, yyRepetition1,
04530: yyError);
04531: } // End scope for v$6.
04532: }
04533:
04534: // Done.
04535: return yyError;
04536: }
04537:
04538: // =========================================================================
04539:
04540: /**
04541: * Parse synthetic nonterminal xtc.lang.Java.EqualityExpression$$Tail1.
04542: *
04543: * @param yyStart The index.
04544: * @return The result.
04545: * @throws IOException Signals an I/O error.
04546: */
04547: private Result pEqualityExpression$$Tail1(final int yyStart)
04548: throws IOException {
04549:
04550: Result yyResult;
04551: Action<Node> yyValue;
04552: ParseError yyError = ParseError.DUMMY;
04553:
04554: // Alternative <Recursion>.
04555:
04556: yyResult = pEqualityOperator(yyStart);
04557: yyError = yyResult.select(yyError);
04558: if (yyResult.hasValue()) {
04559: final Node v$g$2 = yyResult.semanticValue();
04560:
04561: yyResult = pInstanceOfExpression(yyResult.index);
04562: yyError = yyResult.select(yyError);
04563: if (yyResult.hasValue()) {
04564: final Node v$g$3 = yyResult.semanticValue();
04565:
04566: yyValue = new Action<Node>() {
04567: public Node run(Node v$1) {
04568: return GNode.create("EqualityExpression", v$1,
04569: v$g$2, v$g$3);
04570: }
04571: };
04572:
04573: return yyResult.createValue(yyValue, yyError);
04574: }
04575: }
04576:
04577: // Done.
04578: return yyError;
04579: }
04580:
04581: // =========================================================================
04582:
04583: /**
04584: * Parse nonterminal xtc.lang.Java.EqualityOperator.
04585: *
04586: * @param yyStart The index.
04587: * @return The result.
04588: * @throws IOException Signals an I/O error.
04589: */
04590: private Result pEqualityOperator(final int yyStart)
04591: throws IOException {
04592: Result yyResult;
04593: Node yyValue;
04594: ParseError yyError = ParseError.DUMMY;
04595:
04596: // Alternative <Equal>.
04597:
04598: yyResult = pSymbol(yyStart);
04599: yyError = yyResult.select(yyError);
04600: if (yyResult.hasValue()
04601: && ((Node) yyResult.semanticValue()).getTokenText()
04602: .equals("==")) {
04603: yyValue = yyResult.semanticValue();
04604:
04605: return yyResult.createValue(yyValue, yyError);
04606: }
04607:
04608: // Alternative <NotEqual>.
04609:
04610: yyResult = pSymbol(yyStart);
04611: yyError = yyResult.select(yyError);
04612: if (yyResult.hasValue()
04613: && ((Node) yyResult.semanticValue()).getTokenText()
04614: .equals("!=")) {
04615: yyValue = yyResult.semanticValue();
04616:
04617: return yyResult.createValue(yyValue, yyError);
04618: }
04619:
04620: // Done.
04621: yyError = yyError.select("equality operator expected", yyStart);
04622: return yyError;
04623: }
04624:
04625: // =========================================================================
04626:
04627: /**
04628: * Parse nonterminal xtc.lang.Java.InstanceOfExpression.
04629: *
04630: * @param yyStart The index.
04631: * @return The result.
04632: * @throws IOException Signals an I/O error.
04633: */
04634: private Result pInstanceOfExpression(final int yyStart)
04635: throws IOException {
04636: Result yyResult;
04637: int yyBase;
04638: Node yyValue;
04639: ParseError yyError = ParseError.DUMMY;
04640:
04641: // Alternative <Instanceof>.
04642:
04643: yyResult = pRelationalExpression(yyStart);
04644: yyError = yyResult.select(yyError);
04645: if (yyResult.hasValue()) {
04646: final Node v$pt$2 = yyResult.semanticValue();
04647:
04648: yyBase = yyResult.index;
04649: yyResult = pWord(yyBase);
04650: yyError = yyResult.select(yyError);
04651: if (yyResult.hasValue()
04652: && ((Node) yyResult.semanticValue()).getTokenText()
04653: .equals("instanceof")) {
04654: final Node v$pt$1 = yyResult.semanticValue();
04655: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
04656:
04657: yyResult = pType(yyResult.index);
04658: yyError = yyResult.select(yyError);
04659: if (yyResult.hasValue()) {
04660: final Node v$g$2 = yyResult.semanticValue();
04661:
04662: yyValue = GNode.create("InstanceOfExpression",
04663: v$g$1, v$g$2);
04664: yyValue.setLocation(location(yyStart));
04665:
04666: return yyResult.createValue(yyValue, yyError);
04667: }
04668: } else {
04669: yyError = yyError.select("\"instanceof\" expected",
04670: yyBase);
04671: }
04672: }
04673:
04674: // Alternative <Base>.
04675:
04676: yyResult = pRelationalExpression(yyStart);
04677: yyError = yyResult.select(yyError);
04678: if (yyResult.hasValue()) {
04679: yyValue = yyResult.semanticValue();
04680:
04681: return yyResult.createValue(yyValue, yyError);
04682: }
04683:
04684: // Done.
04685: return yyError;
04686: }
04687:
04688: // =========================================================================
04689:
04690: /**
04691: * Parse nonterminal xtc.lang.Java.RelationalExpression.
04692: *
04693: * @param yyStart The index.
04694: * @return The result.
04695: * @throws IOException Signals an I/O error.
04696: */
04697: private Result pRelationalExpression(final int yyStart)
04698: throws IOException {
04699: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
04700: if (null == yyColumn.chunk2)
04701: yyColumn.chunk2 = new Chunk2();
04702: if (null == yyColumn.chunk2.fRelationalExpression)
04703: yyColumn.chunk2.fRelationalExpression = pRelationalExpression$1(yyStart);
04704: return yyColumn.chunk2.fRelationalExpression;
04705: }
04706:
04707: /** Actually parse xtc.lang.Java.RelationalExpression. */
04708: private Result pRelationalExpression$1(final int yyStart)
04709: throws IOException {
04710:
04711: Result yyResult;
04712: int yyRepetition1;
04713: Pair<Action<Node>> yyRepValue1;
04714: Node yyValue;
04715: ParseError yyError = ParseError.DUMMY;
04716:
04717: // Alternative <Base>.
04718:
04719: yyResult = pShiftExpression(yyStart);
04720: yyError = yyResult.select(yyError);
04721: if (yyResult.hasValue()) {
04722: final Node v$4 = yyResult.semanticValue();
04723:
04724: yyRepetition1 = yyResult.index;
04725: yyRepValue1 = Pair.empty();
04726: while (true) {
04727:
04728: yyResult = pRelationalExpression$$Tail1(yyRepetition1);
04729: yyError = yyResult.select(yyError);
04730: if (yyResult.hasValue()) {
04731: final Action<Node> v$5 = yyResult.semanticValue();
04732:
04733: yyRepetition1 = yyResult.index;
04734: yyRepValue1 = new Pair<Action<Node>>(v$5,
04735: yyRepValue1);
04736: continue;
04737: }
04738: break;
04739: }
04740: { // Start scope for v$6.
04741: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
04742:
04743: yyValue = apply(v$6, v$4, yyStart);
04744:
04745: return new SemanticValue(yyValue, yyRepetition1,
04746: yyError);
04747: } // End scope for v$6.
04748: }
04749:
04750: // Done.
04751: return yyError;
04752: }
04753:
04754: // =========================================================================
04755:
04756: /**
04757: * Parse synthetic nonterminal xtc.lang.Java.RelationalExpression$$Tail1.
04758: *
04759: * @param yyStart The index.
04760: * @return The result.
04761: * @throws IOException Signals an I/O error.
04762: */
04763: private Result pRelationalExpression$$Tail1(final int yyStart)
04764: throws IOException {
04765:
04766: Result yyResult;
04767: Action<Node> yyValue;
04768: ParseError yyError = ParseError.DUMMY;
04769:
04770: // Alternative <Recursion>.
04771:
04772: yyResult = pRelationalOperator(yyStart);
04773: yyError = yyResult.select(yyError);
04774: if (yyResult.hasValue()) {
04775: final Node v$g$2 = yyResult.semanticValue();
04776:
04777: yyResult = pShiftExpression(yyResult.index);
04778: yyError = yyResult.select(yyError);
04779: if (yyResult.hasValue()) {
04780: final Node v$g$3 = yyResult.semanticValue();
04781:
04782: yyValue = new Action<Node>() {
04783: public Node run(Node v$1) {
04784: return GNode.create("RelationalExpression",
04785: v$1, v$g$2, v$g$3);
04786: }
04787: };
04788:
04789: return yyResult.createValue(yyValue, yyError);
04790: }
04791: }
04792:
04793: // Done.
04794: return yyError;
04795: }
04796:
04797: // =========================================================================
04798:
04799: /**
04800: * Parse nonterminal xtc.lang.Java.RelationalOperator.
04801: *
04802: * @param yyStart The index.
04803: * @return The result.
04804: * @throws IOException Signals an I/O error.
04805: */
04806: private Result pRelationalOperator(final int yyStart)
04807: throws IOException {
04808: Result yyResult;
04809: Node yyValue;
04810: ParseError yyError = ParseError.DUMMY;
04811:
04812: // Alternative <Less>.
04813:
04814: yyResult = pSymbol(yyStart);
04815: yyError = yyResult.select(yyError);
04816: if (yyResult.hasValue()
04817: && ((Node) yyResult.semanticValue()).getTokenText()
04818: .equals("<")) {
04819: yyValue = yyResult.semanticValue();
04820:
04821: return yyResult.createValue(yyValue, yyError);
04822: }
04823:
04824: // Alternative <Greater>.
04825:
04826: yyResult = pSymbol(yyStart);
04827: yyError = yyResult.select(yyError);
04828: if (yyResult.hasValue()
04829: && ((Node) yyResult.semanticValue()).getTokenText()
04830: .equals(">")) {
04831: yyValue = yyResult.semanticValue();
04832:
04833: return yyResult.createValue(yyValue, yyError);
04834: }
04835:
04836: // Alternative <LessEqual>.
04837:
04838: yyResult = pSymbol(yyStart);
04839: yyError = yyResult.select(yyError);
04840: if (yyResult.hasValue()
04841: && ((Node) yyResult.semanticValue()).getTokenText()
04842: .equals("<=")) {
04843: yyValue = yyResult.semanticValue();
04844:
04845: return yyResult.createValue(yyValue, yyError);
04846: }
04847:
04848: // Alternative <GreaterEqual>.
04849:
04850: yyResult = pSymbol(yyStart);
04851: yyError = yyResult.select(yyError);
04852: if (yyResult.hasValue()
04853: && ((Node) yyResult.semanticValue()).getTokenText()
04854: .equals(">=")) {
04855: yyValue = yyResult.semanticValue();
04856:
04857: return yyResult.createValue(yyValue, yyError);
04858: }
04859:
04860: // Done.
04861: yyError = yyError.select("relational operator expected",
04862: yyStart);
04863: return yyError;
04864: }
04865:
04866: // =========================================================================
04867:
04868: /**
04869: * Parse nonterminal xtc.lang.Java.ShiftExpression.
04870: *
04871: * @param yyStart The index.
04872: * @return The result.
04873: * @throws IOException Signals an I/O error.
04874: */
04875: private Result pShiftExpression(final int yyStart)
04876: throws IOException {
04877: Result yyResult;
04878: int yyRepetition1;
04879: Pair<Action<Node>> yyRepValue1;
04880: Node yyValue;
04881: ParseError yyError = ParseError.DUMMY;
04882:
04883: // Alternative <Base>.
04884:
04885: yyResult = pAdditiveExpression(yyStart);
04886: yyError = yyResult.select(yyError);
04887: if (yyResult.hasValue()) {
04888: final Node v$4 = yyResult.semanticValue();
04889:
04890: yyRepetition1 = yyResult.index;
04891: yyRepValue1 = Pair.empty();
04892: while (true) {
04893:
04894: yyResult = pShiftExpression$$Tail1(yyRepetition1);
04895: yyError = yyResult.select(yyError);
04896: if (yyResult.hasValue()) {
04897: final Action<Node> v$5 = yyResult.semanticValue();
04898:
04899: yyRepetition1 = yyResult.index;
04900: yyRepValue1 = new Pair<Action<Node>>(v$5,
04901: yyRepValue1);
04902: continue;
04903: }
04904: break;
04905: }
04906: { // Start scope for v$6.
04907: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
04908:
04909: yyValue = apply(v$6, v$4, yyStart);
04910:
04911: return new SemanticValue(yyValue, yyRepetition1,
04912: yyError);
04913: } // End scope for v$6.
04914: }
04915:
04916: // Done.
04917: return yyError;
04918: }
04919:
04920: // =========================================================================
04921:
04922: /**
04923: * Parse synthetic nonterminal xtc.lang.Java.ShiftExpression$$Tail1.
04924: *
04925: * @param yyStart The index.
04926: * @return The result.
04927: * @throws IOException Signals an I/O error.
04928: */
04929: private Result pShiftExpression$$Tail1(final int yyStart)
04930: throws IOException {
04931:
04932: Result yyResult;
04933: Action<Node> yyValue;
04934: ParseError yyError = ParseError.DUMMY;
04935:
04936: // Alternative <Recursion>.
04937:
04938: yyResult = pShiftOperator(yyStart);
04939: yyError = yyResult.select(yyError);
04940: if (yyResult.hasValue()) {
04941: final Node v$g$2 = yyResult.semanticValue();
04942:
04943: yyResult = pAdditiveExpression(yyResult.index);
04944: yyError = yyResult.select(yyError);
04945: if (yyResult.hasValue()) {
04946: final Node v$g$3 = yyResult.semanticValue();
04947:
04948: yyValue = new Action<Node>() {
04949: public Node run(Node v$1) {
04950: return GNode.create("ShiftExpression", v$1,
04951: v$g$2, v$g$3);
04952: }
04953: };
04954:
04955: return yyResult.createValue(yyValue, yyError);
04956: }
04957: }
04958:
04959: // Done.
04960: return yyError;
04961: }
04962:
04963: // =========================================================================
04964:
04965: /**
04966: * Parse nonterminal xtc.lang.Java.ShiftOperator.
04967: *
04968: * @param yyStart The index.
04969: * @return The result.
04970: * @throws IOException Signals an I/O error.
04971: */
04972: private Result pShiftOperator(final int yyStart) throws IOException {
04973: Result yyResult;
04974: Node yyValue;
04975: ParseError yyError = ParseError.DUMMY;
04976:
04977: // Alternative <Left>.
04978:
04979: yyResult = pSymbol(yyStart);
04980: yyError = yyResult.select(yyError);
04981: if (yyResult.hasValue()
04982: && ((Node) yyResult.semanticValue()).getTokenText()
04983: .equals("<<")) {
04984: yyValue = yyResult.semanticValue();
04985:
04986: return yyResult.createValue(yyValue, yyError);
04987: }
04988:
04989: // Alternative <Right>.
04990:
04991: yyResult = pSymbol(yyStart);
04992: yyError = yyResult.select(yyError);
04993: if (yyResult.hasValue()
04994: && ((Node) yyResult.semanticValue()).getTokenText()
04995: .equals(">>")) {
04996: yyValue = yyResult.semanticValue();
04997:
04998: return yyResult.createValue(yyValue, yyError);
04999: }
05000:
05001: // Alternative <UnsignedRight>.
05002:
05003: yyResult = pSymbol(yyStart);
05004: yyError = yyResult.select(yyError);
05005: if (yyResult.hasValue()
05006: && ((Node) yyResult.semanticValue()).getTokenText()
05007: .equals(">>>")) {
05008: yyValue = yyResult.semanticValue();
05009:
05010: return yyResult.createValue(yyValue, yyError);
05011: }
05012:
05013: // Done.
05014: yyError = yyError.select("shift operator expected", yyStart);
05015: return yyError;
05016: }
05017:
05018: // =========================================================================
05019:
05020: /**
05021: * Parse nonterminal xtc.lang.Java.AdditiveExpression.
05022: *
05023: * @param yyStart The index.
05024: * @return The result.
05025: * @throws IOException Signals an I/O error.
05026: */
05027: private Result pAdditiveExpression(final int yyStart)
05028: throws IOException {
05029: Result yyResult;
05030: int yyRepetition1;
05031: Pair<Action<Node>> yyRepValue1;
05032: Node yyValue;
05033: ParseError yyError = ParseError.DUMMY;
05034:
05035: // Alternative <Base>.
05036:
05037: yyResult = pMultiplicativeExpression(yyStart);
05038: yyError = yyResult.select(yyError);
05039: if (yyResult.hasValue()) {
05040: final Node v$4 = yyResult.semanticValue();
05041:
05042: yyRepetition1 = yyResult.index;
05043: yyRepValue1 = Pair.empty();
05044: while (true) {
05045:
05046: yyResult = pAdditiveExpression$$Tail1(yyRepetition1);
05047: yyError = yyResult.select(yyError);
05048: if (yyResult.hasValue()) {
05049: final Action<Node> v$5 = yyResult.semanticValue();
05050:
05051: yyRepetition1 = yyResult.index;
05052: yyRepValue1 = new Pair<Action<Node>>(v$5,
05053: yyRepValue1);
05054: continue;
05055: }
05056: break;
05057: }
05058: { // Start scope for v$6.
05059: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
05060:
05061: yyValue = apply(v$6, v$4, yyStart);
05062:
05063: return new SemanticValue(yyValue, yyRepetition1,
05064: yyError);
05065: } // End scope for v$6.
05066: }
05067:
05068: // Done.
05069: return yyError;
05070: }
05071:
05072: // =========================================================================
05073:
05074: /**
05075: * Parse synthetic nonterminal xtc.lang.Java.AdditiveExpression$$Tail1.
05076: *
05077: * @param yyStart The index.
05078: * @return The result.
05079: * @throws IOException Signals an I/O error.
05080: */
05081: private Result pAdditiveExpression$$Tail1(final int yyStart)
05082: throws IOException {
05083:
05084: Result yyResult;
05085: Action<Node> yyValue;
05086: ParseError yyError = ParseError.DUMMY;
05087:
05088: // Alternative <Recursion>.
05089:
05090: yyResult = pAdditiveOperator(yyStart);
05091: yyError = yyResult.select(yyError);
05092: if (yyResult.hasValue()) {
05093: final Node v$g$2 = yyResult.semanticValue();
05094:
05095: yyResult = pMultiplicativeExpression(yyResult.index);
05096: yyError = yyResult.select(yyError);
05097: if (yyResult.hasValue()) {
05098: final Node v$g$3 = yyResult.semanticValue();
05099:
05100: yyValue = new Action<Node>() {
05101: public Node run(Node v$1) {
05102: return GNode.create("AdditiveExpression", v$1,
05103: v$g$2, v$g$3);
05104: }
05105: };
05106:
05107: return yyResult.createValue(yyValue, yyError);
05108: }
05109: }
05110:
05111: // Done.
05112: return yyError;
05113: }
05114:
05115: // =========================================================================
05116:
05117: /**
05118: * Parse nonterminal xtc.lang.Java.AdditiveOperator.
05119: *
05120: * @param yyStart The index.
05121: * @return The result.
05122: * @throws IOException Signals an I/O error.
05123: */
05124: private Result pAdditiveOperator(final int yyStart)
05125: throws IOException {
05126: Result yyResult;
05127: Node yyValue;
05128: ParseError yyError = ParseError.DUMMY;
05129:
05130: // Alternative <Plus>.
05131:
05132: yyResult = pSymbol(yyStart);
05133: yyError = yyResult.select(yyError);
05134: if (yyResult.hasValue()
05135: && ((Node) yyResult.semanticValue()).getTokenText()
05136: .equals("+")) {
05137: yyValue = yyResult.semanticValue();
05138:
05139: return yyResult.createValue(yyValue, yyError);
05140: }
05141:
05142: // Alternative <Minus>.
05143:
05144: yyResult = pSymbol(yyStart);
05145: yyError = yyResult.select(yyError);
05146: if (yyResult.hasValue()
05147: && ((Node) yyResult.semanticValue()).getTokenText()
05148: .equals("-")) {
05149: yyValue = yyResult.semanticValue();
05150:
05151: return yyResult.createValue(yyValue, yyError);
05152: }
05153:
05154: // Done.
05155: yyError = yyError.select("additive operator expected", yyStart);
05156: return yyError;
05157: }
05158:
05159: // =========================================================================
05160:
05161: /**
05162: * Parse nonterminal xtc.lang.Java.MultiplicativeExpression.
05163: *
05164: * @param yyStart The index.
05165: * @return The result.
05166: * @throws IOException Signals an I/O error.
05167: */
05168: private Result pMultiplicativeExpression(final int yyStart)
05169: throws IOException {
05170:
05171: Result yyResult;
05172: int yyRepetition1;
05173: Pair<Action<Node>> yyRepValue1;
05174: Node yyValue;
05175: ParseError yyError = ParseError.DUMMY;
05176:
05177: // Alternative <Base>.
05178:
05179: yyResult = pUnaryExpression(yyStart);
05180: yyError = yyResult.select(yyError);
05181: if (yyResult.hasValue()) {
05182: final Node v$4 = yyResult.semanticValue();
05183:
05184: yyRepetition1 = yyResult.index;
05185: yyRepValue1 = Pair.empty();
05186: while (true) {
05187:
05188: yyResult = pMultiplicativeExpression$$Tail1(yyRepetition1);
05189: yyError = yyResult.select(yyError);
05190: if (yyResult.hasValue()) {
05191: final Action<Node> v$5 = yyResult.semanticValue();
05192:
05193: yyRepetition1 = yyResult.index;
05194: yyRepValue1 = new Pair<Action<Node>>(v$5,
05195: yyRepValue1);
05196: continue;
05197: }
05198: break;
05199: }
05200: { // Start scope for v$6.
05201: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
05202:
05203: yyValue = apply(v$6, v$4, yyStart);
05204:
05205: return new SemanticValue(yyValue, yyRepetition1,
05206: yyError);
05207: } // End scope for v$6.
05208: }
05209:
05210: // Done.
05211: return yyError;
05212: }
05213:
05214: // =========================================================================
05215:
05216: /**
05217: * Parse synthetic nonterminal
05218: * xtc.lang.Java.MultiplicativeExpression$$Tail1.
05219: *
05220: * @param yyStart The index.
05221: * @return The result.
05222: * @throws IOException Signals an I/O error.
05223: */
05224: private Result pMultiplicativeExpression$$Tail1(final int yyStart)
05225: throws IOException {
05226:
05227: Result yyResult;
05228: Action<Node> yyValue;
05229: ParseError yyError = ParseError.DUMMY;
05230:
05231: // Alternative <Times>.
05232:
05233: yyResult = pMultiplicativeOperator(yyStart);
05234: yyError = yyResult.select(yyError);
05235: if (yyResult.hasValue()) {
05236: final Node v$g$2 = yyResult.semanticValue();
05237:
05238: yyResult = pUnaryExpression(yyResult.index);
05239: yyError = yyResult.select(yyError);
05240: if (yyResult.hasValue()) {
05241: final Node v$g$3 = yyResult.semanticValue();
05242:
05243: yyValue = new Action<Node>() {
05244: public Node run(Node v$1) {
05245: return GNode.create("MultiplicativeExpression",
05246: v$1, v$g$2, v$g$3);
05247: }
05248: };
05249:
05250: return yyResult.createValue(yyValue, yyError);
05251: }
05252: }
05253:
05254: // Done.
05255: return yyError;
05256: }
05257:
05258: // =========================================================================
05259:
05260: /**
05261: * Parse nonterminal xtc.lang.Java.MultiplicativeOperator.
05262: *
05263: * @param yyStart The index.
05264: * @return The result.
05265: * @throws IOException Signals an I/O error.
05266: */
05267: private Result pMultiplicativeOperator(final int yyStart)
05268: throws IOException {
05269:
05270: Result yyResult;
05271: Node yyValue;
05272: ParseError yyError = ParseError.DUMMY;
05273:
05274: // Alternative <Times>.
05275:
05276: yyResult = pSymbol(yyStart);
05277: yyError = yyResult.select(yyError);
05278: if (yyResult.hasValue()
05279: && ((Node) yyResult.semanticValue()).getTokenText()
05280: .equals("*")) {
05281: yyValue = yyResult.semanticValue();
05282:
05283: return yyResult.createValue(yyValue, yyError);
05284: }
05285:
05286: // Alternative <Over>.
05287:
05288: yyResult = pSymbol(yyStart);
05289: yyError = yyResult.select(yyError);
05290: if (yyResult.hasValue()
05291: && ((Node) yyResult.semanticValue()).getTokenText()
05292: .equals("/")) {
05293: yyValue = yyResult.semanticValue();
05294:
05295: return yyResult.createValue(yyValue, yyError);
05296: }
05297:
05298: // Alternative <Modulo>.
05299:
05300: yyResult = pSymbol(yyStart);
05301: yyError = yyResult.select(yyError);
05302: if (yyResult.hasValue()
05303: && ((Node) yyResult.semanticValue()).getTokenText()
05304: .equals("%")) {
05305: yyValue = yyResult.semanticValue();
05306:
05307: return yyResult.createValue(yyValue, yyError);
05308: }
05309:
05310: // Done.
05311: yyError = yyError.select("multiplicative operator expected",
05312: yyStart);
05313: return yyError;
05314: }
05315:
05316: // =========================================================================
05317:
05318: /**
05319: * Parse nonterminal xtc.lang.Java.UnaryExpression.
05320: *
05321: * @param yyStart The index.
05322: * @return The result.
05323: * @throws IOException Signals an I/O error.
05324: */
05325: private Result pUnaryExpression(final int yyStart)
05326: throws IOException {
05327: Result yyResult;
05328: Node yyValue;
05329: ParseError yyError = ParseError.DUMMY;
05330:
05331: // Alternative <Plus>.
05332:
05333: yyResult = pSymbol(yyStart);
05334: yyError = yyResult.select(yyError);
05335: if (yyResult.hasValue()
05336: && ((Node) yyResult.semanticValue()).getTokenText()
05337: .equals("+")) {
05338: final Node v$g$1 = yyResult.semanticValue();
05339:
05340: yyResult = pUnaryExpression(yyResult.index);
05341: yyError = yyResult.select(yyError);
05342: if (yyResult.hasValue()) {
05343: final Node v$g$2 = yyResult.semanticValue();
05344:
05345: yyValue = GNode.create("UnaryExpression", v$g$1, v$g$2);
05346: yyValue.setLocation(location(yyStart));
05347:
05348: return yyResult.createValue(yyValue, yyError);
05349: }
05350: }
05351:
05352: // Alternative <Minus>.
05353:
05354: yyResult = pSymbol(yyStart);
05355: yyError = yyResult.select(yyError);
05356: if (yyResult.hasValue()
05357: && ((Node) yyResult.semanticValue()).getTokenText()
05358: .equals("-")) {
05359: final Node v$g$3 = yyResult.semanticValue();
05360:
05361: yyResult = pUnaryExpression(yyResult.index);
05362: yyError = yyResult.select(yyError);
05363: if (yyResult.hasValue()) {
05364: final Node v$g$4 = yyResult.semanticValue();
05365:
05366: yyValue = GNode.create("UnaryExpression", v$g$3, v$g$4);
05367: yyValue.setLocation(location(yyStart));
05368:
05369: return yyResult.createValue(yyValue, yyError);
05370: }
05371: }
05372:
05373: // Alternative <Increment>.
05374:
05375: yyResult = pSymbol(yyStart);
05376: yyError = yyResult.select(yyError);
05377: if (yyResult.hasValue()
05378: && ((Node) yyResult.semanticValue()).getTokenText()
05379: .equals("++")) {
05380: final Node v$g$5 = yyResult.semanticValue();
05381:
05382: yyResult = pUnaryExpression(yyResult.index);
05383: yyError = yyResult.select(yyError);
05384: if (yyResult.hasValue()) {
05385: final Node v$g$6 = yyResult.semanticValue();
05386:
05387: yyValue = GNode.create("UnaryExpression", v$g$5, v$g$6);
05388: yyValue.setLocation(location(yyStart));
05389:
05390: return yyResult.createValue(yyValue, yyError);
05391: }
05392: }
05393:
05394: // Alternative <Decrement>.
05395:
05396: yyResult = pSymbol(yyStart);
05397: yyError = yyResult.select(yyError);
05398: if (yyResult.hasValue()
05399: && ((Node) yyResult.semanticValue()).getTokenText()
05400: .equals("--")) {
05401: final Node v$g$7 = yyResult.semanticValue();
05402:
05403: yyResult = pUnaryExpression(yyResult.index);
05404: yyError = yyResult.select(yyError);
05405: if (yyResult.hasValue()) {
05406: final Node v$g$8 = yyResult.semanticValue();
05407:
05408: yyValue = GNode.create("UnaryExpression", v$g$7, v$g$8);
05409: yyValue.setLocation(location(yyStart));
05410:
05411: return yyResult.createValue(yyValue, yyError);
05412: }
05413: }
05414:
05415: // Alternative <Base>.
05416:
05417: yyResult = pUnaryExpressionNotPlusMinus(yyStart);
05418: yyError = yyResult.select(yyError);
05419: if (yyResult.hasValue()) {
05420: yyValue = yyResult.semanticValue();
05421:
05422: return yyResult.createValue(yyValue, yyError);
05423: }
05424:
05425: // Done.
05426: yyError = yyError.select("unary expression expected", yyStart);
05427: return yyError;
05428: }
05429:
05430: // =========================================================================
05431:
05432: /**
05433: * Parse nonterminal xtc.lang.Java.UnaryExpressionNotPlusMinus.
05434: *
05435: * @param yyStart The index.
05436: * @return The result.
05437: * @throws IOException Signals an I/O error.
05438: */
05439: private Result pUnaryExpressionNotPlusMinus(final int yyStart)
05440: throws IOException {
05441:
05442: Result yyResult;
05443: int yyBase;
05444: int yyOption1;
05445: Node yyOpValue1;
05446: Node yyValue;
05447: ParseError yyError = ParseError.DUMMY;
05448:
05449: // Alternative 1.
05450:
05451: yyResult = pSymbol(yyStart);
05452: yyError = yyResult.select(yyError);
05453: if (yyResult.hasValue()
05454: && ((Node) yyResult.semanticValue()).getTokenText()
05455: .equals("~")) {
05456: final Node v$pt$1 = yyResult.semanticValue();
05457:
05458: yyResult = pUnaryExpression(yyResult.index);
05459: yyError = yyResult.select(yyError);
05460: if (yyResult.hasValue()) {
05461: final Node v$pt$2 = yyResult.semanticValue();
05462: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
05463:
05464: yyValue = GNode.create("BitwiseNegationExpression",
05465: v$g$1);
05466: yyValue.setLocation(location(yyStart));
05467:
05468: return yyResult.createValue(yyValue, yyError);
05469: }
05470: }
05471:
05472: // Alternative 2.
05473:
05474: yyResult = pSymbol(yyStart);
05475: yyError = yyResult.select(yyError);
05476: if (yyResult.hasValue()
05477: && ((Node) yyResult.semanticValue()).getTokenText()
05478: .equals("!")) {
05479: final Node v$pt$1 = yyResult.semanticValue();
05480:
05481: yyResult = pUnaryExpression(yyResult.index);
05482: yyError = yyResult.select(yyError);
05483: if (yyResult.hasValue()) {
05484: final Node v$pt$2 = yyResult.semanticValue();
05485: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
05486:
05487: yyValue = GNode.create("LogicalNegationExpression",
05488: v$g$1);
05489: yyValue.setLocation(location(yyStart));
05490:
05491: return yyResult.createValue(yyValue, yyError);
05492: }
05493: }
05494:
05495: // Alternative 3.
05496:
05497: yyResult = pSymbol(yyStart);
05498: yyError = yyResult.select(yyError);
05499: if (yyResult.hasValue()
05500: && ((Node) yyResult.semanticValue()).getTokenText()
05501: .equals("(")) {
05502: final Node v$pt$1 = yyResult.semanticValue();
05503:
05504: final int yyChoice1 = yyResult.index;
05505:
05506: // Nested alternative 1.
05507:
05508: yyResult = pPrimitiveType(yyChoice1);
05509: yyError = yyResult.select(yyError);
05510: if (yyResult.hasValue()) {
05511: final Node v$pt$2 = yyResult.semanticValue();
05512: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
05513:
05514: yyOption1 = yyResult.index;
05515: yyOpValue1 = null;
05516:
05517: yyResult = pDimensions(yyOption1);
05518: yyError = yyResult.select(yyError);
05519: if (yyResult.hasValue()) {
05520: final Node v$el$1 = yyResult.semanticValue();
05521:
05522: yyOption1 = yyResult.index;
05523: yyOpValue1 = v$el$1;
05524: }
05525: { // Start scope for v$pt$4.
05526: final Node v$pt$4 = yyOpValue1;
05527:
05528: yyBase = yyOption1;
05529: yyResult = pSymbol(yyBase);
05530: yyError = yyResult.select(yyError);
05531: if (yyResult.hasValue()
05532: && ((Node) yyResult.semanticValue())
05533: .getTokenText().equals(")")) {
05534: final Node v$pt$3 = yyResult.semanticValue();
05535: final Node v$g$2 = Formatting.after1(v$pt$4,
05536: v$pt$3);
05537:
05538: yyResult = pUnaryExpression(yyResult.index);
05539: yyError = yyResult.select(yyError);
05540: if (yyResult.hasValue()) {
05541: final Node v$g$3 = yyResult.semanticValue();
05542:
05543: yyValue = GNode.create(
05544: "BasicCastExpression", v$g$1,
05545: v$g$2, v$g$3);
05546: yyValue.setLocation(location(yyStart));
05547:
05548: return yyResult.createValue(yyValue,
05549: yyError);
05550: }
05551: } else {
05552: yyError = yyError.select("\")\" expected",
05553: yyBase);
05554: }
05555: } // End scope for v$pt$4.
05556: }
05557:
05558: // Nested alternative 2.
05559:
05560: yyResult = pType(yyChoice1);
05561: yyError = yyResult.select(yyError);
05562: if (yyResult.hasValue()) {
05563: final Node v$pt$3 = yyResult.semanticValue();
05564:
05565: yyBase = yyResult.index;
05566: yyResult = pSymbol(yyBase);
05567: yyError = yyResult.select(yyError);
05568: if (yyResult.hasValue()
05569: && ((Node) yyResult.semanticValue())
05570: .getTokenText().equals(")")) {
05571: final Node v$pt$2 = yyResult.semanticValue();
05572: final Node v$g$1 = Formatting.round1(v$pt$1,
05573: v$pt$3, v$pt$2);
05574:
05575: yyResult = pUnaryExpressionNotPlusMinus(yyResult.index);
05576: yyError = yyResult.select(yyError);
05577: if (yyResult.hasValue()) {
05578: final Node v$g$2 = yyResult.semanticValue();
05579:
05580: yyValue = GNode.create("CastExpression", v$g$1,
05581: v$g$2);
05582: yyValue.setLocation(location(yyStart));
05583:
05584: return yyResult.createValue(yyValue, yyError);
05585: }
05586: } else {
05587: yyError = yyError.select("\")\" expected", yyBase);
05588: }
05589: }
05590: }
05591:
05592: // Alternative <Base>.
05593:
05594: yyResult = pPostfixExpression(yyStart);
05595: yyError = yyResult.select(yyError);
05596: if (yyResult.hasValue()) {
05597: yyValue = yyResult.semanticValue();
05598:
05599: return yyResult.createValue(yyValue, yyError);
05600: }
05601:
05602: // Done.
05603: yyError = yyError.select(
05604: "unary expression not plus minus expected", yyStart);
05605: return yyError;
05606: }
05607:
05608: // =========================================================================
05609:
05610: /**
05611: * Parse nonterminal xtc.lang.Java.PostfixExpression.
05612: *
05613: * @param yyStart The index.
05614: * @return The result.
05615: * @throws IOException Signals an I/O error.
05616: */
05617: private Result pPostfixExpression(final int yyStart)
05618: throws IOException {
05619: Result yyResult;
05620: int yyRepetition1;
05621: Pair<Action<Node>> yyRepValue1;
05622: Node yyValue;
05623: ParseError yyError = ParseError.DUMMY;
05624:
05625: // Alternative <Base>.
05626:
05627: yyResult = pPrimaryExpression(yyStart);
05628: yyError = yyResult.select(yyError);
05629: if (yyResult.hasValue()) {
05630: final Node v$g$15 = yyResult.semanticValue();
05631:
05632: yyRepetition1 = yyResult.index;
05633: yyRepValue1 = Pair.empty();
05634: while (true) {
05635:
05636: yyResult = pPostfixExpression$$Tail1(yyRepetition1);
05637: yyError = yyResult.select(yyError);
05638: if (yyResult.hasValue()) {
05639: final Action<Node> v$16 = yyResult.semanticValue();
05640:
05641: yyRepetition1 = yyResult.index;
05642: yyRepValue1 = new Pair<Action<Node>>(v$16,
05643: yyRepValue1);
05644: continue;
05645: }
05646: break;
05647: }
05648: { // Start scope for v$17.
05649: final Pair<Action<Node>> v$17 = yyRepValue1.reverse();
05650:
05651: yyValue = apply(v$17, v$g$15, yyStart);
05652:
05653: return new SemanticValue(yyValue, yyRepetition1,
05654: yyError);
05655: } // End scope for v$17.
05656: }
05657:
05658: // Done.
05659: return yyError;
05660: }
05661:
05662: // =========================================================================
05663:
05664: /**
05665: * Parse synthetic nonterminal xtc.lang.Java.PostfixExpression$$Tail1.
05666: *
05667: * @param yyStart The index.
05668: * @return The result.
05669: * @throws IOException Signals an I/O error.
05670: */
05671: private Result pPostfixExpression$$Tail1(final int yyStart)
05672: throws IOException {
05673:
05674: Result yyResult;
05675: int yyBase;
05676: int yyOption1;
05677: Node yyOpValue1;
05678: Action<Node> yyValue;
05679: ParseError yyError = ParseError.DUMMY;
05680:
05681: // Alternative 1.
05682:
05683: yyResult = pSymbol(yyStart);
05684: yyError = yyResult.select(yyError);
05685: if (yyResult.hasValue()
05686: && ((Node) yyResult.semanticValue()).getTokenText()
05687: .equals(".")) {
05688: final Node v$pt$1 = yyResult.semanticValue();
05689:
05690: final int yyChoice1 = yyResult.index;
05691:
05692: // Nested alternative 1.
05693: final Node v$g$2 = Formatting.before1(v$pt$1, null);
05694: { // Start scope for nested choice.
05695:
05696: final int yyChoice2 = yyChoice1;
05697:
05698: // Nested alternative 1.
05699:
05700: yyResult = pIdentifier(yyChoice2);
05701: yyError = yyResult.select(yyError);
05702: if (yyResult.hasValue()) {
05703: final Node v$g$3 = yyResult.semanticValue();
05704:
05705: yyResult = pArguments(yyResult.index);
05706: yyError = yyResult.select(yyError);
05707: if (yyResult.hasValue()) {
05708: final Node v$g$4 = yyResult.semanticValue();
05709:
05710: yyValue = new Action<Node>() {
05711: public Node run(Node v$1) {
05712: return GNode.create("CallExpression",
05713: v$1, v$g$2, v$g$3, v$g$4);
05714: }
05715: };
05716:
05717: return yyResult.createValue(yyValue, yyError);
05718: }
05719: }
05720:
05721: // Nested alternative 2.
05722:
05723: yyBase = yyChoice2;
05724: yyResult = pWord(yyBase);
05725: yyError = yyResult.select(yyError);
05726: if (yyResult.hasValue()
05727: && ((Node) yyResult.semanticValue())
05728: .getTokenText().equals("super")) {
05729: final Node v$g$5 = yyResult.semanticValue();
05730:
05731: yyResult = pArguments(yyResult.index);
05732: yyError = yyResult.select(yyError);
05733: if (yyResult.hasValue()) {
05734: final Node v$g$6 = yyResult.semanticValue();
05735:
05736: yyValue = new Action<Node>() {
05737: public Node run(Node v$1) {
05738: return GNode.create("CallExpression",
05739: v$1, v$g$2, v$g$5, v$g$6);
05740: }
05741: };
05742:
05743: return yyResult.createValue(yyValue, yyError);
05744: }
05745: } else {
05746: yyError = yyError.select("\"super\" expected",
05747: yyBase);
05748: }
05749: } // End scope for nested choice.
05750:
05751: // Nested alternative 2.
05752:
05753: yyBase = yyChoice1;
05754: yyResult = pWord(yyBase);
05755: yyError = yyResult.select(yyError);
05756: if (yyResult.hasValue()
05757: && ((Node) yyResult.semanticValue()).getTokenText()
05758: .equals("super")) {
05759: final Node v$pt$3 = yyResult.semanticValue();
05760:
05761: yyValue = new Action<Node>() {
05762: public Node run(Node v$1) {
05763: Node yyValue = GNode.create("SuperExpression",
05764: v$1);
05765: yyValue = Formatting.variable()
05766: .addNode(yyValue).add(v$pt$1).add(
05767: v$pt$3);
05768: return yyValue;
05769: }
05770: };
05771:
05772: return yyResult.createValue(yyValue, yyError);
05773: } else {
05774: yyError = yyError.select("\"super\" expected", yyBase);
05775: }
05776:
05777: // Nested alternative 3.
05778:
05779: yyResult = pIdentifier(yyChoice1);
05780: yyError = yyResult.select(yyError);
05781: if (yyResult.hasValue()) {
05782: final Node v$pt$4 = yyResult.semanticValue();
05783: final Node v$g$7 = Formatting.before1(v$pt$1, v$pt$4);
05784:
05785: yyValue = new Action<Node>() {
05786: public Node run(Node v$1) {
05787: return GNode.create("SelectionExpression", v$1,
05788: v$g$7);
05789: }
05790: };
05791:
05792: return yyResult.createValue(yyValue, yyError);
05793: }
05794: }
05795:
05796: // Alternative 2.
05797:
05798: yyResult = pSymbol(yyStart);
05799: yyError = yyResult.select(yyError);
05800: if (yyResult.hasValue()
05801: && ((Node) yyResult.semanticValue()).getTokenText()
05802: .equals("[")) {
05803: final Node v$pt$5 = yyResult.semanticValue();
05804:
05805: yyResult = pExpression(yyResult.index);
05806: yyError = yyResult.select(yyError);
05807: if (yyResult.hasValue()) {
05808: final Node v$pt$7 = yyResult.semanticValue();
05809:
05810: yyBase = yyResult.index;
05811: yyResult = pSymbol(yyBase);
05812: yyError = yyResult.select(yyError);
05813: if (yyResult.hasValue()
05814: && ((Node) yyResult.semanticValue())
05815: .getTokenText().equals("]")) {
05816: final Node v$pt$6 = yyResult.semanticValue();
05817: final Node v$g$8 = Formatting.round1(v$pt$5,
05818: v$pt$7, v$pt$6);
05819:
05820: yyValue = new Action<Node>() {
05821: public Node run(Node v$1) {
05822: return GNode.create("SubscriptExpression",
05823: v$1, v$g$8);
05824: }
05825: };
05826:
05827: return yyResult.createValue(yyValue, yyError);
05828: } else {
05829: yyError = yyError.select("\"]\" expected", yyBase);
05830: }
05831: }
05832: }
05833:
05834: // Alternative 3.
05835:
05836: yyResult = pSymbol(yyStart);
05837: yyError = yyResult.select(yyError);
05838: if (yyResult.hasValue()
05839: && ((Node) yyResult.semanticValue()).getTokenText()
05840: .equals("++")) {
05841: final Node v$g$9 = yyResult.semanticValue();
05842:
05843: yyValue = new Action<Node>() {
05844: public Node run(Node v$1) {
05845: return GNode
05846: .create("PostfixExpression", v$1, v$g$9);
05847: }
05848: };
05849:
05850: return yyResult.createValue(yyValue, yyError);
05851: }
05852:
05853: // Alternative 4.
05854:
05855: yyResult = pSymbol(yyStart);
05856: yyError = yyResult.select(yyError);
05857: if (yyResult.hasValue()
05858: && ((Node) yyResult.semanticValue()).getTokenText()
05859: .equals("--")) {
05860: final Node v$g$10 = yyResult.semanticValue();
05861:
05862: yyValue = new Action<Node>() {
05863: public Node run(Node v$1) {
05864: return GNode.create("PostfixExpression", v$1,
05865: v$g$10);
05866: }
05867: };
05868:
05869: return yyResult.createValue(yyValue, yyError);
05870: }
05871:
05872: // Alternative 5.
05873:
05874: yyResult = pSymbol(yyStart);
05875: yyError = yyResult.select(yyError);
05876: if (yyResult.hasValue()
05877: && ((Node) yyResult.semanticValue()).getTokenText()
05878: .equals(".")) {
05879: final Node v$pt$8 = yyResult.semanticValue();
05880:
05881: yyBase = yyResult.index;
05882: yyResult = pWord(yyBase);
05883: yyError = yyResult.select(yyError);
05884: if (yyResult.hasValue()
05885: && ((Node) yyResult.semanticValue()).getTokenText()
05886: .equals("new")) {
05887: final Node v$pt$9 = yyResult.semanticValue();
05888: final Node v$g$11 = Formatting.variable().add(v$pt$8)
05889: .add(v$pt$9).addNode(null);
05890:
05891: yyResult = pTypeName(yyResult.index);
05892: yyError = yyResult.select(yyError);
05893: if (yyResult.hasValue()) {
05894: final Node v$g$12 = yyResult.semanticValue();
05895:
05896: yyResult = pArguments(yyResult.index);
05897: yyError = yyResult.select(yyError);
05898: if (yyResult.hasValue()) {
05899: final Node v$g$13 = yyResult.semanticValue();
05900:
05901: yyOption1 = yyResult.index;
05902: yyOpValue1 = null;
05903:
05904: yyResult = pClassBody(yyOption1);
05905: yyError = yyResult.select(yyError);
05906: if (yyResult.hasValue()) {
05907: final Node v$el$1 = yyResult
05908: .semanticValue();
05909:
05910: yyOption1 = yyResult.index;
05911: yyOpValue1 = v$el$1;
05912: }
05913: { // Start scope for v$g$14.
05914: final Node v$g$14 = yyOpValue1;
05915:
05916: yyValue = new Action<Node>() {
05917: public Node run(Node v$1) {
05918: return GNode.create(
05919: "NewClassExpression", v$1,
05920: v$g$11, v$g$12, v$g$13,
05921: v$g$14);
05922: }
05923: };
05924:
05925: return new SemanticValue(yyValue,
05926: yyOption1, yyError);
05927: } // End scope for v$g$14.
05928: }
05929: }
05930: } else {
05931: yyError = yyError.select("\"new\" expected", yyBase);
05932: }
05933: }
05934:
05935: // Done.
05936: yyError = yyError
05937: .select("postfix expression expected", yyStart);
05938: return yyError;
05939: }
05940:
05941: // =========================================================================
05942:
05943: /**
05944: * Parse nonterminal xtc.lang.Java.PrimaryExpression.
05945: *
05946: * @param yyStart The index.
05947: * @return The result.
05948: * @throws IOException Signals an I/O error.
05949: */
05950: private Result pPrimaryExpression(final int yyStart)
05951: throws IOException {
05952: Result yyResult;
05953: int yyBase;
05954: int yyOption1;
05955: Node yyOpValue1;
05956: Node yyValue;
05957: ParseError yyError = ParseError.DUMMY;
05958:
05959: // Alternative <Literal>.
05960:
05961: yyResult = pLiteral(yyStart);
05962: yyError = yyResult.select(yyError);
05963: if (yyResult.hasValue()) {
05964: yyValue = yyResult.semanticValue();
05965:
05966: return yyResult.createValue(yyValue, yyError);
05967: }
05968:
05969: // Alternative <Expression>.
05970:
05971: yyResult = pIdentifier(yyStart);
05972: yyError = yyResult.select(yyError);
05973: if (yyResult.hasValue()) {
05974: final Node v$g$3 = yyResult.semanticValue();
05975:
05976: yyResult = pArguments(yyResult.index);
05977: yyError = yyResult.select(yyError);
05978: if (yyResult.hasValue()) {
05979: final Node v$g$4 = yyResult.semanticValue();
05980:
05981: yyValue = GNode.create("CallExpression", null, null,
05982: v$g$3, v$g$4);
05983: yyValue.setLocation(location(yyStart));
05984:
05985: return yyResult.createValue(yyValue, yyError);
05986: }
05987: }
05988:
05989: // Alternative <Expression>.
05990:
05991: yyResult = pResultType(yyStart);
05992: yyError = yyResult.select(yyError);
05993: if (yyResult.hasValue()) {
05994: final Node v$pt$3 = yyResult.semanticValue();
05995:
05996: yyBase = yyResult.index;
05997: yyResult = pSymbol(yyBase);
05998: yyError = yyResult.select(yyError);
05999: if (yyResult.hasValue()
06000: && ((Node) yyResult.semanticValue()).getTokenText()
06001: .equals(".")) {
06002: final Node v$pt$1 = yyResult.semanticValue();
06003:
06004: yyBase = yyResult.index;
06005: yyResult = pWord(yyBase);
06006: yyError = yyResult.select(yyError);
06007: if (yyResult.hasValue()
06008: && ((Node) yyResult.semanticValue())
06009: .getTokenText().equals("class")) {
06010: final Node v$pt$2 = yyResult.semanticValue();
06011: final Node v$g$1 = Formatting.variable().addNode(
06012: v$pt$3).add(v$pt$1).add(v$pt$2);
06013:
06014: yyValue = GNode.create("ClassLiteralExpression",
06015: v$g$1);
06016: yyValue.setLocation(location(yyStart));
06017:
06018: return yyResult.createValue(yyValue, yyError);
06019: } else {
06020: yyError = yyError.select("\"class\" expected",
06021: yyBase);
06022: }
06023: } else {
06024: yyError = yyError.select("\".\" expected", yyBase);
06025: }
06026: }
06027:
06028: // Alternative <Expression>.
06029:
06030: yyResult = pWord(yyStart);
06031: yyError = yyResult.select(yyError);
06032: if (yyResult.hasValue()
06033: && ((Node) yyResult.semanticValue()).getTokenText()
06034: .equals("this")) {
06035: final Node v$g$3 = yyResult.semanticValue();
06036:
06037: yyResult = pArguments(yyResult.index);
06038: yyError = yyResult.select(yyError);
06039: if (yyResult.hasValue()) {
06040: final Node v$g$4 = yyResult.semanticValue();
06041:
06042: yyValue = GNode.create("CallExpression", null, null,
06043: v$g$3, v$g$4);
06044: yyValue.setLocation(location(yyStart));
06045:
06046: return yyResult.createValue(yyValue, yyError);
06047: }
06048: }
06049:
06050: // Alternative <Expression>.
06051:
06052: yyOption1 = yyStart;
06053: yyOpValue1 = null;
06054:
06055: yyResult = pQualifiedIdentifier(yyOption1);
06056: yyError = yyResult.select(yyError);
06057: if (yyResult.hasValue()) {
06058: final Node v$pt$2 = yyResult.semanticValue();
06059:
06060: yyBase = yyResult.index;
06061: yyResult = pSymbol(yyBase);
06062: yyError = yyResult.select(yyError);
06063: if (yyResult.hasValue()
06064: && ((Node) yyResult.semanticValue()).getTokenText()
06065: .equals(".")) {
06066: final Node v$pt$1 = yyResult.semanticValue();
06067: final Node v$el$1 = Formatting.after1(v$pt$2, v$pt$1);
06068:
06069: yyOption1 = yyResult.index;
06070: yyOpValue1 = v$el$1;
06071: } else {
06072: yyError = yyError.select("\".\" expected", yyBase);
06073: }
06074: }
06075: { // Start scope for v$pt$4.
06076: final Node v$pt$4 = yyOpValue1;
06077:
06078: yyBase = yyOption1;
06079: yyResult = pWord(yyBase);
06080: yyError = yyResult.select(yyError);
06081: if (yyResult.hasValue()
06082: && ((Node) yyResult.semanticValue()).getTokenText()
06083: .equals("this")) {
06084: final Node v$pt$3 = yyResult.semanticValue();
06085: final Node v$g$1 = Formatting.after1(v$pt$4, v$pt$3);
06086:
06087: yyValue = GNode.create("ThisExpression", v$g$1);
06088: yyValue.setLocation(location(yyStart));
06089:
06090: return yyResult.createValue(yyValue, yyError);
06091: } else {
06092: yyError = yyError.select("\"this\" expected", yyBase);
06093: }
06094: } // End scope for v$pt$4.
06095:
06096: // Alternative <Expression>.
06097:
06098: yyResult = pWord(yyStart);
06099: yyError = yyResult.select(yyError);
06100: if (yyResult.hasValue()
06101: && ((Node) yyResult.semanticValue()).getTokenText()
06102: .equals("super")) {
06103: final Node v$g$3 = yyResult.semanticValue();
06104:
06105: yyResult = pArguments(yyResult.index);
06106: yyError = yyResult.select(yyError);
06107: if (yyResult.hasValue()) {
06108: final Node v$g$4 = yyResult.semanticValue();
06109:
06110: yyValue = GNode.create("CallExpression", null, null,
06111: v$g$3, v$g$4);
06112: yyValue.setLocation(location(yyStart));
06113:
06114: return yyResult.createValue(yyValue, yyError);
06115: }
06116: }
06117:
06118: // Alternative <Expression>.
06119:
06120: yyResult = pWord(yyStart);
06121: yyError = yyResult.select(yyError);
06122: if (yyResult.hasValue()
06123: && ((Node) yyResult.semanticValue()).getTokenText()
06124: .equals("super")) {
06125: final Node v$pt$1 = yyResult.semanticValue();
06126: final Node v$g$1 = Formatting.after1(null, v$pt$1);
06127:
06128: yyValue = GNode.create("SuperExpression", v$g$1);
06129: yyValue.setLocation(location(yyStart));
06130:
06131: return yyResult.createValue(yyValue, yyError);
06132: }
06133:
06134: // Alternative 8.
06135:
06136: yyResult = pIdentifier(yyStart);
06137: yyError = yyResult.select(yyError);
06138: if (yyResult.hasValue()) {
06139: final Node v$g$1 = yyResult.semanticValue();
06140:
06141: yyValue = GNode.create("PrimaryIdentifier", v$g$1);
06142: yyValue.setLocation(location(yyStart));
06143:
06144: return yyResult.createValue(yyValue, yyError);
06145: }
06146:
06147: // Alternative <Expression>.
06148:
06149: yyResult = pWord(yyStart);
06150: yyError = yyResult.select(yyError);
06151: if (yyResult.hasValue()
06152: && ((Node) yyResult.semanticValue()).getTokenText()
06153: .equals("new")) {
06154: final Node v$pt$1 = yyResult.semanticValue();
06155: final Node v$g$1 = Formatting.after1(null, v$pt$1);
06156:
06157: yyResult = pTypeName(yyResult.index);
06158: yyError = yyResult.select(yyError);
06159: if (yyResult.hasValue()) {
06160: final Node v$g$3 = yyResult.semanticValue();
06161:
06162: yyResult = pArguments(yyResult.index);
06163: yyError = yyResult.select(yyError);
06164: if (yyResult.hasValue()) {
06165: final Node v$g$4 = yyResult.semanticValue();
06166:
06167: yyOption1 = yyResult.index;
06168: yyOpValue1 = null;
06169:
06170: yyResult = pClassBody(yyOption1);
06171: yyError = yyResult.select(yyError);
06172: if (yyResult.hasValue()) {
06173: final Node v$el$1 = yyResult.semanticValue();
06174:
06175: yyOption1 = yyResult.index;
06176: yyOpValue1 = v$el$1;
06177: }
06178: { // Start scope for v$g$5.
06179: final Node v$g$5 = yyOpValue1;
06180:
06181: yyValue = GNode.create("NewClassExpression",
06182: v$g$1, null, v$g$3, v$g$4, v$g$5);
06183: yyValue.setLocation(location(yyStart));
06184:
06185: return new SemanticValue(yyValue, yyOption1,
06186: yyError);
06187: } // End scope for v$g$5.
06188: }
06189: }
06190: }
06191:
06192: // Alternative 10.
06193:
06194: yyResult = pWord(yyStart);
06195: yyError = yyResult.select(yyError);
06196: if (yyResult.hasValue()
06197: && ((Node) yyResult.semanticValue()).getTokenText()
06198: .equals("new")) {
06199: final Node v$pt$1 = yyResult.semanticValue();
06200:
06201: yyResult = pTypeName(yyResult.index);
06202: yyError = yyResult.select(yyError);
06203: if (yyResult.hasValue()) {
06204: final Node v$pt$2 = yyResult.semanticValue();
06205: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
06206:
06207: final int yyChoice1 = yyResult.index;
06208:
06209: // Nested alternative 1.
06210:
06211: yyResult = pConcreteDimensions(yyChoice1);
06212: yyError = yyResult.select(yyError);
06213: if (yyResult.hasValue()) {
06214: final Node v$g$2 = yyResult.semanticValue();
06215:
06216: yyOption1 = yyResult.index;
06217: yyOpValue1 = null;
06218:
06219: yyResult = pDimensions(yyOption1);
06220: yyError = yyResult.select(yyError);
06221: if (yyResult.hasValue()) {
06222: final Node v$el$1 = yyResult.semanticValue();
06223:
06224: yyOption1 = yyResult.index;
06225: yyOpValue1 = v$el$1;
06226: }
06227: { // Start scope for v$g$3.
06228: final Node v$g$3 = yyOpValue1;
06229:
06230: yyValue = GNode.create("NewArrayExpression",
06231: v$g$1, v$g$2, v$g$3, null);
06232: yyValue.setLocation(location(yyStart));
06233:
06234: return new SemanticValue(yyValue, yyOption1,
06235: yyError);
06236: } // End scope for v$g$3.
06237: }
06238:
06239: // Nested alternative 2.
06240:
06241: yyOption1 = yyChoice1;
06242: yyOpValue1 = null;
06243:
06244: yyResult = pDimensions(yyOption1);
06245: yyError = yyResult.select(yyError);
06246: if (yyResult.hasValue()) {
06247: final Node v$el$2 = yyResult.semanticValue();
06248:
06249: yyOption1 = yyResult.index;
06250: yyOpValue1 = v$el$2;
06251: }
06252: { // Start scope for v$g$6.
06253: final Node v$g$6 = yyOpValue1;
06254:
06255: yyResult = pArrayInitializer(yyOption1);
06256: yyError = yyResult.select(yyError);
06257: if (yyResult.hasValue()) {
06258: final Node v$g$7 = yyResult.semanticValue();
06259:
06260: yyValue = GNode.create("NewArrayExpression",
06261: v$g$1, null, v$g$6, v$g$7);
06262: yyValue.setLocation(location(yyStart));
06263:
06264: return yyResult.createValue(yyValue, yyError);
06265: }
06266: } // End scope for v$g$6.
06267: }
06268: }
06269:
06270: // Alternative <Nested>.
06271:
06272: yyResult = pSymbol(yyStart);
06273: yyError = yyResult.select(yyError);
06274: if (yyResult.hasValue()
06275: && ((Node) yyResult.semanticValue()).getTokenText()
06276: .equals("(")) {
06277: final Node v$pt$1 = yyResult.semanticValue();
06278:
06279: yyResult = pExpression(yyResult.index);
06280: yyError = yyResult.select(yyError);
06281: if (yyResult.hasValue()) {
06282: final Node v$pt$3 = yyResult.semanticValue();
06283:
06284: yyBase = yyResult.index;
06285: yyResult = pSymbol(yyBase);
06286: yyError = yyResult.select(yyError);
06287: if (yyResult.hasValue()
06288: && ((Node) yyResult.semanticValue())
06289: .getTokenText().equals(")")) {
06290: final Node v$pt$2 = yyResult.semanticValue();
06291: yyValue = Formatting.round1(v$pt$1, v$pt$3, v$pt$2);
06292:
06293: return yyResult.createValue(yyValue, yyError);
06294: } else {
06295: yyError = yyError.select("\")\" expected", yyBase);
06296: }
06297: }
06298: }
06299:
06300: // Done.
06301: yyError = yyError
06302: .select("primary expression expected", yyStart);
06303: return yyError;
06304: }
06305:
06306: // =========================================================================
06307:
06308: /**
06309: * Parse nonterminal xtc.lang.Java.ConcreteDimensions.
06310: *
06311: * @param yyStart The index.
06312: * @return The result.
06313: * @throws IOException Signals an I/O error.
06314: */
06315: private Result pConcreteDimensions(final int yyStart)
06316: throws IOException {
06317: Result yyResult;
06318: int yyRepetition1;
06319: boolean yyRepeated1;
06320: Pair<Node> yyRepValue1;
06321: Node yyValue;
06322: ParseError yyError = ParseError.DUMMY;
06323:
06324: // Alternative 1.
06325:
06326: yyRepetition1 = yyStart;
06327: yyRepeated1 = false;
06328: yyRepValue1 = Pair.empty();
06329: while (true) {
06330:
06331: yyResult = pConcreteDimension(yyRepetition1);
06332: yyError = yyResult.select(yyError);
06333: if (yyResult.hasValue()) {
06334: final Node v$el$1 = yyResult.semanticValue();
06335:
06336: yyRepetition1 = yyResult.index;
06337: yyRepeated1 = true;
06338: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
06339: continue;
06340: }
06341: break;
06342: }
06343:
06344: if (yyRepeated1) {
06345: final Pair<Node> v$g$1 = yyRepValue1.reverse();
06346:
06347: yyValue = GNode.createFromPair("ConcreteDimensions", v$g$1);
06348: yyValue.setLocation(location(yyStart));
06349:
06350: return new SemanticValue(yyValue, yyRepetition1, yyError);
06351: }
06352:
06353: // Done.
06354: return yyError;
06355: }
06356:
06357: // =========================================================================
06358:
06359: /**
06360: * Parse nonterminal xtc.lang.Java.ConcreteDimension.
06361: *
06362: * @param yyStart The index.
06363: * @return The result.
06364: * @throws IOException Signals an I/O error.
06365: */
06366: private Result pConcreteDimension(final int yyStart)
06367: throws IOException {
06368: Result yyResult;
06369: int yyBase;
06370: Node yyValue;
06371: ParseError yyError = ParseError.DUMMY;
06372:
06373: // Alternative 1.
06374:
06375: yyResult = pSymbol(yyStart);
06376: yyError = yyResult.select(yyError);
06377: if (yyResult.hasValue()
06378: && ((Node) yyResult.semanticValue()).getTokenText()
06379: .equals("[")) {
06380: final Node v$pt$1 = yyResult.semanticValue();
06381:
06382: yyResult = pExpression(yyResult.index);
06383: yyError = yyResult.select(yyError);
06384: if (yyResult.hasValue()) {
06385: final Node v$pt$3 = yyResult.semanticValue();
06386:
06387: yyBase = yyResult.index;
06388: yyResult = pSymbol(yyBase);
06389: yyError = yyResult.select(yyError);
06390: if (yyResult.hasValue()
06391: && ((Node) yyResult.semanticValue())
06392: .getTokenText().equals("]")) {
06393: final Node v$pt$2 = yyResult.semanticValue();
06394: yyValue = Formatting.round1(v$pt$1, v$pt$3, v$pt$2);
06395:
06396: return yyResult.createValue(yyValue, yyError);
06397: } else {
06398: yyError = yyError.select("\"]\" expected", yyBase);
06399: }
06400: }
06401: }
06402:
06403: // Done.
06404: yyError = yyError
06405: .select("concrete dimension expected", yyStart);
06406: return yyError;
06407: }
06408:
06409: // =========================================================================
06410:
06411: /**
06412: * Parse nonterminal xtc.lang.Java.ArrayInitializer.
06413: *
06414: * @param yyStart The index.
06415: * @return The result.
06416: * @throws IOException Signals an I/O error.
06417: */
06418: private Result pArrayInitializer(final int yyStart)
06419: throws IOException {
06420: Result yyResult;
06421: int yyBase;
06422: int yyOption1;
06423: Node yyOpValue1;
06424: Node yyValue;
06425: ParseError yyError = ParseError.DUMMY;
06426:
06427: // Alternative 1.
06428:
06429: yyResult = pArrayInitializer$$Split1(yyStart);
06430: yyError = yyResult.select(yyError);
06431: if (yyResult.hasValue()) {
06432: final Node v$pt$1 = yyResult.semanticValue();
06433:
06434: yyOption1 = yyResult.index;
06435: yyOpValue1 = null;
06436:
06437: yyBase = yyOption1;
06438: yyResult = pSymbol(yyBase);
06439: yyError = yyResult.select(yyError);
06440: if (yyResult.hasValue()
06441: && ((Node) yyResult.semanticValue()).getTokenText()
06442: .equals(",")) {
06443: final Node v$el$1 = yyResult.semanticValue();
06444:
06445: yyOption1 = yyResult.index;
06446: yyOpValue1 = v$el$1;
06447: } else {
06448: yyError = yyError.select("\",\" expected", yyBase);
06449: }
06450: { // Start scope for v$pt$2.
06451: final Node v$pt$2 = yyOpValue1;
06452:
06453: yyBase = yyOption1;
06454: yyResult = pSymbol(yyBase);
06455: yyError = yyResult.select(yyError);
06456: if (yyResult.hasValue()
06457: && ((Node) yyResult.semanticValue())
06458: .getTokenText().equals("}")) {
06459: final Node v$pt$3 = yyResult.semanticValue();
06460: yyValue = Formatting.variable().addNode(v$pt$1)
06461: .add(v$pt$2).add(v$pt$3);
06462:
06463: return yyResult.createValue(yyValue, yyError);
06464: } else {
06465: yyError = yyError.select("\"}\" expected", yyBase);
06466: }
06467: } // End scope for v$pt$2.
06468: }
06469:
06470: // Alternative 2.
06471:
06472: yyResult = pSymbol(yyStart);
06473: yyError = yyResult.select(yyError);
06474: if (yyResult.hasValue()
06475: && ((Node) yyResult.semanticValue()).getTokenText()
06476: .equals("{")) {
06477: final Node v$pt$4 = yyResult.semanticValue();
06478:
06479: yyOption1 = yyResult.index;
06480: yyOpValue1 = null;
06481:
06482: yyBase = yyOption1;
06483: yyResult = pSymbol(yyBase);
06484: yyError = yyResult.select(yyError);
06485: if (yyResult.hasValue()
06486: && ((Node) yyResult.semanticValue()).getTokenText()
06487: .equals(",")) {
06488: final Node v$el$2 = yyResult.semanticValue();
06489:
06490: yyOption1 = yyResult.index;
06491: yyOpValue1 = v$el$2;
06492: } else {
06493: yyError = yyError.select("\",\" expected", yyBase);
06494: }
06495: { // Start scope for v$pt$5.
06496: final Node v$pt$5 = yyOpValue1;
06497:
06498: yyBase = yyOption1;
06499: yyResult = pSymbol(yyBase);
06500: yyError = yyResult.select(yyError);
06501: if (yyResult.hasValue()
06502: && ((Node) yyResult.semanticValue())
06503: .getTokenText().equals("}")) {
06504: final Node v$pt$6 = yyResult.semanticValue();
06505:
06506: yyValue = GNode.create("ArrayInitializer", false);
06507: yyValue.setLocation(location(yyStart));
06508: yyValue = Formatting.variable().addNode(yyValue)
06509: .add(v$pt$4).add(v$pt$5).add(v$pt$6);
06510:
06511: return yyResult.createValue(yyValue, yyError);
06512: } else {
06513: yyError = yyError.select("\"}\" expected", yyBase);
06514: }
06515: } // End scope for v$pt$5.
06516: }
06517:
06518: // Done.
06519: yyError = yyError.select("array initializer expected", yyStart);
06520: return yyError;
06521: }
06522:
06523: // =========================================================================
06524:
06525: /**
06526: * Parse synthetic nonterminal xtc.lang.Java.ArrayInitializer$$Split1.
06527: *
06528: * @param yyStart The index.
06529: * @return The result.
06530: * @throws IOException Signals an I/O error.
06531: */
06532: private Result pArrayInitializer$$Split1(final int yyStart)
06533: throws IOException {
06534:
06535: Result yyResult;
06536: int yyBase;
06537: int yyRepetition1;
06538: Pair<Node> yyRepValue1;
06539: Node yyValue;
06540: ParseError yyError = ParseError.DUMMY;
06541:
06542: // Alternative 1.
06543:
06544: yyResult = pSymbol(yyStart);
06545: yyError = yyResult.select(yyError);
06546: if (yyResult.hasValue()
06547: && ((Node) yyResult.semanticValue()).getTokenText()
06548: .equals("{")) {
06549: final Node v$pt$3 = yyResult.semanticValue();
06550:
06551: yyResult = pVariableInitializer(yyResult.index);
06552: yyError = yyResult.select(yyError);
06553: if (yyResult.hasValue()) {
06554: final Node v$pt$4 = yyResult.semanticValue();
06555: final Node v$g$1 = Formatting.before1(v$pt$3, v$pt$4);
06556:
06557: yyRepetition1 = yyResult.index;
06558: yyRepValue1 = Pair.empty();
06559: while (true) {
06560:
06561: yyBase = yyRepetition1;
06562: yyResult = pSymbol(yyBase);
06563: yyError = yyResult.select(yyError);
06564: if (yyResult.hasValue()
06565: && ((Node) yyResult.semanticValue())
06566: .getTokenText().equals(",")) {
06567: final Node v$pt$1 = yyResult.semanticValue();
06568:
06569: yyResult = pVariableInitializer(yyResult.index);
06570: yyError = yyResult.select(yyError);
06571: if (yyResult.hasValue()) {
06572: final Node v$pt$2 = yyResult
06573: .semanticValue();
06574: final Node v$el$1 = Formatting.before1(
06575: v$pt$1, v$pt$2);
06576:
06577: yyRepetition1 = yyResult.index;
06578: yyRepValue1 = new Pair<Node>(v$el$1,
06579: yyRepValue1);
06580: continue;
06581: }
06582: } else {
06583: yyError = yyError.select("\",\" expected",
06584: yyBase);
06585: }
06586: break;
06587: }
06588: { // Start scope for v$g$2.
06589: final Pair<Node> v$g$2 = yyRepValue1.reverse();
06590:
06591: yyValue = GNode.createFromPair("ArrayInitializer",
06592: v$g$1, v$g$2);
06593: yyValue.setLocation(location(yyStart));
06594:
06595: return new SemanticValue(yyValue, yyRepetition1,
06596: yyError);
06597: } // End scope for v$g$2.
06598: }
06599: }
06600:
06601: // Done.
06602: yyError = yyError.select("array initializer expected", yyStart);
06603: return yyError;
06604: }
06605:
06606: // =========================================================================
06607:
06608: /**
06609: * Parse nonterminal xtc.lang.Java.VariableInitializer.
06610: *
06611: * @param yyStart The index.
06612: * @return The result.
06613: * @throws IOException Signals an I/O error.
06614: */
06615: private Result pVariableInitializer(final int yyStart)
06616: throws IOException {
06617: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
06618: if (null == yyColumn.chunk2)
06619: yyColumn.chunk2 = new Chunk2();
06620: if (null == yyColumn.chunk2.fVariableInitializer)
06621: yyColumn.chunk2.fVariableInitializer = pVariableInitializer$1(yyStart);
06622: return yyColumn.chunk2.fVariableInitializer;
06623: }
06624:
06625: /** Actually parse xtc.lang.Java.VariableInitializer. */
06626: private Result pVariableInitializer$1(final int yyStart)
06627: throws IOException {
06628:
06629: Result yyResult;
06630: Node yyValue;
06631: ParseError yyError = ParseError.DUMMY;
06632:
06633: // Alternative <Array>.
06634:
06635: yyResult = pArrayInitializer(yyStart);
06636: yyError = yyResult.select(yyError);
06637: if (yyResult.hasValue()) {
06638: yyValue = yyResult.semanticValue();
06639:
06640: return yyResult.createValue(yyValue, yyError);
06641: }
06642:
06643: // Alternative <Expression>.
06644:
06645: yyResult = pExpression(yyStart);
06646: yyError = yyResult.select(yyError);
06647: if (yyResult.hasValue()) {
06648: yyValue = yyResult.semanticValue();
06649:
06650: return yyResult.createValue(yyValue, yyError);
06651: }
06652:
06653: // Done.
06654: return yyError;
06655: }
06656:
06657: // =========================================================================
06658:
06659: /**
06660: * Parse nonterminal xtc.lang.Java.Arguments.
06661: *
06662: * @param yyStart The index.
06663: * @return The result.
06664: * @throws IOException Signals an I/O error.
06665: */
06666: private Result pArguments(final int yyStart) throws IOException {
06667: Result yyResult;
06668: int yyBase;
06669: Node yyValue;
06670: ParseError yyError = ParseError.DUMMY;
06671:
06672: // Alternative 1.
06673:
06674: yyResult = pArguments$$Split1(yyStart);
06675: yyError = yyResult.select(yyError);
06676: if (yyResult.hasValue()) {
06677: final Node v$pt$1 = yyResult.semanticValue();
06678:
06679: yyBase = yyResult.index;
06680: yyResult = pSymbol(yyBase);
06681: yyError = yyResult.select(yyError);
06682: if (yyResult.hasValue()
06683: && ((Node) yyResult.semanticValue()).getTokenText()
06684: .equals(")")) {
06685: final Node v$pt$2 = yyResult.semanticValue();
06686: yyValue = Formatting.after1(v$pt$1, v$pt$2);
06687:
06688: return yyResult.createValue(yyValue, yyError);
06689: } else {
06690: yyError = yyError.select("\")\" expected", yyBase);
06691: }
06692: }
06693:
06694: // Alternative 2.
06695:
06696: yyResult = pSymbol(yyStart);
06697: yyError = yyResult.select(yyError);
06698: if (yyResult.hasValue()
06699: && ((Node) yyResult.semanticValue()).getTokenText()
06700: .equals("(")) {
06701: final Node v$pt$3 = yyResult.semanticValue();
06702:
06703: yyBase = yyResult.index;
06704: yyResult = pSymbol(yyBase);
06705: yyError = yyResult.select(yyError);
06706: if (yyResult.hasValue()
06707: && ((Node) yyResult.semanticValue()).getTokenText()
06708: .equals(")")) {
06709: final Node v$pt$4 = yyResult.semanticValue();
06710:
06711: yyValue = GNode.create("Arguments", false);
06712: yyValue.setLocation(location(yyStart));
06713: yyValue = Formatting.variable().addNode(yyValue).add(
06714: v$pt$3).add(v$pt$4);
06715:
06716: return yyResult.createValue(yyValue, yyError);
06717: } else {
06718: yyError = yyError.select("\")\" expected", yyBase);
06719: }
06720: }
06721:
06722: // Done.
06723: yyError = yyError.select("arguments expected", yyStart);
06724: return yyError;
06725: }
06726:
06727: // =========================================================================
06728:
06729: /**
06730: * Parse synthetic nonterminal xtc.lang.Java.Arguments$$Split1.
06731: *
06732: * @param yyStart The index.
06733: * @return The result.
06734: * @throws IOException Signals an I/O error.
06735: */
06736: private Result pArguments$$Split1(final int yyStart)
06737: throws IOException {
06738: Result yyResult;
06739: int yyBase;
06740: int yyRepetition1;
06741: Pair<Node> yyRepValue1;
06742: Node yyValue;
06743: ParseError yyError = ParseError.DUMMY;
06744:
06745: // Alternative 1.
06746:
06747: yyResult = pSymbol(yyStart);
06748: yyError = yyResult.select(yyError);
06749: if (yyResult.hasValue()
06750: && ((Node) yyResult.semanticValue()).getTokenText()
06751: .equals("(")) {
06752: final Node v$pt$3 = yyResult.semanticValue();
06753:
06754: yyResult = pExpression(yyResult.index);
06755: yyError = yyResult.select(yyError);
06756: if (yyResult.hasValue()) {
06757: final Node v$pt$4 = yyResult.semanticValue();
06758: final Node v$g$1 = Formatting.before1(v$pt$3, v$pt$4);
06759:
06760: yyRepetition1 = yyResult.index;
06761: yyRepValue1 = Pair.empty();
06762: while (true) {
06763:
06764: yyBase = yyRepetition1;
06765: yyResult = pSymbol(yyBase);
06766: yyError = yyResult.select(yyError);
06767: if (yyResult.hasValue()
06768: && ((Node) yyResult.semanticValue())
06769: .getTokenText().equals(",")) {
06770: final Node v$pt$1 = yyResult.semanticValue();
06771:
06772: yyResult = pExpression(yyResult.index);
06773: yyError = yyResult.select(yyError);
06774: if (yyResult.hasValue()) {
06775: final Node v$pt$2 = yyResult
06776: .semanticValue();
06777: final Node v$el$1 = Formatting.before1(
06778: v$pt$1, v$pt$2);
06779:
06780: yyRepetition1 = yyResult.index;
06781: yyRepValue1 = new Pair<Node>(v$el$1,
06782: yyRepValue1);
06783: continue;
06784: }
06785: } else {
06786: yyError = yyError.select("\",\" expected",
06787: yyBase);
06788: }
06789: break;
06790: }
06791: { // Start scope for v$g$2.
06792: final Pair<Node> v$g$2 = yyRepValue1.reverse();
06793:
06794: yyValue = GNode.createFromPair("Arguments", v$g$1,
06795: v$g$2);
06796: yyValue.setLocation(location(yyStart));
06797:
06798: return new SemanticValue(yyValue, yyRepetition1,
06799: yyError);
06800: } // End scope for v$g$2.
06801: }
06802: }
06803:
06804: // Done.
06805: yyError = yyError.select("arguments expected", yyStart);
06806: return yyError;
06807: }
06808:
06809: // =========================================================================
06810:
06811: /**
06812: * Parse nonterminal xtc.lang.JavaType.ResultType.
06813: *
06814: * @param yyStart The index.
06815: * @return The result.
06816: * @throws IOException Signals an I/O error.
06817: */
06818: private Result pResultType(final int yyStart) throws IOException {
06819: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
06820: if (null == yyColumn.chunk2)
06821: yyColumn.chunk2 = new Chunk2();
06822: if (null == yyColumn.chunk2.fResultType)
06823: yyColumn.chunk2.fResultType = pResultType$1(yyStart);
06824: return yyColumn.chunk2.fResultType;
06825: }
06826:
06827: /** Actually parse xtc.lang.JavaType.ResultType. */
06828: private Result pResultType$1(final int yyStart) throws IOException {
06829: Result yyResult;
06830: Node yyValue;
06831: ParseError yyError = ParseError.DUMMY;
06832:
06833: // Alternative <Void>.
06834:
06835: yyResult = pVoidType(yyStart);
06836: yyError = yyResult.select(yyError);
06837: if (yyResult.hasValue()) {
06838: yyValue = yyResult.semanticValue();
06839:
06840: return yyResult.createValue(yyValue, yyError);
06841: }
06842:
06843: // Alternative <Regular>.
06844:
06845: yyResult = pType(yyStart);
06846: yyError = yyResult.select(yyError);
06847: if (yyResult.hasValue()) {
06848: yyValue = yyResult.semanticValue();
06849:
06850: return yyResult.createValue(yyValue, yyError);
06851: }
06852:
06853: // Done.
06854: return yyError;
06855: }
06856:
06857: // =========================================================================
06858:
06859: /**
06860: * Parse nonterminal xtc.lang.JavaType.VoidType.
06861: *
06862: * @param yyStart The index.
06863: * @return The result.
06864: * @throws IOException Signals an I/O error.
06865: */
06866: private Result pVoidType(final int yyStart) throws IOException {
06867: Result yyResult;
06868: Node yyValue;
06869: ParseError yyError = ParseError.DUMMY;
06870:
06871: // Alternative <Void>.
06872:
06873: yyResult = pWord(yyStart);
06874: yyError = yyResult.select(yyError);
06875: if (yyResult.hasValue()
06876: && ((Node) yyResult.semanticValue()).getTokenText()
06877: .equals("void")) {
06878: final Node v$pt$1 = yyResult.semanticValue();
06879:
06880: yyValue = GNode.create("VoidType", false);
06881: yyValue.setLocation(location(yyStart));
06882: yyValue = Formatting.after1(yyValue, v$pt$1);
06883:
06884: return yyResult.createValue(yyValue, yyError);
06885: }
06886:
06887: // Done.
06888: yyError = yyError.select("void type expected", yyStart);
06889: return yyError;
06890: }
06891:
06892: // =========================================================================
06893:
06894: /**
06895: * Parse nonterminal xtc.lang.JavaType.Type.
06896: *
06897: * @param yyStart The index.
06898: * @return The result.
06899: * @throws IOException Signals an I/O error.
06900: */
06901: private Result pType(final int yyStart) throws IOException {
06902: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
06903: if (null == yyColumn.chunk2)
06904: yyColumn.chunk2 = new Chunk2();
06905: if (null == yyColumn.chunk2.fType)
06906: yyColumn.chunk2.fType = pType$1(yyStart);
06907: return yyColumn.chunk2.fType;
06908: }
06909:
06910: /** Actually parse xtc.lang.JavaType.Type. */
06911: private Result pType$1(final int yyStart) throws IOException {
06912: Result yyResult;
06913: int yyOption1;
06914: Node yyOpValue1;
06915: Node yyValue;
06916: ParseError yyError = ParseError.DUMMY;
06917:
06918: // Alternative <Type>.
06919:
06920: yyResult = pTypeName(yyStart);
06921: yyError = yyResult.select(yyError);
06922: if (yyResult.hasValue()) {
06923: final Node v$g$1 = yyResult.semanticValue();
06924:
06925: yyOption1 = yyResult.index;
06926: yyOpValue1 = null;
06927:
06928: yyResult = pDimensions(yyOption1);
06929: yyError = yyResult.select(yyError);
06930: if (yyResult.hasValue()) {
06931: final Node v$el$1 = yyResult.semanticValue();
06932:
06933: yyOption1 = yyResult.index;
06934: yyOpValue1 = v$el$1;
06935: }
06936: { // Start scope for v$g$2.
06937: final Node v$g$2 = yyOpValue1;
06938:
06939: yyValue = GNode.create("Type", v$g$1, v$g$2);
06940: yyValue.setLocation(location(yyStart));
06941:
06942: return new SemanticValue(yyValue, yyOption1, yyError);
06943: } // End scope for v$g$2.
06944: }
06945:
06946: // Done.
06947: return yyError;
06948: }
06949:
06950: // =========================================================================
06951:
06952: /**
06953: * Parse nonterminal xtc.lang.JavaType.TypeName.
06954: *
06955: * @param yyStart The index.
06956: * @return The result.
06957: * @throws IOException Signals an I/O error.
06958: */
06959: private Result pTypeName(final int yyStart) throws IOException {
06960: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
06961: if (null == yyColumn.chunk2)
06962: yyColumn.chunk2 = new Chunk2();
06963: if (null == yyColumn.chunk2.fTypeName)
06964: yyColumn.chunk2.fTypeName = pTypeName$1(yyStart);
06965: return yyColumn.chunk2.fTypeName;
06966: }
06967:
06968: /** Actually parse xtc.lang.JavaType.TypeName. */
06969: private Result pTypeName$1(final int yyStart) throws IOException {
06970: Result yyResult;
06971: Node yyValue;
06972: ParseError yyError = ParseError.DUMMY;
06973:
06974: // Alternative <Basic>.
06975:
06976: yyResult = pPrimitiveType(yyStart);
06977: yyError = yyResult.select(yyError);
06978: if (yyResult.hasValue()) {
06979: yyValue = yyResult.semanticValue();
06980:
06981: return yyResult.createValue(yyValue, yyError);
06982: }
06983:
06984: // Alternative <Class>.
06985:
06986: yyResult = pQualifiedIdentifier(yyStart);
06987: yyError = yyResult.select(yyError);
06988: if (yyResult.hasValue()) {
06989: yyValue = yyResult.semanticValue();
06990:
06991: return yyResult.createValue(yyValue, yyError);
06992: }
06993:
06994: // Done.
06995: return yyError;
06996: }
06997:
06998: // =========================================================================
06999:
07000: /**
07001: * Parse nonterminal xtc.lang.JavaType.PrimitiveType.
07002: *
07003: * @param yyStart The index.
07004: * @return The result.
07005: * @throws IOException Signals an I/O error.
07006: */
07007: private Result pPrimitiveType(final int yyStart) throws IOException {
07008: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
07009: if (null == yyColumn.chunk2)
07010: yyColumn.chunk2 = new Chunk2();
07011: if (null == yyColumn.chunk2.fPrimitiveType)
07012: yyColumn.chunk2.fPrimitiveType = pPrimitiveType$1(yyStart);
07013: return yyColumn.chunk2.fPrimitiveType;
07014: }
07015:
07016: /** Actually parse xtc.lang.JavaType.PrimitiveType. */
07017: private Result pPrimitiveType$1(final int yyStart)
07018: throws IOException {
07019: Result yyResult;
07020: Node yyValue;
07021: ParseError yyError = ParseError.DUMMY;
07022:
07023: // Alternative <Byte>.
07024:
07025: yyResult = pWord(yyStart);
07026: yyError = yyResult.select(yyError);
07027: if (yyResult.hasValue()
07028: && ((Node) yyResult.semanticValue()).getTokenText()
07029: .equals("byte")) {
07030: final Node v$g$1 = yyResult.semanticValue();
07031:
07032: yyValue = GNode.create("PrimitiveType", v$g$1);
07033: yyValue.setLocation(location(yyStart));
07034:
07035: return yyResult.createValue(yyValue, yyError);
07036: }
07037:
07038: // Alternative <Short>.
07039:
07040: yyResult = pWord(yyStart);
07041: yyError = yyResult.select(yyError);
07042: if (yyResult.hasValue()
07043: && ((Node) yyResult.semanticValue()).getTokenText()
07044: .equals("short")) {
07045: final Node v$g$2 = yyResult.semanticValue();
07046:
07047: yyValue = GNode.create("PrimitiveType", v$g$2);
07048: yyValue.setLocation(location(yyStart));
07049:
07050: return yyResult.createValue(yyValue, yyError);
07051: }
07052:
07053: // Alternative <Char>.
07054:
07055: yyResult = pWord(yyStart);
07056: yyError = yyResult.select(yyError);
07057: if (yyResult.hasValue()
07058: && ((Node) yyResult.semanticValue()).getTokenText()
07059: .equals("char")) {
07060: final Node v$g$3 = yyResult.semanticValue();
07061:
07062: yyValue = GNode.create("PrimitiveType", v$g$3);
07063: yyValue.setLocation(location(yyStart));
07064:
07065: return yyResult.createValue(yyValue, yyError);
07066: }
07067:
07068: // Alternative <Int>.
07069:
07070: yyResult = pWord(yyStart);
07071: yyError = yyResult.select(yyError);
07072: if (yyResult.hasValue()
07073: && ((Node) yyResult.semanticValue()).getTokenText()
07074: .equals("int")) {
07075: final Node v$g$4 = yyResult.semanticValue();
07076:
07077: yyValue = GNode.create("PrimitiveType", v$g$4);
07078: yyValue.setLocation(location(yyStart));
07079:
07080: return yyResult.createValue(yyValue, yyError);
07081: }
07082:
07083: // Alternative <Long>.
07084:
07085: yyResult = pWord(yyStart);
07086: yyError = yyResult.select(yyError);
07087: if (yyResult.hasValue()
07088: && ((Node) yyResult.semanticValue()).getTokenText()
07089: .equals("long")) {
07090: final Node v$g$5 = yyResult.semanticValue();
07091:
07092: yyValue = GNode.create("PrimitiveType", v$g$5);
07093: yyValue.setLocation(location(yyStart));
07094:
07095: return yyResult.createValue(yyValue, yyError);
07096: }
07097:
07098: // Alternative <Float>.
07099:
07100: yyResult = pWord(yyStart);
07101: yyError = yyResult.select(yyError);
07102: if (yyResult.hasValue()
07103: && ((Node) yyResult.semanticValue()).getTokenText()
07104: .equals("float")) {
07105: final Node v$g$6 = yyResult.semanticValue();
07106:
07107: yyValue = GNode.create("PrimitiveType", v$g$6);
07108: yyValue.setLocation(location(yyStart));
07109:
07110: return yyResult.createValue(yyValue, yyError);
07111: }
07112:
07113: // Alternative <Double>.
07114:
07115: yyResult = pWord(yyStart);
07116: yyError = yyResult.select(yyError);
07117: if (yyResult.hasValue()
07118: && ((Node) yyResult.semanticValue()).getTokenText()
07119: .equals("double")) {
07120: final Node v$g$7 = yyResult.semanticValue();
07121:
07122: yyValue = GNode.create("PrimitiveType", v$g$7);
07123: yyValue.setLocation(location(yyStart));
07124:
07125: return yyResult.createValue(yyValue, yyError);
07126: }
07127:
07128: // Alternative <Boolean>.
07129:
07130: yyResult = pWord(yyStart);
07131: yyError = yyResult.select(yyError);
07132: if (yyResult.hasValue()
07133: && ((Node) yyResult.semanticValue()).getTokenText()
07134: .equals("boolean")) {
07135: final Node v$g$8 = yyResult.semanticValue();
07136:
07137: yyValue = GNode.create("PrimitiveType", v$g$8);
07138: yyValue.setLocation(location(yyStart));
07139:
07140: return yyResult.createValue(yyValue, yyError);
07141: }
07142:
07143: // Done.
07144: yyError = yyError.select("primitive type expected", yyStart);
07145: return yyError;
07146: }
07147:
07148: // =========================================================================
07149:
07150: /**
07151: * Parse nonterminal xtc.lang.JavaType.Dimensions.
07152: *
07153: * @param yyStart The index.
07154: * @return The result.
07155: * @throws IOException Signals an I/O error.
07156: */
07157: private Result pDimensions(final int yyStart) throws IOException {
07158: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
07159: if (null == yyColumn.chunk2)
07160: yyColumn.chunk2 = new Chunk2();
07161: if (null == yyColumn.chunk2.fDimensions)
07162: yyColumn.chunk2.fDimensions = pDimensions$1(yyStart);
07163: return yyColumn.chunk2.fDimensions;
07164: }
07165:
07166: /** Actually parse xtc.lang.JavaType.Dimensions. */
07167: private Result pDimensions$1(final int yyStart) throws IOException {
07168: Result yyResult;
07169: Node yyValue;
07170: ParseError yyError = ParseError.DUMMY;
07171:
07172: // Alternative 1.
07173:
07174: yyResult = pDimensions$$Plus1(yyStart);
07175: yyError = yyResult.select(yyError);
07176: if (yyResult.hasValue()) {
07177: final Pair<Node> v$g$1 = yyResult.semanticValue();
07178:
07179: yyValue = GNode.createFromPair("Dimensions", v$g$1);
07180: yyValue.setLocation(location(yyStart));
07181:
07182: return yyResult.createValue(yyValue, yyError);
07183: }
07184:
07185: // Done.
07186: return yyError;
07187: }
07188:
07189: // =========================================================================
07190:
07191: /**
07192: * Parse synthetic nonterminal xtc.lang.Java.Dimensions$$Plus1.
07193: *
07194: * @param yyStart The index.
07195: * @return The result.
07196: * @throws IOException Signals an I/O error.
07197: */
07198: private Result pDimensions$$Plus1(final int yyStart)
07199: throws IOException {
07200: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
07201: if (null == yyColumn.chunk2)
07202: yyColumn.chunk2 = new Chunk2();
07203: if (null == yyColumn.chunk2.fDimensions$$Plus1)
07204: yyColumn.chunk2.fDimensions$$Plus1 = pDimensions$$Plus1$1(yyStart);
07205: return yyColumn.chunk2.fDimensions$$Plus1;
07206: }
07207:
07208: /** Actually parse xtc.lang.Java.Dimensions$$Plus1. */
07209: private Result pDimensions$$Plus1$1(final int yyStart)
07210: throws IOException {
07211: Result yyResult;
07212: int yyBase;
07213: Pair<Node> yyValue;
07214: ParseError yyError = ParseError.DUMMY;
07215:
07216: // Alternative 1.
07217:
07218: yyResult = pSymbol(yyStart);
07219: yyError = yyResult.select(yyError);
07220: if (yyResult.hasValue()
07221: && ((Node) yyResult.semanticValue()).getTokenText()
07222: .equals("[")) {
07223: final Node v$pt$2 = yyResult.semanticValue();
07224:
07225: yyBase = yyResult.index;
07226: yyResult = pSymbol(yyBase);
07227: yyError = yyResult.select(yyError);
07228: if (yyResult.hasValue()
07229: && ((Node) yyResult.semanticValue()).getTokenText()
07230: .equals("]")) {
07231: final Node v$pt$1 = yyResult.semanticValue();
07232: final Node v$el$1 = Formatting.after1(v$pt$2, v$pt$1);
07233:
07234: final int yyChoice1 = yyResult.index;
07235:
07236: // Nested alternative 1.
07237:
07238: yyResult = pDimensions$$Plus1(yyChoice1);
07239: yyError = yyResult.select(yyError);
07240: if (yyResult.hasValue()) {
07241: final Pair<Node> v$2 = yyResult.semanticValue();
07242:
07243: yyValue = new Pair<Node>(v$el$1, v$2);
07244:
07245: return yyResult.createValue(yyValue, yyError);
07246: }
07247:
07248: // Nested alternative 2.
07249:
07250: yyValue = new Pair<Node>(v$el$1);
07251:
07252: return new SemanticValue(yyValue, yyChoice1, yyError);
07253: } else {
07254: yyError = yyError.select("\"]\" expected", yyBase);
07255: }
07256: }
07257:
07258: // Done.
07259: yyError = yyError.select("dimensions expected", yyStart);
07260: return yyError;
07261: }
07262:
07263: // =========================================================================
07264:
07265: /**
07266: * Parse nonterminal xtc.lang.JavaConstant.Literal.
07267: *
07268: * @param yyStart The index.
07269: * @return The result.
07270: * @throws IOException Signals an I/O error.
07271: */
07272: private Result pLiteral(final int yyStart) throws IOException {
07273: Result yyResult;
07274: Node yyValue;
07275: ParseError yyError = ParseError.DUMMY;
07276:
07277: // Alternative 1.
07278:
07279: yyResult = pFloatingPointLiteral(yyStart);
07280: yyError = yyResult.select(yyError);
07281: if (yyResult.hasValue()) {
07282: final Node v$pt$2 = yyResult.semanticValue();
07283:
07284: yyResult = pSpacing(yyResult.index);
07285: yyError = yyResult.select(yyError);
07286: if (yyResult.hasValue()) {
07287: final Token v$pt$1 = yyResult.semanticValue();
07288: yyValue = Formatting.after1(v$pt$2, v$pt$1);
07289:
07290: return yyResult.createValue(yyValue, yyError);
07291: }
07292: }
07293:
07294: // Alternative 2.
07295:
07296: yyResult = pIntegerLiteral(yyStart);
07297: yyError = yyResult.select(yyError);
07298: if (yyResult.hasValue()) {
07299: final Node v$pt$4 = yyResult.semanticValue();
07300:
07301: yyResult = pSpacing(yyResult.index);
07302: yyError = yyResult.select(yyError);
07303: if (yyResult.hasValue()) {
07304: final Token v$pt$3 = yyResult.semanticValue();
07305: yyValue = Formatting.after1(v$pt$4, v$pt$3);
07306:
07307: return yyResult.createValue(yyValue, yyError);
07308: }
07309: }
07310:
07311: // Alternative 3.
07312:
07313: yyResult = pCharacterLiteral(yyStart);
07314: yyError = yyResult.select(yyError);
07315: if (yyResult.hasValue()) {
07316: final Node v$pt$6 = yyResult.semanticValue();
07317:
07318: yyResult = pSpacing(yyResult.index);
07319: yyError = yyResult.select(yyError);
07320: if (yyResult.hasValue()) {
07321: final Token v$pt$5 = yyResult.semanticValue();
07322: yyValue = Formatting.after1(v$pt$6, v$pt$5);
07323:
07324: return yyResult.createValue(yyValue, yyError);
07325: }
07326: }
07327:
07328: // Alternative 4.
07329:
07330: yyResult = pStringLiteral(yyStart);
07331: yyError = yyResult.select(yyError);
07332: if (yyResult.hasValue()) {
07333: final Node v$pt$8 = yyResult.semanticValue();
07334:
07335: yyResult = pSpacing(yyResult.index);
07336: yyError = yyResult.select(yyError);
07337: if (yyResult.hasValue()) {
07338: final Token v$pt$7 = yyResult.semanticValue();
07339: yyValue = Formatting.after1(v$pt$8, v$pt$7);
07340:
07341: return yyResult.createValue(yyValue, yyError);
07342: }
07343: }
07344:
07345: // Alternative 5.
07346:
07347: yyResult = pWord(yyStart);
07348: yyError = yyResult.select(yyError);
07349: if (yyResult.hasValue()
07350: && ((Node) yyResult.semanticValue()).getTokenText()
07351: .equals("true")) {
07352: final Node v$g$1 = yyResult.semanticValue();
07353:
07354: yyValue = GNode.create("BooleanLiteral", v$g$1);
07355: yyValue.setLocation(location(yyStart));
07356:
07357: return yyResult.createValue(yyValue, yyError);
07358: }
07359:
07360: // Alternative 6.
07361:
07362: yyResult = pWord(yyStart);
07363: yyError = yyResult.select(yyError);
07364: if (yyResult.hasValue()
07365: && ((Node) yyResult.semanticValue()).getTokenText()
07366: .equals("false")) {
07367: final Node v$g$2 = yyResult.semanticValue();
07368:
07369: yyValue = GNode.create("BooleanLiteral", v$g$2);
07370: yyValue.setLocation(location(yyStart));
07371:
07372: return yyResult.createValue(yyValue, yyError);
07373: }
07374:
07375: // Alternative 7.
07376:
07377: yyResult = pWord(yyStart);
07378: yyError = yyResult.select(yyError);
07379: if (yyResult.hasValue()
07380: && ((Node) yyResult.semanticValue()).getTokenText()
07381: .equals("null")) {
07382: final Node v$pt$1 = yyResult.semanticValue();
07383:
07384: yyValue = GNode.create("NullLiteral", false);
07385: yyValue.setLocation(location(yyStart));
07386: yyValue = Formatting.after1(yyValue, v$pt$1);
07387:
07388: return yyResult.createValue(yyValue, yyError);
07389: }
07390:
07391: // Done.
07392: yyError = yyError.select("literal expected", yyStart);
07393: return yyError;
07394: }
07395:
07396: // =========================================================================
07397:
07398: /**
07399: * Parse nonterminal xtc.lang.JavaConstant.IntegerLiteral.
07400: *
07401: * @param yyStart The index.
07402: * @return The result.
07403: * @throws IOException Signals an I/O error.
07404: */
07405: private Result pIntegerLiteral(final int yyStart)
07406: throws IOException {
07407: Result yyResult;
07408: Node yyValue;
07409: ParseError yyError = ParseError.DUMMY;
07410:
07411: // Alternative <Hex>.
07412:
07413: yyResult = pHexLiteral(yyStart);
07414: yyError = yyResult.select(yyError);
07415: if (yyResult.hasValue()) {
07416: final Token v$g$1 = yyResult.semanticValue();
07417:
07418: yyValue = GNode.create("IntegerLiteral", v$g$1);
07419: yyValue.setLocation(location(yyStart));
07420:
07421: return yyResult.createValue(yyValue, yyError);
07422: }
07423:
07424: // Alternative <Octal>.
07425:
07426: yyResult = pOctalLiteral(yyStart);
07427: yyError = yyResult.select(yyError);
07428: if (yyResult.hasValue()) {
07429: final Token v$g$2 = yyResult.semanticValue();
07430:
07431: yyValue = GNode.create("IntegerLiteral", v$g$2);
07432: yyValue.setLocation(location(yyStart));
07433:
07434: return yyResult.createValue(yyValue, yyError);
07435: }
07436:
07437: // Alternative <Decimal>.
07438:
07439: yyResult = pDecimalLiteral(yyStart);
07440: yyError = yyResult.select(yyError);
07441: if (yyResult.hasValue()) {
07442: final Token v$g$3 = yyResult.semanticValue();
07443:
07444: yyValue = GNode.create("IntegerLiteral", v$g$3);
07445: yyValue.setLocation(location(yyStart));
07446:
07447: return yyResult.createValue(yyValue, yyError);
07448: }
07449:
07450: // Done.
07451: return yyError;
07452: }
07453:
07454: // =========================================================================
07455:
07456: /**
07457: * Parse nonterminal xtc.lang.JavaConstant.HexLiteral.
07458: *
07459: * @param yyStart The index.
07460: * @return The result.
07461: * @throws IOException Signals an I/O error.
07462: */
07463: private Result pHexLiteral(final int yyStart) throws IOException {
07464: int yyC;
07465: int yyIndex;
07466: Result yyResult;
07467: int yyOption1;
07468: Token yyValue;
07469: ParseError yyError = ParseError.DUMMY;
07470:
07471: // Alternative 1.
07472:
07473: yyResult = pHexNumeral(yyStart);
07474: yyError = yyResult.select(yyError);
07475: if (yyResult.hasValue()) {
07476:
07477: yyOption1 = yyResult.index;
07478:
07479: yyC = character(yyOption1);
07480: if (-1 != yyC) {
07481: yyIndex = yyOption1 + 1;
07482:
07483: switch (yyC) {
07484: case 'L':
07485: case 'l': {
07486: yyOption1 = yyIndex;
07487: }
07488:
07489: default:
07490: /* No match. */
07491: }
07492: }
07493:
07494: yyValue = new Token(difference(yyStart, yyOption1));
07495: yyValue.setLocation(location(yyStart));
07496:
07497: return new SemanticValue(yyValue, yyOption1, yyError);
07498: }
07499:
07500: // Done.
07501: yyError = yyError.select("hex literal expected", yyStart);
07502: return yyError;
07503: }
07504:
07505: // =========================================================================
07506:
07507: /**
07508: * Parse nonterminal xtc.lang.JavaConstant.OctalLiteral.
07509: *
07510: * @param yyStart The index.
07511: * @return The result.
07512: * @throws IOException Signals an I/O error.
07513: */
07514: private Result pOctalLiteral(final int yyStart) throws IOException {
07515: int yyC;
07516: int yyIndex;
07517: Result yyResult;
07518: int yyOption1;
07519: Token yyValue;
07520: ParseError yyError = ParseError.DUMMY;
07521:
07522: // Alternative 1.
07523:
07524: yyResult = pOctalNumeral(yyStart);
07525: yyError = yyResult.select(yyError);
07526: if (yyResult.hasValue()) {
07527:
07528: yyOption1 = yyResult.index;
07529:
07530: yyC = character(yyOption1);
07531: if (-1 != yyC) {
07532: yyIndex = yyOption1 + 1;
07533:
07534: switch (yyC) {
07535: case 'L':
07536: case 'l': {
07537: yyOption1 = yyIndex;
07538: }
07539:
07540: default:
07541: /* No match. */
07542: }
07543: }
07544:
07545: yyValue = new Token(difference(yyStart, yyOption1));
07546: yyValue.setLocation(location(yyStart));
07547:
07548: return new SemanticValue(yyValue, yyOption1, yyError);
07549: }
07550:
07551: // Done.
07552: yyError = yyError.select("octal literal expected", yyStart);
07553: return yyError;
07554: }
07555:
07556: // =========================================================================
07557:
07558: /**
07559: * Parse nonterminal xtc.lang.JavaConstant.DecimalLiteral.
07560: *
07561: * @param yyStart The index.
07562: * @return The result.
07563: * @throws IOException Signals an I/O error.
07564: */
07565: private Result pDecimalLiteral(final int yyStart)
07566: throws IOException {
07567: int yyC;
07568: int yyIndex;
07569: Result yyResult;
07570: int yyOption1;
07571: Token yyValue;
07572: ParseError yyError = ParseError.DUMMY;
07573:
07574: // Alternative 1.
07575:
07576: yyResult = pDecimalNumeral(yyStart);
07577: yyError = yyResult.select(yyError);
07578: if (yyResult.hasValue()) {
07579:
07580: yyOption1 = yyResult.index;
07581:
07582: yyC = character(yyOption1);
07583: if (-1 != yyC) {
07584: yyIndex = yyOption1 + 1;
07585:
07586: switch (yyC) {
07587: case 'L':
07588: case 'l': {
07589: yyOption1 = yyIndex;
07590: }
07591:
07592: default:
07593: /* No match. */
07594: }
07595: }
07596:
07597: yyValue = new Token(difference(yyStart, yyOption1));
07598: yyValue.setLocation(location(yyStart));
07599:
07600: return new SemanticValue(yyValue, yyOption1, yyError);
07601: }
07602:
07603: // Done.
07604: yyError = yyError.select("decimal literal expected", yyStart);
07605: return yyError;
07606: }
07607:
07608: // =========================================================================
07609:
07610: /**
07611: * Parse nonterminal xtc.lang.JavaConstant.DecimalNumeral.
07612: *
07613: * @param yyStart The index.
07614: * @return The result.
07615: * @throws IOException Signals an I/O error.
07616: */
07617: private Result pDecimalNumeral(final int yyStart)
07618: throws IOException {
07619: int yyC;
07620: int yyIndex;
07621: int yyRepetition1;
07622: Void yyValue;
07623: ParseError yyError = ParseError.DUMMY;
07624:
07625: // Alternative 1.
07626:
07627: yyC = character(yyStart);
07628: if (-1 != yyC) {
07629: yyIndex = yyStart + 1;
07630:
07631: switch (yyC) {
07632: case '0': {
07633: yyValue = null;
07634:
07635: return new SemanticValue(yyValue, yyIndex, yyError);
07636: }
07637:
07638: case '1':
07639: case '2':
07640: case '3':
07641: case '4':
07642: case '5':
07643: case '6':
07644: case '7':
07645: case '8':
07646: case '9': {
07647: yyRepetition1 = yyIndex;
07648: while (true) {
07649:
07650: yyC = character(yyRepetition1);
07651: if (-1 != yyC) {
07652: yyIndex = yyRepetition1 + 1;
07653:
07654: switch (yyC) {
07655: case '0':
07656: case '1':
07657: case '2':
07658: case '3':
07659: case '4':
07660: case '5':
07661: case '6':
07662: case '7':
07663: case '8':
07664: case '9': {
07665: yyRepetition1 = yyIndex;
07666: continue;
07667: }
07668:
07669: default:
07670: /* No match. */
07671: }
07672: }
07673: break;
07674: }
07675:
07676: yyValue = null;
07677:
07678: return new SemanticValue(yyValue, yyRepetition1,
07679: yyError);
07680: }
07681:
07682: default:
07683: /* No match. */
07684: }
07685: }
07686:
07687: // Done.
07688: yyError = yyError.select("decimal numeral expected", yyStart);
07689: return yyError;
07690: }
07691:
07692: // =========================================================================
07693:
07694: /**
07695: * Parse nonterminal xtc.lang.JavaConstant.HexNumeral.
07696: *
07697: * @param yyStart The index.
07698: * @return The result.
07699: * @throws IOException Signals an I/O error.
07700: */
07701: private Result pHexNumeral(final int yyStart) throws IOException {
07702: int yyC;
07703: int yyIndex;
07704: int yyRepetition1;
07705: boolean yyRepeated1;
07706: Void yyValue;
07707: ParseError yyError = ParseError.DUMMY;
07708:
07709: // Alternative 1.
07710:
07711: yyC = character(yyStart);
07712: if ('0' == yyC) {
07713: yyIndex = yyStart + 1;
07714:
07715: yyC = character(yyIndex);
07716: if (-1 != yyC) {
07717: yyIndex = yyIndex + 1;
07718:
07719: switch (yyC) {
07720: case 'X':
07721: case 'x': {
07722: yyRepetition1 = yyIndex;
07723: yyRepeated1 = false;
07724: while (true) {
07725:
07726: yyC = character(yyRepetition1);
07727: if (-1 != yyC) {
07728: yyIndex = yyRepetition1 + 1;
07729:
07730: switch (yyC) {
07731: case '0':
07732: case '1':
07733: case '2':
07734: case '3':
07735: case '4':
07736: case '5':
07737: case '6':
07738: case '7':
07739: case '8':
07740: case '9':
07741: case 'A':
07742: case 'B':
07743: case 'C':
07744: case 'D':
07745: case 'E':
07746: case 'F':
07747: case 'a':
07748: case 'b':
07749: case 'c':
07750: case 'd':
07751: case 'e':
07752: case 'f': {
07753: yyRepetition1 = yyIndex;
07754: yyRepeated1 = true;
07755: continue;
07756: }
07757:
07758: default:
07759: /* No match. */
07760: }
07761: }
07762: break;
07763: }
07764:
07765: if (yyRepeated1) {
07766:
07767: yyValue = null;
07768:
07769: return new SemanticValue(yyValue,
07770: yyRepetition1, yyError);
07771: }
07772: }
07773: break;
07774:
07775: default:
07776: /* No match. */
07777: }
07778: }
07779: }
07780:
07781: // Done.
07782: yyError = yyError.select("hex numeral expected", yyStart);
07783: return yyError;
07784: }
07785:
07786: // =========================================================================
07787:
07788: /**
07789: * Parse nonterminal xtc.lang.JavaConstant.OctalNumeral.
07790: *
07791: * @param yyStart The index.
07792: * @return The result.
07793: * @throws IOException Signals an I/O error.
07794: */
07795: private Result pOctalNumeral(final int yyStart) throws IOException {
07796: int yyC;
07797: int yyIndex;
07798: int yyRepetition1;
07799: boolean yyRepeated1;
07800: Void yyValue;
07801: ParseError yyError = ParseError.DUMMY;
07802:
07803: // Alternative 1.
07804:
07805: yyC = character(yyStart);
07806: if ('0' == yyC) {
07807: yyIndex = yyStart + 1;
07808:
07809: yyRepetition1 = yyIndex;
07810: yyRepeated1 = false;
07811: while (true) {
07812:
07813: yyC = character(yyRepetition1);
07814: if (-1 != yyC) {
07815: yyIndex = yyRepetition1 + 1;
07816:
07817: switch (yyC) {
07818: case '0':
07819: case '1':
07820: case '2':
07821: case '3':
07822: case '4':
07823: case '5':
07824: case '6':
07825: case '7': {
07826: yyRepetition1 = yyIndex;
07827: yyRepeated1 = true;
07828: continue;
07829: }
07830:
07831: default:
07832: /* No match. */
07833: }
07834: }
07835: break;
07836: }
07837:
07838: if (yyRepeated1) {
07839:
07840: yyValue = null;
07841:
07842: return new SemanticValue(yyValue, yyRepetition1,
07843: yyError);
07844: }
07845: }
07846:
07847: // Done.
07848: yyError = yyError.select("octal numeral expected", yyStart);
07849: return yyError;
07850: }
07851:
07852: // =========================================================================
07853:
07854: /**
07855: * Parse nonterminal xtc.lang.JavaConstant.FloatingPointLiteral.
07856: *
07857: * @param yyStart The index.
07858: * @return The result.
07859: * @throws IOException Signals an I/O error.
07860: */
07861: private Result pFloatingPointLiteral(final int yyStart)
07862: throws IOException {
07863: Result yyResult;
07864: Node yyValue;
07865: ParseError yyError = ParseError.DUMMY;
07866:
07867: // Alternative 1.
07868:
07869: yyResult = pFloatingPointString(yyStart);
07870: yyError = yyResult.select(yyError);
07871: if (yyResult.hasValue()) {
07872: final Token v$g$1 = yyResult.semanticValue();
07873:
07874: yyValue = GNode.create("FloatingPointLiteral", v$g$1);
07875: yyValue.setLocation(location(yyStart));
07876:
07877: return yyResult.createValue(yyValue, yyError);
07878: }
07879:
07880: // Done.
07881: return yyError;
07882: }
07883:
07884: // =========================================================================
07885:
07886: /**
07887: * Parse nonterminal xtc.lang.JavaConstant.FloatingPointString.
07888: *
07889: * @param yyStart The index.
07890: * @return The result.
07891: * @throws IOException Signals an I/O error.
07892: */
07893: private Result pFloatingPointString(final int yyStart)
07894: throws IOException {
07895: int yyC;
07896: int yyIndex;
07897: Result yyResult;
07898: int yyRepetition1;
07899: boolean yyRepeated1;
07900: int yyOption1;
07901: Token yyValue;
07902: ParseError yyError = ParseError.DUMMY;
07903:
07904: // Alternative 1.
07905:
07906: yyRepetition1 = yyStart;
07907: yyRepeated1 = false;
07908: while (true) {
07909:
07910: yyC = character(yyRepetition1);
07911: if (-1 != yyC) {
07912: yyIndex = yyRepetition1 + 1;
07913:
07914: switch (yyC) {
07915: case '0':
07916: case '1':
07917: case '2':
07918: case '3':
07919: case '4':
07920: case '5':
07921: case '6':
07922: case '7':
07923: case '8':
07924: case '9': {
07925: yyRepetition1 = yyIndex;
07926: yyRepeated1 = true;
07927: continue;
07928: }
07929:
07930: default:
07931: /* No match. */
07932: }
07933: }
07934: break;
07935: }
07936:
07937: if (yyRepeated1) {
07938:
07939: yyC = character(yyRepetition1);
07940: if ('.' == yyC) {
07941: yyIndex = yyRepetition1 + 1;
07942:
07943: yyRepetition1 = yyIndex;
07944: while (true) {
07945:
07946: yyC = character(yyRepetition1);
07947: if (-1 != yyC) {
07948: yyIndex = yyRepetition1 + 1;
07949:
07950: switch (yyC) {
07951: case '0':
07952: case '1':
07953: case '2':
07954: case '3':
07955: case '4':
07956: case '5':
07957: case '6':
07958: case '7':
07959: case '8':
07960: case '9': {
07961: yyRepetition1 = yyIndex;
07962: continue;
07963: }
07964:
07965: default:
07966: /* No match. */
07967: }
07968: }
07969: break;
07970: }
07971:
07972: yyOption1 = yyRepetition1;
07973:
07974: yyResult = pExponent(yyOption1);
07975: yyError = yyResult.select(yyError);
07976: if (yyResult.hasValue()) {
07977:
07978: yyOption1 = yyResult.index;
07979: }
07980:
07981: yyC = character(yyOption1);
07982: if (-1 != yyC) {
07983: yyIndex = yyOption1 + 1;
07984:
07985: switch (yyC) {
07986: case 'D':
07987: case 'F':
07988: case 'd':
07989: case 'f': {
07990: yyOption1 = yyIndex;
07991: }
07992:
07993: default:
07994: /* No match. */
07995: }
07996: }
07997:
07998: yyValue = new Token(difference(yyStart, yyOption1));
07999: yyValue.setLocation(location(yyStart));
08000:
08001: return new SemanticValue(yyValue, yyOption1, yyError);
08002: }
08003: }
08004:
08005: // Alternative 2.
08006:
08007: yyC = character(yyStart);
08008: if ('.' == yyC) {
08009: yyIndex = yyStart + 1;
08010:
08011: yyRepetition1 = yyIndex;
08012: yyRepeated1 = false;
08013: while (true) {
08014:
08015: yyC = character(yyRepetition1);
08016: if (-1 != yyC) {
08017: yyIndex = yyRepetition1 + 1;
08018:
08019: switch (yyC) {
08020: case '0':
08021: case '1':
08022: case '2':
08023: case '3':
08024: case '4':
08025: case '5':
08026: case '6':
08027: case '7':
08028: case '8':
08029: case '9': {
08030: yyRepetition1 = yyIndex;
08031: yyRepeated1 = true;
08032: continue;
08033: }
08034:
08035: default:
08036: /* No match. */
08037: }
08038: }
08039: break;
08040: }
08041:
08042: if (yyRepeated1) {
08043:
08044: yyOption1 = yyRepetition1;
08045:
08046: yyResult = pExponent(yyOption1);
08047: yyError = yyResult.select(yyError);
08048: if (yyResult.hasValue()) {
08049:
08050: yyOption1 = yyResult.index;
08051: }
08052:
08053: yyC = character(yyOption1);
08054: if (-1 != yyC) {
08055: yyIndex = yyOption1 + 1;
08056:
08057: switch (yyC) {
08058: case 'D':
08059: case 'F':
08060: case 'd':
08061: case 'f': {
08062: yyOption1 = yyIndex;
08063: }
08064:
08065: default:
08066: /* No match. */
08067: }
08068: }
08069:
08070: yyValue = new Token(difference(yyStart, yyOption1));
08071: yyValue.setLocation(location(yyStart));
08072:
08073: return new SemanticValue(yyValue, yyOption1, yyError);
08074: }
08075: }
08076:
08077: // Alternative 3.
08078:
08079: yyRepetition1 = yyStart;
08080: yyRepeated1 = false;
08081: while (true) {
08082:
08083: yyC = character(yyRepetition1);
08084: if (-1 != yyC) {
08085: yyIndex = yyRepetition1 + 1;
08086:
08087: switch (yyC) {
08088: case '0':
08089: case '1':
08090: case '2':
08091: case '3':
08092: case '4':
08093: case '5':
08094: case '6':
08095: case '7':
08096: case '8':
08097: case '9': {
08098: yyRepetition1 = yyIndex;
08099: yyRepeated1 = true;
08100: continue;
08101: }
08102:
08103: default:
08104: /* No match. */
08105: }
08106: }
08107: break;
08108: }
08109:
08110: if (yyRepeated1) {
08111:
08112: final int yyChoice1 = yyRepetition1;
08113:
08114: // Nested alternative 1.
08115:
08116: yyResult = pExponent(yyChoice1);
08117: yyError = yyResult.select(yyError);
08118: if (yyResult.hasValue()) {
08119:
08120: yyOption1 = yyResult.index;
08121:
08122: yyC = character(yyOption1);
08123: if (-1 != yyC) {
08124: yyIndex = yyOption1 + 1;
08125:
08126: switch (yyC) {
08127: case 'D':
08128: case 'F':
08129: case 'd':
08130: case 'f': {
08131: yyOption1 = yyIndex;
08132: }
08133:
08134: default:
08135: /* No match. */
08136: }
08137: }
08138:
08139: yyValue = new Token(difference(yyStart, yyOption1));
08140: yyValue.setLocation(location(yyStart));
08141:
08142: return new SemanticValue(yyValue, yyOption1, yyError);
08143: }
08144:
08145: // Nested alternative 2.
08146:
08147: yyOption1 = yyChoice1;
08148:
08149: yyResult = pExponent(yyOption1);
08150: yyError = yyResult.select(yyError);
08151: if (yyResult.hasValue()) {
08152:
08153: yyOption1 = yyResult.index;
08154: }
08155:
08156: yyC = character(yyOption1);
08157: if (-1 != yyC) {
08158: yyIndex = yyOption1 + 1;
08159:
08160: switch (yyC) {
08161: case 'D':
08162: case 'F':
08163: case 'd':
08164: case 'f': {
08165: yyValue = new Token(difference(yyStart, yyIndex));
08166: yyValue.setLocation(location(yyStart));
08167:
08168: return new SemanticValue(yyValue, yyIndex, yyError);
08169: }
08170:
08171: default:
08172: /* No match. */
08173: }
08174: }
08175: }
08176:
08177: // Done.
08178: yyError = yyError.select("floating point string expected",
08179: yyStart);
08180: return yyError;
08181: }
08182:
08183: // =========================================================================
08184:
08185: /**
08186: * Parse nonterminal xtc.lang.JavaConstant.Exponent.
08187: *
08188: * @param yyStart The index.
08189: * @return The result.
08190: * @throws IOException Signals an I/O error.
08191: */
08192: private Result pExponent(final int yyStart) throws IOException {
08193: int yyC;
08194: int yyIndex;
08195: int yyRepetition1;
08196: boolean yyRepeated1;
08197: int yyOption1;
08198: Void yyValue;
08199: ParseError yyError = ParseError.DUMMY;
08200:
08201: // Alternative 1.
08202:
08203: yyC = character(yyStart);
08204: if (-1 != yyC) {
08205: yyIndex = yyStart + 1;
08206:
08207: switch (yyC) {
08208: case 'E':
08209: case 'e': {
08210: yyOption1 = yyIndex;
08211:
08212: yyC = character(yyOption1);
08213: if (-1 != yyC) {
08214: yyIndex = yyOption1 + 1;
08215:
08216: switch (yyC) {
08217: case '+':
08218: case '-': {
08219: yyOption1 = yyIndex;
08220: }
08221:
08222: default:
08223: /* No match. */
08224: }
08225: }
08226:
08227: yyRepetition1 = yyOption1;
08228: yyRepeated1 = false;
08229: while (true) {
08230:
08231: yyC = character(yyRepetition1);
08232: if (-1 != yyC) {
08233: yyIndex = yyRepetition1 + 1;
08234:
08235: switch (yyC) {
08236: case '0':
08237: case '1':
08238: case '2':
08239: case '3':
08240: case '4':
08241: case '5':
08242: case '6':
08243: case '7':
08244: case '8':
08245: case '9': {
08246: yyRepetition1 = yyIndex;
08247: yyRepeated1 = true;
08248: continue;
08249: }
08250:
08251: default:
08252: /* No match. */
08253: }
08254: }
08255: break;
08256: }
08257:
08258: if (yyRepeated1) {
08259:
08260: yyValue = null;
08261:
08262: return new SemanticValue(yyValue, yyRepetition1,
08263: yyError);
08264: }
08265: }
08266: break;
08267:
08268: default:
08269: /* No match. */
08270: }
08271: }
08272:
08273: // Done.
08274: yyError = yyError.select("exponent expected", yyStart);
08275: return yyError;
08276: }
08277:
08278: // =========================================================================
08279:
08280: /**
08281: * Parse nonterminal xtc.lang.JavaConstant.CharacterLiteral.
08282: *
08283: * @param yyStart The index.
08284: * @return The result.
08285: * @throws IOException Signals an I/O error.
08286: */
08287: private Result pCharacterLiteral(final int yyStart)
08288: throws IOException {
08289: Result yyResult;
08290: Node yyValue;
08291: ParseError yyError = ParseError.DUMMY;
08292:
08293: // Alternative 1.
08294:
08295: yyResult = pCharacterConstant(yyStart);
08296: yyError = yyResult.select(yyError);
08297: if (yyResult.hasValue()) {
08298: final Token v$g$1 = yyResult.semanticValue();
08299:
08300: yyValue = GNode.create("CharacterLiteral", v$g$1);
08301: yyValue.setLocation(location(yyStart));
08302:
08303: return yyResult.createValue(yyValue, yyError);
08304: }
08305:
08306: // Done.
08307: return yyError;
08308: }
08309:
08310: // =========================================================================
08311:
08312: /**
08313: * Parse nonterminal xtc.lang.JavaConstant.StringLiteral.
08314: *
08315: * @param yyStart The index.
08316: * @return The result.
08317: * @throws IOException Signals an I/O error.
08318: */
08319: private Result pStringLiteral(final int yyStart) throws IOException {
08320: Result yyResult;
08321: Node yyValue;
08322: ParseError yyError = ParseError.DUMMY;
08323:
08324: // Alternative 1.
08325:
08326: yyResult = pStringConstant(yyStart);
08327: yyError = yyResult.select(yyError);
08328: if (yyResult.hasValue()) {
08329: final Token v$g$1 = yyResult.semanticValue();
08330:
08331: yyValue = GNode.create("StringLiteral", v$g$1);
08332: yyValue.setLocation(location(yyStart));
08333:
08334: return yyResult.createValue(yyValue, yyError);
08335: }
08336:
08337: // Done.
08338: return yyError;
08339: }
08340:
08341: // =========================================================================
08342:
08343: /**
08344: * Parse nonterminal xtc.lang.JavaConstant.CharacterConstant.
08345: *
08346: * @param yyStart The index.
08347: * @return The result.
08348: * @throws IOException Signals an I/O error.
08349: */
08350: private Result pCharacterConstant(final int yyStart)
08351: throws IOException {
08352: int yyC;
08353: int yyIndex;
08354: Result yyResult;
08355: Token yyValue;
08356: ParseError yyError = ParseError.DUMMY;
08357:
08358: // Alternative 1.
08359:
08360: yyC = character(yyStart);
08361: if ('\'' == yyC) {
08362: yyIndex = yyStart + 1;
08363:
08364: yyResult = pCharacterConstant$$Choice1(yyIndex);
08365: yyError = yyResult.select(yyError);
08366: if (yyResult.hasValue()) {
08367:
08368: yyC = character(yyResult.index);
08369: if ('\'' == yyC) {
08370: yyIndex = yyResult.index + 1;
08371:
08372: yyValue = new Token(difference(yyStart, yyIndex));
08373: yyValue.setLocation(location(yyStart));
08374:
08375: return new SemanticValue(yyValue, yyIndex, yyError);
08376: }
08377: }
08378: }
08379:
08380: // Done.
08381: yyError = yyError
08382: .select("character constant expected", yyStart);
08383: return yyError;
08384: }
08385:
08386: // =========================================================================
08387:
08388: /**
08389: * Parse synthetic nonterminal xtc.lang.Java.CharacterConstant$$Choice1.
08390: *
08391: * @param yyStart The index.
08392: * @return The result.
08393: * @throws IOException Signals an I/O error.
08394: */
08395: private Result pCharacterConstant$$Choice1(final int yyStart)
08396: throws IOException {
08397:
08398: int yyC;
08399: int yyIndex;
08400: Void yyValue;
08401: ParseError yyError = ParseError.DUMMY;
08402:
08403: // Alternative 1.
08404:
08405: yyC = character(yyStart);
08406: if (-1 != yyC) {
08407: yyIndex = yyStart + 1;
08408:
08409: switch (yyC) {
08410: case '\\': {
08411: final int yyChoice1 = yyIndex;
08412:
08413: // Nested alternative 1.
08414:
08415: yyC = character(yyChoice1);
08416: if (-1 != yyC) {
08417: yyIndex = yyChoice1 + 1;
08418:
08419: switch (yyC) {
08420: case '\"':
08421: case '\'':
08422: case '\\':
08423: case 'b':
08424: case 'f':
08425: case 'n':
08426: case 'r':
08427: case 't': {
08428: yyValue = null;
08429:
08430: return new SemanticValue(yyValue, yyIndex,
08431: yyError);
08432: }
08433:
08434: case 'u': {
08435: yyC = character(yyIndex);
08436: if (-1 != yyC) {
08437: yyIndex = yyIndex + 1;
08438:
08439: switch (yyC) {
08440: case '0':
08441: case '1':
08442: case '2':
08443: case '3':
08444: case '4':
08445: case '5':
08446: case '6':
08447: case '7':
08448: case '8':
08449: case '9':
08450: case 'A':
08451: case 'B':
08452: case 'C':
08453: case 'D':
08454: case 'E':
08455: case 'F':
08456: case 'a':
08457: case 'b':
08458: case 'c':
08459: case 'd':
08460: case 'e':
08461: case 'f': {
08462: yyC = character(yyIndex);
08463: if (-1 != yyC) {
08464: yyIndex = yyIndex + 1;
08465:
08466: switch (yyC) {
08467: case '0':
08468: case '1':
08469: case '2':
08470: case '3':
08471: case '4':
08472: case '5':
08473: case '6':
08474: case '7':
08475: case '8':
08476: case '9':
08477: case 'A':
08478: case 'B':
08479: case 'C':
08480: case 'D':
08481: case 'E':
08482: case 'F':
08483: case 'a':
08484: case 'b':
08485: case 'c':
08486: case 'd':
08487: case 'e':
08488: case 'f': {
08489: yyC = character(yyIndex);
08490: if (-1 != yyC) {
08491: yyIndex = yyIndex + 1;
08492:
08493: switch (yyC) {
08494: case '0':
08495: case '1':
08496: case '2':
08497: case '3':
08498: case '4':
08499: case '5':
08500: case '6':
08501: case '7':
08502: case '8':
08503: case '9':
08504: case 'A':
08505: case 'B':
08506: case 'C':
08507: case 'D':
08508: case 'E':
08509: case 'F':
08510: case 'a':
08511: case 'b':
08512: case 'c':
08513: case 'd':
08514: case 'e':
08515: case 'f': {
08516: yyC = character(yyIndex);
08517: if (-1 != yyC) {
08518: yyIndex = yyIndex + 1;
08519:
08520: switch (yyC) {
08521: case '0':
08522: case '1':
08523: case '2':
08524: case '3':
08525: case '4':
08526: case '5':
08527: case '6':
08528: case '7':
08529: case '8':
08530: case '9':
08531: case 'A':
08532: case 'B':
08533: case 'C':
08534: case 'D':
08535: case 'E':
08536: case 'F':
08537: case 'a':
08538: case 'b':
08539: case 'c':
08540: case 'd':
08541: case 'e':
08542: case 'f': {
08543: yyValue = null;
08544:
08545: return new SemanticValue(
08546: yyValue,
08547: yyIndex,
08548: yyError);
08549: }
08550:
08551: default:
08552: /* No match. */
08553: }
08554: }
08555: }
08556: break;
08557:
08558: default:
08559: /* No match. */
08560: }
08561: }
08562: }
08563: break;
08564:
08565: default:
08566: /* No match. */
08567: }
08568: }
08569: }
08570: break;
08571:
08572: default:
08573: /* No match. */
08574: }
08575: }
08576: }
08577: break;
08578:
08579: default:
08580: /* No match. */
08581: }
08582: }
08583:
08584: // Nested alternative 2.
08585: { // Start scope for nested choice.
08586:
08587: final int yyChoice2 = yyChoice1;
08588:
08589: // Nested alternative 1.
08590:
08591: yyC = character(yyChoice2);
08592: if (-1 != yyC) {
08593: yyIndex = yyChoice2 + 1;
08594:
08595: switch (yyC) {
08596: case '0':
08597: case '1':
08598: case '2':
08599: case '3': {
08600: yyC = character(yyIndex);
08601: if (-1 != yyC) {
08602: yyIndex = yyIndex + 1;
08603:
08604: switch (yyC) {
08605: case '0':
08606: case '1':
08607: case '2':
08608: case '3':
08609: case '4':
08610: case '5':
08611: case '6':
08612: case '7': {
08613: yyC = character(yyIndex);
08614: if (-1 != yyC) {
08615: yyIndex = yyIndex + 1;
08616:
08617: switch (yyC) {
08618: case '0':
08619: case '1':
08620: case '2':
08621: case '3':
08622: case '4':
08623: case '5':
08624: case '6':
08625: case '7': {
08626: yyValue = null;
08627:
08628: return new SemanticValue(
08629: yyValue, yyIndex,
08630: yyError);
08631: }
08632:
08633: default:
08634: /* No match. */
08635: }
08636: }
08637: }
08638: break;
08639:
08640: default:
08641: /* No match. */
08642: }
08643: }
08644: }
08645: break;
08646:
08647: default:
08648: /* No match. */
08649: }
08650: }
08651:
08652: // Nested alternative 2.
08653:
08654: yyC = character(yyChoice2);
08655: if (-1 != yyC) {
08656: yyIndex = yyChoice2 + 1;
08657:
08658: switch (yyC) {
08659: case '0':
08660: case '1':
08661: case '2':
08662: case '3':
08663: case '4':
08664: case '5':
08665: case '6':
08666: case '7': {
08667: final int yyChoice3 = yyIndex;
08668:
08669: // Nested alternative 1.
08670:
08671: yyC = character(yyChoice3);
08672: if (-1 != yyC) {
08673: yyIndex = yyChoice3 + 1;
08674:
08675: switch (yyC) {
08676: case '0':
08677: case '1':
08678: case '2':
08679: case '3':
08680: case '4':
08681: case '5':
08682: case '6':
08683: case '7': {
08684: yyValue = null;
08685:
08686: return new SemanticValue(yyValue,
08687: yyIndex, yyError);
08688: }
08689:
08690: default:
08691: /* No match. */
08692: }
08693: }
08694:
08695: // Nested alternative 2.
08696:
08697: yyValue = null;
08698:
08699: return new SemanticValue(yyValue,
08700: yyChoice3, yyError);
08701: }
08702:
08703: default:
08704: /* No match. */
08705: }
08706: }
08707: } // End scope for nested choice.
08708: }
08709: break;
08710:
08711: default:
08712: /* No match. */
08713: }
08714: }
08715:
08716: // Alternative 2.
08717:
08718: yyC = character(yyStart);
08719: if (-1 != yyC) {
08720: yyIndex = yyStart + 1;
08721:
08722: switch (yyC) {
08723: case '\'':
08724: case '\\':
08725: /* No match. */
08726: break;
08727:
08728: default: {
08729: yyValue = null;
08730:
08731: return new SemanticValue(yyValue, yyIndex, yyError);
08732: }
08733: }
08734: }
08735:
08736: // Done.
08737: yyError = yyError
08738: .select("character constant expected", yyStart);
08739: return yyError;
08740: }
08741:
08742: // =========================================================================
08743:
08744: /**
08745: * Parse nonterminal xtc.lang.JavaConstant.StringConstant.
08746: *
08747: * @param yyStart The index.
08748: * @return The result.
08749: * @throws IOException Signals an I/O error.
08750: */
08751: private Result pStringConstant(final int yyStart)
08752: throws IOException {
08753: int yyC;
08754: int yyIndex;
08755: int yyRepetition1;
08756: Token yyValue;
08757: ParseError yyError = ParseError.DUMMY;
08758:
08759: // Alternative 1.
08760:
08761: yyC = character(yyStart);
08762: if ('\"' == yyC) {
08763: yyIndex = yyStart + 1;
08764:
08765: yyRepetition1 = yyIndex;
08766: while (true) {
08767:
08768: final int yyChoice1 = yyRepetition1;
08769:
08770: // Nested alternative 1.
08771:
08772: yyC = character(yyChoice1);
08773: if (-1 != yyC) {
08774: yyIndex = yyChoice1 + 1;
08775:
08776: switch (yyC) {
08777: case '\\': {
08778: final int yyChoice2 = yyIndex;
08779:
08780: // Nested alternative 1.
08781:
08782: yyC = character(yyChoice2);
08783: if (-1 != yyC) {
08784: yyIndex = yyChoice2 + 1;
08785:
08786: switch (yyC) {
08787: case '\"':
08788: case '\'':
08789: case '\\':
08790: case 'b':
08791: case 'f':
08792: case 'n':
08793: case 'r':
08794: case 't': {
08795: yyRepetition1 = yyIndex;
08796: continue;
08797: }
08798:
08799: case 'u': {
08800: yyC = character(yyIndex);
08801: if (-1 != yyC) {
08802: yyIndex = yyIndex + 1;
08803:
08804: switch (yyC) {
08805: case '0':
08806: case '1':
08807: case '2':
08808: case '3':
08809: case '4':
08810: case '5':
08811: case '6':
08812: case '7':
08813: case '8':
08814: case '9':
08815: case 'A':
08816: case 'B':
08817: case 'C':
08818: case 'D':
08819: case 'E':
08820: case 'F':
08821: case 'a':
08822: case 'b':
08823: case 'c':
08824: case 'd':
08825: case 'e':
08826: case 'f': {
08827: yyC = character(yyIndex);
08828: if (-1 != yyC) {
08829: yyIndex = yyIndex + 1;
08830:
08831: switch (yyC) {
08832: case '0':
08833: case '1':
08834: case '2':
08835: case '3':
08836: case '4':
08837: case '5':
08838: case '6':
08839: case '7':
08840: case '8':
08841: case '9':
08842: case 'A':
08843: case 'B':
08844: case 'C':
08845: case 'D':
08846: case 'E':
08847: case 'F':
08848: case 'a':
08849: case 'b':
08850: case 'c':
08851: case 'd':
08852: case 'e':
08853: case 'f': {
08854: yyC = character(yyIndex);
08855: if (-1 != yyC) {
08856: yyIndex = yyIndex + 1;
08857:
08858: switch (yyC) {
08859: case '0':
08860: case '1':
08861: case '2':
08862: case '3':
08863: case '4':
08864: case '5':
08865: case '6':
08866: case '7':
08867: case '8':
08868: case '9':
08869: case 'A':
08870: case 'B':
08871: case 'C':
08872: case 'D':
08873: case 'E':
08874: case 'F':
08875: case 'a':
08876: case 'b':
08877: case 'c':
08878: case 'd':
08879: case 'e':
08880: case 'f': {
08881: yyC = character(yyIndex);
08882: if (-1 != yyC) {
08883: yyIndex = yyIndex + 1;
08884:
08885: switch (yyC) {
08886: case '0':
08887: case '1':
08888: case '2':
08889: case '3':
08890: case '4':
08891: case '5':
08892: case '6':
08893: case '7':
08894: case '8':
08895: case '9':
08896: case 'A':
08897: case 'B':
08898: case 'C':
08899: case 'D':
08900: case 'E':
08901: case 'F':
08902: case 'a':
08903: case 'b':
08904: case 'c':
08905: case 'd':
08906: case 'e':
08907: case 'f': {
08908: yyRepetition1 = yyIndex;
08909: continue;
08910: }
08911:
08912: default:
08913: /* No match. */
08914: }
08915: }
08916: }
08917: break;
08918:
08919: default:
08920: /* No match. */
08921: }
08922: }
08923: }
08924: break;
08925:
08926: default:
08927: /* No match. */
08928: }
08929: }
08930: }
08931: break;
08932:
08933: default:
08934: /* No match. */
08935: }
08936: }
08937: }
08938: break;
08939:
08940: default:
08941: /* No match. */
08942: }
08943: }
08944:
08945: // Nested alternative 2.
08946: { // Start scope for nested choice.
08947:
08948: final int yyChoice3 = yyChoice2;
08949:
08950: // Nested alternative 1.
08951:
08952: yyC = character(yyChoice3);
08953: if (-1 != yyC) {
08954: yyIndex = yyChoice3 + 1;
08955:
08956: switch (yyC) {
08957: case '0':
08958: case '1':
08959: case '2':
08960: case '3': {
08961: yyC = character(yyIndex);
08962: if (-1 != yyC) {
08963: yyIndex = yyIndex + 1;
08964:
08965: switch (yyC) {
08966: case '0':
08967: case '1':
08968: case '2':
08969: case '3':
08970: case '4':
08971: case '5':
08972: case '6':
08973: case '7': {
08974: yyC = character(yyIndex);
08975: if (-1 != yyC) {
08976: yyIndex = yyIndex + 1;
08977:
08978: switch (yyC) {
08979: case '0':
08980: case '1':
08981: case '2':
08982: case '3':
08983: case '4':
08984: case '5':
08985: case '6':
08986: case '7': {
08987: yyRepetition1 = yyIndex;
08988: continue;
08989: }
08990:
08991: default:
08992: /* No match. */
08993: }
08994: }
08995: }
08996: break;
08997:
08998: default:
08999: /* No match. */
09000: }
09001: }
09002: }
09003: break;
09004:
09005: default:
09006: /* No match. */
09007: }
09008: }
09009:
09010: // Nested alternative 2.
09011:
09012: yyC = character(yyChoice3);
09013: if (-1 != yyC) {
09014: yyIndex = yyChoice3 + 1;
09015:
09016: switch (yyC) {
09017: case '0':
09018: case '1':
09019: case '2':
09020: case '3':
09021: case '4':
09022: case '5':
09023: case '6':
09024: case '7': {
09025: final int yyChoice4 = yyIndex;
09026:
09027: // Nested alternative 1.
09028:
09029: yyC = character(yyChoice4);
09030: if (-1 != yyC) {
09031: yyIndex = yyChoice4 + 1;
09032:
09033: switch (yyC) {
09034: case '0':
09035: case '1':
09036: case '2':
09037: case '3':
09038: case '4':
09039: case '5':
09040: case '6':
09041: case '7': {
09042: yyRepetition1 = yyIndex;
09043: continue;
09044: }
09045:
09046: default:
09047: /* No match. */
09048: }
09049: }
09050:
09051: // Nested alternative 2.
09052:
09053: yyRepetition1 = yyChoice4;
09054: continue;
09055: }
09056:
09057: default:
09058: /* No match. */
09059: }
09060: }
09061: } // End scope for nested choice.
09062: }
09063: break;
09064:
09065: default:
09066: /* No match. */
09067: }
09068: }
09069:
09070: // Nested alternative 2.
09071:
09072: yyC = character(yyChoice1);
09073: if (-1 != yyC) {
09074: yyIndex = yyChoice1 + 1;
09075:
09076: switch (yyC) {
09077: case '\"':
09078: case '\\':
09079: /* No match. */
09080: break;
09081:
09082: default: {
09083: yyRepetition1 = yyIndex;
09084: continue;
09085: }
09086: }
09087: }
09088: break;
09089: }
09090:
09091: yyC = character(yyRepetition1);
09092: if ('\"' == yyC) {
09093: yyIndex = yyRepetition1 + 1;
09094:
09095: yyValue = new Token(difference(yyStart, yyIndex));
09096: yyValue.setLocation(location(yyStart));
09097:
09098: return new SemanticValue(yyValue, yyIndex, yyError);
09099: }
09100: }
09101:
09102: // Done.
09103: yyError = yyError.select("string constant expected", yyStart);
09104: return yyError;
09105: }
09106:
09107: // =========================================================================
09108:
09109: /**
09110: * Parse nonterminal xtc.lang.JavaIdentifier.QualifiedIdentifier.
09111: *
09112: * @param yyStart The index.
09113: * @return The result.
09114: * @throws IOException Signals an I/O error.
09115: */
09116: private Result pQualifiedIdentifier(final int yyStart)
09117: throws IOException {
09118: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
09119: if (null == yyColumn.chunk2)
09120: yyColumn.chunk2 = new Chunk2();
09121: if (null == yyColumn.chunk2.fQualifiedIdentifier)
09122: yyColumn.chunk2.fQualifiedIdentifier = pQualifiedIdentifier$1(yyStart);
09123: return yyColumn.chunk2.fQualifiedIdentifier;
09124: }
09125:
09126: /** Actually parse xtc.lang.JavaIdentifier.QualifiedIdentifier. */
09127: private Result pQualifiedIdentifier$1(final int yyStart)
09128: throws IOException {
09129:
09130: Result yyResult;
09131: Node yyValue;
09132: ParseError yyError = ParseError.DUMMY;
09133:
09134: // Alternative 1.
09135:
09136: yyResult = pIdentifier(yyStart);
09137: yyError = yyResult.select(yyError);
09138: if (yyResult.hasValue()) {
09139: final Node v$g$1 = yyResult.semanticValue();
09140:
09141: yyResult = pQualifiedIdentifier$$Star1(yyResult.index);
09142: yyError = yyResult.select(yyError);
09143: if (yyResult.hasValue()) {
09144: final Pair<Node> v$g$2 = yyResult.semanticValue();
09145:
09146: yyValue = GNode.createFromPair("QualifiedIdentifier",
09147: v$g$1, v$g$2);
09148: yyValue.setLocation(location(yyStart));
09149:
09150: return yyResult.createValue(yyValue, yyError);
09151: }
09152: }
09153:
09154: // Done.
09155: return yyError;
09156: }
09157:
09158: // =========================================================================
09159:
09160: /**
09161: * Parse synthetic nonterminal xtc.lang.Java.QualifiedIdentifier$$Star1.
09162: *
09163: * @param yyStart The index.
09164: * @return The result.
09165: * @throws IOException Signals an I/O error.
09166: */
09167: private Result pQualifiedIdentifier$$Star1(final int yyStart)
09168: throws IOException {
09169:
09170: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
09171: if (null == yyColumn.chunk2)
09172: yyColumn.chunk2 = new Chunk2();
09173: if (null == yyColumn.chunk2.fQualifiedIdentifier$$Star1)
09174: yyColumn.chunk2.fQualifiedIdentifier$$Star1 = pQualifiedIdentifier$$Star1$1(yyStart);
09175: return yyColumn.chunk2.fQualifiedIdentifier$$Star1;
09176: }
09177:
09178: /** Actually parse xtc.lang.Java.QualifiedIdentifier$$Star1. */
09179: private Result pQualifiedIdentifier$$Star1$1(final int yyStart)
09180: throws IOException {
09181:
09182: Result yyResult;
09183: Pair<Node> yyValue;
09184: ParseError yyError = ParseError.DUMMY;
09185:
09186: // Alternative 1.
09187:
09188: yyResult = pSymbol(yyStart);
09189: yyError = yyResult.select(yyError);
09190: if (yyResult.hasValue()
09191: && ((Node) yyResult.semanticValue()).getTokenText()
09192: .equals(".")) {
09193: final Node v$pt$1 = yyResult.semanticValue();
09194:
09195: yyResult = pIdentifier(yyResult.index);
09196: yyError = yyResult.select(yyError);
09197: if (yyResult.hasValue()) {
09198: final Node v$pt$2 = yyResult.semanticValue();
09199: final Node v$el$1 = Formatting.before1(v$pt$1, v$pt$2);
09200:
09201: yyResult = pQualifiedIdentifier$$Star1(yyResult.index);
09202: yyError = yyResult.select(yyError);
09203: if (yyResult.hasValue()) {
09204: final Pair<Node> v$2 = yyResult.semanticValue();
09205:
09206: yyValue = new Pair<Node>(v$el$1, v$2);
09207:
09208: return yyResult.createValue(yyValue, yyError);
09209: }
09210: }
09211: }
09212:
09213: // Alternative 2.
09214:
09215: yyValue = Pair.empty();
09216:
09217: return new SemanticValue(yyValue, yyStart, yyError);
09218: }
09219:
09220: // =========================================================================
09221:
09222: /**
09223: * Parse nonterminal xtc.lang.JavaIdentifier.Identifier.
09224: *
09225: * @param yyStart The index.
09226: * @return The result.
09227: * @throws IOException Signals an I/O error.
09228: */
09229: private Result pIdentifier(final int yyStart) throws IOException {
09230: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
09231: if (null == yyColumn.chunk3)
09232: yyColumn.chunk3 = new Chunk3();
09233: if (null == yyColumn.chunk3.fIdentifier)
09234: yyColumn.chunk3.fIdentifier = pIdentifier$1(yyStart);
09235: return yyColumn.chunk3.fIdentifier;
09236: }
09237:
09238: /** Actually parse xtc.lang.JavaIdentifier.Identifier. */
09239: private Result pIdentifier$1(final int yyStart) throws IOException {
09240: Result yyResult;
09241: Node yyValue;
09242: ParseError yyError = ParseError.DUMMY;
09243:
09244: // Alternative 1.
09245:
09246: yyResult = pWord(yyStart);
09247: yyError = yyResult.select(yyError);
09248: if (yyResult.hasValue()) {
09249: yyValue = yyResult.semanticValue();
09250:
09251: if (!contains(JAVA_KEYWORDS, toText(yyValue))) {
09252:
09253: return yyResult.createValue(yyValue, yyError);
09254: }
09255: }
09256:
09257: // Done.
09258: yyError = yyError.select("identifier expected", yyStart);
09259: return yyError;
09260: }
09261:
09262: // =========================================================================
09263:
09264: /**
09265: * Parse nonterminal xtc.lang.JavaIdentifier.Word.
09266: *
09267: * @param yyStart The index.
09268: * @return The result.
09269: * @throws IOException Signals an I/O error.
09270: */
09271: private Result pWord(final int yyStart) throws IOException {
09272: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
09273: if (null == yyColumn.chunk3)
09274: yyColumn.chunk3 = new Chunk3();
09275: if (null == yyColumn.chunk3.fWord)
09276: yyColumn.chunk3.fWord = pWord$1(yyStart);
09277: return yyColumn.chunk3.fWord;
09278: }
09279:
09280: /** Actually parse xtc.lang.JavaIdentifier.Word. */
09281: private Result pWord$1(final int yyStart) throws IOException {
09282: Result yyResult;
09283: Node yyValue;
09284: ParseError yyError = ParseError.DUMMY;
09285:
09286: // Alternative 1.
09287:
09288: yyResult = pWordCharacters(yyStart);
09289: yyError = yyResult.select(yyError);
09290: if (yyResult.hasValue()) {
09291: final Token v$pt$2 = yyResult.semanticValue();
09292:
09293: yyResult = pSpacing(yyResult.index);
09294: yyError = yyResult.select(yyError);
09295: if (yyResult.hasValue()) {
09296: final Token v$pt$1 = yyResult.semanticValue();
09297: yyValue = Formatting.after1(v$pt$2, v$pt$1);
09298:
09299: return yyResult.createValue(yyValue, yyError);
09300: }
09301: }
09302:
09303: // Done.
09304: return yyError;
09305: }
09306:
09307: // =========================================================================
09308:
09309: /**
09310: * Parse nonterminal xtc.lang.JavaIdentifier.WordCharacters.
09311: *
09312: * @param yyStart The index.
09313: * @return The result.
09314: * @throws IOException Signals an I/O error.
09315: */
09316: private Result pWordCharacters(final int yyStart)
09317: throws IOException {
09318: int yyC;
09319: int yyIndex;
09320: int yyRepetition1;
09321: Token yyValue;
09322: ParseError yyError = ParseError.DUMMY;
09323:
09324: // Alternative 1.
09325:
09326: yyC = character(yyStart);
09327: if (-1 != yyC) {
09328: yyIndex = yyStart + 1;
09329: final char start = (char) yyC;
09330:
09331: if (Character.isJavaIdentifierStart(start)) {
09332:
09333: yyRepetition1 = yyIndex;
09334: while (true) {
09335:
09336: yyC = character(yyRepetition1);
09337: if (-1 != yyC) {
09338: yyIndex = yyRepetition1 + 1;
09339: final char part = (char) yyC;
09340:
09341: if (Character.isJavaIdentifierPart(part)) {
09342:
09343: yyRepetition1 = yyIndex;
09344: continue;
09345: }
09346: }
09347: break;
09348: }
09349:
09350: yyValue = new Token(difference(yyStart, yyRepetition1));
09351: yyValue.setLocation(location(yyStart));
09352:
09353: return new SemanticValue(yyValue, yyRepetition1,
09354: yyError);
09355: }
09356: }
09357:
09358: // Done.
09359: yyError = yyError.select("word characters expected", yyStart);
09360: return yyError;
09361: }
09362:
09363: // =========================================================================
09364:
09365: /**
09366: * Parse nonterminal xtc.lang.JavaSymbol.Symbol.
09367: *
09368: * @param yyStart The index.
09369: * @return The result.
09370: * @throws IOException Signals an I/O error.
09371: */
09372: private Result pSymbol(final int yyStart) throws IOException {
09373: JavaReaderColumn yyColumn = (JavaReaderColumn) column(yyStart);
09374: if (null == yyColumn.chunk3)
09375: yyColumn.chunk3 = new Chunk3();
09376: if (null == yyColumn.chunk3.fSymbol)
09377: yyColumn.chunk3.fSymbol = pSymbol$1(yyStart);
09378: return yyColumn.chunk3.fSymbol;
09379: }
09380:
09381: /** Actually parse xtc.lang.JavaSymbol.Symbol. */
09382: private Result pSymbol$1(final int yyStart) throws IOException {
09383: Result yyResult;
09384: Node yyValue;
09385: ParseError yyError = ParseError.DUMMY;
09386:
09387: // Alternative 1.
09388:
09389: yyResult = pSymbolCharacters(yyStart);
09390: yyError = yyResult.select(yyError);
09391: if (yyResult.hasValue()) {
09392: final Token v$pt$2 = yyResult.semanticValue();
09393:
09394: yyResult = pSpacing(yyResult.index);
09395: yyError = yyResult.select(yyError);
09396: if (yyResult.hasValue()) {
09397: final Token v$pt$1 = yyResult.semanticValue();
09398: yyValue = Formatting.after1(v$pt$2, v$pt$1);
09399:
09400: return yyResult.createValue(yyValue, yyError);
09401: }
09402: }
09403:
09404: // Done.
09405: return yyError;
09406: }
09407:
09408: // =========================================================================
09409:
09410: /**
09411: * Parse nonterminal xtc.lang.JavaSymbol.SymbolCharacters.
09412: *
09413: * @param yyStart The index.
09414: * @return The result.
09415: * @throws IOException Signals an I/O error.
09416: */
09417: private Result pSymbolCharacters(final int yyStart)
09418: throws IOException {
09419: int yyC;
09420: int yyIndex;
09421: Token yyValue;
09422: ParseError yyError = ParseError.DUMMY;
09423:
09424: // Alternative 1.
09425:
09426: yyC = character(yyStart);
09427: if (-1 != yyC) {
09428: yyIndex = yyStart + 1;
09429:
09430: switch (yyC) {
09431: case '>': {
09432: final int yyChoice1 = yyIndex;
09433:
09434: // Nested alternative 1.
09435:
09436: yyC = character(yyChoice1);
09437: if (-1 != yyC) {
09438: yyIndex = yyChoice1 + 1;
09439:
09440: switch (yyC) {
09441: case '>': {
09442: final int yyChoice2 = yyIndex;
09443:
09444: // Nested alternative 1.
09445:
09446: yyC = character(yyChoice2);
09447: if (-1 != yyC) {
09448: yyIndex = yyChoice2 + 1;
09449:
09450: switch (yyC) {
09451: case '>': {
09452: final int yyChoice3 = yyIndex;
09453:
09454: // Nested alternative 1.
09455:
09456: yyC = character(yyChoice3);
09457: if (-1 != yyC) {
09458: yyIndex = yyChoice3 + 1;
09459: if ('=' == yyC) {
09460:
09461: yyValue = new Token(">>>=");
09462: yyValue
09463: .setLocation(location(yyStart));
09464:
09465: return new SemanticValue(
09466: yyValue, yyIndex,
09467: yyError);
09468: }
09469: }
09470:
09471: // Nested alternative 2.
09472:
09473: yyValue = new Token(">>>");
09474: yyValue.setLocation(location(yyStart));
09475:
09476: return new SemanticValue(yyValue,
09477: yyChoice3, yyError);
09478: }
09479:
09480: case '=': {
09481: yyValue = new Token(">>=");
09482: yyValue.setLocation(location(yyStart));
09483:
09484: return new SemanticValue(yyValue,
09485: yyIndex, yyError);
09486: }
09487:
09488: default:
09489: /* No match. */
09490: }
09491: }
09492:
09493: // Nested alternative 2.
09494:
09495: yyValue = new Token(">>");
09496: yyValue.setLocation(location(yyStart));
09497:
09498: return new SemanticValue(yyValue, yyChoice2,
09499: yyError);
09500: }
09501:
09502: case '=': {
09503: yyValue = new Token(">=");
09504: yyValue.setLocation(location(yyStart));
09505:
09506: return new SemanticValue(yyValue, yyIndex,
09507: yyError);
09508: }
09509:
09510: default:
09511: /* No match. */
09512: }
09513: }
09514:
09515: // Nested alternative 2.
09516:
09517: yyValue = new Token(">");
09518: yyValue.setLocation(location(yyStart));
09519:
09520: return new SemanticValue(yyValue, yyChoice1, yyError);
09521: }
09522:
09523: case '<': {
09524: final int yyChoice1 = yyIndex;
09525:
09526: // Nested alternative 1.
09527:
09528: yyC = character(yyChoice1);
09529: if (-1 != yyC) {
09530: yyIndex = yyChoice1 + 1;
09531:
09532: switch (yyC) {
09533: case '<': {
09534: final int yyChoice2 = yyIndex;
09535:
09536: // Nested alternative 1.
09537:
09538: yyC = character(yyChoice2);
09539: if (-1 != yyC) {
09540: yyIndex = yyChoice2 + 1;
09541: if ('=' == yyC) {
09542:
09543: yyValue = new Token("<<=");
09544: yyValue.setLocation(location(yyStart));
09545:
09546: return new SemanticValue(yyValue,
09547: yyIndex, yyError);
09548: }
09549: }
09550:
09551: // Nested alternative 2.
09552:
09553: yyValue = new Token("<<");
09554: yyValue.setLocation(location(yyStart));
09555:
09556: return new SemanticValue(yyValue, yyChoice2,
09557: yyError);
09558: }
09559:
09560: case '=': {
09561: yyValue = new Token("<=");
09562: yyValue.setLocation(location(yyStart));
09563:
09564: return new SemanticValue(yyValue, yyIndex,
09565: yyError);
09566: }
09567:
09568: default:
09569: /* No match. */
09570: }
09571: }
09572:
09573: // Nested alternative 2.
09574:
09575: yyValue = new Token("<");
09576: yyValue.setLocation(location(yyStart));
09577:
09578: return new SemanticValue(yyValue, yyChoice1, yyError);
09579: }
09580:
09581: case '+': {
09582: final int yyChoice1 = yyIndex;
09583:
09584: // Nested alternative 1.
09585:
09586: yyC = character(yyChoice1);
09587: if (-1 != yyC) {
09588: yyIndex = yyChoice1 + 1;
09589:
09590: switch (yyC) {
09591: case '=': {
09592: yyValue = new Token("+=");
09593: yyValue.setLocation(location(yyStart));
09594:
09595: return new SemanticValue(yyValue, yyIndex,
09596: yyError);
09597: }
09598:
09599: case '+': {
09600: yyValue = new Token("++");
09601: yyValue.setLocation(location(yyStart));
09602:
09603: return new SemanticValue(yyValue, yyIndex,
09604: yyError);
09605: }
09606:
09607: default:
09608: /* No match. */
09609: }
09610: }
09611:
09612: // Nested alternative 2.
09613:
09614: yyValue = new Token("+");
09615: yyValue.setLocation(location(yyStart));
09616:
09617: return new SemanticValue(yyValue, yyChoice1, yyError);
09618: }
09619:
09620: case '-': {
09621: final int yyChoice1 = yyIndex;
09622:
09623: // Nested alternative 1.
09624:
09625: yyC = character(yyChoice1);
09626: if (-1 != yyC) {
09627: yyIndex = yyChoice1 + 1;
09628:
09629: switch (yyC) {
09630: case '=': {
09631: yyValue = new Token("-=");
09632: yyValue.setLocation(location(yyStart));
09633:
09634: return new SemanticValue(yyValue, yyIndex,
09635: yyError);
09636: }
09637:
09638: case '-': {
09639: yyValue = new Token("--");
09640: yyValue.setLocation(location(yyStart));
09641:
09642: return new SemanticValue(yyValue, yyIndex,
09643: yyError);
09644: }
09645:
09646: default:
09647: /* No match. */
09648: }
09649: }
09650:
09651: // Nested alternative 2.
09652:
09653: yyValue = new Token("-");
09654: yyValue.setLocation(location(yyStart));
09655:
09656: return new SemanticValue(yyValue, yyChoice1, yyError);
09657: }
09658:
09659: case '*': {
09660: final int yyChoice1 = yyIndex;
09661:
09662: // Nested alternative 1.
09663:
09664: yyC = character(yyChoice1);
09665: if (-1 != yyC) {
09666: yyIndex = yyChoice1 + 1;
09667: if ('=' == yyC) {
09668:
09669: yyValue = new Token("*=");
09670: yyValue.setLocation(location(yyStart));
09671:
09672: return new SemanticValue(yyValue, yyIndex,
09673: yyError);
09674: }
09675: }
09676:
09677: // Nested alternative 2.
09678:
09679: yyValue = new Token("*");
09680: yyValue.setLocation(location(yyStart));
09681:
09682: return new SemanticValue(yyValue, yyChoice1, yyError);
09683: }
09684:
09685: case '/': {
09686: final int yyChoice1 = yyIndex;
09687:
09688: // Nested alternative 1.
09689:
09690: yyC = character(yyChoice1);
09691: if (-1 != yyC) {
09692: yyIndex = yyChoice1 + 1;
09693: if ('=' == yyC) {
09694:
09695: yyValue = new Token("/=");
09696: yyValue.setLocation(location(yyStart));
09697:
09698: return new SemanticValue(yyValue, yyIndex,
09699: yyError);
09700: }
09701: }
09702:
09703: // Nested alternative 2.
09704:
09705: yyValue = new Token("/");
09706: yyValue.setLocation(location(yyStart));
09707:
09708: return new SemanticValue(yyValue, yyChoice1, yyError);
09709: }
09710:
09711: case '%': {
09712: final int yyChoice1 = yyIndex;
09713:
09714: // Nested alternative 1.
09715:
09716: yyC = character(yyChoice1);
09717: if (-1 != yyC) {
09718: yyIndex = yyChoice1 + 1;
09719: if ('=' == yyC) {
09720:
09721: yyValue = new Token("%=");
09722: yyValue.setLocation(location(yyStart));
09723:
09724: return new SemanticValue(yyValue, yyIndex,
09725: yyError);
09726: }
09727: }
09728:
09729: // Nested alternative 2.
09730:
09731: yyValue = new Token("%");
09732: yyValue.setLocation(location(yyStart));
09733:
09734: return new SemanticValue(yyValue, yyChoice1, yyError);
09735: }
09736:
09737: case '&': {
09738: final int yyChoice1 = yyIndex;
09739:
09740: // Nested alternative 1.
09741:
09742: yyC = character(yyChoice1);
09743: if (-1 != yyC) {
09744: yyIndex = yyChoice1 + 1;
09745:
09746: switch (yyC) {
09747: case '=': {
09748: yyValue = new Token("&=");
09749: yyValue.setLocation(location(yyStart));
09750:
09751: return new SemanticValue(yyValue, yyIndex,
09752: yyError);
09753: }
09754:
09755: case '&': {
09756: yyValue = new Token("&&");
09757: yyValue.setLocation(location(yyStart));
09758:
09759: return new SemanticValue(yyValue, yyIndex,
09760: yyError);
09761: }
09762:
09763: default:
09764: /* No match. */
09765: }
09766: }
09767:
09768: // Nested alternative 2.
09769:
09770: yyValue = new Token("&");
09771: yyValue.setLocation(location(yyStart));
09772:
09773: return new SemanticValue(yyValue, yyChoice1, yyError);
09774: }
09775:
09776: case '^': {
09777: final int yyChoice1 = yyIndex;
09778:
09779: // Nested alternative 1.
09780:
09781: yyC = character(yyChoice1);
09782: if (-1 != yyC) {
09783: yyIndex = yyChoice1 + 1;
09784: if ('=' == yyC) {
09785:
09786: yyValue = new Token("^=");
09787: yyValue.setLocation(location(yyStart));
09788:
09789: return new SemanticValue(yyValue, yyIndex,
09790: yyError);
09791: }
09792: }
09793:
09794: // Nested alternative 2.
09795:
09796: yyValue = new Token("^");
09797: yyValue.setLocation(location(yyStart));
09798:
09799: return new SemanticValue(yyValue, yyChoice1, yyError);
09800: }
09801:
09802: case '|': {
09803: final int yyChoice1 = yyIndex;
09804:
09805: // Nested alternative 1.
09806:
09807: yyC = character(yyChoice1);
09808: if (-1 != yyC) {
09809: yyIndex = yyChoice1 + 1;
09810:
09811: switch (yyC) {
09812: case '=': {
09813: yyValue = new Token("|=");
09814: yyValue.setLocation(location(yyStart));
09815:
09816: return new SemanticValue(yyValue, yyIndex,
09817: yyError);
09818: }
09819:
09820: case '|': {
09821: yyValue = new Token("||");
09822: yyValue.setLocation(location(yyStart));
09823:
09824: return new SemanticValue(yyValue, yyIndex,
09825: yyError);
09826: }
09827:
09828: default:
09829: /* No match. */
09830: }
09831: }
09832:
09833: // Nested alternative 2.
09834:
09835: yyValue = new Token("|");
09836: yyValue.setLocation(location(yyStart));
09837:
09838: return new SemanticValue(yyValue, yyChoice1, yyError);
09839: }
09840:
09841: case '=': {
09842: final int yyChoice1 = yyIndex;
09843:
09844: // Nested alternative 1.
09845:
09846: yyC = character(yyChoice1);
09847: if (-1 != yyC) {
09848: yyIndex = yyChoice1 + 1;
09849: if ('=' == yyC) {
09850:
09851: yyValue = new Token("==");
09852: yyValue.setLocation(location(yyStart));
09853:
09854: return new SemanticValue(yyValue, yyIndex,
09855: yyError);
09856: }
09857: }
09858:
09859: // Nested alternative 2.
09860:
09861: yyValue = new Token("=");
09862: yyValue.setLocation(location(yyStart));
09863:
09864: return new SemanticValue(yyValue, yyChoice1, yyError);
09865: }
09866:
09867: case '!': {
09868: final int yyChoice1 = yyIndex;
09869:
09870: // Nested alternative 1.
09871:
09872: yyC = character(yyChoice1);
09873: if (-1 != yyC) {
09874: yyIndex = yyChoice1 + 1;
09875: if ('=' == yyC) {
09876:
09877: yyValue = new Token("!=");
09878: yyValue.setLocation(location(yyStart));
09879:
09880: return new SemanticValue(yyValue, yyIndex,
09881: yyError);
09882: }
09883: }
09884:
09885: // Nested alternative 2.
09886:
09887: yyValue = new Token("!");
09888: yyValue.setLocation(location(yyStart));
09889:
09890: return new SemanticValue(yyValue, yyChoice1, yyError);
09891: }
09892:
09893: case ';': {
09894: yyValue = new Token(";");
09895: yyValue.setLocation(location(yyStart));
09896:
09897: return new SemanticValue(yyValue, yyIndex, yyError);
09898: }
09899:
09900: case ':': {
09901: yyValue = new Token(":");
09902: yyValue.setLocation(location(yyStart));
09903:
09904: return new SemanticValue(yyValue, yyIndex, yyError);
09905: }
09906:
09907: case ',': {
09908: yyValue = new Token(",");
09909: yyValue.setLocation(location(yyStart));
09910:
09911: return new SemanticValue(yyValue, yyIndex, yyError);
09912: }
09913:
09914: case '.': {
09915: yyValue = new Token(".");
09916: yyValue.setLocation(location(yyStart));
09917:
09918: return new SemanticValue(yyValue, yyIndex, yyError);
09919: }
09920:
09921: case '{': {
09922: yyValue = new Token("{");
09923: yyValue.setLocation(location(yyStart));
09924:
09925: return new SemanticValue(yyValue, yyIndex, yyError);
09926: }
09927:
09928: case '}': {
09929: yyValue = new Token("}");
09930: yyValue.setLocation(location(yyStart));
09931:
09932: return new SemanticValue(yyValue, yyIndex, yyError);
09933: }
09934:
09935: case '(': {
09936: yyValue = new Token("(");
09937: yyValue.setLocation(location(yyStart));
09938:
09939: return new SemanticValue(yyValue, yyIndex, yyError);
09940: }
09941:
09942: case ')': {
09943: yyValue = new Token(")");
09944: yyValue.setLocation(location(yyStart));
09945:
09946: return new SemanticValue(yyValue, yyIndex, yyError);
09947: }
09948:
09949: case '[': {
09950: yyValue = new Token("[");
09951: yyValue.setLocation(location(yyStart));
09952:
09953: return new SemanticValue(yyValue, yyIndex, yyError);
09954: }
09955:
09956: case ']': {
09957: yyValue = new Token("]");
09958: yyValue.setLocation(location(yyStart));
09959:
09960: return new SemanticValue(yyValue, yyIndex, yyError);
09961: }
09962:
09963: case '~': {
09964: yyValue = new Token("~");
09965: yyValue.setLocation(location(yyStart));
09966:
09967: return new SemanticValue(yyValue, yyIndex, yyError);
09968: }
09969:
09970: case '?': {
09971: yyValue = new Token("?");
09972: yyValue.setLocation(location(yyStart));
09973:
09974: return new SemanticValue(yyValue, yyIndex, yyError);
09975: }
09976:
09977: default:
09978: /* No match. */
09979: }
09980: }
09981:
09982: // Done.
09983: yyError = yyError.select("symbol characters expected", yyStart);
09984: return yyError;
09985: }
09986:
09987: // =========================================================================
09988:
09989: /**
09990: * Parse nonterminal xtc.util.Spacing.Spacing.
09991: *
09992: * @param yyStart The index.
09993: * @return The result.
09994: * @throws IOException Signals an I/O error.
09995: */
09996: private Result pSpacing(final int yyStart) throws IOException {
09997: int yyC;
09998: int yyIndex;
09999: Result yyPredResult;
10000: boolean yyPredMatched;
10001: int yyBase;
10002: int yyRepetition1;
10003: int yyRepetition2;
10004: Token yyValue;
10005: ParseError yyError = ParseError.DUMMY;
10006:
10007: // Alternative 1.
10008:
10009: yyRepetition1 = yyStart;
10010: while (true) {
10011:
10012: final int yyChoice1 = yyRepetition1;
10013:
10014: // Nested alternative 1.
10015:
10016: yyC = character(yyChoice1);
10017: if (-1 != yyC) {
10018: yyIndex = yyChoice1 + 1;
10019:
10020: switch (yyC) {
10021: case ' ': {
10022: yyRepetition1 = yyIndex;
10023: continue;
10024: }
10025:
10026: case '\t': {
10027: yyRepetition1 = yyIndex;
10028: continue;
10029: }
10030:
10031: case '\f': {
10032: yyRepetition1 = yyIndex;
10033: continue;
10034: }
10035:
10036: case '\r': {
10037: final int yyChoice2 = yyIndex;
10038:
10039: // Nested alternative 1.
10040:
10041: yyC = character(yyChoice2);
10042: if ('\n' == yyC) {
10043: yyIndex = yyChoice2 + 1;
10044:
10045: yyRepetition1 = yyIndex;
10046: continue;
10047: }
10048:
10049: // Nested alternative 2.
10050:
10051: yyRepetition1 = yyChoice2;
10052: continue;
10053: }
10054:
10055: case '\n': {
10056: yyRepetition1 = yyIndex;
10057: continue;
10058: }
10059:
10060: case '/': {
10061: yyC = character(yyIndex);
10062: if (-1 != yyC) {
10063: yyIndex = yyIndex + 1;
10064:
10065: switch (yyC) {
10066: case '*': {
10067: yyRepetition2 = yyIndex;
10068: while (true) {
10069:
10070: final int yyChoice2 = yyRepetition2;
10071:
10072: // Nested alternative 1.
10073:
10074: yyC = character(yyChoice2);
10075: if (-1 != yyC) {
10076: yyIndex = yyChoice2 + 1;
10077:
10078: switch (yyC) {
10079: case '*': {
10080: yyPredMatched = false;
10081:
10082: yyC = character(yyIndex);
10083: if ('/' == yyC) {
10084:
10085: yyPredMatched = true;
10086: }
10087:
10088: if (!yyPredMatched) {
10089:
10090: yyRepetition2 = yyIndex;
10091: continue;
10092: } else {
10093: yyError = yyError.select(
10094: "spacing expected",
10095: yyStart);
10096: }
10097: }
10098: break;
10099:
10100: default: {
10101: yyRepetition2 = yyIndex;
10102: continue;
10103: }
10104: }
10105: }
10106: break;
10107: }
10108:
10109: yyBase = yyRepetition2;
10110: yyC = character(yyBase);
10111: if ('*' == yyC) {
10112: yyIndex = yyRepetition2 + 1;
10113:
10114: yyC = character(yyIndex);
10115: if ('/' == yyC) {
10116: yyIndex = yyIndex + 1;
10117:
10118: yyRepetition1 = yyIndex;
10119: continue;
10120: } else {
10121: yyError = yyError.select(
10122: "\"*/\" expected", yyBase);
10123: }
10124: } else {
10125: yyError = yyError.select(
10126: "\"*/\" expected", yyBase);
10127: }
10128: }
10129: break;
10130:
10131: case '/': {
10132: yyRepetition2 = yyIndex;
10133: while (true) {
10134:
10135: yyC = character(yyRepetition2);
10136: if (-1 != yyC) {
10137: yyIndex = yyRepetition2 + 1;
10138:
10139: switch (yyC) {
10140: case '\n':
10141: case '\r':
10142: /* No match. */
10143: break;
10144:
10145: default: {
10146: yyRepetition2 = yyIndex;
10147: continue;
10148: }
10149: }
10150: }
10151: break;
10152: }
10153:
10154: final int yyChoice2 = yyRepetition2;
10155:
10156: // Nested alternative 1.
10157:
10158: yyC = character(yyChoice2);
10159: if (-1 != yyC) {
10160: yyIndex = yyChoice2 + 1;
10161:
10162: switch (yyC) {
10163: case '\r': {
10164: final int yyChoice3 = yyIndex;
10165:
10166: // Nested alternative 1.
10167:
10168: yyC = character(yyChoice3);
10169: if ('\n' == yyC) {
10170: yyIndex = yyChoice3 + 1;
10171:
10172: yyRepetition1 = yyIndex;
10173: continue;
10174: }
10175:
10176: // Nested alternative 2.
10177:
10178: yyRepetition1 = yyChoice3;
10179: continue;
10180: }
10181:
10182: case '\n': {
10183: yyRepetition1 = yyIndex;
10184: continue;
10185: }
10186:
10187: default:
10188: /* No match. */
10189: }
10190: }
10191:
10192: // Nested alternative 2.
10193:
10194: yyPredResult = pEndOfFile(yyChoice2);
10195: yyError = yyPredResult.select(yyError);
10196: if (yyPredResult.hasValue()) {
10197:
10198: yyRepetition1 = yyChoice2;
10199: continue;
10200: }
10201: }
10202: break;
10203:
10204: default:
10205: /* No match. */
10206: }
10207: }
10208: }
10209: break;
10210:
10211: default:
10212: /* No match. */
10213: }
10214: }
10215: break;
10216: }
10217:
10218: yyValue = new Token(difference(yyStart, yyRepetition1));
10219: yyValue.setLocation(location(yyStart));
10220:
10221: return new SemanticValue(yyValue, yyRepetition1, yyError);
10222: }
10223:
10224: // =========================================================================
10225:
10226: /**
10227: * Parse nonterminal xtc.util.Spacing.EndOfFile.
10228: *
10229: * @param yyStart The index.
10230: * @return The result.
10231: * @throws IOException Signals an I/O error.
10232: */
10233: private Result pEndOfFile(final int yyStart) throws IOException {
10234: int yyC;
10235: boolean yyPredMatched;
10236: Void yyValue;
10237: ParseError yyError = ParseError.DUMMY;
10238:
10239: // Alternative 1.
10240:
10241: yyPredMatched = false;
10242:
10243: yyC = character(yyStart);
10244: if (-1 != yyC) {
10245:
10246: yyPredMatched = true;
10247: }
10248:
10249: if (!yyPredMatched) {
10250:
10251: yyValue = null;
10252:
10253: return new SemanticValue(yyValue, yyStart, yyError);
10254: } else {
10255: yyError = yyError.select("end of file expected", yyStart);
10256: }
10257:
10258: // Done.
10259: return yyError;
10260: }
10261:
10262: // =========================================================================
10263:
10264: static {
10265: add(JAVA_KEYWORDS, new String[] { "abstract", "continue",
10266: "for", "new", "switch", "assert", "default", "if",
10267: "package", "synchronized", "boolean", "do", "goto",
10268: "private", "this", "break", "double", "implements",
10269: "protected", "throw", "byte", "else", "import",
10270: "public", "throws", "case", "instanceof", "return",
10271: "transient", "catch", "extends", "int", "short", "try",
10272: "char", "final", "interface", "static", "void",
10273: "class", "finally", "long", "strictfp", "volatile",
10274: "const", "float", "native", "super", "while" });
10275: }
10276:
10277: // =========================================================================
10278:
10279: /**
10280: * Get the text for the specified annotated token.
10281: *
10282: * @param n The annotated token.
10283: * @return The corresponding text.
10284: */
10285: protected static final String toText(Node n) {
10286: return n.getTokenText();
10287: }
10288:
10289: // =========================================================================
10290:
10291: /**
10292: * Add the specified values to the specified set.
10293: *
10294: * @param set The set.
10295: * @param values The new values.
10296: */
10297: protected static final <T> void add(Set<T> set, T[] values) {
10298: for (T v : values)
10299: set.add(v);
10300: }
10301:
10302: /**
10303: * Check whether the specified set contains the specified value.
10304: *
10305: * @param set The set.
10306: * @param value The value.
10307: * @return <code>true</code> if the set contains the value.
10308: */
10309: protected static final <T> boolean contains(Set<T> set, T value) {
10310: return set.contains(value);
10311: }
10312:
10313: }
|