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:12 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.JavaFive</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 JavaFiveReader 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 fImplementation;
00051: Result fImplementation$$Star1;
00052: Result fBlock;
00053: Result fParExpression;
00054: Result fCatchClause;
00055: Result fExpression;
00056: }
00057:
00058: /** Chunk 2 of memoized results. */
00059: static final class Chunk2 {
00060: Result fConditionalExpression;
00061: Result fLogicalOrExpression;
00062: Result fRelationalExpression;
00063: Result fVariableInitializer;
00064: Result fAnnotations;
00065: Result fAnnotations$$Plus1;
00066: Result fElementValuePair;
00067: Result fElementValue;
00068: Result fResultType;
00069: Result fType;
00070: }
00071:
00072: /** Chunk 3 of memoized results. */
00073: static final class Chunk3 {
00074: Result fTypeName;
00075: Result fPrimitiveType;
00076: Result fDimensions;
00077: Result fDimensions$$Plus1;
00078: Result fTypeParameters;
00079: Result fTypeParameter;
00080: Result fTypeArguments;
00081: Result fTypeArgument;
00082: Result fTypeInstantiation;
00083: Result fQualifiedIdentifier;
00084: }
00085:
00086: /** Chunk 4 of memoized results. */
00087: static final class Chunk4 {
00088: Result fQualifiedIdentifier$$Star1;
00089: Result fIdentifier;
00090: Result fWord;
00091: Result fSymbol;
00092: }
00093:
00094: // =========================================================================
00095:
00096: /** Memoization table column. */
00097: static final class JavaFiveReaderColumn extends Column {
00098: Chunk1 chunk1;
00099: Chunk2 chunk2;
00100: Chunk3 chunk3;
00101: Chunk4 chunk4;
00102: }
00103:
00104: // =========================================================================
00105:
00106: /**
00107: * Create a new packrat parser.
00108: *
00109: * @param reader The reader.
00110: * @param file The file name.
00111: */
00112: public JavaFiveReader(final Reader reader, final String file) {
00113: super (reader, file);
00114: }
00115:
00116: /**
00117: * Create a new packrat parser.
00118: *
00119: * @param reader The file reader.
00120: * @param file The file name.
00121: * @param size The file size.
00122: */
00123: public JavaFiveReader(final Reader reader, final String file,
00124: final int size) {
00125: super (reader, file, size);
00126: }
00127:
00128: // =========================================================================
00129:
00130: protected Column newColumn() {
00131: return new JavaFiveReaderColumn();
00132: }
00133:
00134: // =========================================================================
00135:
00136: /**
00137: * Parse nonterminal xtc.lang.JavaFive.CompilationUnit.
00138: *
00139: * @param yyStart The index.
00140: * @return The result.
00141: * @throws IOException Signals an I/O error.
00142: */
00143: public Result pCompilationUnit(final int yyStart)
00144: throws IOException {
00145: int yyC;
00146: int yyIndex;
00147: Result yyResult;
00148: int yyOption1;
00149: Character yyOpValue1;
00150: Node yyValue;
00151: ParseError yyError = ParseError.DUMMY;
00152:
00153: // Alternative 1.
00154:
00155: yyResult = pCompilationUnit$$Split1(yyStart);
00156: yyError = yyResult.select(yyError);
00157: if (yyResult.hasValue()) {
00158: final Node v$pt$1 = yyResult.semanticValue();
00159:
00160: yyOption1 = yyResult.index;
00161: yyOpValue1 = null;
00162:
00163: yyC = character(yyOption1);
00164: if ('\u001a' == yyC) {
00165: yyIndex = yyOption1 + 1;
00166: final char v$el$1 = (char) yyC;
00167:
00168: yyOption1 = yyIndex;
00169: yyOpValue1 = v$el$1;
00170: }
00171: { // Start scope for v$pt$2.
00172: final Character v$pt$2 = yyOpValue1;
00173:
00174: yyResult = pEndOfFile(yyOption1);
00175: yyError = yyResult.select(yyError);
00176: if (yyResult.hasValue()) {
00177: yyValue = Formatting.after1(v$pt$1, v$pt$2);
00178:
00179: return yyResult.createValue(yyValue, yyError);
00180: }
00181: } // End scope for v$pt$2.
00182: }
00183:
00184: // Done.
00185: yyError = yyError.select("compilation unit expected", yyStart);
00186: return yyError;
00187: }
00188:
00189: // =========================================================================
00190:
00191: /**
00192: * Parse synthetic nonterminal xtc.lang.JavaFive.CompilationUnit$$Split1.
00193: *
00194: * @param yyStart The index.
00195: * @return The result.
00196: * @throws IOException Signals an I/O error.
00197: */
00198: public Result pCompilationUnit$$Split1(final int yyStart)
00199: throws IOException {
00200:
00201: Result yyResult;
00202: int yyRepetition1;
00203: Pair<Node> yyRepValue1;
00204: int yyOption1;
00205: Node yyOpValue1;
00206: Node yyValue;
00207: ParseError yyError = ParseError.DUMMY;
00208:
00209: // Alternative 1.
00210:
00211: yyResult = pSpacing(yyStart);
00212: yyError = yyResult.select(yyError);
00213: if (yyResult.hasValue()) {
00214: final Token v$pt$1 = yyResult.semanticValue();
00215:
00216: yyOption1 = yyResult.index;
00217: yyOpValue1 = null;
00218:
00219: yyResult = pPackageDeclaration(yyOption1);
00220: yyError = yyResult.select(yyError);
00221: if (yyResult.hasValue()) {
00222: final Node v$el$1 = yyResult.semanticValue();
00223:
00224: yyOption1 = yyResult.index;
00225: yyOpValue1 = v$el$1;
00226: }
00227: { // Start scope for v$pt$2.
00228: final Node v$pt$2 = yyOpValue1;
00229: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
00230:
00231: yyRepetition1 = yyOption1;
00232: yyRepValue1 = Pair.empty();
00233: while (true) {
00234:
00235: yyResult = pImportDeclaration(yyRepetition1);
00236: yyError = yyResult.select(yyError);
00237: if (yyResult.hasValue()) {
00238: final Node v$el$2 = yyResult.semanticValue();
00239:
00240: yyRepetition1 = yyResult.index;
00241: yyRepValue1 = new Pair<Node>(v$el$2,
00242: yyRepValue1);
00243: continue;
00244: }
00245: break;
00246: }
00247: { // Start scope for v$g$2.
00248: final Pair<Node> v$g$2 = yyRepValue1.reverse();
00249:
00250: yyRepValue1 = Pair.empty();
00251: while (true) {
00252:
00253: yyResult = pDeclaration(yyRepetition1);
00254: yyError = yyResult.select(yyError);
00255: if (yyResult.hasValue()) {
00256: final Node v$el$3 = yyResult
00257: .semanticValue();
00258:
00259: yyRepetition1 = yyResult.index;
00260: yyRepValue1 = new Pair<Node>(v$el$3,
00261: yyRepValue1);
00262: continue;
00263: }
00264: break;
00265: }
00266: { // Start scope for v$g$3.
00267: final Pair<Node> v$g$3 = yyRepValue1.reverse();
00268:
00269: yyValue = GNode.create("CompilationUnit",
00270: v$g$2.size() + v$g$3.size() + 1).add(
00271: v$g$1).addAll(v$g$2).addAll(v$g$3);
00272: yyValue.setLocation(location(yyStart));
00273:
00274: return new SemanticValue(yyValue,
00275: yyRepetition1, yyError);
00276: } // End scope for v$g$3.
00277: } // End scope for v$g$2.
00278: } // End scope for v$pt$2.
00279: }
00280:
00281: // Done.
00282: return yyError;
00283: }
00284:
00285: // =========================================================================
00286:
00287: /**
00288: * Parse nonterminal xtc.lang.JavaFive.PackageDeclaration.
00289: *
00290: * @param yyStart The index.
00291: * @return The result.
00292: * @throws IOException Signals an I/O error.
00293: */
00294: private Result pPackageDeclaration(final int yyStart)
00295: throws IOException {
00296: Result yyResult;
00297: int yyBase;
00298: int yyOption1;
00299: Node yyOpValue1;
00300: Node yyValue;
00301: ParseError yyError = ParseError.DUMMY;
00302:
00303: // Alternative <Declaration>.
00304:
00305: yyOption1 = yyStart;
00306: yyOpValue1 = null;
00307:
00308: yyResult = pAnnotations(yyOption1);
00309: yyError = yyResult.select(yyError);
00310: if (yyResult.hasValue()) {
00311: final Node v$el$1 = yyResult.semanticValue();
00312:
00313: yyOption1 = yyResult.index;
00314: yyOpValue1 = v$el$1;
00315: }
00316: { // Start scope for v$pt$2.
00317: final Node v$pt$2 = yyOpValue1;
00318:
00319: yyBase = yyOption1;
00320: yyResult = pWord(yyBase);
00321: yyError = yyResult.select(yyError);
00322: if (yyResult.hasValue()
00323: && ((Node) yyResult.semanticValue()).getTokenText()
00324: .equals("package")) {
00325: final Node v$pt$1 = yyResult.semanticValue();
00326: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
00327:
00328: yyResult = pQualifiedIdentifier(yyResult.index);
00329: yyError = yyResult.select(yyError);
00330: if (yyResult.hasValue()) {
00331: final Node v$pt$4 = yyResult.semanticValue();
00332:
00333: yyBase = yyResult.index;
00334: yyResult = pSymbol(yyBase);
00335: yyError = yyResult.select(yyError);
00336: if (yyResult.hasValue()
00337: && ((Node) yyResult.semanticValue())
00338: .getTokenText().equals(";")) {
00339: final Node v$pt$3 = yyResult.semanticValue();
00340: final Node v$g$2 = Formatting.after1(v$pt$4,
00341: v$pt$3);
00342:
00343: yyValue = GNode.create("PackageDeclaration",
00344: v$g$1, v$g$2);
00345: yyValue.setLocation(location(yyStart));
00346:
00347: return yyResult.createValue(yyValue, yyError);
00348: } else {
00349: yyError = yyError.select("\";\" expected",
00350: yyBase);
00351: }
00352: }
00353: } else {
00354: yyError = yyError
00355: .select("\"package\" expected", yyBase);
00356: }
00357: } // End scope for v$pt$2.
00358:
00359: // Done.
00360: return yyError;
00361: }
00362:
00363: // =========================================================================
00364:
00365: /**
00366: * Parse nonterminal xtc.lang.JavaFive.ImportDeclaration.
00367: *
00368: * @param yyStart The index.
00369: * @return The result.
00370: * @throws IOException Signals an I/O error.
00371: */
00372: private Result pImportDeclaration(final int yyStart)
00373: throws IOException {
00374: Result yyResult;
00375: int yyBase;
00376: int yyOption1;
00377: Node yyOpValue1;
00378: Node yyValue;
00379: ParseError yyError = ParseError.DUMMY;
00380:
00381: // Alternative <Declaration>.
00382:
00383: yyResult = pWord(yyStart);
00384: yyError = yyResult.select(yyError);
00385: if (yyResult.hasValue()
00386: && ((Node) yyResult.semanticValue()).getTokenText()
00387: .equals("import")) {
00388: final Node v$pt$1 = yyResult.semanticValue();
00389:
00390: yyOption1 = yyResult.index;
00391: yyOpValue1 = null;
00392:
00393: yyBase = yyOption1;
00394: yyResult = pWord(yyBase);
00395: yyError = yyResult.select(yyError);
00396: if (yyResult.hasValue()
00397: && ((Node) yyResult.semanticValue()).getTokenText()
00398: .equals("static")) {
00399: final Node v$el$1 = yyResult.semanticValue();
00400:
00401: yyOption1 = yyResult.index;
00402: yyOpValue1 = v$el$1;
00403: } else {
00404: yyError = yyError.select("\"static\" expected", yyBase);
00405: }
00406: { // Start scope for v$pt$2.
00407: final Node v$pt$2 = yyOpValue1;
00408: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
00409:
00410: yyResult = pQualifiedIdentifier(yyOption1);
00411: yyError = yyResult.select(yyError);
00412: if (yyResult.hasValue()) {
00413: final Node v$g$2 = yyResult.semanticValue();
00414:
00415: yyOption1 = yyResult.index;
00416: yyOpValue1 = null;
00417:
00418: yyResult = pDotStarTail(yyOption1);
00419: yyError = yyResult.select(yyError);
00420: if (yyResult.hasValue()) {
00421: final Node v$el$2 = yyResult.semanticValue();
00422:
00423: yyOption1 = yyResult.index;
00424: yyOpValue1 = v$el$2;
00425: }
00426: { // Start scope for v$pt$4.
00427: final Node v$pt$4 = yyOpValue1;
00428:
00429: yyBase = yyOption1;
00430: yyResult = pSymbol(yyBase);
00431: yyError = yyResult.select(yyError);
00432: if (yyResult.hasValue()
00433: && ((Node) yyResult.semanticValue())
00434: .getTokenText().equals(";")) {
00435: final Node v$pt$3 = yyResult
00436: .semanticValue();
00437: final Node v$g$3 = Formatting.after1(
00438: v$pt$4, v$pt$3);
00439:
00440: yyValue = GNode.create("ImportDeclaration",
00441: v$g$1, v$g$2, v$g$3);
00442: yyValue.setLocation(location(yyStart));
00443:
00444: return yyResult.createValue(yyValue,
00445: yyError);
00446: } else {
00447: yyError = yyError.select("\";\" expected",
00448: yyBase);
00449: }
00450: } // End scope for v$pt$4.
00451: }
00452: } // End scope for v$pt$2.
00453: }
00454:
00455: // Done.
00456: yyError = yyError
00457: .select("import declaration expected", yyStart);
00458: return yyError;
00459: }
00460:
00461: // =========================================================================
00462:
00463: /**
00464: * Parse nonterminal xtc.lang.JavaFive.DotStarTail.
00465: *
00466: * @param yyStart The index.
00467: * @return The result.
00468: * @throws IOException Signals an I/O error.
00469: */
00470: private Result pDotStarTail(final int yyStart) throws IOException {
00471: Result yyResult;
00472: int yyBase;
00473: Node yyValue;
00474: ParseError yyError = ParseError.DUMMY;
00475:
00476: // Alternative 1.
00477:
00478: yyResult = pSymbol(yyStart);
00479: yyError = yyResult.select(yyError);
00480: if (yyResult.hasValue()
00481: && ((Node) yyResult.semanticValue()).getTokenText()
00482: .equals(".")) {
00483: final Node v$pt$1 = yyResult.semanticValue();
00484:
00485: yyBase = yyResult.index;
00486: yyResult = pSymbol(yyBase);
00487: yyError = yyResult.select(yyError);
00488: if (yyResult.hasValue()
00489: && ((Node) yyResult.semanticValue()).getTokenText()
00490: .equals("*")) {
00491: final Node v$pt$2 = yyResult.semanticValue();
00492: yyValue = Formatting.before1(v$pt$1, v$pt$2);
00493:
00494: return yyResult.createValue(yyValue, yyError);
00495: } else {
00496: yyError = yyError.select("\"*\" expected", yyBase);
00497: }
00498: }
00499:
00500: // Done.
00501: yyError = yyError.select("dot star tail expected", yyStart);
00502: return yyError;
00503: }
00504:
00505: // =========================================================================
00506:
00507: /**
00508: * Parse nonterminal xtc.lang.JavaFive.Modifiers.
00509: *
00510: * @param yyStart The index.
00511: * @return The result.
00512: * @throws IOException Signals an I/O error.
00513: */
00514: private Result pModifiers(final int yyStart) throws IOException {
00515: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
00516: if (null == yyColumn.chunk1)
00517: yyColumn.chunk1 = new Chunk1();
00518: if (null == yyColumn.chunk1.fModifiers)
00519: yyColumn.chunk1.fModifiers = pModifiers$1(yyStart);
00520: return yyColumn.chunk1.fModifiers;
00521: }
00522:
00523: /** Actually parse xtc.lang.JavaFive.Modifiers. */
00524: private Result pModifiers$1(final int yyStart) throws IOException {
00525: Result yyResult;
00526: Node yyValue;
00527: ParseError yyError = ParseError.DUMMY;
00528:
00529: // Alternative 1.
00530:
00531: yyResult = pModifierList(yyStart);
00532: yyError = yyResult.select(yyError);
00533: if (yyResult.hasValue()) {
00534: final Pair<Node> v$g$1 = yyResult.semanticValue();
00535:
00536: yyValue = GNode.createFromPair("Modifiers", v$g$1);
00537: yyValue.setLocation(location(yyStart));
00538:
00539: return yyResult.createValue(yyValue, yyError);
00540: }
00541:
00542: // Done.
00543: return yyError;
00544: }
00545:
00546: // =========================================================================
00547:
00548: /**
00549: * Parse nonterminal xtc.lang.JavaFive.ModifierList.
00550: *
00551: * @param yyStart The index.
00552: * @return The result.
00553: * @throws IOException Signals an I/O error.
00554: */
00555: private Result pModifierList(final int yyStart) throws IOException {
00556: Result yyResult;
00557: int yyRepetition1;
00558: Pair<Node> yyRepValue1;
00559: Pair<Node> yyValue;
00560: ParseError yyError = ParseError.DUMMY;
00561:
00562: // Alternative 1.
00563:
00564: yyRepetition1 = yyStart;
00565: yyRepValue1 = Pair.empty();
00566: while (true) {
00567:
00568: yyResult = pModifier(yyRepetition1);
00569: yyError = yyResult.select(yyError);
00570: if (yyResult.hasValue()) {
00571: final Node v$el$1 = yyResult.semanticValue();
00572:
00573: yyRepetition1 = yyResult.index;
00574: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
00575: continue;
00576: }
00577: break;
00578: }
00579: { // Start scope for yyValue.
00580: yyValue = yyRepValue1.reverse();
00581:
00582: return new SemanticValue(yyValue, yyRepetition1, yyError);
00583: } // End scope for yyValue.
00584: }
00585:
00586: // =========================================================================
00587:
00588: /**
00589: * Parse nonterminal xtc.lang.JavaFive.Modifier.
00590: *
00591: * @param yyStart The index.
00592: * @return The result.
00593: * @throws IOException Signals an I/O error.
00594: */
00595: private Result pModifier(final int yyStart) throws IOException {
00596: Result yyResult;
00597: Node yyValue;
00598: ParseError yyError = ParseError.DUMMY;
00599:
00600: // Alternative <Annotation>.
00601:
00602: yyResult = pAnnotation(yyStart);
00603: yyError = yyResult.select(yyError);
00604: if (yyResult.hasValue()) {
00605: yyValue = yyResult.semanticValue();
00606:
00607: return yyResult.createValue(yyValue, yyError);
00608: }
00609:
00610: // Alternative <Public>.
00611:
00612: yyResult = pWord(yyStart);
00613: yyError = yyResult.select(yyError);
00614: if (yyResult.hasValue()
00615: && ((Node) yyResult.semanticValue()).getTokenText()
00616: .equals("public")) {
00617: final Node v$g$1 = yyResult.semanticValue();
00618:
00619: yyValue = GNode.create("Modifier", v$g$1);
00620: yyValue.setLocation(location(yyStart));
00621:
00622: return yyResult.createValue(yyValue, yyError);
00623: }
00624:
00625: // Alternative <Protected>.
00626:
00627: yyResult = pWord(yyStart);
00628: yyError = yyResult.select(yyError);
00629: if (yyResult.hasValue()
00630: && ((Node) yyResult.semanticValue()).getTokenText()
00631: .equals("protected")) {
00632: final Node v$g$2 = yyResult.semanticValue();
00633:
00634: yyValue = GNode.create("Modifier", v$g$2);
00635: yyValue.setLocation(location(yyStart));
00636:
00637: return yyResult.createValue(yyValue, yyError);
00638: }
00639:
00640: // Alternative <Private>.
00641:
00642: yyResult = pWord(yyStart);
00643: yyError = yyResult.select(yyError);
00644: if (yyResult.hasValue()
00645: && ((Node) yyResult.semanticValue()).getTokenText()
00646: .equals("private")) {
00647: final Node v$g$3 = yyResult.semanticValue();
00648:
00649: yyValue = GNode.create("Modifier", v$g$3);
00650: yyValue.setLocation(location(yyStart));
00651:
00652: return yyResult.createValue(yyValue, yyError);
00653: }
00654:
00655: // Alternative <Static>.
00656:
00657: yyResult = pWord(yyStart);
00658: yyError = yyResult.select(yyError);
00659: if (yyResult.hasValue()
00660: && ((Node) yyResult.semanticValue()).getTokenText()
00661: .equals("static")) {
00662: final Node v$g$4 = yyResult.semanticValue();
00663:
00664: yyValue = GNode.create("Modifier", v$g$4);
00665: yyValue.setLocation(location(yyStart));
00666:
00667: return yyResult.createValue(yyValue, yyError);
00668: }
00669:
00670: // Alternative <Abstract>.
00671:
00672: yyResult = pWord(yyStart);
00673: yyError = yyResult.select(yyError);
00674: if (yyResult.hasValue()
00675: && ((Node) yyResult.semanticValue()).getTokenText()
00676: .equals("abstract")) {
00677: final Node v$g$5 = yyResult.semanticValue();
00678:
00679: yyValue = GNode.create("Modifier", v$g$5);
00680: yyValue.setLocation(location(yyStart));
00681:
00682: return yyResult.createValue(yyValue, yyError);
00683: }
00684:
00685: // Alternative <Final>.
00686:
00687: yyResult = pWord(yyStart);
00688: yyError = yyResult.select(yyError);
00689: if (yyResult.hasValue()
00690: && ((Node) yyResult.semanticValue()).getTokenText()
00691: .equals("final")) {
00692: final Node v$g$6 = yyResult.semanticValue();
00693:
00694: yyValue = GNode.create("Modifier", v$g$6);
00695: yyValue.setLocation(location(yyStart));
00696:
00697: return yyResult.createValue(yyValue, yyError);
00698: }
00699:
00700: // Alternative <Native>.
00701:
00702: yyResult = pWord(yyStart);
00703: yyError = yyResult.select(yyError);
00704: if (yyResult.hasValue()
00705: && ((Node) yyResult.semanticValue()).getTokenText()
00706: .equals("native")) {
00707: final Node v$g$7 = yyResult.semanticValue();
00708:
00709: yyValue = GNode.create("Modifier", v$g$7);
00710: yyValue.setLocation(location(yyStart));
00711:
00712: return yyResult.createValue(yyValue, yyError);
00713: }
00714:
00715: // Alternative <Synchronized>.
00716:
00717: yyResult = pWord(yyStart);
00718: yyError = yyResult.select(yyError);
00719: if (yyResult.hasValue()
00720: && ((Node) yyResult.semanticValue()).getTokenText()
00721: .equals("synchronized")) {
00722: final Node v$g$8 = yyResult.semanticValue();
00723:
00724: yyValue = GNode.create("Modifier", v$g$8);
00725: yyValue.setLocation(location(yyStart));
00726:
00727: return yyResult.createValue(yyValue, yyError);
00728: }
00729:
00730: // Alternative <Transient>.
00731:
00732: yyResult = pWord(yyStart);
00733: yyError = yyResult.select(yyError);
00734: if (yyResult.hasValue()
00735: && ((Node) yyResult.semanticValue()).getTokenText()
00736: .equals("transient")) {
00737: final Node v$g$9 = yyResult.semanticValue();
00738:
00739: yyValue = GNode.create("Modifier", v$g$9);
00740: yyValue.setLocation(location(yyStart));
00741:
00742: return yyResult.createValue(yyValue, yyError);
00743: }
00744:
00745: // Alternative <Volatile>.
00746:
00747: yyResult = pWord(yyStart);
00748: yyError = yyResult.select(yyError);
00749: if (yyResult.hasValue()
00750: && ((Node) yyResult.semanticValue()).getTokenText()
00751: .equals("volatile")) {
00752: final Node v$g$10 = yyResult.semanticValue();
00753:
00754: yyValue = GNode.create("Modifier", v$g$10);
00755: yyValue.setLocation(location(yyStart));
00756:
00757: return yyResult.createValue(yyValue, yyError);
00758: }
00759:
00760: // Alternative <Strictfp>.
00761:
00762: yyResult = pWord(yyStart);
00763: yyError = yyResult.select(yyError);
00764: if (yyResult.hasValue()
00765: && ((Node) yyResult.semanticValue()).getTokenText()
00766: .equals("strictfp")) {
00767: final Node v$g$11 = yyResult.semanticValue();
00768:
00769: yyValue = GNode.create("Modifier", v$g$11);
00770: yyValue.setLocation(location(yyStart));
00771:
00772: return yyResult.createValue(yyValue, yyError);
00773: }
00774:
00775: // Done.
00776: yyError = yyError.select("modifier expected", yyStart);
00777: return yyError;
00778: }
00779:
00780: // =========================================================================
00781:
00782: /**
00783: * Parse nonterminal xtc.lang.JavaFive.FormalParameter.
00784: *
00785: * @param yyStart The index.
00786: * @return The result.
00787: * @throws IOException Signals an I/O error.
00788: */
00789: private Result pFormalParameter(final int yyStart)
00790: throws IOException {
00791: Result yyResult;
00792: int yyBase;
00793: int yyOption1;
00794: Node yyOpValue1;
00795: Node yyValue;
00796: ParseError yyError = ParseError.DUMMY;
00797:
00798: // Alternative <Parameter>.
00799:
00800: yyResult = pVariableModifiers(yyStart);
00801: yyError = yyResult.select(yyError);
00802: if (yyResult.hasValue()) {
00803: final Node v$g$1 = yyResult.semanticValue();
00804:
00805: yyResult = pType(yyResult.index);
00806: yyError = yyResult.select(yyError);
00807: if (yyResult.hasValue()) {
00808: final Node v$g$2 = yyResult.semanticValue();
00809:
00810: yyOption1 = yyResult.index;
00811: yyOpValue1 = null;
00812:
00813: yyBase = yyOption1;
00814: yyResult = pSymbol(yyBase);
00815: yyError = yyResult.select(yyError);
00816: if (yyResult.hasValue()
00817: && ((Node) yyResult.semanticValue())
00818: .getTokenText().equals("...")) {
00819: final Node v$el$1 = yyResult.semanticValue();
00820:
00821: yyOption1 = yyResult.index;
00822: yyOpValue1 = v$el$1;
00823: } else {
00824: yyError = yyError
00825: .select("\"...\" expected", yyBase);
00826: }
00827: { // Start scope for v$g$3.
00828: final Node v$g$3 = yyOpValue1;
00829:
00830: yyResult = pIdentifier(yyOption1);
00831: yyError = yyResult.select(yyError);
00832: if (yyResult.hasValue()) {
00833: final Node v$g$4 = yyResult.semanticValue();
00834:
00835: yyOption1 = yyResult.index;
00836: yyOpValue1 = null;
00837:
00838: yyResult = pDimensions(yyOption1);
00839: yyError = yyResult.select(yyError);
00840: if (yyResult.hasValue()) {
00841: final Node v$el$2 = yyResult
00842: .semanticValue();
00843:
00844: yyOption1 = yyResult.index;
00845: yyOpValue1 = v$el$2;
00846: }
00847: { // Start scope for v$g$5.
00848: final Node v$g$5 = yyOpValue1;
00849:
00850: yyValue = GNode.create("FormalParameter",
00851: v$g$1, v$g$2, v$g$3, v$g$4, v$g$5);
00852: yyValue.setLocation(location(yyStart));
00853:
00854: return new SemanticValue(yyValue,
00855: yyOption1, yyError);
00856: } // End scope for v$g$5.
00857: }
00858: } // End scope for v$g$3.
00859: }
00860: }
00861:
00862: // Done.
00863: return yyError;
00864: }
00865:
00866: // =========================================================================
00867:
00868: /**
00869: * Parse nonterminal xtc.lang.JavaFive.VariableModifiers.
00870: *
00871: * @param yyStart The index.
00872: * @return The result.
00873: * @throws IOException Signals an I/O error.
00874: */
00875: private Result pVariableModifiers(final int yyStart)
00876: throws IOException {
00877: Result yyResult;
00878: int yyRepetition1;
00879: Pair<Node> yyRepValue1;
00880: Node yyValue;
00881: ParseError yyError = ParseError.DUMMY;
00882:
00883: // Alternative <Modifiers>.
00884:
00885: yyRepetition1 = yyStart;
00886: yyRepValue1 = Pair.empty();
00887: while (true) {
00888:
00889: yyResult = pVariableModifier(yyRepetition1);
00890: yyError = yyResult.select(yyError);
00891: if (yyResult.hasValue()) {
00892: final Node v$el$1 = yyResult.semanticValue();
00893:
00894: yyRepetition1 = yyResult.index;
00895: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
00896: continue;
00897: }
00898: break;
00899: }
00900: { // Start scope for v$g$1.
00901: final Pair<Node> v$g$1 = yyRepValue1.reverse();
00902:
00903: yyValue = GNode.createFromPair("Modifiers", v$g$1);
00904: yyValue.setLocation(location(yyStart));
00905:
00906: return new SemanticValue(yyValue, yyRepetition1, yyError);
00907: } // End scope for v$g$1.
00908: }
00909:
00910: // =========================================================================
00911:
00912: /**
00913: * Parse nonterminal xtc.lang.JavaFive.FinalModifier.
00914: *
00915: * @param yyStart The index.
00916: * @return The result.
00917: * @throws IOException Signals an I/O error.
00918: */
00919: private Result pFinalModifier(final int yyStart) throws IOException {
00920: Result yyResult;
00921: Node yyValue;
00922: ParseError yyError = ParseError.DUMMY;
00923:
00924: // Alternative 1.
00925:
00926: yyResult = pWord(yyStart);
00927: yyError = yyResult.select(yyError);
00928: if (yyResult.hasValue()
00929: && ((Node) yyResult.semanticValue()).getTokenText()
00930: .equals("final")) {
00931: final Node v$g$1 = yyResult.semanticValue();
00932:
00933: yyValue = GNode.create("Modifier", v$g$1);
00934: yyValue.setLocation(location(yyStart));
00935:
00936: return yyResult.createValue(yyValue, yyError);
00937: }
00938:
00939: // Done.
00940: yyError = yyError.select("final modifier expected", yyStart);
00941: return yyError;
00942: }
00943:
00944: // =========================================================================
00945:
00946: /**
00947: * Parse nonterminal xtc.lang.JavaFive.FormalParameters.
00948: *
00949: * @param yyStart The index.
00950: * @return The result.
00951: * @throws IOException Signals an I/O error.
00952: */
00953: private Result pFormalParameters(final int yyStart)
00954: throws IOException {
00955: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
00956: if (null == yyColumn.chunk1)
00957: yyColumn.chunk1 = new Chunk1();
00958: if (null == yyColumn.chunk1.fFormalParameters)
00959: yyColumn.chunk1.fFormalParameters = pFormalParameters$1(yyStart);
00960: return yyColumn.chunk1.fFormalParameters;
00961: }
00962:
00963: /** Actually parse xtc.lang.JavaFive.FormalParameters. */
00964: private Result pFormalParameters$1(final int yyStart)
00965: throws IOException {
00966: Result yyResult;
00967: int yyBase;
00968: Node yyValue;
00969: ParseError yyError = ParseError.DUMMY;
00970:
00971: // Alternative 1.
00972:
00973: yyResult = pFormalParameters$$Split1(yyStart);
00974: yyError = yyResult.select(yyError);
00975: if (yyResult.hasValue()) {
00976: final Node v$pt$1 = yyResult.semanticValue();
00977:
00978: yyBase = yyResult.index;
00979: yyResult = pSymbol(yyBase);
00980: yyError = yyResult.select(yyError);
00981: if (yyResult.hasValue()
00982: && ((Node) yyResult.semanticValue()).getTokenText()
00983: .equals(")")) {
00984: final Node v$pt$2 = yyResult.semanticValue();
00985: yyValue = Formatting.after1(v$pt$1, v$pt$2);
00986:
00987: return yyResult.createValue(yyValue, yyError);
00988: } else {
00989: yyError = yyError.select("\")\" expected", yyBase);
00990: }
00991: }
00992:
00993: // Alternative 2.
00994:
00995: yyResult = pSymbol(yyStart);
00996: yyError = yyResult.select(yyError);
00997: if (yyResult.hasValue()
00998: && ((Node) yyResult.semanticValue()).getTokenText()
00999: .equals("(")) {
01000: final Node v$pt$3 = yyResult.semanticValue();
01001:
01002: yyBase = yyResult.index;
01003: yyResult = pSymbol(yyBase);
01004: yyError = yyResult.select(yyError);
01005: if (yyResult.hasValue()
01006: && ((Node) yyResult.semanticValue()).getTokenText()
01007: .equals(")")) {
01008: final Node v$pt$4 = yyResult.semanticValue();
01009:
01010: yyValue = GNode.create("FormalParameters", false);
01011: yyValue.setLocation(location(yyStart));
01012: yyValue = Formatting.variable().addNode(yyValue).add(
01013: v$pt$3).add(v$pt$4);
01014:
01015: return yyResult.createValue(yyValue, yyError);
01016: } else {
01017: yyError = yyError.select("\")\" expected", yyBase);
01018: }
01019: }
01020:
01021: // Done.
01022: yyError = yyError.select("formal parameters expected", yyStart);
01023: return yyError;
01024: }
01025:
01026: // =========================================================================
01027:
01028: /**
01029: * Parse synthetic nonterminal xtc.lang.JavaFive.FormalParameters$$Split1.
01030: *
01031: * @param yyStart The index.
01032: * @return The result.
01033: * @throws IOException Signals an I/O error.
01034: */
01035: private Result pFormalParameters$$Split1(final int yyStart)
01036: throws IOException {
01037:
01038: Result yyResult;
01039: int yyBase;
01040: int yyRepetition1;
01041: Pair<Node> yyRepValue1;
01042: Node yyValue;
01043: ParseError yyError = ParseError.DUMMY;
01044:
01045: // Alternative 1.
01046:
01047: yyResult = pSymbol(yyStart);
01048: yyError = yyResult.select(yyError);
01049: if (yyResult.hasValue()
01050: && ((Node) yyResult.semanticValue()).getTokenText()
01051: .equals("(")) {
01052: final Node v$pt$3 = yyResult.semanticValue();
01053:
01054: yyResult = pFormalParameter(yyResult.index);
01055: yyError = yyResult.select(yyError);
01056: if (yyResult.hasValue()) {
01057: final Node v$pt$4 = yyResult.semanticValue();
01058: final Node v$g$1 = Formatting.before1(v$pt$3, v$pt$4);
01059:
01060: yyRepetition1 = yyResult.index;
01061: yyRepValue1 = Pair.empty();
01062: while (true) {
01063:
01064: yyBase = yyRepetition1;
01065: yyResult = pSymbol(yyBase);
01066: yyError = yyResult.select(yyError);
01067: if (yyResult.hasValue()
01068: && ((Node) yyResult.semanticValue())
01069: .getTokenText().equals(",")) {
01070: final Node v$pt$1 = yyResult.semanticValue();
01071:
01072: yyResult = pFormalParameter(yyResult.index);
01073: yyError = yyResult.select(yyError);
01074: if (yyResult.hasValue()) {
01075: final Node v$pt$2 = yyResult
01076: .semanticValue();
01077: final Node v$el$1 = Formatting.before1(
01078: v$pt$1, v$pt$2);
01079:
01080: yyRepetition1 = yyResult.index;
01081: yyRepValue1 = new Pair<Node>(v$el$1,
01082: yyRepValue1);
01083: continue;
01084: }
01085: } else {
01086: yyError = yyError.select("\",\" expected",
01087: yyBase);
01088: }
01089: break;
01090: }
01091: { // Start scope for v$g$2.
01092: final Pair<Node> v$g$2 = yyRepValue1.reverse();
01093:
01094: yyValue = GNode.createFromPair("FormalParameters",
01095: v$g$1, v$g$2);
01096: yyValue.setLocation(location(yyStart));
01097:
01098: return new SemanticValue(yyValue, yyRepetition1,
01099: yyError);
01100: } // End scope for v$g$2.
01101: }
01102: }
01103:
01104: // Done.
01105: yyError = yyError.select("formal parameters expected", yyStart);
01106: return yyError;
01107: }
01108:
01109: // =========================================================================
01110:
01111: /**
01112: * Parse nonterminal xtc.lang.JavaFive.Declarator.
01113: *
01114: * @param yyStart The index.
01115: * @return The result.
01116: * @throws IOException Signals an I/O error.
01117: */
01118: private Result pDeclarator(final int yyStart) throws IOException {
01119: Result yyResult;
01120: int yyBase;
01121: int yyOption1;
01122: Node yyOpValue1;
01123: Node yyValue;
01124: ParseError yyError = ParseError.DUMMY;
01125:
01126: // Alternative <Declarator>.
01127:
01128: yyResult = pIdentifier(yyStart);
01129: yyError = yyResult.select(yyError);
01130: if (yyResult.hasValue()) {
01131: final Node v$g$1 = yyResult.semanticValue();
01132:
01133: yyOption1 = yyResult.index;
01134: yyOpValue1 = null;
01135:
01136: yyResult = pDimensions(yyOption1);
01137: yyError = yyResult.select(yyError);
01138: if (yyResult.hasValue()) {
01139: final Node v$el$1 = yyResult.semanticValue();
01140:
01141: yyOption1 = yyResult.index;
01142: yyOpValue1 = v$el$1;
01143: }
01144: { // Start scope for v$g$2.
01145: final Node v$g$2 = yyOpValue1;
01146:
01147: yyOpValue1 = null;
01148:
01149: yyBase = yyOption1;
01150: yyResult = pSymbol(yyBase);
01151: yyError = yyResult.select(yyError);
01152: if (yyResult.hasValue()
01153: && ((Node) yyResult.semanticValue())
01154: .getTokenText().equals("=")) {
01155: final Node v$pt$1 = yyResult.semanticValue();
01156:
01157: yyResult = pVariableInitializer(yyResult.index);
01158: yyError = yyResult.select(yyError);
01159: if (yyResult.hasValue()) {
01160: final Node v$pt$2 = yyResult.semanticValue();
01161: final Node v$el$2 = Formatting.before1(v$pt$1,
01162: v$pt$2);
01163:
01164: yyOption1 = yyResult.index;
01165: yyOpValue1 = v$el$2;
01166: }
01167: } else {
01168: yyError = yyError.select("\"=\" expected", yyBase);
01169: }
01170: { // Start scope for v$g$3.
01171: final Node v$g$3 = yyOpValue1;
01172:
01173: yyValue = GNode.create("Declarator", v$g$1, v$g$2,
01174: v$g$3);
01175: yyValue.setLocation(location(yyStart));
01176:
01177: return new SemanticValue(yyValue, yyOption1,
01178: yyError);
01179: } // End scope for v$g$3.
01180: } // End scope for v$g$2.
01181: }
01182:
01183: // Done.
01184: return yyError;
01185: }
01186:
01187: // =========================================================================
01188:
01189: /**
01190: * Parse nonterminal xtc.lang.JavaFive.Declarators.
01191: *
01192: * @param yyStart The index.
01193: * @return The result.
01194: * @throws IOException Signals an I/O error.
01195: */
01196: private Result pDeclarators(final int yyStart) throws IOException {
01197: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
01198: if (null == yyColumn.chunk1)
01199: yyColumn.chunk1 = new Chunk1();
01200: if (null == yyColumn.chunk1.fDeclarators)
01201: yyColumn.chunk1.fDeclarators = pDeclarators$1(yyStart);
01202: return yyColumn.chunk1.fDeclarators;
01203: }
01204:
01205: /** Actually parse xtc.lang.JavaFive.Declarators. */
01206: private Result pDeclarators$1(final int yyStart) throws IOException {
01207: Result yyResult;
01208: Node yyValue;
01209: ParseError yyError = ParseError.DUMMY;
01210:
01211: // Alternative 1.
01212:
01213: yyResult = pDeclarator(yyStart);
01214: yyError = yyResult.select(yyError);
01215: if (yyResult.hasValue()) {
01216: final Node v$g$1 = yyResult.semanticValue();
01217:
01218: yyResult = pDeclarators$$Star1(yyResult.index);
01219: yyError = yyResult.select(yyError);
01220: if (yyResult.hasValue()) {
01221: final Pair<Node> v$g$2 = yyResult.semanticValue();
01222:
01223: yyValue = GNode.createFromPair("Declarators", v$g$1,
01224: v$g$2);
01225: yyValue.setLocation(location(yyStart));
01226:
01227: return yyResult.createValue(yyValue, yyError);
01228: }
01229: }
01230:
01231: // Done.
01232: return yyError;
01233: }
01234:
01235: // =========================================================================
01236:
01237: /**
01238: * Parse synthetic nonterminal xtc.lang.JavaFive.Declarators$$Star1.
01239: *
01240: * @param yyStart The index.
01241: * @return The result.
01242: * @throws IOException Signals an I/O error.
01243: */
01244: private Result pDeclarators$$Star1(final int yyStart)
01245: throws IOException {
01246: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
01247: if (null == yyColumn.chunk1)
01248: yyColumn.chunk1 = new Chunk1();
01249: if (null == yyColumn.chunk1.fDeclarators$$Star1)
01250: yyColumn.chunk1.fDeclarators$$Star1 = pDeclarators$$Star1$1(yyStart);
01251: return yyColumn.chunk1.fDeclarators$$Star1;
01252: }
01253:
01254: /** Actually parse xtc.lang.JavaFive.Declarators$$Star1. */
01255: private Result pDeclarators$$Star1$1(final int yyStart)
01256: throws IOException {
01257: Result yyResult;
01258: Pair<Node> yyValue;
01259: ParseError yyError = ParseError.DUMMY;
01260:
01261: // Alternative 1.
01262:
01263: yyResult = pSymbol(yyStart);
01264: yyError = yyResult.select(yyError);
01265: if (yyResult.hasValue()
01266: && ((Node) yyResult.semanticValue()).getTokenText()
01267: .equals(",")) {
01268: final Node v$pt$1 = yyResult.semanticValue();
01269:
01270: yyResult = pDeclarator(yyResult.index);
01271: yyError = yyResult.select(yyError);
01272: if (yyResult.hasValue()) {
01273: final Node v$pt$2 = yyResult.semanticValue();
01274: final Node v$el$1 = Formatting.before1(v$pt$1, v$pt$2);
01275:
01276: yyResult = pDeclarators$$Star1(yyResult.index);
01277: yyError = yyResult.select(yyError);
01278: if (yyResult.hasValue()) {
01279: final Pair<Node> v$2 = yyResult.semanticValue();
01280:
01281: yyValue = new Pair<Node>(v$el$1, v$2);
01282:
01283: return yyResult.createValue(yyValue, yyError);
01284: }
01285: }
01286: }
01287:
01288: // Alternative 2.
01289:
01290: yyValue = Pair.empty();
01291:
01292: return new SemanticValue(yyValue, yyStart, yyError);
01293: }
01294:
01295: // =========================================================================
01296:
01297: /**
01298: * Parse nonterminal xtc.lang.JavaFive.ClassBody.
01299: *
01300: * @param yyStart The index.
01301: * @return The result.
01302: * @throws IOException Signals an I/O error.
01303: */
01304: private Result pClassBody(final int yyStart) throws IOException {
01305: Result yyResult;
01306: int yyBase;
01307: Node yyValue;
01308: ParseError yyError = ParseError.DUMMY;
01309:
01310: // Alternative <Body>.
01311:
01312: yyResult = pSymbol(yyStart);
01313: yyError = yyResult.select(yyError);
01314: if (yyResult.hasValue()
01315: && ((Node) yyResult.semanticValue()).getTokenText()
01316: .equals("{")) {
01317: final Node v$pt$1 = yyResult.semanticValue();
01318:
01319: yyResult = pClassBody$$Split1(yyResult.index);
01320: yyError = yyResult.select(yyError);
01321: if (yyResult.hasValue()) {
01322: final Node v$pt$2 = yyResult.semanticValue();
01323:
01324: yyBase = yyResult.index;
01325: yyResult = pSymbol(yyBase);
01326: yyError = yyResult.select(yyError);
01327: if (yyResult.hasValue()
01328: && ((Node) yyResult.semanticValue())
01329: .getTokenText().equals("}")) {
01330: final Node v$pt$3 = yyResult.semanticValue();
01331: yyValue = Formatting.round1(v$pt$1, v$pt$2, v$pt$3);
01332:
01333: return yyResult.createValue(yyValue, yyError);
01334: } else {
01335: yyError = yyError.select("\"}\" expected", yyBase);
01336: }
01337: }
01338: }
01339:
01340: // Done.
01341: yyError = yyError.select("class body expected", yyStart);
01342: return yyError;
01343: }
01344:
01345: // =========================================================================
01346:
01347: /**
01348: * Parse synthetic nonterminal xtc.lang.JavaFive.ClassBody$$Split1.
01349: *
01350: * @param yyStart The index.
01351: * @return The result.
01352: * @throws IOException Signals an I/O error.
01353: */
01354: private Result pClassBody$$Split1(final int yyStart)
01355: throws IOException {
01356: Result yyResult;
01357: int yyRepetition1;
01358: Pair<Node> yyRepValue1;
01359: Node yyValue;
01360: ParseError yyError = ParseError.DUMMY;
01361:
01362: // Alternative <Body>.
01363:
01364: yyRepetition1 = yyStart;
01365: yyRepValue1 = Pair.empty();
01366: while (true) {
01367:
01368: yyResult = pDeclaration(yyRepetition1);
01369: yyError = yyResult.select(yyError);
01370: if (yyResult.hasValue()) {
01371: final Node v$el$1 = yyResult.semanticValue();
01372:
01373: yyRepetition1 = yyResult.index;
01374: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
01375: continue;
01376: }
01377: break;
01378: }
01379: { // Start scope for v$g$1.
01380: final Pair<Node> v$g$1 = yyRepValue1.reverse();
01381:
01382: yyValue = GNode.createFromPair("ClassBody", v$g$1);
01383: yyValue.setLocation(location(yyStart));
01384:
01385: return new SemanticValue(yyValue, yyRepetition1, yyError);
01386: } // End scope for v$g$1.
01387: }
01388:
01389: // =========================================================================
01390:
01391: /**
01392: * Parse nonterminal xtc.lang.JavaFive.Declaration.
01393: *
01394: * @param yyStart The index.
01395: * @return The result.
01396: * @throws IOException Signals an I/O error.
01397: */
01398: private Result pDeclaration(final int yyStart) throws IOException {
01399: Result yyResult;
01400: int yyBase;
01401: int yyOption1;
01402: Node yyOpValue1;
01403: Node yyValue;
01404: ParseError yyError = ParseError.DUMMY;
01405:
01406: // Alternative 1.
01407:
01408: yyResult = pModifiers(yyStart);
01409: yyError = yyResult.select(yyError);
01410: if (yyResult.hasValue()) {
01411: final Node v$g$1 = yyResult.semanticValue();
01412:
01413: final int yyChoice1 = yyResult.index;
01414:
01415: // Nested alternative 1.
01416:
01417: yyResult = pType(yyChoice1);
01418: yyError = yyResult.select(yyError);
01419: if (yyResult.hasValue()) {
01420: final Node v$g$2 = yyResult.semanticValue();
01421:
01422: yyResult = pDeclarators(yyResult.index);
01423: yyError = yyResult.select(yyError);
01424: if (yyResult.hasValue()) {
01425: final Node v$pt$2 = yyResult.semanticValue();
01426:
01427: yyBase = yyResult.index;
01428: yyResult = pSymbol(yyBase);
01429: yyError = yyResult.select(yyError);
01430: if (yyResult.hasValue()
01431: && ((Node) yyResult.semanticValue())
01432: .getTokenText().equals(";")) {
01433: final Node v$pt$1 = yyResult.semanticValue();
01434: final Node v$g$3 = Formatting.after1(v$pt$2,
01435: v$pt$1);
01436:
01437: yyValue = GNode.create("FieldDeclaration",
01438: v$g$1, v$g$2, v$g$3);
01439: yyValue.setLocation(location(yyStart));
01440:
01441: return yyResult.createValue(yyValue, yyError);
01442: } else {
01443: yyError = yyError.select("\";\" expected",
01444: yyBase);
01445: }
01446: }
01447: }
01448:
01449: // Nested alternative 2.
01450:
01451: yyOption1 = yyChoice1;
01452: yyOpValue1 = null;
01453:
01454: yyResult = pTypeParameters(yyOption1);
01455: yyError = yyResult.select(yyError);
01456: if (yyResult.hasValue()) {
01457: final Node v$el$1 = yyResult.semanticValue();
01458:
01459: yyOption1 = yyResult.index;
01460: yyOpValue1 = v$el$1;
01461: }
01462: { // Start scope for v$g$2.
01463: final Node v$g$2 = yyOpValue1;
01464:
01465: final int yyChoice2 = yyOption1;
01466:
01467: // Nested alternative 1.
01468:
01469: yyResult = pResultType(yyChoice2);
01470: yyError = yyResult.select(yyError);
01471: if (yyResult.hasValue()) {
01472: final Node v$g$3 = yyResult.semanticValue();
01473:
01474: yyResult = pIdentifier(yyResult.index);
01475: yyError = yyResult.select(yyError);
01476: if (yyResult.hasValue()) {
01477: final Node v$g$4 = yyResult.semanticValue();
01478:
01479: yyResult = pFormalParameters(yyResult.index);
01480: yyError = yyResult.select(yyError);
01481: if (yyResult.hasValue()) {
01482: final Node v$g$5 = yyResult.semanticValue();
01483:
01484: yyOption1 = yyResult.index;
01485: yyOpValue1 = null;
01486:
01487: yyResult = pDimensions(yyOption1);
01488: yyError = yyResult.select(yyError);
01489: if (yyResult.hasValue()) {
01490: final Node v$el$2 = yyResult
01491: .semanticValue();
01492:
01493: yyOption1 = yyResult.index;
01494: yyOpValue1 = v$el$2;
01495: }
01496: { // Start scope for v$g$6.
01497: final Node v$g$6 = yyOpValue1;
01498:
01499: yyOpValue1 = null;
01500:
01501: yyResult = pThrowsClause(yyOption1);
01502: yyError = yyResult.select(yyError);
01503: if (yyResult.hasValue()) {
01504: final Node v$el$3 = yyResult
01505: .semanticValue();
01506:
01507: yyOption1 = yyResult.index;
01508: yyOpValue1 = v$el$3;
01509: }
01510: { // Start scope for v$g$7.
01511: final Node v$g$7 = yyOpValue1;
01512:
01513: final int yyChoice3 = yyOption1;
01514:
01515: // Nested alternative 1.
01516:
01517: yyResult = pBlock(yyChoice3);
01518: yyError = yyResult.select(yyError);
01519: if (yyResult.hasValue()) {
01520: final Node v$g$8 = yyResult
01521: .semanticValue();
01522:
01523: yyValue = GNode.create(
01524: "MethodDeclaration",
01525: v$g$1, v$g$2, v$g$3,
01526: v$g$4, v$g$5, v$g$6,
01527: v$g$7, v$g$8);
01528: yyValue
01529: .setLocation(location(yyStart));
01530:
01531: return yyResult.createValue(
01532: yyValue, yyError);
01533: }
01534:
01535: // Nested alternative 2.
01536:
01537: yyBase = yyChoice3;
01538: yyResult = pSymbol(yyBase);
01539: yyError = yyResult.select(yyError);
01540: if (yyResult.hasValue()
01541: && ((Node) yyResult
01542: .semanticValue())
01543: .getTokenText()
01544: .equals(";")) {
01545: final Node v$pt$1 = yyResult
01546: .semanticValue();
01547: final Node v$g$9 = Formatting
01548: .after1(null, v$pt$1);
01549:
01550: yyValue = GNode.create(
01551: "MethodDeclaration",
01552: v$g$1, v$g$2, v$g$3,
01553: v$g$4, v$g$5, v$g$6,
01554: v$g$7, v$g$9);
01555: yyValue
01556: .setLocation(location(yyStart));
01557:
01558: return yyResult.createValue(
01559: yyValue, yyError);
01560: } else {
01561: yyError = yyError.select(
01562: "\";\" expected",
01563: yyBase);
01564: }
01565: } // End scope for v$g$7.
01566: } // End scope for v$g$6.
01567: }
01568: }
01569: }
01570:
01571: // Nested alternative 2.
01572:
01573: yyResult = pIdentifier(yyChoice2);
01574: yyError = yyResult.select(yyError);
01575: if (yyResult.hasValue()) {
01576: final Node v$g$3 = yyResult.semanticValue();
01577:
01578: yyResult = pFormalParameters(yyResult.index);
01579: yyError = yyResult.select(yyError);
01580: if (yyResult.hasValue()) {
01581: final Node v$g$4 = yyResult.semanticValue();
01582:
01583: yyOption1 = yyResult.index;
01584: yyOpValue1 = null;
01585:
01586: yyResult = pThrowsClause(yyOption1);
01587: yyError = yyResult.select(yyError);
01588: if (yyResult.hasValue()) {
01589: final Node v$el$2 = yyResult
01590: .semanticValue();
01591:
01592: yyOption1 = yyResult.index;
01593: yyOpValue1 = v$el$2;
01594: }
01595: { // Start scope for v$g$5.
01596: final Node v$g$5 = yyOpValue1;
01597:
01598: yyResult = pBlock(yyOption1);
01599: yyError = yyResult.select(yyError);
01600: if (yyResult.hasValue()) {
01601: final Node v$g$6 = yyResult
01602: .semanticValue();
01603:
01604: yyValue = GNode.create(
01605: "ConstructorDeclaration",
01606: v$g$1, v$g$2, v$g$3, v$g$4,
01607: v$g$5, v$g$6);
01608: yyValue.setLocation(location(yyStart));
01609:
01610: return yyResult.createValue(yyValue,
01611: yyError);
01612: }
01613: } // End scope for v$g$5.
01614: }
01615: }
01616: } // End scope for v$g$2.
01617: }
01618:
01619: // Alternative 2.
01620:
01621: yyResult = pModifiers(yyStart);
01622: yyError = yyResult.select(yyError);
01623: if (yyResult.hasValue()) {
01624: final Node v$pt$2 = yyResult.semanticValue();
01625:
01626: final int yyChoice1 = yyResult.index;
01627:
01628: // Nested alternative 1.
01629:
01630: yyBase = yyChoice1;
01631: yyResult = pWord(yyBase);
01632: yyError = yyResult.select(yyError);
01633: if (yyResult.hasValue()
01634: && ((Node) yyResult.semanticValue()).getTokenText()
01635: .equals("class")) {
01636: final Node v$pt$1 = yyResult.semanticValue();
01637: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
01638:
01639: yyResult = pIdentifier(yyResult.index);
01640: yyError = yyResult.select(yyError);
01641: if (yyResult.hasValue()) {
01642: final Node v$g$2 = yyResult.semanticValue();
01643:
01644: yyOption1 = yyResult.index;
01645: yyOpValue1 = null;
01646:
01647: yyResult = pTypeParameters(yyOption1);
01648: yyError = yyResult.select(yyError);
01649: if (yyResult.hasValue()) {
01650: final Node v$el$1 = yyResult.semanticValue();
01651:
01652: yyOption1 = yyResult.index;
01653: yyOpValue1 = v$el$1;
01654: }
01655: { // Start scope for v$g$3.
01656: final Node v$g$3 = yyOpValue1;
01657:
01658: yyOpValue1 = null;
01659:
01660: yyResult = pExtension(yyOption1);
01661: yyError = yyResult.select(yyError);
01662: if (yyResult.hasValue()) {
01663: final Node v$el$2 = yyResult
01664: .semanticValue();
01665:
01666: yyOption1 = yyResult.index;
01667: yyOpValue1 = v$el$2;
01668: }
01669: { // Start scope for v$g$4.
01670: final Node v$g$4 = yyOpValue1;
01671:
01672: yyOpValue1 = null;
01673:
01674: yyResult = pImplementation(yyOption1);
01675: yyError = yyResult.select(yyError);
01676: if (yyResult.hasValue()) {
01677: final Node v$el$3 = yyResult
01678: .semanticValue();
01679:
01680: yyOption1 = yyResult.index;
01681: yyOpValue1 = v$el$3;
01682: }
01683: { // Start scope for v$g$5.
01684: final Node v$g$5 = yyOpValue1;
01685:
01686: yyResult = pClassBody(yyOption1);
01687: yyError = yyResult.select(yyError);
01688: if (yyResult.hasValue()) {
01689: final Node v$g$6 = yyResult
01690: .semanticValue();
01691:
01692: yyValue = GNode.create(
01693: "ClassDeclaration", v$g$1,
01694: v$g$2, v$g$3, v$g$4, v$g$5,
01695: v$g$6);
01696: yyValue
01697: .setLocation(location(yyStart));
01698:
01699: return yyResult.createValue(
01700: yyValue, yyError);
01701: }
01702: } // End scope for v$g$5.
01703: } // End scope for v$g$4.
01704: } // End scope for v$g$3.
01705: }
01706: } else {
01707: yyError = yyError.select("\"class\" expected", yyBase);
01708: }
01709:
01710: // Nested alternative 2.
01711:
01712: yyBase = yyChoice1;
01713: yyResult = pWord(yyBase);
01714: yyError = yyResult.select(yyError);
01715: if (yyResult.hasValue()
01716: && ((Node) yyResult.semanticValue()).getTokenText()
01717: .equals("interface")) {
01718: final Node v$pt$1 = yyResult.semanticValue();
01719: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
01720:
01721: yyResult = pIdentifier(yyResult.index);
01722: yyError = yyResult.select(yyError);
01723: if (yyResult.hasValue()) {
01724: final Node v$g$2 = yyResult.semanticValue();
01725:
01726: yyOption1 = yyResult.index;
01727: yyOpValue1 = null;
01728:
01729: yyResult = pTypeParameters(yyOption1);
01730: yyError = yyResult.select(yyError);
01731: if (yyResult.hasValue()) {
01732: final Node v$el$1 = yyResult.semanticValue();
01733:
01734: yyOption1 = yyResult.index;
01735: yyOpValue1 = v$el$1;
01736: }
01737: { // Start scope for v$g$3.
01738: final Node v$g$3 = yyOpValue1;
01739:
01740: yyOpValue1 = null;
01741:
01742: yyResult = pExtension(yyOption1);
01743: yyError = yyResult.select(yyError);
01744: if (yyResult.hasValue()) {
01745: final Node v$el$2 = yyResult
01746: .semanticValue();
01747:
01748: yyOption1 = yyResult.index;
01749: yyOpValue1 = v$el$2;
01750: }
01751: { // Start scope for v$g$4.
01752: final Node v$g$4 = yyOpValue1;
01753:
01754: yyResult = pClassBody(yyOption1);
01755: yyError = yyResult.select(yyError);
01756: if (yyResult.hasValue()) {
01757: final Node v$g$5 = yyResult
01758: .semanticValue();
01759:
01760: yyValue = GNode.create(
01761: "InterfaceDeclaration", v$g$1,
01762: v$g$2, v$g$3, v$g$4, v$g$5);
01763: yyValue.setLocation(location(yyStart));
01764:
01765: return yyResult.createValue(yyValue,
01766: yyError);
01767: }
01768: } // End scope for v$g$4.
01769: } // End scope for v$g$3.
01770: }
01771: } else {
01772: yyError = yyError.select("\"interface\" expected",
01773: yyBase);
01774: }
01775: }
01776:
01777: // Alternative <Declaration>.
01778:
01779: yyResult = pModifiers(yyStart);
01780: yyError = yyResult.select(yyError);
01781: if (yyResult.hasValue()) {
01782: final Node v$pt$3 = yyResult.semanticValue();
01783:
01784: yyBase = yyResult.index;
01785: yyResult = pSymbol(yyBase);
01786: yyError = yyResult.select(yyError);
01787: if (yyResult.hasValue()
01788: && ((Node) yyResult.semanticValue()).getTokenText()
01789: .equals("@")) {
01790: final Node v$pt$1 = yyResult.semanticValue();
01791:
01792: yyBase = yyResult.index;
01793: yyResult = pWord(yyBase);
01794: yyError = yyResult.select(yyError);
01795: if (yyResult.hasValue()
01796: && ((Node) yyResult.semanticValue())
01797: .getTokenText().equals("interface")) {
01798: final Node v$pt$2 = yyResult.semanticValue();
01799: final Node v$g$1 = Formatting.variable().addNode(
01800: v$pt$3).add(v$pt$1).add(v$pt$2);
01801:
01802: yyResult = pIdentifier(yyResult.index);
01803: yyError = yyResult.select(yyError);
01804: if (yyResult.hasValue()) {
01805: final Node v$g$2 = yyResult.semanticValue();
01806:
01807: yyResult = pAnnotationBody(yyResult.index);
01808: yyError = yyResult.select(yyError);
01809: if (yyResult.hasValue()) {
01810: final Node v$g$3 = yyResult.semanticValue();
01811:
01812: yyValue = GNode.create(
01813: "AnnotationDeclaration", v$g$1,
01814: v$g$2, v$g$3);
01815: yyValue.setLocation(location(yyStart));
01816:
01817: return yyResult.createValue(yyValue,
01818: yyError);
01819: }
01820: }
01821: } else {
01822: yyError = yyError.select("\"interface\" expected",
01823: yyBase);
01824: }
01825: } else {
01826: yyError = yyError.select("\"@\" expected", yyBase);
01827: }
01828: }
01829:
01830: // Alternative <Declaration>.
01831:
01832: yyResult = pModifiers(yyStart);
01833: yyError = yyResult.select(yyError);
01834: if (yyResult.hasValue()) {
01835: final Node v$pt$2 = yyResult.semanticValue();
01836:
01837: yyBase = yyResult.index;
01838: yyResult = pWord(yyBase);
01839: yyError = yyResult.select(yyError);
01840: if (yyResult.hasValue()
01841: && ((Node) yyResult.semanticValue()).getTokenText()
01842: .equals("enum")) {
01843: final Node v$pt$1 = yyResult.semanticValue();
01844: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
01845:
01846: yyResult = pIdentifier(yyResult.index);
01847: yyError = yyResult.select(yyError);
01848: if (yyResult.hasValue()) {
01849: final Node v$g$2 = yyResult.semanticValue();
01850:
01851: yyOption1 = yyResult.index;
01852: yyOpValue1 = null;
01853:
01854: yyResult = pImplementation(yyOption1);
01855: yyError = yyResult.select(yyError);
01856: if (yyResult.hasValue()) {
01857: final Node v$el$1 = yyResult.semanticValue();
01858:
01859: yyOption1 = yyResult.index;
01860: yyOpValue1 = v$el$1;
01861: }
01862: { // Start scope for v$pt$4.
01863: final Node v$pt$4 = yyOpValue1;
01864:
01865: yyBase = yyOption1;
01866: yyResult = pSymbol(yyBase);
01867: yyError = yyResult.select(yyError);
01868: if (yyResult.hasValue()
01869: && ((Node) yyResult.semanticValue())
01870: .getTokenText().equals("{")) {
01871: final Node v$pt$3 = yyResult
01872: .semanticValue();
01873: final Node v$g$3 = Formatting.after1(
01874: v$pt$4, v$pt$3);
01875:
01876: yyOption1 = yyResult.index;
01877: yyOpValue1 = null;
01878:
01879: yyResult = pEnumConstants(yyOption1);
01880: yyError = yyResult.select(yyError);
01881: if (yyResult.hasValue()) {
01882: final Node v$el$2 = yyResult
01883: .semanticValue();
01884:
01885: yyOption1 = yyResult.index;
01886: yyOpValue1 = v$el$2;
01887: }
01888: { // Start scope for v$pt$6.
01889: final Node v$pt$6 = yyOpValue1;
01890:
01891: yyOpValue1 = null;
01892:
01893: yyBase = yyOption1;
01894: yyResult = pSymbol(yyBase);
01895: yyError = yyResult.select(yyError);
01896: if (yyResult.hasValue()
01897: && ((Node) yyResult
01898: .semanticValue())
01899: .getTokenText().equals(
01900: ",")) {
01901: final Node v$el$3 = yyResult
01902: .semanticValue();
01903:
01904: yyOption1 = yyResult.index;
01905: yyOpValue1 = v$el$3;
01906: } else {
01907: yyError = yyError.select(
01908: "\",\" expected", yyBase);
01909: }
01910: { // Start scope for v$pt$5.
01911: final Node v$pt$5 = yyOpValue1;
01912: final Node v$g$4 = Formatting
01913: .after1(v$pt$6, v$pt$5);
01914:
01915: yyOpValue1 = null;
01916:
01917: yyResult = pEnumMembers(yyOption1);
01918: yyError = yyResult.select(yyError);
01919: if (yyResult.hasValue()) {
01920: final Node v$el$4 = yyResult
01921: .semanticValue();
01922:
01923: yyOption1 = yyResult.index;
01924: yyOpValue1 = v$el$4;
01925: }
01926: { // Start scope for v$pt$8.
01927: final Node v$pt$8 = yyOpValue1;
01928:
01929: yyBase = yyOption1;
01930: yyResult = pSymbol(yyBase);
01931: yyError = yyResult
01932: .select(yyError);
01933: if (yyResult.hasValue()
01934: && ((Node) yyResult
01935: .semanticValue())
01936: .getTokenText()
01937: .equals("}")) {
01938: final Node v$pt$7 = yyResult
01939: .semanticValue();
01940: final Node v$g$5 = Formatting
01941: .after1(v$pt$8,
01942: v$pt$7);
01943:
01944: yyValue = GNode
01945: .create(
01946: "EnumDeclaration",
01947: v$g$1,
01948: v$g$2,
01949: v$g$3,
01950: v$g$4,
01951: v$g$5);
01952: yyValue
01953: .setLocation(location(yyStart));
01954:
01955: return yyResult
01956: .createValue(
01957: yyValue,
01958: yyError);
01959: } else {
01960: yyError = yyError.select(
01961: "\"}\" expected",
01962: yyBase);
01963: }
01964: } // End scope for v$pt$8.
01965: } // End scope for v$pt$5.
01966: } // End scope for v$pt$6.
01967: } else {
01968: yyError = yyError.select("\"{\" expected",
01969: yyBase);
01970: }
01971: } // End scope for v$pt$4.
01972: }
01973: } else {
01974: yyError = yyError.select("\"enum\" expected", yyBase);
01975: }
01976: }
01977:
01978: // Alternative 5.
01979:
01980: yyOption1 = yyStart;
01981: yyOpValue1 = null;
01982:
01983: yyBase = yyOption1;
01984: yyResult = pWord(yyBase);
01985: yyError = yyResult.select(yyError);
01986: if (yyResult.hasValue()
01987: && ((Node) yyResult.semanticValue()).getTokenText()
01988: .equals("static")) {
01989: final Node v$el$1 = yyResult.semanticValue();
01990:
01991: yyOption1 = yyResult.index;
01992: yyOpValue1 = v$el$1;
01993: } else {
01994: yyError = yyError.select("\"static\" expected", yyBase);
01995: }
01996: { // Start scope for v$g$1.
01997: final Node v$g$1 = yyOpValue1;
01998:
01999: yyResult = pBlock(yyOption1);
02000: yyError = yyResult.select(yyError);
02001: if (yyResult.hasValue()) {
02002: final Node v$g$2 = yyResult.semanticValue();
02003:
02004: yyValue = GNode
02005: .create("BlockDeclaration", v$g$1, v$g$2);
02006: yyValue.setLocation(location(yyStart));
02007:
02008: return yyResult.createValue(yyValue, yyError);
02009: }
02010: } // End scope for v$g$1.
02011:
02012: // Alternative 6.
02013:
02014: yyResult = pSymbol(yyStart);
02015: yyError = yyResult.select(yyError);
02016: if (yyResult.hasValue()
02017: && ((Node) yyResult.semanticValue()).getTokenText()
02018: .equals(";")) {
02019: final Node v$pt$1 = yyResult.semanticValue();
02020:
02021: yyValue = GNode.create("EmptyDeclaration", false);
02022: yyValue.setLocation(location(yyStart));
02023: yyValue = Formatting.after1(yyValue, v$pt$1);
02024:
02025: return yyResult.createValue(yyValue, yyError);
02026: }
02027:
02028: // Done.
02029: yyError = yyError.select("declaration expected", yyStart);
02030: return yyError;
02031: }
02032:
02033: // =========================================================================
02034:
02035: /**
02036: * Parse nonterminal xtc.lang.JavaFive.ThrowsClause.
02037: *
02038: * @param yyStart The index.
02039: * @return The result.
02040: * @throws IOException Signals an I/O error.
02041: */
02042: private Result pThrowsClause(final int yyStart) throws IOException {
02043: Result yyResult;
02044: int yyBase;
02045: int yyRepetition1;
02046: Pair<Node> yyRepValue1;
02047: Node yyValue;
02048: ParseError yyError = ParseError.DUMMY;
02049:
02050: // Alternative 1.
02051:
02052: yyResult = pWord(yyStart);
02053: yyError = yyResult.select(yyError);
02054: if (yyResult.hasValue()
02055: && ((Node) yyResult.semanticValue()).getTokenText()
02056: .equals("throws")) {
02057: final Node v$pt$3 = yyResult.semanticValue();
02058:
02059: yyResult = pQualifiedIdentifier(yyResult.index);
02060: yyError = yyResult.select(yyError);
02061: if (yyResult.hasValue()) {
02062: final Node v$pt$4 = yyResult.semanticValue();
02063: final Node v$g$1 = Formatting.before1(v$pt$3, v$pt$4);
02064:
02065: yyRepetition1 = yyResult.index;
02066: yyRepValue1 = Pair.empty();
02067: while (true) {
02068:
02069: yyBase = yyRepetition1;
02070: yyResult = pSymbol(yyBase);
02071: yyError = yyResult.select(yyError);
02072: if (yyResult.hasValue()
02073: && ((Node) yyResult.semanticValue())
02074: .getTokenText().equals(",")) {
02075: final Node v$pt$1 = yyResult.semanticValue();
02076:
02077: yyResult = pQualifiedIdentifier(yyResult.index);
02078: yyError = yyResult.select(yyError);
02079: if (yyResult.hasValue()) {
02080: final Node v$pt$2 = yyResult
02081: .semanticValue();
02082: final Node v$el$1 = Formatting.before1(
02083: v$pt$1, v$pt$2);
02084:
02085: yyRepetition1 = yyResult.index;
02086: yyRepValue1 = new Pair<Node>(v$el$1,
02087: yyRepValue1);
02088: continue;
02089: }
02090: } else {
02091: yyError = yyError.select("\",\" expected",
02092: yyBase);
02093: }
02094: break;
02095: }
02096: { // Start scope for v$g$2.
02097: final Pair<Node> v$g$2 = yyRepValue1.reverse();
02098:
02099: yyValue = GNode.createFromPair("ThrowsClause",
02100: v$g$1, v$g$2);
02101: yyValue.setLocation(location(yyStart));
02102:
02103: return new SemanticValue(yyValue, yyRepetition1,
02104: yyError);
02105: } // End scope for v$g$2.
02106: }
02107: }
02108:
02109: // Done.
02110: yyError = yyError.select("throws clause expected", yyStart);
02111: return yyError;
02112: }
02113:
02114: // =========================================================================
02115:
02116: /**
02117: * Parse nonterminal xtc.lang.JavaFive.Extension.
02118: *
02119: * @param yyStart The index.
02120: * @return The result.
02121: * @throws IOException Signals an I/O error.
02122: */
02123: private Result pExtension(final int yyStart) throws IOException {
02124: Result yyResult;
02125: int yyBase;
02126: int yyRepetition1;
02127: Pair<Node> yyRepValue1;
02128: Node yyValue;
02129: ParseError yyError = ParseError.DUMMY;
02130:
02131: // Alternative 1.
02132:
02133: yyResult = pWord(yyStart);
02134: yyError = yyResult.select(yyError);
02135: if (yyResult.hasValue()
02136: && ((Node) yyResult.semanticValue()).getTokenText()
02137: .equals("extends")) {
02138: final Node v$pt$3 = yyResult.semanticValue();
02139:
02140: yyResult = pType(yyResult.index);
02141: yyError = yyResult.select(yyError);
02142: if (yyResult.hasValue()) {
02143: final Node v$pt$4 = yyResult.semanticValue();
02144: final Node v$g$1 = Formatting.before1(v$pt$3, v$pt$4);
02145:
02146: yyRepetition1 = yyResult.index;
02147: yyRepValue1 = Pair.empty();
02148: while (true) {
02149:
02150: yyBase = yyRepetition1;
02151: yyResult = pSymbol(yyBase);
02152: yyError = yyResult.select(yyError);
02153: if (yyResult.hasValue()
02154: && ((Node) yyResult.semanticValue())
02155: .getTokenText().equals(",")) {
02156: final Node v$pt$1 = yyResult.semanticValue();
02157:
02158: yyResult = pType(yyResult.index);
02159: yyError = yyResult.select(yyError);
02160: if (yyResult.hasValue()) {
02161: final Node v$pt$2 = yyResult
02162: .semanticValue();
02163: final Node v$el$1 = Formatting.before1(
02164: v$pt$1, v$pt$2);
02165:
02166: yyRepetition1 = yyResult.index;
02167: yyRepValue1 = new Pair<Node>(v$el$1,
02168: yyRepValue1);
02169: continue;
02170: }
02171: } else {
02172: yyError = yyError.select("\",\" expected",
02173: yyBase);
02174: }
02175: break;
02176: }
02177: { // Start scope for v$g$2.
02178: final Pair<Node> v$g$2 = yyRepValue1.reverse();
02179:
02180: yyValue = GNode.createFromPair("Extension", v$g$1,
02181: v$g$2);
02182: yyValue.setLocation(location(yyStart));
02183:
02184: return new SemanticValue(yyValue, yyRepetition1,
02185: yyError);
02186: } // End scope for v$g$2.
02187: }
02188: }
02189:
02190: // Done.
02191: yyError = yyError.select("extension expected", yyStart);
02192: return yyError;
02193: }
02194:
02195: // =========================================================================
02196:
02197: /**
02198: * Parse nonterminal xtc.lang.JavaFive.Implementation.
02199: *
02200: * @param yyStart The index.
02201: * @return The result.
02202: * @throws IOException Signals an I/O error.
02203: */
02204: private Result pImplementation(final int yyStart)
02205: throws IOException {
02206: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
02207: if (null == yyColumn.chunk1)
02208: yyColumn.chunk1 = new Chunk1();
02209: if (null == yyColumn.chunk1.fImplementation)
02210: yyColumn.chunk1.fImplementation = pImplementation$1(yyStart);
02211: return yyColumn.chunk1.fImplementation;
02212: }
02213:
02214: /** Actually parse xtc.lang.JavaFive.Implementation. */
02215: private Result pImplementation$1(final int yyStart)
02216: throws IOException {
02217: Result yyResult;
02218: Node yyValue;
02219: ParseError yyError = ParseError.DUMMY;
02220:
02221: // Alternative 1.
02222:
02223: yyResult = pWord(yyStart);
02224: yyError = yyResult.select(yyError);
02225: if (yyResult.hasValue()
02226: && ((Node) yyResult.semanticValue()).getTokenText()
02227: .equals("implements")) {
02228: final Node v$pt$3 = yyResult.semanticValue();
02229:
02230: yyResult = pType(yyResult.index);
02231: yyError = yyResult.select(yyError);
02232: if (yyResult.hasValue()) {
02233: final Node v$pt$4 = yyResult.semanticValue();
02234: final Node v$g$1 = Formatting.before1(v$pt$3, v$pt$4);
02235:
02236: yyResult = pImplementation$$Star1(yyResult.index);
02237: yyError = yyResult.select(yyError);
02238: if (yyResult.hasValue()) {
02239: final Pair<Node> v$g$2 = yyResult.semanticValue();
02240:
02241: yyValue = GNode.createFromPair("Implementation",
02242: v$g$1, v$g$2);
02243: yyValue.setLocation(location(yyStart));
02244:
02245: return yyResult.createValue(yyValue, yyError);
02246: }
02247: }
02248: }
02249:
02250: // Done.
02251: yyError = yyError.select("implementation expected", yyStart);
02252: return yyError;
02253: }
02254:
02255: // =========================================================================
02256:
02257: /**
02258: * Parse synthetic nonterminal xtc.lang.JavaFive.Implementation$$Star1.
02259: *
02260: * @param yyStart The index.
02261: * @return The result.
02262: * @throws IOException Signals an I/O error.
02263: */
02264: private Result pImplementation$$Star1(final int yyStart)
02265: throws IOException {
02266:
02267: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
02268: if (null == yyColumn.chunk1)
02269: yyColumn.chunk1 = new Chunk1();
02270: if (null == yyColumn.chunk1.fImplementation$$Star1)
02271: yyColumn.chunk1.fImplementation$$Star1 = pImplementation$$Star1$1(yyStart);
02272: return yyColumn.chunk1.fImplementation$$Star1;
02273: }
02274:
02275: /** Actually parse xtc.lang.JavaFive.Implementation$$Star1. */
02276: private Result pImplementation$$Star1$1(final int yyStart)
02277: throws IOException {
02278:
02279: Result yyResult;
02280: Pair<Node> yyValue;
02281: ParseError yyError = ParseError.DUMMY;
02282:
02283: // Alternative 1.
02284:
02285: yyResult = pSymbol(yyStart);
02286: yyError = yyResult.select(yyError);
02287: if (yyResult.hasValue()
02288: && ((Node) yyResult.semanticValue()).getTokenText()
02289: .equals(",")) {
02290: final Node v$pt$1 = yyResult.semanticValue();
02291:
02292: yyResult = pType(yyResult.index);
02293: yyError = yyResult.select(yyError);
02294: if (yyResult.hasValue()) {
02295: final Node v$pt$2 = yyResult.semanticValue();
02296: final Node v$el$1 = Formatting.before1(v$pt$1, v$pt$2);
02297:
02298: yyResult = pImplementation$$Star1(yyResult.index);
02299: yyError = yyResult.select(yyError);
02300: if (yyResult.hasValue()) {
02301: final Pair<Node> v$2 = yyResult.semanticValue();
02302:
02303: yyValue = new Pair<Node>(v$el$1, v$2);
02304:
02305: return yyResult.createValue(yyValue, yyError);
02306: }
02307: }
02308: }
02309:
02310: // Alternative 2.
02311:
02312: yyValue = Pair.empty();
02313:
02314: return new SemanticValue(yyValue, yyStart, yyError);
02315: }
02316:
02317: // =========================================================================
02318:
02319: /**
02320: * Parse nonterminal xtc.lang.JavaFive.Block.
02321: *
02322: * @param yyStart The index.
02323: * @return The result.
02324: * @throws IOException Signals an I/O error.
02325: */
02326: private Result pBlock(final int yyStart) throws IOException {
02327: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
02328: if (null == yyColumn.chunk1)
02329: yyColumn.chunk1 = new Chunk1();
02330: if (null == yyColumn.chunk1.fBlock)
02331: yyColumn.chunk1.fBlock = pBlock$1(yyStart);
02332: return yyColumn.chunk1.fBlock;
02333: }
02334:
02335: /** Actually parse xtc.lang.JavaFive.Block. */
02336: private Result pBlock$1(final int yyStart) throws IOException {
02337: Result yyResult;
02338: int yyBase;
02339: Node yyValue;
02340: ParseError yyError = ParseError.DUMMY;
02341:
02342: // Alternative <Block>.
02343:
02344: yyResult = pSymbol(yyStart);
02345: yyError = yyResult.select(yyError);
02346: if (yyResult.hasValue()
02347: && ((Node) yyResult.semanticValue()).getTokenText()
02348: .equals("{")) {
02349: final Node v$pt$1 = yyResult.semanticValue();
02350:
02351: yyResult = pBlock$$Split1(yyResult.index);
02352: yyError = yyResult.select(yyError);
02353: if (yyResult.hasValue()) {
02354: final Node v$pt$2 = yyResult.semanticValue();
02355:
02356: yyBase = yyResult.index;
02357: yyResult = pSymbol(yyBase);
02358: yyError = yyResult.select(yyError);
02359: if (yyResult.hasValue()
02360: && ((Node) yyResult.semanticValue())
02361: .getTokenText().equals("}")) {
02362: final Node v$pt$3 = yyResult.semanticValue();
02363: yyValue = Formatting.round1(v$pt$1, v$pt$2, v$pt$3);
02364:
02365: return yyResult.createValue(yyValue, yyError);
02366: } else {
02367: yyError = yyError.select("\"}\" expected", yyBase);
02368: }
02369: }
02370: }
02371:
02372: // Done.
02373: yyError = yyError.select("block expected", yyStart);
02374: return yyError;
02375: }
02376:
02377: // =========================================================================
02378:
02379: /**
02380: * Parse synthetic nonterminal xtc.lang.JavaFive.Block$$Split1.
02381: *
02382: * @param yyStart The index.
02383: * @return The result.
02384: * @throws IOException Signals an I/O error.
02385: */
02386: private Result pBlock$$Split1(final int yyStart) throws IOException {
02387: Result yyResult;
02388: int yyRepetition1;
02389: Pair<Node> yyRepValue1;
02390: Node yyValue;
02391: ParseError yyError = ParseError.DUMMY;
02392:
02393: // Alternative <Block>.
02394:
02395: yyRepetition1 = yyStart;
02396: yyRepValue1 = Pair.empty();
02397: while (true) {
02398:
02399: yyResult = pDeclarationOrStatement(yyRepetition1);
02400: yyError = yyResult.select(yyError);
02401: if (yyResult.hasValue()) {
02402: final Node v$el$1 = yyResult.semanticValue();
02403:
02404: yyRepetition1 = yyResult.index;
02405: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
02406: continue;
02407: }
02408: break;
02409: }
02410: { // Start scope for v$g$1.
02411: final Pair<Node> v$g$1 = yyRepValue1.reverse();
02412:
02413: yyValue = GNode.createFromPair("Block", v$g$1);
02414: yyValue.setLocation(location(yyStart));
02415:
02416: return new SemanticValue(yyValue, yyRepetition1, yyError);
02417: } // End scope for v$g$1.
02418: }
02419:
02420: // =========================================================================
02421:
02422: /**
02423: * Parse nonterminal xtc.lang.JavaFive.DeclarationOrStatement.
02424: *
02425: * @param yyStart The index.
02426: * @return The result.
02427: * @throws IOException Signals an I/O error.
02428: */
02429: private Result pDeclarationOrStatement(final int yyStart)
02430: throws IOException {
02431:
02432: Result yyResult;
02433: Node yyValue;
02434: ParseError yyError = ParseError.DUMMY;
02435:
02436: // Alternative <Declaration>.
02437:
02438: yyResult = pInBlockDeclaration(yyStart);
02439: yyError = yyResult.select(yyError);
02440: if (yyResult.hasValue()) {
02441: yyValue = yyResult.semanticValue();
02442:
02443: return yyResult.createValue(yyValue, yyError);
02444: }
02445:
02446: // Alternative <Statement>.
02447:
02448: yyResult = pStatement(yyStart);
02449: yyError = yyResult.select(yyError);
02450: if (yyResult.hasValue()) {
02451: yyValue = yyResult.semanticValue();
02452:
02453: return yyResult.createValue(yyValue, yyError);
02454: }
02455:
02456: // Done.
02457: return yyError;
02458: }
02459:
02460: // =========================================================================
02461:
02462: /**
02463: * Parse nonterminal xtc.lang.JavaFive.InBlockDeclaration.
02464: *
02465: * @param yyStart The index.
02466: * @return The result.
02467: * @throws IOException Signals an I/O error.
02468: */
02469: private Result pInBlockDeclaration(final int yyStart)
02470: throws IOException {
02471: Result yyResult;
02472: int yyBase;
02473: int yyOption1;
02474: Node yyOpValue1;
02475: Node yyValue;
02476: ParseError yyError = ParseError.DUMMY;
02477:
02478: // Alternative <Variable>.
02479:
02480: yyResult = pVariableDeclaration(yyStart);
02481: yyError = yyResult.select(yyError);
02482: if (yyResult.hasValue()) {
02483: yyValue = yyResult.semanticValue();
02484:
02485: return yyResult.createValue(yyValue, yyError);
02486: }
02487:
02488: // Alternative 2.
02489:
02490: yyResult = pModifiers(yyStart);
02491: yyError = yyResult.select(yyError);
02492: if (yyResult.hasValue()) {
02493: final Node v$pt$2 = yyResult.semanticValue();
02494:
02495: final int yyChoice1 = yyResult.index;
02496:
02497: // Nested alternative 1.
02498:
02499: yyBase = yyChoice1;
02500: yyResult = pWord(yyBase);
02501: yyError = yyResult.select(yyError);
02502: if (yyResult.hasValue()
02503: && ((Node) yyResult.semanticValue()).getTokenText()
02504: .equals("class")) {
02505: final Node v$pt$1 = yyResult.semanticValue();
02506: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
02507:
02508: yyResult = pIdentifier(yyResult.index);
02509: yyError = yyResult.select(yyError);
02510: if (yyResult.hasValue()) {
02511: final Node v$g$2 = yyResult.semanticValue();
02512:
02513: yyOption1 = yyResult.index;
02514: yyOpValue1 = null;
02515:
02516: yyResult = pTypeParameters(yyOption1);
02517: yyError = yyResult.select(yyError);
02518: if (yyResult.hasValue()) {
02519: final Node v$el$1 = yyResult.semanticValue();
02520:
02521: yyOption1 = yyResult.index;
02522: yyOpValue1 = v$el$1;
02523: }
02524: { // Start scope for v$g$3.
02525: final Node v$g$3 = yyOpValue1;
02526:
02527: yyOpValue1 = null;
02528:
02529: yyResult = pExtension(yyOption1);
02530: yyError = yyResult.select(yyError);
02531: if (yyResult.hasValue()) {
02532: final Node v$el$2 = yyResult
02533: .semanticValue();
02534:
02535: yyOption1 = yyResult.index;
02536: yyOpValue1 = v$el$2;
02537: }
02538: { // Start scope for v$g$4.
02539: final Node v$g$4 = yyOpValue1;
02540:
02541: yyOpValue1 = null;
02542:
02543: yyResult = pImplementation(yyOption1);
02544: yyError = yyResult.select(yyError);
02545: if (yyResult.hasValue()) {
02546: final Node v$el$3 = yyResult
02547: .semanticValue();
02548:
02549: yyOption1 = yyResult.index;
02550: yyOpValue1 = v$el$3;
02551: }
02552: { // Start scope for v$g$5.
02553: final Node v$g$5 = yyOpValue1;
02554:
02555: yyResult = pClassBody(yyOption1);
02556: yyError = yyResult.select(yyError);
02557: if (yyResult.hasValue()) {
02558: final Node v$g$6 = yyResult
02559: .semanticValue();
02560:
02561: yyValue = GNode.create(
02562: "ClassDeclaration", v$g$1,
02563: v$g$2, v$g$3, v$g$4, v$g$5,
02564: v$g$6);
02565: yyValue
02566: .setLocation(location(yyStart));
02567:
02568: return yyResult.createValue(
02569: yyValue, yyError);
02570: }
02571: } // End scope for v$g$5.
02572: } // End scope for v$g$4.
02573: } // End scope for v$g$3.
02574: }
02575: } else {
02576: yyError = yyError.select("\"class\" expected", yyBase);
02577: }
02578:
02579: // Nested alternative 2.
02580:
02581: yyBase = yyChoice1;
02582: yyResult = pWord(yyBase);
02583: yyError = yyResult.select(yyError);
02584: if (yyResult.hasValue()
02585: && ((Node) yyResult.semanticValue()).getTokenText()
02586: .equals("interface")) {
02587: final Node v$pt$1 = yyResult.semanticValue();
02588: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
02589:
02590: yyResult = pIdentifier(yyResult.index);
02591: yyError = yyResult.select(yyError);
02592: if (yyResult.hasValue()) {
02593: final Node v$g$2 = yyResult.semanticValue();
02594:
02595: yyOption1 = yyResult.index;
02596: yyOpValue1 = null;
02597:
02598: yyResult = pTypeParameters(yyOption1);
02599: yyError = yyResult.select(yyError);
02600: if (yyResult.hasValue()) {
02601: final Node v$el$1 = yyResult.semanticValue();
02602:
02603: yyOption1 = yyResult.index;
02604: yyOpValue1 = v$el$1;
02605: }
02606: { // Start scope for v$g$3.
02607: final Node v$g$3 = yyOpValue1;
02608:
02609: yyOpValue1 = null;
02610:
02611: yyResult = pExtension(yyOption1);
02612: yyError = yyResult.select(yyError);
02613: if (yyResult.hasValue()) {
02614: final Node v$el$2 = yyResult
02615: .semanticValue();
02616:
02617: yyOption1 = yyResult.index;
02618: yyOpValue1 = v$el$2;
02619: }
02620: { // Start scope for v$g$4.
02621: final Node v$g$4 = yyOpValue1;
02622:
02623: yyResult = pClassBody(yyOption1);
02624: yyError = yyResult.select(yyError);
02625: if (yyResult.hasValue()) {
02626: final Node v$g$5 = yyResult
02627: .semanticValue();
02628:
02629: yyValue = GNode.create(
02630: "InterfaceDeclaration", v$g$1,
02631: v$g$2, v$g$3, v$g$4, v$g$5);
02632: yyValue.setLocation(location(yyStart));
02633:
02634: return yyResult.createValue(yyValue,
02635: yyError);
02636: }
02637: } // End scope for v$g$4.
02638: } // End scope for v$g$3.
02639: }
02640: } else {
02641: yyError = yyError.select("\"interface\" expected",
02642: yyBase);
02643: }
02644: }
02645:
02646: // Done.
02647: return yyError;
02648: }
02649:
02650: // =========================================================================
02651:
02652: /**
02653: * Parse nonterminal xtc.lang.JavaFive.VariableDeclaration.
02654: *
02655: * @param yyStart The index.
02656: * @return The result.
02657: * @throws IOException Signals an I/O error.
02658: */
02659: private Result pVariableDeclaration(final int yyStart)
02660: throws IOException {
02661: Result yyResult;
02662: int yyBase;
02663: Node yyValue;
02664: ParseError yyError = ParseError.DUMMY;
02665:
02666: // Alternative <Declaration>.
02667:
02668: yyResult = pVariableModifiers(yyStart);
02669: yyError = yyResult.select(yyError);
02670: if (yyResult.hasValue()) {
02671: final Node v$g$1 = yyResult.semanticValue();
02672:
02673: yyResult = pType(yyResult.index);
02674: yyError = yyResult.select(yyError);
02675: if (yyResult.hasValue()) {
02676: final Node v$g$2 = yyResult.semanticValue();
02677:
02678: yyResult = pDeclarators(yyResult.index);
02679: yyError = yyResult.select(yyError);
02680: if (yyResult.hasValue()) {
02681: final Node v$pt$2 = yyResult.semanticValue();
02682:
02683: yyBase = yyResult.index;
02684: yyResult = pSymbol(yyBase);
02685: yyError = yyResult.select(yyError);
02686: if (yyResult.hasValue()
02687: && ((Node) yyResult.semanticValue())
02688: .getTokenText().equals(";")) {
02689: final Node v$pt$1 = yyResult.semanticValue();
02690: final Node v$g$3 = Formatting.after1(v$pt$2,
02691: v$pt$1);
02692:
02693: yyValue = GNode.create("FieldDeclaration",
02694: v$g$1, v$g$2, v$g$3);
02695: yyValue.setLocation(location(yyStart));
02696:
02697: return yyResult.createValue(yyValue, yyError);
02698: } else {
02699: yyError = yyError.select("\";\" expected",
02700: yyBase);
02701: }
02702: }
02703: }
02704: }
02705:
02706: // Done.
02707: return yyError;
02708: }
02709:
02710: // =========================================================================
02711:
02712: /**
02713: * Parse nonterminal xtc.lang.JavaFive.Statement.
02714: *
02715: * @param yyStart The index.
02716: * @return The result.
02717: * @throws IOException Signals an I/O error.
02718: */
02719: private Result pStatement(final int yyStart) throws IOException {
02720: Result yyResult;
02721: int yyBase;
02722: int yyRepetition1;
02723: boolean yyRepeated1;
02724: Pair<Node> yyRepValue1;
02725: int yyOption1;
02726: Node yyOpValue1;
02727: Node yyValue;
02728: ParseError yyError = ParseError.DUMMY;
02729:
02730: // Alternative <Block>.
02731:
02732: yyResult = pBlock(yyStart);
02733: yyError = yyResult.select(yyError);
02734: if (yyResult.hasValue()) {
02735: yyValue = yyResult.semanticValue();
02736:
02737: return yyResult.createValue(yyValue, yyError);
02738: }
02739:
02740: // Alternative 2.
02741:
02742: yyResult = pWord(yyStart);
02743: yyError = yyResult.select(yyError);
02744: if (yyResult.hasValue()
02745: && ((Node) yyResult.semanticValue()).getTokenText()
02746: .equals("if")) {
02747: final Node v$pt$1 = yyResult.semanticValue();
02748:
02749: yyResult = pParExpression(yyResult.index);
02750: yyError = yyResult.select(yyError);
02751: if (yyResult.hasValue()) {
02752: final Node v$pt$2 = yyResult.semanticValue();
02753: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
02754:
02755: yyResult = pStatement(yyResult.index);
02756: yyError = yyResult.select(yyError);
02757: if (yyResult.hasValue()) {
02758: final Node v$g$2 = yyResult.semanticValue();
02759:
02760: final int yyChoice1 = yyResult.index;
02761:
02762: // Nested alternative 1.
02763:
02764: yyBase = yyChoice1;
02765: yyResult = pWord(yyBase);
02766: yyError = yyResult.select(yyError);
02767: if (yyResult.hasValue()
02768: && ((Node) yyResult.semanticValue())
02769: .getTokenText().equals("else")) {
02770: final Node v$pt$3 = yyResult.semanticValue();
02771:
02772: yyResult = pStatement(yyResult.index);
02773: yyError = yyResult.select(yyError);
02774: if (yyResult.hasValue()) {
02775: final Node v$pt$4 = yyResult
02776: .semanticValue();
02777: final Node v$g$3 = Formatting.before1(
02778: v$pt$3, v$pt$4);
02779:
02780: yyValue = GNode.create(
02781: "ConditionalStatement", v$g$1,
02782: v$g$2, v$g$3);
02783: yyValue.setLocation(location(yyStart));
02784:
02785: return yyResult.createValue(yyValue,
02786: yyError);
02787: }
02788: } else {
02789: yyError = yyError.select("\"else\" expected",
02790: yyBase);
02791: }
02792:
02793: // Nested alternative 2.
02794:
02795: yyValue = GNode.create("ConditionalStatement",
02796: v$g$1, v$g$2, null);
02797: yyValue.setLocation(location(yyStart));
02798:
02799: return new SemanticValue(yyValue, yyChoice1,
02800: yyError);
02801: }
02802: }
02803: }
02804:
02805: // Alternative 3.
02806:
02807: yyResult = pWord(yyStart);
02808: yyError = yyResult.select(yyError);
02809: if (yyResult.hasValue()
02810: && ((Node) yyResult.semanticValue()).getTokenText()
02811: .equals("for")) {
02812: final Node v$pt$1 = yyResult.semanticValue();
02813:
02814: yyBase = yyResult.index;
02815: yyResult = pSymbol(yyBase);
02816: yyError = yyResult.select(yyError);
02817: if (yyResult.hasValue()
02818: && ((Node) yyResult.semanticValue()).getTokenText()
02819: .equals("(")) {
02820: final Node v$pt$2 = yyResult.semanticValue();
02821:
02822: yyResult = pForControl(yyResult.index);
02823: yyError = yyResult.select(yyError);
02824: if (yyResult.hasValue()) {
02825: final Node v$pt$4 = yyResult.semanticValue();
02826:
02827: yyBase = yyResult.index;
02828: yyResult = pSymbol(yyBase);
02829: yyError = yyResult.select(yyError);
02830: if (yyResult.hasValue()
02831: && ((Node) yyResult.semanticValue())
02832: .getTokenText().equals(")")) {
02833: final Node v$pt$3 = yyResult.semanticValue();
02834: final Node v$g$1 = Formatting.variable().add(
02835: v$pt$1).add(v$pt$2).addNode(v$pt$4)
02836: .add(v$pt$3);
02837:
02838: yyResult = pStatement(yyResult.index);
02839: yyError = yyResult.select(yyError);
02840: if (yyResult.hasValue()) {
02841: final Node v$g$2 = yyResult.semanticValue();
02842:
02843: yyValue = GNode.create("ForStatement",
02844: v$g$1, v$g$2);
02845: yyValue.setLocation(location(yyStart));
02846:
02847: return yyResult.createValue(yyValue,
02848: yyError);
02849: }
02850: } else {
02851: yyError = yyError.select("\")\" expected",
02852: yyBase);
02853: }
02854: }
02855: } else {
02856: yyError = yyError.select("\"(\" expected", yyBase);
02857: }
02858: }
02859:
02860: // Alternative 4.
02861:
02862: yyResult = pWord(yyStart);
02863: yyError = yyResult.select(yyError);
02864: if (yyResult.hasValue()
02865: && ((Node) yyResult.semanticValue()).getTokenText()
02866: .equals("while")) {
02867: final Node v$pt$1 = yyResult.semanticValue();
02868:
02869: yyResult = pParExpression(yyResult.index);
02870: yyError = yyResult.select(yyError);
02871: if (yyResult.hasValue()) {
02872: final Node v$pt$2 = yyResult.semanticValue();
02873: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
02874:
02875: yyResult = pStatement(yyResult.index);
02876: yyError = yyResult.select(yyError);
02877: if (yyResult.hasValue()) {
02878: final Node v$g$2 = yyResult.semanticValue();
02879:
02880: yyValue = GNode.create("WhileStatement", v$g$1,
02881: v$g$2);
02882: yyValue.setLocation(location(yyStart));
02883:
02884: return yyResult.createValue(yyValue, yyError);
02885: }
02886: }
02887: }
02888:
02889: // Alternative 5.
02890:
02891: yyResult = pWord(yyStart);
02892: yyError = yyResult.select(yyError);
02893: if (yyResult.hasValue()
02894: && ((Node) yyResult.semanticValue()).getTokenText()
02895: .equals("do")) {
02896: final Node v$pt$1 = yyResult.semanticValue();
02897:
02898: yyResult = pStatement(yyResult.index);
02899: yyError = yyResult.select(yyError);
02900: if (yyResult.hasValue()) {
02901: final Node v$pt$3 = yyResult.semanticValue();
02902:
02903: yyBase = yyResult.index;
02904: yyResult = pWord(yyBase);
02905: yyError = yyResult.select(yyError);
02906: if (yyResult.hasValue()
02907: && ((Node) yyResult.semanticValue())
02908: .getTokenText().equals("while")) {
02909: final Node v$pt$2 = yyResult.semanticValue();
02910: final Node v$g$1 = Formatting.round1(v$pt$1,
02911: v$pt$3, v$pt$2);
02912:
02913: yyResult = pParExpression(yyResult.index);
02914: yyError = yyResult.select(yyError);
02915: if (yyResult.hasValue()) {
02916: final Node v$pt$5 = yyResult.semanticValue();
02917:
02918: yyBase = yyResult.index;
02919: yyResult = pSymbol(yyBase);
02920: yyError = yyResult.select(yyError);
02921: if (yyResult.hasValue()
02922: && ((Node) yyResult.semanticValue())
02923: .getTokenText().equals(";")) {
02924: final Node v$pt$4 = yyResult
02925: .semanticValue();
02926: final Node v$g$2 = Formatting.after1(
02927: v$pt$5, v$pt$4);
02928:
02929: yyValue = GNode.create("DoWhileStatement",
02930: v$g$1, v$g$2);
02931: yyValue.setLocation(location(yyStart));
02932:
02933: return yyResult.createValue(yyValue,
02934: yyError);
02935: } else {
02936: yyError = yyError.select("\";\" expected",
02937: yyBase);
02938: }
02939: }
02940: } else {
02941: yyError = yyError.select("\"while\" expected",
02942: yyBase);
02943: }
02944: }
02945: }
02946:
02947: // Alternative 6.
02948:
02949: yyResult = pWord(yyStart);
02950: yyError = yyResult.select(yyError);
02951: if (yyResult.hasValue()
02952: && ((Node) yyResult.semanticValue()).getTokenText()
02953: .equals("try")) {
02954: final Node v$pt$1 = yyResult.semanticValue();
02955:
02956: yyResult = pBlock(yyResult.index);
02957: yyError = yyResult.select(yyError);
02958: if (yyResult.hasValue()) {
02959: final Node v$pt$2 = yyResult.semanticValue();
02960: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
02961:
02962: final int yyChoice1 = yyResult.index;
02963:
02964: // Nested alternative 1.
02965:
02966: yyRepetition1 = yyChoice1;
02967: yyRepValue1 = Pair.empty();
02968: while (true) {
02969:
02970: yyResult = pCatchClause(yyRepetition1);
02971: yyError = yyResult.select(yyError);
02972: if (yyResult.hasValue()) {
02973: final Node v$el$1 = yyResult.semanticValue();
02974:
02975: yyRepetition1 = yyResult.index;
02976: yyRepValue1 = new Pair<Node>(v$el$1,
02977: yyRepValue1);
02978: continue;
02979: }
02980: break;
02981: }
02982: { // Start scope for v$g$2.
02983: final Pair<Node> v$g$2 = yyRepValue1.reverse();
02984:
02985: yyBase = yyRepetition1;
02986: yyResult = pWord(yyBase);
02987: yyError = yyResult.select(yyError);
02988: if (yyResult.hasValue()
02989: && ((Node) yyResult.semanticValue())
02990: .getTokenText().equals("finally")) {
02991: final Node v$pt$3 = yyResult.semanticValue();
02992:
02993: yyResult = pBlock(yyResult.index);
02994: yyError = yyResult.select(yyError);
02995: if (yyResult.hasValue()) {
02996: final Node v$pt$4 = yyResult
02997: .semanticValue();
02998: final Node v$g$3 = Formatting.before1(
02999: v$pt$3, v$pt$4);
03000:
03001: yyValue = GNode.create(
03002: "TryCatchFinallyStatement",
03003: v$g$2.size() + 2).add(v$g$1)
03004: .addAll(v$g$2).add(v$g$3);
03005: yyValue.setLocation(location(yyStart));
03006:
03007: return yyResult.createValue(yyValue,
03008: yyError);
03009: }
03010: } else {
03011: yyError = yyError.select(
03012: "\"finally\" expected", yyBase);
03013: }
03014: } // End scope for v$g$2.
03015:
03016: // Nested alternative 2.
03017:
03018: yyRepetition1 = yyChoice1;
03019: yyRepeated1 = false;
03020: yyRepValue1 = Pair.empty();
03021: while (true) {
03022:
03023: yyResult = pCatchClause(yyRepetition1);
03024: yyError = yyResult.select(yyError);
03025: if (yyResult.hasValue()) {
03026: final Node v$el$2 = yyResult.semanticValue();
03027:
03028: yyRepetition1 = yyResult.index;
03029: yyRepeated1 = true;
03030: yyRepValue1 = new Pair<Node>(v$el$2,
03031: yyRepValue1);
03032: continue;
03033: }
03034: break;
03035: }
03036:
03037: if (yyRepeated1) {
03038: final Pair<Node> v$g$4 = yyRepValue1.reverse();
03039:
03040: yyValue = GNode.create("TryCatchFinallyStatement",
03041: v$g$4.size() + 2).add(v$g$1).addAll(v$g$4)
03042: .add(null);
03043: yyValue.setLocation(location(yyStart));
03044:
03045: return new SemanticValue(yyValue, yyRepetition1,
03046: yyError);
03047: }
03048: }
03049: }
03050:
03051: // Alternative 7.
03052:
03053: yyResult = pSwitchStatement$$Split1(yyStart);
03054: yyError = yyResult.select(yyError);
03055: if (yyResult.hasValue()) {
03056: final Node v$pt$1 = yyResult.semanticValue();
03057:
03058: yyBase = yyResult.index;
03059: yyResult = pSymbol(yyBase);
03060: yyError = yyResult.select(yyError);
03061: if (yyResult.hasValue()
03062: && ((Node) yyResult.semanticValue()).getTokenText()
03063: .equals("}")) {
03064: final Node v$pt$2 = yyResult.semanticValue();
03065: yyValue = Formatting.after1(v$pt$1, v$pt$2);
03066:
03067: return yyResult.createValue(yyValue, yyError);
03068: } else {
03069: yyError = yyError.select("\"}\" expected", yyBase);
03070: }
03071: }
03072:
03073: // Alternative 8.
03074:
03075: yyResult = pWord(yyStart);
03076: yyError = yyResult.select(yyError);
03077: if (yyResult.hasValue()
03078: && ((Node) yyResult.semanticValue()).getTokenText()
03079: .equals("synchronized")) {
03080: final Node v$pt$1 = yyResult.semanticValue();
03081:
03082: yyResult = pParExpression(yyResult.index);
03083: yyError = yyResult.select(yyError);
03084: if (yyResult.hasValue()) {
03085: final Node v$pt$2 = yyResult.semanticValue();
03086: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
03087:
03088: yyResult = pBlock(yyResult.index);
03089: yyError = yyResult.select(yyError);
03090: if (yyResult.hasValue()) {
03091: final Node v$g$2 = yyResult.semanticValue();
03092:
03093: yyValue = GNode.create("SynchronizedStatement",
03094: v$g$1, v$g$2);
03095: yyValue.setLocation(location(yyStart));
03096:
03097: return yyResult.createValue(yyValue, yyError);
03098: }
03099: }
03100: }
03101:
03102: // Alternative 9.
03103:
03104: yyResult = pWord(yyStart);
03105: yyError = yyResult.select(yyError);
03106: if (yyResult.hasValue()
03107: && ((Node) yyResult.semanticValue()).getTokenText()
03108: .equals("return")) {
03109: final Node v$pt$1 = yyResult.semanticValue();
03110:
03111: yyOption1 = yyResult.index;
03112: yyOpValue1 = null;
03113:
03114: yyResult = pExpression(yyOption1);
03115: yyError = yyResult.select(yyError);
03116: if (yyResult.hasValue()) {
03117: final Node v$el$1 = yyResult.semanticValue();
03118:
03119: yyOption1 = yyResult.index;
03120: yyOpValue1 = v$el$1;
03121: }
03122: { // Start scope for v$pt$3.
03123: final Node v$pt$3 = yyOpValue1;
03124:
03125: yyBase = yyOption1;
03126: yyResult = pSymbol(yyBase);
03127: yyError = yyResult.select(yyError);
03128: if (yyResult.hasValue()
03129: && ((Node) yyResult.semanticValue())
03130: .getTokenText().equals(";")) {
03131: final Node v$pt$2 = yyResult.semanticValue();
03132: final Node v$g$1 = Formatting.round1(v$pt$1,
03133: v$pt$3, v$pt$2);
03134:
03135: yyValue = GNode.create("ReturnStatement", v$g$1);
03136: yyValue.setLocation(location(yyStart));
03137:
03138: return yyResult.createValue(yyValue, yyError);
03139: } else {
03140: yyError = yyError.select("\";\" expected", yyBase);
03141: }
03142: } // End scope for v$pt$3.
03143: }
03144:
03145: // Alternative 10.
03146:
03147: yyResult = pWord(yyStart);
03148: yyError = yyResult.select(yyError);
03149: if (yyResult.hasValue()
03150: && ((Node) yyResult.semanticValue()).getTokenText()
03151: .equals("throw")) {
03152: final Node v$pt$1 = yyResult.semanticValue();
03153:
03154: yyResult = pExpression(yyResult.index);
03155: yyError = yyResult.select(yyError);
03156: if (yyResult.hasValue()) {
03157: final Node v$pt$3 = yyResult.semanticValue();
03158:
03159: yyBase = yyResult.index;
03160: yyResult = pSymbol(yyBase);
03161: yyError = yyResult.select(yyError);
03162: if (yyResult.hasValue()
03163: && ((Node) yyResult.semanticValue())
03164: .getTokenText().equals(";")) {
03165: final Node v$pt$2 = yyResult.semanticValue();
03166: final Node v$g$1 = Formatting.round1(v$pt$1,
03167: v$pt$3, v$pt$2);
03168:
03169: yyValue = GNode.create("ThrowStatement", v$g$1);
03170: yyValue.setLocation(location(yyStart));
03171:
03172: return yyResult.createValue(yyValue, yyError);
03173: } else {
03174: yyError = yyError.select("\";\" expected", yyBase);
03175: }
03176: }
03177: }
03178:
03179: // Alternative 11.
03180:
03181: yyResult = pWord(yyStart);
03182: yyError = yyResult.select(yyError);
03183: if (yyResult.hasValue()
03184: && ((Node) yyResult.semanticValue()).getTokenText()
03185: .equals("break")) {
03186: final Node v$pt$1 = yyResult.semanticValue();
03187:
03188: yyOption1 = yyResult.index;
03189: yyOpValue1 = null;
03190:
03191: yyResult = pIdentifier(yyOption1);
03192: yyError = yyResult.select(yyError);
03193: if (yyResult.hasValue()) {
03194: final Node v$el$1 = yyResult.semanticValue();
03195:
03196: yyOption1 = yyResult.index;
03197: yyOpValue1 = v$el$1;
03198: }
03199: { // Start scope for v$pt$3.
03200: final Node v$pt$3 = yyOpValue1;
03201:
03202: yyBase = yyOption1;
03203: yyResult = pSymbol(yyBase);
03204: yyError = yyResult.select(yyError);
03205: if (yyResult.hasValue()
03206: && ((Node) yyResult.semanticValue())
03207: .getTokenText().equals(";")) {
03208: final Node v$pt$2 = yyResult.semanticValue();
03209: final Node v$g$1 = Formatting.round1(v$pt$1,
03210: v$pt$3, v$pt$2);
03211:
03212: yyValue = GNode.create("BreakStatement", v$g$1);
03213: yyValue.setLocation(location(yyStart));
03214:
03215: return yyResult.createValue(yyValue, yyError);
03216: } else {
03217: yyError = yyError.select("\";\" expected", yyBase);
03218: }
03219: } // End scope for v$pt$3.
03220: }
03221:
03222: // Alternative 12.
03223:
03224: yyResult = pWord(yyStart);
03225: yyError = yyResult.select(yyError);
03226: if (yyResult.hasValue()
03227: && ((Node) yyResult.semanticValue()).getTokenText()
03228: .equals("continue")) {
03229: final Node v$pt$1 = yyResult.semanticValue();
03230:
03231: yyOption1 = yyResult.index;
03232: yyOpValue1 = null;
03233:
03234: yyResult = pIdentifier(yyOption1);
03235: yyError = yyResult.select(yyError);
03236: if (yyResult.hasValue()) {
03237: final Node v$el$1 = yyResult.semanticValue();
03238:
03239: yyOption1 = yyResult.index;
03240: yyOpValue1 = v$el$1;
03241: }
03242: { // Start scope for v$pt$3.
03243: final Node v$pt$3 = yyOpValue1;
03244:
03245: yyBase = yyOption1;
03246: yyResult = pSymbol(yyBase);
03247: yyError = yyResult.select(yyError);
03248: if (yyResult.hasValue()
03249: && ((Node) yyResult.semanticValue())
03250: .getTokenText().equals(";")) {
03251: final Node v$pt$2 = yyResult.semanticValue();
03252: final Node v$g$1 = Formatting.round1(v$pt$1,
03253: v$pt$3, v$pt$2);
03254:
03255: yyValue = GNode.create("ContinueStatement", v$g$1);
03256: yyValue.setLocation(location(yyStart));
03257:
03258: return yyResult.createValue(yyValue, yyError);
03259: } else {
03260: yyError = yyError.select("\";\" expected", yyBase);
03261: }
03262: } // End scope for v$pt$3.
03263: }
03264:
03265: // Alternative 13.
03266:
03267: yyResult = pIdentifier(yyStart);
03268: yyError = yyResult.select(yyError);
03269: if (yyResult.hasValue()) {
03270: final Node v$pt$2 = yyResult.semanticValue();
03271:
03272: yyBase = yyResult.index;
03273: yyResult = pSymbol(yyBase);
03274: yyError = yyResult.select(yyError);
03275: if (yyResult.hasValue()
03276: && ((Node) yyResult.semanticValue()).getTokenText()
03277: .equals(":")) {
03278: final Node v$pt$1 = yyResult.semanticValue();
03279: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
03280:
03281: yyResult = pStatement(yyResult.index);
03282: yyError = yyResult.select(yyError);
03283: if (yyResult.hasValue()) {
03284: final Node v$g$2 = yyResult.semanticValue();
03285:
03286: yyValue = GNode.create("LabeledStatement", v$g$1,
03287: v$g$2);
03288: yyValue.setLocation(location(yyStart));
03289:
03290: return yyResult.createValue(yyValue, yyError);
03291: }
03292: } else {
03293: yyError = yyError.select("\":\" expected", yyBase);
03294: }
03295: }
03296:
03297: // Alternative 14.
03298:
03299: yyResult = pExpression(yyStart);
03300: yyError = yyResult.select(yyError);
03301: if (yyResult.hasValue()) {
03302: final Node v$pt$2 = yyResult.semanticValue();
03303:
03304: yyBase = yyResult.index;
03305: yyResult = pSymbol(yyBase);
03306: yyError = yyResult.select(yyError);
03307: if (yyResult.hasValue()
03308: && ((Node) yyResult.semanticValue()).getTokenText()
03309: .equals(";")) {
03310: final Node v$pt$1 = yyResult.semanticValue();
03311: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
03312:
03313: yyValue = GNode.create("ExpressionStatement", v$g$1);
03314: yyValue.setLocation(location(yyStart));
03315:
03316: return yyResult.createValue(yyValue, yyError);
03317: } else {
03318: yyError = yyError.select("\";\" expected", yyBase);
03319: }
03320: }
03321:
03322: // Alternative 15.
03323:
03324: yyResult = pWord(yyStart);
03325: yyError = yyResult.select(yyError);
03326: if (yyResult.hasValue()
03327: && ((Node) yyResult.semanticValue()).getTokenText()
03328: .equals("assert")) {
03329: final Node v$pt$3 = yyResult.semanticValue();
03330:
03331: yyResult = pExpression(yyResult.index);
03332: yyError = yyResult.select(yyError);
03333: if (yyResult.hasValue()) {
03334: final Node v$pt$4 = yyResult.semanticValue();
03335: final Node v$g$1 = Formatting.before1(v$pt$3, v$pt$4);
03336:
03337: yyOption1 = yyResult.index;
03338: yyOpValue1 = null;
03339:
03340: yyBase = yyOption1;
03341: yyResult = pSymbol(yyBase);
03342: yyError = yyResult.select(yyError);
03343: if (yyResult.hasValue()
03344: && ((Node) yyResult.semanticValue())
03345: .getTokenText().equals(":")) {
03346: final Node v$pt$1 = yyResult.semanticValue();
03347:
03348: yyResult = pExpression(yyResult.index);
03349: yyError = yyResult.select(yyError);
03350: if (yyResult.hasValue()) {
03351: final Node v$pt$2 = yyResult.semanticValue();
03352: final Node v$el$1 = Formatting.before1(v$pt$1,
03353: v$pt$2);
03354:
03355: yyOption1 = yyResult.index;
03356: yyOpValue1 = v$el$1;
03357: }
03358: } else {
03359: yyError = yyError.select("\":\" expected", yyBase);
03360: }
03361: { // Start scope for v$pt$6.
03362: final Node v$pt$6 = yyOpValue1;
03363:
03364: yyBase = yyOption1;
03365: yyResult = pSymbol(yyBase);
03366: yyError = yyResult.select(yyError);
03367: if (yyResult.hasValue()
03368: && ((Node) yyResult.semanticValue())
03369: .getTokenText().equals(";")) {
03370: final Node v$pt$5 = yyResult.semanticValue();
03371: final Node v$g$2 = Formatting.after1(v$pt$6,
03372: v$pt$5);
03373:
03374: yyValue = GNode.create("AssertStatement",
03375: v$g$1, v$g$2);
03376: yyValue.setLocation(location(yyStart));
03377:
03378: return yyResult.createValue(yyValue, yyError);
03379: } else {
03380: yyError = yyError.select("\";\" expected",
03381: yyBase);
03382: }
03383: } // End scope for v$pt$6.
03384: }
03385: }
03386:
03387: // Alternative 16.
03388:
03389: yyResult = pSymbol(yyStart);
03390: yyError = yyResult.select(yyError);
03391: if (yyResult.hasValue()
03392: && ((Node) yyResult.semanticValue()).getTokenText()
03393: .equals(";")) {
03394: final Node v$pt$1 = yyResult.semanticValue();
03395:
03396: yyValue = GNode.create("EmptyStatement", false);
03397: yyValue.setLocation(location(yyStart));
03398: yyValue = Formatting.after1(yyValue, v$pt$1);
03399:
03400: return yyResult.createValue(yyValue, yyError);
03401: }
03402:
03403: // Done.
03404: yyError = yyError.select("statement expected", yyStart);
03405: return yyError;
03406: }
03407:
03408: // =========================================================================
03409:
03410: /**
03411: * Parse nonterminal xtc.lang.JavaFive.ForControl.
03412: *
03413: * @param yyStart The index.
03414: * @return The result.
03415: * @throws IOException Signals an I/O error.
03416: */
03417: private Result pForControl(final int yyStart) throws IOException {
03418: Result yyResult;
03419: int yyBase;
03420: int yyOption1;
03421: Node yyOpValue1;
03422: Node yyValue;
03423: ParseError yyError = ParseError.DUMMY;
03424:
03425: // Alternative 1.
03426:
03427: yyResult = pVariableModifiers(yyStart);
03428: yyError = yyResult.select(yyError);
03429: if (yyResult.hasValue()) {
03430: final Node v$g$1 = yyResult.semanticValue();
03431:
03432: yyResult = pType(yyResult.index);
03433: yyError = yyResult.select(yyError);
03434: if (yyResult.hasValue()) {
03435: final Node v$g$2 = yyResult.semanticValue();
03436:
03437: final int yyChoice1 = yyResult.index;
03438:
03439: // Nested alternative 1.
03440:
03441: yyResult = pIdentifier(yyChoice1);
03442: yyError = yyResult.select(yyError);
03443: if (yyResult.hasValue()) {
03444: final Node v$pt$2 = yyResult.semanticValue();
03445:
03446: yyBase = yyResult.index;
03447: yyResult = pSymbol(yyBase);
03448: yyError = yyResult.select(yyError);
03449: if (yyResult.hasValue()
03450: && ((Node) yyResult.semanticValue())
03451: .getTokenText().equals(":")) {
03452: final Node v$pt$1 = yyResult.semanticValue();
03453: final Node v$g$3 = Formatting.after1(v$pt$2,
03454: v$pt$1);
03455:
03456: yyResult = pExpression(yyResult.index);
03457: yyError = yyResult.select(yyError);
03458: if (yyResult.hasValue()) {
03459: final Node v$g$4 = yyResult.semanticValue();
03460:
03461: yyValue = GNode.create(
03462: "EnhancedForControl", v$g$1, v$g$2,
03463: v$g$3, v$g$4);
03464: yyValue.setLocation(location(yyStart));
03465:
03466: return yyResult.createValue(yyValue,
03467: yyError);
03468: }
03469: } else {
03470: yyError = yyError.select("\":\" expected",
03471: yyBase);
03472: }
03473: }
03474:
03475: // Nested alternative 2.
03476:
03477: yyResult = pDeclarators(yyChoice1);
03478: yyError = yyResult.select(yyError);
03479: if (yyResult.hasValue()) {
03480: final Node v$pt$2 = yyResult.semanticValue();
03481:
03482: yyBase = yyResult.index;
03483: yyResult = pSymbol(yyBase);
03484: yyError = yyResult.select(yyError);
03485: if (yyResult.hasValue()
03486: && ((Node) yyResult.semanticValue())
03487: .getTokenText().equals(";")) {
03488: final Node v$pt$1 = yyResult.semanticValue();
03489: final Node v$g$3 = Formatting.after1(v$pt$2,
03490: v$pt$1);
03491:
03492: yyOption1 = yyResult.index;
03493: yyOpValue1 = null;
03494:
03495: yyResult = pExpression(yyOption1);
03496: yyError = yyResult.select(yyError);
03497: if (yyResult.hasValue()) {
03498: final Node v$el$1 = yyResult
03499: .semanticValue();
03500:
03501: yyOption1 = yyResult.index;
03502: yyOpValue1 = v$el$1;
03503: }
03504: { // Start scope for v$pt$4.
03505: final Node v$pt$4 = yyOpValue1;
03506:
03507: yyBase = yyOption1;
03508: yyResult = pSymbol(yyBase);
03509: yyError = yyResult.select(yyError);
03510: if (yyResult.hasValue()
03511: && ((Node) yyResult.semanticValue())
03512: .getTokenText().equals(";")) {
03513: final Node v$pt$3 = yyResult
03514: .semanticValue();
03515: final Node v$g$4 = Formatting.after1(
03516: v$pt$4, v$pt$3);
03517:
03518: yyOption1 = yyResult.index;
03519: yyOpValue1 = null;
03520:
03521: yyResult = pExpressionList(yyOption1);
03522: yyError = yyResult.select(yyError);
03523: if (yyResult.hasValue()) {
03524: final Node v$el$2 = yyResult
03525: .semanticValue();
03526:
03527: yyOption1 = yyResult.index;
03528: yyOpValue1 = v$el$2;
03529: }
03530: { // Start scope for v$g$5.
03531: final Node v$g$5 = yyOpValue1;
03532:
03533: yyValue = GNode.create(
03534: "BasicForControl", v$g$1,
03535: v$g$2, v$g$3, v$g$4, v$g$5);
03536: yyValue
03537: .setLocation(location(yyStart));
03538:
03539: return new SemanticValue(yyValue,
03540: yyOption1, yyError);
03541: } // End scope for v$g$5.
03542: } else {
03543: yyError = yyError.select(
03544: "\";\" expected", yyBase);
03545: }
03546: } // End scope for v$pt$4.
03547: } else {
03548: yyError = yyError.select("\";\" expected",
03549: yyBase);
03550: }
03551: }
03552: }
03553: }
03554:
03555: // Alternative <Initialization>.
03556:
03557: yyOption1 = yyStart;
03558: yyOpValue1 = null;
03559:
03560: yyResult = pExpressionList(yyOption1);
03561: yyError = yyResult.select(yyError);
03562: if (yyResult.hasValue()) {
03563: final Node v$el$3 = yyResult.semanticValue();
03564:
03565: yyOption1 = yyResult.index;
03566: yyOpValue1 = v$el$3;
03567: }
03568: { // Start scope for v$pt$6.
03569: final Node v$pt$6 = yyOpValue1;
03570:
03571: yyBase = yyOption1;
03572: yyResult = pSymbol(yyBase);
03573: yyError = yyResult.select(yyError);
03574: if (yyResult.hasValue()
03575: && ((Node) yyResult.semanticValue()).getTokenText()
03576: .equals(";")) {
03577: final Node v$pt$5 = yyResult.semanticValue();
03578: final Node v$g$8 = Formatting.after1(v$pt$6, v$pt$5);
03579:
03580: yyOption1 = yyResult.index;
03581: yyOpValue1 = null;
03582:
03583: yyResult = pExpression(yyOption1);
03584: yyError = yyResult.select(yyError);
03585: if (yyResult.hasValue()) {
03586: final Node v$el$4 = yyResult.semanticValue();
03587:
03588: yyOption1 = yyResult.index;
03589: yyOpValue1 = v$el$4;
03590: }
03591: { // Start scope for v$pt$8.
03592: final Node v$pt$8 = yyOpValue1;
03593:
03594: yyBase = yyOption1;
03595: yyResult = pSymbol(yyBase);
03596: yyError = yyResult.select(yyError);
03597: if (yyResult.hasValue()
03598: && ((Node) yyResult.semanticValue())
03599: .getTokenText().equals(";")) {
03600: final Node v$pt$7 = yyResult.semanticValue();
03601: final Node v$g$9 = Formatting.after1(v$pt$8,
03602: v$pt$7);
03603:
03604: yyOption1 = yyResult.index;
03605: yyOpValue1 = null;
03606:
03607: yyResult = pExpressionList(yyOption1);
03608: yyError = yyResult.select(yyError);
03609: if (yyResult.hasValue()) {
03610: final Node v$el$5 = yyResult
03611: .semanticValue();
03612:
03613: yyOption1 = yyResult.index;
03614: yyOpValue1 = v$el$5;
03615: }
03616: { // Start scope for v$g$10.
03617: final Node v$g$10 = yyOpValue1;
03618:
03619: yyValue = GNode.create("BasicForControl",
03620: null, null, v$g$8, v$g$9, v$g$10);
03621: yyValue.setLocation(location(yyStart));
03622:
03623: return new SemanticValue(yyValue,
03624: yyOption1, yyError);
03625: } // End scope for v$g$10.
03626: } else {
03627: yyError = yyError.select("\";\" expected",
03628: yyBase);
03629: }
03630: } // End scope for v$pt$8.
03631: } else {
03632: yyError = yyError.select("\";\" expected", yyBase);
03633: }
03634: } // End scope for v$pt$6.
03635:
03636: // Done.
03637: return yyError;
03638: }
03639:
03640: // =========================================================================
03641:
03642: /**
03643: * Parse nonterminal xtc.lang.JavaFive.ParExpression.
03644: *
03645: * @param yyStart The index.
03646: * @return The result.
03647: * @throws IOException Signals an I/O error.
03648: */
03649: private Result pParExpression(final int yyStart) throws IOException {
03650: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
03651: if (null == yyColumn.chunk1)
03652: yyColumn.chunk1 = new Chunk1();
03653: if (null == yyColumn.chunk1.fParExpression)
03654: yyColumn.chunk1.fParExpression = pParExpression$1(yyStart);
03655: return yyColumn.chunk1.fParExpression;
03656: }
03657:
03658: /** Actually parse xtc.lang.JavaFive.ParExpression. */
03659: private Result pParExpression$1(final int yyStart)
03660: throws IOException {
03661: Result yyResult;
03662: int yyBase;
03663: Node yyValue;
03664: ParseError yyError = ParseError.DUMMY;
03665:
03666: // Alternative 1.
03667:
03668: yyResult = pSymbol(yyStart);
03669: yyError = yyResult.select(yyError);
03670: if (yyResult.hasValue()
03671: && ((Node) yyResult.semanticValue()).getTokenText()
03672: .equals("(")) {
03673: final Node v$pt$1 = yyResult.semanticValue();
03674:
03675: yyResult = pExpression(yyResult.index);
03676: yyError = yyResult.select(yyError);
03677: if (yyResult.hasValue()) {
03678: final Node v$pt$3 = yyResult.semanticValue();
03679:
03680: yyBase = yyResult.index;
03681: yyResult = pSymbol(yyBase);
03682: yyError = yyResult.select(yyError);
03683: if (yyResult.hasValue()
03684: && ((Node) yyResult.semanticValue())
03685: .getTokenText().equals(")")) {
03686: final Node v$pt$2 = yyResult.semanticValue();
03687: yyValue = Formatting.round1(v$pt$1, v$pt$3, v$pt$2);
03688:
03689: return yyResult.createValue(yyValue, yyError);
03690: } else {
03691: yyError = yyError.select("\")\" expected", yyBase);
03692: }
03693: }
03694: }
03695:
03696: // Done.
03697: yyError = yyError.select("par expression expected", yyStart);
03698: return yyError;
03699: }
03700:
03701: // =========================================================================
03702:
03703: /**
03704: * Parse nonterminal xtc.lang.JavaFive.CatchClause.
03705: *
03706: * @param yyStart The index.
03707: * @return The result.
03708: * @throws IOException Signals an I/O error.
03709: */
03710: private Result pCatchClause(final int yyStart) throws IOException {
03711: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
03712: if (null == yyColumn.chunk1)
03713: yyColumn.chunk1 = new Chunk1();
03714: if (null == yyColumn.chunk1.fCatchClause)
03715: yyColumn.chunk1.fCatchClause = pCatchClause$1(yyStart);
03716: return yyColumn.chunk1.fCatchClause;
03717: }
03718:
03719: /** Actually parse xtc.lang.JavaFive.CatchClause. */
03720: private Result pCatchClause$1(final int yyStart) throws IOException {
03721: Result yyResult;
03722: int yyBase;
03723: Node yyValue;
03724: ParseError yyError = ParseError.DUMMY;
03725:
03726: // Alternative 1.
03727:
03728: yyResult = pWord(yyStart);
03729: yyError = yyResult.select(yyError);
03730: if (yyResult.hasValue()
03731: && ((Node) yyResult.semanticValue()).getTokenText()
03732: .equals("catch")) {
03733: final Node v$pt$1 = yyResult.semanticValue();
03734:
03735: yyBase = yyResult.index;
03736: yyResult = pSymbol(yyBase);
03737: yyError = yyResult.select(yyError);
03738: if (yyResult.hasValue()
03739: && ((Node) yyResult.semanticValue()).getTokenText()
03740: .equals("(")) {
03741: final Node v$pt$2 = yyResult.semanticValue();
03742:
03743: yyResult = pFormalParameter(yyResult.index);
03744: yyError = yyResult.select(yyError);
03745: if (yyResult.hasValue()) {
03746: final Node v$pt$4 = yyResult.semanticValue();
03747:
03748: yyBase = yyResult.index;
03749: yyResult = pSymbol(yyBase);
03750: yyError = yyResult.select(yyError);
03751: if (yyResult.hasValue()
03752: && ((Node) yyResult.semanticValue())
03753: .getTokenText().equals(")")) {
03754: final Node v$pt$3 = yyResult.semanticValue();
03755: final Node v$g$1 = Formatting.variable().add(
03756: v$pt$1).add(v$pt$2).addNode(v$pt$4)
03757: .add(v$pt$3);
03758:
03759: yyResult = pBlock(yyResult.index);
03760: yyError = yyResult.select(yyError);
03761: if (yyResult.hasValue()) {
03762: final Node v$g$2 = yyResult.semanticValue();
03763:
03764: yyValue = GNode.create("CatchClause",
03765: v$g$1, v$g$2);
03766: yyValue.setLocation(location(yyStart));
03767:
03768: return yyResult.createValue(yyValue,
03769: yyError);
03770: }
03771: } else {
03772: yyError = yyError.select("\")\" expected",
03773: yyBase);
03774: }
03775: }
03776: } else {
03777: yyError = yyError.select("\"(\" expected", yyBase);
03778: }
03779: }
03780:
03781: // Done.
03782: yyError = yyError.select("catch clause expected", yyStart);
03783: return yyError;
03784: }
03785:
03786: // =========================================================================
03787:
03788: /**
03789: * Parse synthetic nonterminal xtc.lang.JavaFive.SwitchStatement$$Split1.
03790: *
03791: * @param yyStart The index.
03792: * @return The result.
03793: * @throws IOException Signals an I/O error.
03794: */
03795: private Result pSwitchStatement$$Split1(final int yyStart)
03796: throws IOException {
03797:
03798: Result yyResult;
03799: int yyBase;
03800: int yyRepetition1;
03801: Pair<Node> yyRepValue1;
03802: Node yyValue;
03803: ParseError yyError = ParseError.DUMMY;
03804:
03805: // Alternative 1.
03806:
03807: yyResult = pWord(yyStart);
03808: yyError = yyResult.select(yyError);
03809: if (yyResult.hasValue()
03810: && ((Node) yyResult.semanticValue()).getTokenText()
03811: .equals("switch")) {
03812: final Node v$pt$1 = yyResult.semanticValue();
03813:
03814: yyResult = pParExpression(yyResult.index);
03815: yyError = yyResult.select(yyError);
03816: if (yyResult.hasValue()) {
03817: final Node v$pt$3 = yyResult.semanticValue();
03818:
03819: yyBase = yyResult.index;
03820: yyResult = pSymbol(yyBase);
03821: yyError = yyResult.select(yyError);
03822: if (yyResult.hasValue()
03823: && ((Node) yyResult.semanticValue())
03824: .getTokenText().equals("{")) {
03825: final Node v$pt$2 = yyResult.semanticValue();
03826: final Node v$g$1 = Formatting.round1(v$pt$1,
03827: v$pt$3, v$pt$2);
03828:
03829: yyRepetition1 = yyResult.index;
03830: yyRepValue1 = Pair.empty();
03831: while (true) {
03832:
03833: yyResult = pSwitchClause(yyRepetition1);
03834: yyError = yyResult.select(yyError);
03835: if (yyResult.hasValue()) {
03836: final Node v$el$1 = yyResult
03837: .semanticValue();
03838:
03839: yyRepetition1 = yyResult.index;
03840: yyRepValue1 = new Pair<Node>(v$el$1,
03841: yyRepValue1);
03842: continue;
03843: }
03844: break;
03845: }
03846: { // Start scope for v$g$2.
03847: final Pair<Node> v$g$2 = yyRepValue1.reverse();
03848:
03849: yyValue = GNode.createFromPair(
03850: "SwitchStatement", v$g$1, v$g$2);
03851: yyValue.setLocation(location(yyStart));
03852:
03853: return new SemanticValue(yyValue,
03854: yyRepetition1, yyError);
03855: } // End scope for v$g$2.
03856: } else {
03857: yyError = yyError.select("\"{\" expected", yyBase);
03858: }
03859: }
03860: }
03861:
03862: // Done.
03863: yyError = yyError.select("switch statement expected", yyStart);
03864: return yyError;
03865: }
03866:
03867: // =========================================================================
03868:
03869: /**
03870: * Parse nonterminal xtc.lang.JavaFive.SwitchClause.
03871: *
03872: * @param yyStart The index.
03873: * @return The result.
03874: * @throws IOException Signals an I/O error.
03875: */
03876: private Result pSwitchClause(final int yyStart) throws IOException {
03877: Result yyResult;
03878: int yyBase;
03879: int yyRepetition1;
03880: Pair<Node> yyRepValue1;
03881: Node yyValue;
03882: ParseError yyError = ParseError.DUMMY;
03883:
03884: // Alternative 1.
03885:
03886: yyResult = pWord(yyStart);
03887: yyError = yyResult.select(yyError);
03888: if (yyResult.hasValue()
03889: && ((Node) yyResult.semanticValue()).getTokenText()
03890: .equals("case")) {
03891: final Node v$pt$1 = yyResult.semanticValue();
03892:
03893: yyResult = pExpression(yyResult.index);
03894: yyError = yyResult.select(yyError);
03895: if (yyResult.hasValue()) {
03896: final Node v$pt$3 = yyResult.semanticValue();
03897:
03898: yyBase = yyResult.index;
03899: yyResult = pSymbol(yyBase);
03900: yyError = yyResult.select(yyError);
03901: if (yyResult.hasValue()
03902: && ((Node) yyResult.semanticValue())
03903: .getTokenText().equals(":")) {
03904: final Node v$pt$2 = yyResult.semanticValue();
03905: final Node v$g$1 = Formatting.round1(v$pt$1,
03906: v$pt$3, v$pt$2);
03907:
03908: yyRepetition1 = yyResult.index;
03909: yyRepValue1 = Pair.empty();
03910: while (true) {
03911:
03912: yyResult = pDeclarationOrStatement(yyRepetition1);
03913: yyError = yyResult.select(yyError);
03914: if (yyResult.hasValue()) {
03915: final Node v$el$1 = yyResult
03916: .semanticValue();
03917:
03918: yyRepetition1 = yyResult.index;
03919: yyRepValue1 = new Pair<Node>(v$el$1,
03920: yyRepValue1);
03921: continue;
03922: }
03923: break;
03924: }
03925: { // Start scope for v$g$2.
03926: final Pair<Node> v$g$2 = yyRepValue1.reverse();
03927:
03928: yyValue = GNode.createFromPair("CaseClause",
03929: v$g$1, v$g$2);
03930: yyValue.setLocation(location(yyStart));
03931:
03932: return new SemanticValue(yyValue,
03933: yyRepetition1, yyError);
03934: } // End scope for v$g$2.
03935: } else {
03936: yyError = yyError.select("\":\" expected", yyBase);
03937: }
03938: }
03939: }
03940:
03941: // Alternative 2.
03942:
03943: yyResult = pWord(yyStart);
03944: yyError = yyResult.select(yyError);
03945: if (yyResult.hasValue()
03946: && ((Node) yyResult.semanticValue()).getTokenText()
03947: .equals("default")) {
03948: final Node v$pt$1 = yyResult.semanticValue();
03949:
03950: yyBase = yyResult.index;
03951: yyResult = pSymbol(yyBase);
03952: yyError = yyResult.select(yyError);
03953: if (yyResult.hasValue()
03954: && ((Node) yyResult.semanticValue()).getTokenText()
03955: .equals(":")) {
03956: final Node v$pt$2 = yyResult.semanticValue();
03957:
03958: yyResult = pDefaultClause$$Split1(yyResult.index);
03959: yyError = yyResult.select(yyError);
03960: if (yyResult.hasValue()) {
03961: final Node v$pt$3 = yyResult.semanticValue();
03962: yyValue = Formatting.variable().add(v$pt$1).add(
03963: v$pt$2).addNode(v$pt$3);
03964:
03965: return yyResult.createValue(yyValue, yyError);
03966: }
03967: } else {
03968: yyError = yyError.select("\":\" expected", yyBase);
03969: }
03970: }
03971:
03972: // Done.
03973: yyError = yyError.select("switch clause expected", yyStart);
03974: return yyError;
03975: }
03976:
03977: // =========================================================================
03978:
03979: /**
03980: * Parse synthetic nonterminal xtc.lang.JavaFive.DefaultClause$$Split1.
03981: *
03982: * @param yyStart The index.
03983: * @return The result.
03984: * @throws IOException Signals an I/O error.
03985: */
03986: private Result pDefaultClause$$Split1(final int yyStart)
03987: throws IOException {
03988:
03989: Result yyResult;
03990: int yyRepetition1;
03991: Pair<Node> yyRepValue1;
03992: Node yyValue;
03993: ParseError yyError = ParseError.DUMMY;
03994:
03995: // Alternative 1.
03996:
03997: yyRepetition1 = yyStart;
03998: yyRepValue1 = Pair.empty();
03999: while (true) {
04000:
04001: yyResult = pDeclarationOrStatement(yyRepetition1);
04002: yyError = yyResult.select(yyError);
04003: if (yyResult.hasValue()) {
04004: final Node v$el$1 = yyResult.semanticValue();
04005:
04006: yyRepetition1 = yyResult.index;
04007: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
04008: continue;
04009: }
04010: break;
04011: }
04012: { // Start scope for v$g$1.
04013: final Pair<Node> v$g$1 = yyRepValue1.reverse();
04014:
04015: yyValue = GNode.createFromPair("DefaultClause", v$g$1);
04016: yyValue.setLocation(location(yyStart));
04017:
04018: return new SemanticValue(yyValue, yyRepetition1, yyError);
04019: } // End scope for v$g$1.
04020: }
04021:
04022: // =========================================================================
04023:
04024: /**
04025: * Parse nonterminal xtc.lang.JavaFive.ExpressionList.
04026: *
04027: * @param yyStart The index.
04028: * @return The result.
04029: * @throws IOException Signals an I/O error.
04030: */
04031: private Result pExpressionList(final int yyStart)
04032: throws IOException {
04033: Result yyResult;
04034: int yyBase;
04035: int yyRepetition1;
04036: Pair<Node> yyRepValue1;
04037: Node yyValue;
04038: ParseError yyError = ParseError.DUMMY;
04039:
04040: // Alternative 1.
04041:
04042: yyResult = pExpression(yyStart);
04043: yyError = yyResult.select(yyError);
04044: if (yyResult.hasValue()) {
04045: final Node v$g$1 = yyResult.semanticValue();
04046:
04047: yyRepetition1 = yyResult.index;
04048: yyRepValue1 = Pair.empty();
04049: while (true) {
04050:
04051: yyBase = yyRepetition1;
04052: yyResult = pSymbol(yyBase);
04053: yyError = yyResult.select(yyError);
04054: if (yyResult.hasValue()
04055: && ((Node) yyResult.semanticValue())
04056: .getTokenText().equals(",")) {
04057: final Node v$pt$1 = yyResult.semanticValue();
04058:
04059: yyResult = pExpression(yyResult.index);
04060: yyError = yyResult.select(yyError);
04061: if (yyResult.hasValue()) {
04062: final Node v$pt$2 = yyResult.semanticValue();
04063: final Node v$el$1 = Formatting.before1(v$pt$1,
04064: v$pt$2);
04065:
04066: yyRepetition1 = yyResult.index;
04067: yyRepValue1 = new Pair<Node>(v$el$1,
04068: yyRepValue1);
04069: continue;
04070: }
04071: } else {
04072: yyError = yyError.select("\",\" expected", yyBase);
04073: }
04074: break;
04075: }
04076: { // Start scope for v$g$2.
04077: final Pair<Node> v$g$2 = yyRepValue1.reverse();
04078:
04079: yyValue = GNode.createFromPair("ExpressionList", v$g$1,
04080: v$g$2);
04081: yyValue.setLocation(location(yyStart));
04082:
04083: return new SemanticValue(yyValue, yyRepetition1,
04084: yyError);
04085: } // End scope for v$g$2.
04086: }
04087:
04088: // Done.
04089: return yyError;
04090: }
04091:
04092: // =========================================================================
04093:
04094: /**
04095: * Parse nonterminal xtc.lang.JavaFive.Expression.
04096: *
04097: * @param yyStart The index.
04098: * @return The result.
04099: * @throws IOException Signals an I/O error.
04100: */
04101: private Result pExpression(final int yyStart) throws IOException {
04102: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
04103: if (null == yyColumn.chunk1)
04104: yyColumn.chunk1 = new Chunk1();
04105: if (null == yyColumn.chunk1.fExpression)
04106: yyColumn.chunk1.fExpression = pExpression$1(yyStart);
04107: return yyColumn.chunk1.fExpression;
04108: }
04109:
04110: /** Actually parse xtc.lang.JavaFive.Expression. */
04111: private Result pExpression$1(final int yyStart) throws IOException {
04112: Result yyResult;
04113: Node yyValue;
04114: ParseError yyError = ParseError.DUMMY;
04115:
04116: // Alternative <Assignment>.
04117:
04118: yyResult = pConditionalExpression(yyStart);
04119: yyError = yyResult.select(yyError);
04120: if (yyResult.hasValue()) {
04121: final Node v$g$1 = yyResult.semanticValue();
04122:
04123: yyResult = pAssignmentOperator(yyResult.index);
04124: yyError = yyResult.select(yyError);
04125: if (yyResult.hasValue()) {
04126: final Node v$g$2 = yyResult.semanticValue();
04127:
04128: yyResult = pExpression(yyResult.index);
04129: yyError = yyResult.select(yyError);
04130: if (yyResult.hasValue()) {
04131: final Node v$g$3 = yyResult.semanticValue();
04132:
04133: yyValue = GNode.create("Expression", v$g$1, v$g$2,
04134: v$g$3);
04135: yyValue.setLocation(location(yyStart));
04136:
04137: return yyResult.createValue(yyValue, yyError);
04138: }
04139: }
04140: }
04141:
04142: // Alternative <Base>.
04143:
04144: yyResult = pConditionalExpression(yyStart);
04145: yyError = yyResult.select(yyError);
04146: if (yyResult.hasValue()) {
04147: yyValue = yyResult.semanticValue();
04148:
04149: return yyResult.createValue(yyValue, yyError);
04150: }
04151:
04152: // Done.
04153: return yyError;
04154: }
04155:
04156: // =========================================================================
04157:
04158: /**
04159: * Parse nonterminal xtc.lang.JavaFive.AssignmentOperator.
04160: *
04161: * @param yyStart The index.
04162: * @return The result.
04163: * @throws IOException Signals an I/O error.
04164: */
04165: private Result pAssignmentOperator(final int yyStart)
04166: throws IOException {
04167: Result yyResult;
04168: Node yyValue;
04169: ParseError yyError = ParseError.DUMMY;
04170:
04171: // Alternative <Equal>.
04172:
04173: yyResult = pSymbol(yyStart);
04174: yyError = yyResult.select(yyError);
04175: if (yyResult.hasValue()
04176: && ((Node) yyResult.semanticValue()).getTokenText()
04177: .equals("=")) {
04178: yyValue = yyResult.semanticValue();
04179:
04180: return yyResult.createValue(yyValue, yyError);
04181: }
04182:
04183: // Alternative <PlusEqual>.
04184:
04185: yyResult = pSymbol(yyStart);
04186: yyError = yyResult.select(yyError);
04187: if (yyResult.hasValue()
04188: && ((Node) yyResult.semanticValue()).getTokenText()
04189: .equals("+=")) {
04190: yyValue = yyResult.semanticValue();
04191:
04192: return yyResult.createValue(yyValue, yyError);
04193: }
04194:
04195: // Alternative <MinusEqual>.
04196:
04197: yyResult = pSymbol(yyStart);
04198: yyError = yyResult.select(yyError);
04199: if (yyResult.hasValue()
04200: && ((Node) yyResult.semanticValue()).getTokenText()
04201: .equals("-=")) {
04202: yyValue = yyResult.semanticValue();
04203:
04204: return yyResult.createValue(yyValue, yyError);
04205: }
04206:
04207: // Alternative <StarEqual>.
04208:
04209: yyResult = pSymbol(yyStart);
04210: yyError = yyResult.select(yyError);
04211: if (yyResult.hasValue()
04212: && ((Node) yyResult.semanticValue()).getTokenText()
04213: .equals("*=")) {
04214: yyValue = yyResult.semanticValue();
04215:
04216: return yyResult.createValue(yyValue, yyError);
04217: }
04218:
04219: // Alternative <SlashEqual>.
04220:
04221: yyResult = pSymbol(yyStart);
04222: yyError = yyResult.select(yyError);
04223: if (yyResult.hasValue()
04224: && ((Node) yyResult.semanticValue()).getTokenText()
04225: .equals("/=")) {
04226: yyValue = yyResult.semanticValue();
04227:
04228: return yyResult.createValue(yyValue, yyError);
04229: }
04230:
04231: // Alternative <AmpersandEqual>.
04232:
04233: yyResult = pSymbol(yyStart);
04234: yyError = yyResult.select(yyError);
04235: if (yyResult.hasValue()
04236: && ((Node) yyResult.semanticValue()).getTokenText()
04237: .equals("&=")) {
04238: yyValue = yyResult.semanticValue();
04239:
04240: return yyResult.createValue(yyValue, yyError);
04241: }
04242:
04243: // Alternative <BarEqual>.
04244:
04245: yyResult = pSymbol(yyStart);
04246: yyError = yyResult.select(yyError);
04247: if (yyResult.hasValue()
04248: && ((Node) yyResult.semanticValue()).getTokenText()
04249: .equals("|=")) {
04250: yyValue = yyResult.semanticValue();
04251:
04252: return yyResult.createValue(yyValue, yyError);
04253: }
04254:
04255: // Alternative <CaretEqual>.
04256:
04257: yyResult = pSymbol(yyStart);
04258: yyError = yyResult.select(yyError);
04259: if (yyResult.hasValue()
04260: && ((Node) yyResult.semanticValue()).getTokenText()
04261: .equals("^=")) {
04262: yyValue = yyResult.semanticValue();
04263:
04264: return yyResult.createValue(yyValue, yyError);
04265: }
04266:
04267: // Alternative <PercentEqual>.
04268:
04269: yyResult = pSymbol(yyStart);
04270: yyError = yyResult.select(yyError);
04271: if (yyResult.hasValue()
04272: && ((Node) yyResult.semanticValue()).getTokenText()
04273: .equals("%=")) {
04274: yyValue = yyResult.semanticValue();
04275:
04276: return yyResult.createValue(yyValue, yyError);
04277: }
04278:
04279: // Alternative <DoubleLessEqual>.
04280:
04281: yyResult = pSymbol(yyStart);
04282: yyError = yyResult.select(yyError);
04283: if (yyResult.hasValue()
04284: && ((Node) yyResult.semanticValue()).getTokenText()
04285: .equals("<<=")) {
04286: yyValue = yyResult.semanticValue();
04287:
04288: return yyResult.createValue(yyValue, yyError);
04289: }
04290:
04291: // Alternative <DoubleGreaterEqual>.
04292:
04293: yyResult = pSymbol(yyStart);
04294: yyError = yyResult.select(yyError);
04295: if (yyResult.hasValue()
04296: && ((Node) yyResult.semanticValue()).getTokenText()
04297: .equals(">>=")) {
04298: yyValue = yyResult.semanticValue();
04299:
04300: return yyResult.createValue(yyValue, yyError);
04301: }
04302:
04303: // Alternative <TripleGreaterEqual>.
04304:
04305: yyResult = pSymbol(yyStart);
04306: yyError = yyResult.select(yyError);
04307: if (yyResult.hasValue()
04308: && ((Node) yyResult.semanticValue()).getTokenText()
04309: .equals(">>>=")) {
04310: yyValue = yyResult.semanticValue();
04311:
04312: return yyResult.createValue(yyValue, yyError);
04313: }
04314:
04315: // Done.
04316: yyError = yyError.select("assignment operator expected",
04317: yyStart);
04318: return yyError;
04319: }
04320:
04321: // =========================================================================
04322:
04323: /**
04324: * Parse nonterminal xtc.lang.JavaFive.ConditionalExpression.
04325: *
04326: * @param yyStart The index.
04327: * @return The result.
04328: * @throws IOException Signals an I/O error.
04329: */
04330: private Result pConditionalExpression(final int yyStart)
04331: throws IOException {
04332:
04333: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
04334: if (null == yyColumn.chunk2)
04335: yyColumn.chunk2 = new Chunk2();
04336: if (null == yyColumn.chunk2.fConditionalExpression)
04337: yyColumn.chunk2.fConditionalExpression = pConditionalExpression$1(yyStart);
04338: return yyColumn.chunk2.fConditionalExpression;
04339: }
04340:
04341: /** Actually parse xtc.lang.JavaFive.ConditionalExpression. */
04342: private Result pConditionalExpression$1(final int yyStart)
04343: throws IOException {
04344:
04345: Result yyResult;
04346: int yyBase;
04347: Node yyValue;
04348: ParseError yyError = ParseError.DUMMY;
04349:
04350: // Alternative <Conditional>.
04351:
04352: yyResult = pLogicalOrExpression(yyStart);
04353: yyError = yyResult.select(yyError);
04354: if (yyResult.hasValue()) {
04355: final Node v$pt$2 = yyResult.semanticValue();
04356:
04357: yyBase = yyResult.index;
04358: yyResult = pSymbol(yyBase);
04359: yyError = yyResult.select(yyError);
04360: if (yyResult.hasValue()
04361: && ((Node) yyResult.semanticValue()).getTokenText()
04362: .equals("?")) {
04363: final Node v$pt$1 = yyResult.semanticValue();
04364: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
04365:
04366: yyResult = pExpression(yyResult.index);
04367: yyError = yyResult.select(yyError);
04368: if (yyResult.hasValue()) {
04369: final Node v$pt$4 = yyResult.semanticValue();
04370:
04371: yyBase = yyResult.index;
04372: yyResult = pSymbol(yyBase);
04373: yyError = yyResult.select(yyError);
04374: if (yyResult.hasValue()
04375: && ((Node) yyResult.semanticValue())
04376: .getTokenText().equals(":")) {
04377: final Node v$pt$3 = yyResult.semanticValue();
04378: final Node v$g$2 = Formatting.after1(v$pt$4,
04379: v$pt$3);
04380:
04381: yyResult = pConditionalExpression(yyResult.index);
04382: yyError = yyResult.select(yyError);
04383: if (yyResult.hasValue()) {
04384: final Node v$g$3 = yyResult.semanticValue();
04385:
04386: yyValue = GNode.create(
04387: "ConditionalExpression", v$g$1,
04388: v$g$2, v$g$3);
04389: yyValue.setLocation(location(yyStart));
04390:
04391: return yyResult.createValue(yyValue,
04392: yyError);
04393: }
04394: } else {
04395: yyError = yyError.select("\":\" expected",
04396: yyBase);
04397: }
04398: }
04399: } else {
04400: yyError = yyError.select("\"?\" expected", yyBase);
04401: }
04402: }
04403:
04404: // Alternative <Base>.
04405:
04406: yyResult = pLogicalOrExpression(yyStart);
04407: yyError = yyResult.select(yyError);
04408: if (yyResult.hasValue()) {
04409: yyValue = yyResult.semanticValue();
04410:
04411: return yyResult.createValue(yyValue, yyError);
04412: }
04413:
04414: // Done.
04415: return yyError;
04416: }
04417:
04418: // =========================================================================
04419:
04420: /**
04421: * Parse nonterminal xtc.lang.JavaFive.LogicalOrExpression.
04422: *
04423: * @param yyStart The index.
04424: * @return The result.
04425: * @throws IOException Signals an I/O error.
04426: */
04427: private Result pLogicalOrExpression(final int yyStart)
04428: throws IOException {
04429: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
04430: if (null == yyColumn.chunk2)
04431: yyColumn.chunk2 = new Chunk2();
04432: if (null == yyColumn.chunk2.fLogicalOrExpression)
04433: yyColumn.chunk2.fLogicalOrExpression = pLogicalOrExpression$1(yyStart);
04434: return yyColumn.chunk2.fLogicalOrExpression;
04435: }
04436:
04437: /** Actually parse xtc.lang.JavaFive.LogicalOrExpression. */
04438: private Result pLogicalOrExpression$1(final int yyStart)
04439: throws IOException {
04440:
04441: Result yyResult;
04442: int yyRepetition1;
04443: Pair<Action<Node>> yyRepValue1;
04444: Node yyValue;
04445: ParseError yyError = ParseError.DUMMY;
04446:
04447: // Alternative <Base>.
04448:
04449: yyResult = pLogicalAndExpression(yyStart);
04450: yyError = yyResult.select(yyError);
04451: if (yyResult.hasValue()) {
04452: final Node v$3 = yyResult.semanticValue();
04453:
04454: yyRepetition1 = yyResult.index;
04455: yyRepValue1 = Pair.empty();
04456: while (true) {
04457:
04458: yyResult = pLogicalOrExpression$$Tail1(yyRepetition1);
04459: yyError = yyResult.select(yyError);
04460: if (yyResult.hasValue()) {
04461: final Action<Node> v$4 = yyResult.semanticValue();
04462:
04463: yyRepetition1 = yyResult.index;
04464: yyRepValue1 = new Pair<Action<Node>>(v$4,
04465: yyRepValue1);
04466: continue;
04467: }
04468: break;
04469: }
04470: { // Start scope for v$5.
04471: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
04472:
04473: yyValue = apply(v$5, v$3, yyStart);
04474:
04475: return new SemanticValue(yyValue, yyRepetition1,
04476: yyError);
04477: } // End scope for v$5.
04478: }
04479:
04480: // Done.
04481: return yyError;
04482: }
04483:
04484: // =========================================================================
04485:
04486: /**
04487: * Parse synthetic nonterminal xtc.lang.JavaFive.LogicalOrExpression$$Tail1.
04488: *
04489: * @param yyStart The index.
04490: * @return The result.
04491: * @throws IOException Signals an I/O error.
04492: */
04493: private Result pLogicalOrExpression$$Tail1(final int yyStart)
04494: throws IOException {
04495:
04496: Result yyResult;
04497: Action<Node> yyValue;
04498: ParseError yyError = ParseError.DUMMY;
04499:
04500: // Alternative <Or>.
04501:
04502: yyResult = pSymbol(yyStart);
04503: yyError = yyResult.select(yyError);
04504: if (yyResult.hasValue()
04505: && ((Node) yyResult.semanticValue()).getTokenText()
04506: .equals("||")) {
04507: final Node v$pt$1 = yyResult.semanticValue();
04508:
04509: yyResult = pLogicalAndExpression(yyResult.index);
04510: yyError = yyResult.select(yyError);
04511: if (yyResult.hasValue()) {
04512: final Node v$pt$2 = yyResult.semanticValue();
04513: final Node v$g$2 = Formatting.before1(v$pt$1, v$pt$2);
04514:
04515: yyValue = new Action<Node>() {
04516: public Node run(Node v$1) {
04517: return GNode.create("LogicalOrExpression", v$1,
04518: v$g$2);
04519: }
04520: };
04521:
04522: return yyResult.createValue(yyValue, yyError);
04523: }
04524: }
04525:
04526: // Done.
04527: yyError = yyError.select("logical or expression expected",
04528: yyStart);
04529: return yyError;
04530: }
04531:
04532: // =========================================================================
04533:
04534: /**
04535: * Parse nonterminal xtc.lang.JavaFive.LogicalAndExpression.
04536: *
04537: * @param yyStart The index.
04538: * @return The result.
04539: * @throws IOException Signals an I/O error.
04540: */
04541: private Result pLogicalAndExpression(final int yyStart)
04542: throws IOException {
04543: Result yyResult;
04544: int yyRepetition1;
04545: Pair<Action<Node>> yyRepValue1;
04546: Node yyValue;
04547: ParseError yyError = ParseError.DUMMY;
04548:
04549: // Alternative <Base>.
04550:
04551: yyResult = pBitwiseOrExpression(yyStart);
04552: yyError = yyResult.select(yyError);
04553: if (yyResult.hasValue()) {
04554: final Node v$3 = yyResult.semanticValue();
04555:
04556: yyRepetition1 = yyResult.index;
04557: yyRepValue1 = Pair.empty();
04558: while (true) {
04559:
04560: yyResult = pLogicalAndExpression$$Tail1(yyRepetition1);
04561: yyError = yyResult.select(yyError);
04562: if (yyResult.hasValue()) {
04563: final Action<Node> v$4 = yyResult.semanticValue();
04564:
04565: yyRepetition1 = yyResult.index;
04566: yyRepValue1 = new Pair<Action<Node>>(v$4,
04567: yyRepValue1);
04568: continue;
04569: }
04570: break;
04571: }
04572: { // Start scope for v$5.
04573: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
04574:
04575: yyValue = apply(v$5, v$3, yyStart);
04576:
04577: return new SemanticValue(yyValue, yyRepetition1,
04578: yyError);
04579: } // End scope for v$5.
04580: }
04581:
04582: // Done.
04583: return yyError;
04584: }
04585:
04586: // =========================================================================
04587:
04588: /**
04589: * Parse synthetic nonterminal
04590: * xtc.lang.JavaFive.LogicalAndExpression$$Tail1.
04591: *
04592: * @param yyStart The index.
04593: * @return The result.
04594: * @throws IOException Signals an I/O error.
04595: */
04596: private Result pLogicalAndExpression$$Tail1(final int yyStart)
04597: throws IOException {
04598:
04599: Result yyResult;
04600: Action<Node> yyValue;
04601: ParseError yyError = ParseError.DUMMY;
04602:
04603: // Alternative <And>.
04604:
04605: yyResult = pSymbol(yyStart);
04606: yyError = yyResult.select(yyError);
04607: if (yyResult.hasValue()
04608: && ((Node) yyResult.semanticValue()).getTokenText()
04609: .equals("&&")) {
04610: final Node v$pt$1 = yyResult.semanticValue();
04611:
04612: yyResult = pBitwiseOrExpression(yyResult.index);
04613: yyError = yyResult.select(yyError);
04614: if (yyResult.hasValue()) {
04615: final Node v$pt$2 = yyResult.semanticValue();
04616: final Node v$g$2 = Formatting.before1(v$pt$1, v$pt$2);
04617:
04618: yyValue = new Action<Node>() {
04619: public Node run(Node v$1) {
04620: return GNode.create("LogicalAndExpression",
04621: v$1, v$g$2);
04622: }
04623: };
04624:
04625: return yyResult.createValue(yyValue, yyError);
04626: }
04627: }
04628:
04629: // Done.
04630: yyError = yyError.select("logical and expression expected",
04631: yyStart);
04632: return yyError;
04633: }
04634:
04635: // =========================================================================
04636:
04637: /**
04638: * Parse nonterminal xtc.lang.JavaFive.BitwiseOrExpression.
04639: *
04640: * @param yyStart The index.
04641: * @return The result.
04642: * @throws IOException Signals an I/O error.
04643: */
04644: private Result pBitwiseOrExpression(final int yyStart)
04645: throws IOException {
04646: Result yyResult;
04647: int yyRepetition1;
04648: Pair<Action<Node>> yyRepValue1;
04649: Node yyValue;
04650: ParseError yyError = ParseError.DUMMY;
04651:
04652: // Alternative <Base>.
04653:
04654: yyResult = pBitwiseXorExpression(yyStart);
04655: yyError = yyResult.select(yyError);
04656: if (yyResult.hasValue()) {
04657: final Node v$3 = yyResult.semanticValue();
04658:
04659: yyRepetition1 = yyResult.index;
04660: yyRepValue1 = Pair.empty();
04661: while (true) {
04662:
04663: yyResult = pBitwiseOrExpression$$Tail1(yyRepetition1);
04664: yyError = yyResult.select(yyError);
04665: if (yyResult.hasValue()) {
04666: final Action<Node> v$4 = yyResult.semanticValue();
04667:
04668: yyRepetition1 = yyResult.index;
04669: yyRepValue1 = new Pair<Action<Node>>(v$4,
04670: yyRepValue1);
04671: continue;
04672: }
04673: break;
04674: }
04675: { // Start scope for v$5.
04676: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
04677:
04678: yyValue = apply(v$5, v$3, yyStart);
04679:
04680: return new SemanticValue(yyValue, yyRepetition1,
04681: yyError);
04682: } // End scope for v$5.
04683: }
04684:
04685: // Done.
04686: return yyError;
04687: }
04688:
04689: // =========================================================================
04690:
04691: /**
04692: * Parse synthetic nonterminal xtc.lang.JavaFive.BitwiseOrExpression$$Tail1.
04693: *
04694: * @param yyStart The index.
04695: * @return The result.
04696: * @throws IOException Signals an I/O error.
04697: */
04698: private Result pBitwiseOrExpression$$Tail1(final int yyStart)
04699: throws IOException {
04700:
04701: Result yyResult;
04702: Action<Node> yyValue;
04703: ParseError yyError = ParseError.DUMMY;
04704:
04705: // Alternative <Or>.
04706:
04707: yyResult = pSymbol(yyStart);
04708: yyError = yyResult.select(yyError);
04709: if (yyResult.hasValue()
04710: && ((Node) yyResult.semanticValue()).getTokenText()
04711: .equals("|")) {
04712: final Node v$pt$1 = yyResult.semanticValue();
04713:
04714: yyResult = pBitwiseXorExpression(yyResult.index);
04715: yyError = yyResult.select(yyError);
04716: if (yyResult.hasValue()) {
04717: final Node v$pt$2 = yyResult.semanticValue();
04718: final Node v$g$2 = Formatting.before1(v$pt$1, v$pt$2);
04719:
04720: yyValue = new Action<Node>() {
04721: public Node run(Node v$1) {
04722: return GNode.create("BitwiseOrExpression", v$1,
04723: v$g$2);
04724: }
04725: };
04726:
04727: return yyResult.createValue(yyValue, yyError);
04728: }
04729: }
04730:
04731: // Done.
04732: yyError = yyError.select("bitwise or expression expected",
04733: yyStart);
04734: return yyError;
04735: }
04736:
04737: // =========================================================================
04738:
04739: /**
04740: * Parse nonterminal xtc.lang.JavaFive.BitwiseXorExpression.
04741: *
04742: * @param yyStart The index.
04743: * @return The result.
04744: * @throws IOException Signals an I/O error.
04745: */
04746: private Result pBitwiseXorExpression(final int yyStart)
04747: throws IOException {
04748: Result yyResult;
04749: int yyRepetition1;
04750: Pair<Action<Node>> yyRepValue1;
04751: Node yyValue;
04752: ParseError yyError = ParseError.DUMMY;
04753:
04754: // Alternative <Base>.
04755:
04756: yyResult = pBitwiseAndExpression(yyStart);
04757: yyError = yyResult.select(yyError);
04758: if (yyResult.hasValue()) {
04759: final Node v$3 = yyResult.semanticValue();
04760:
04761: yyRepetition1 = yyResult.index;
04762: yyRepValue1 = Pair.empty();
04763: while (true) {
04764:
04765: yyResult = pBitwiseXorExpression$$Tail1(yyRepetition1);
04766: yyError = yyResult.select(yyError);
04767: if (yyResult.hasValue()) {
04768: final Action<Node> v$4 = yyResult.semanticValue();
04769:
04770: yyRepetition1 = yyResult.index;
04771: yyRepValue1 = new Pair<Action<Node>>(v$4,
04772: yyRepValue1);
04773: continue;
04774: }
04775: break;
04776: }
04777: { // Start scope for v$5.
04778: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
04779:
04780: yyValue = apply(v$5, v$3, yyStart);
04781:
04782: return new SemanticValue(yyValue, yyRepetition1,
04783: yyError);
04784: } // End scope for v$5.
04785: }
04786:
04787: // Done.
04788: return yyError;
04789: }
04790:
04791: // =========================================================================
04792:
04793: /**
04794: * Parse synthetic nonterminal
04795: * xtc.lang.JavaFive.BitwiseXorExpression$$Tail1.
04796: *
04797: * @param yyStart The index.
04798: * @return The result.
04799: * @throws IOException Signals an I/O error.
04800: */
04801: private Result pBitwiseXorExpression$$Tail1(final int yyStart)
04802: throws IOException {
04803:
04804: Result yyResult;
04805: Action<Node> yyValue;
04806: ParseError yyError = ParseError.DUMMY;
04807:
04808: // Alternative <Xor>.
04809:
04810: yyResult = pSymbol(yyStart);
04811: yyError = yyResult.select(yyError);
04812: if (yyResult.hasValue()
04813: && ((Node) yyResult.semanticValue()).getTokenText()
04814: .equals("^")) {
04815: final Node v$pt$1 = yyResult.semanticValue();
04816:
04817: yyResult = pBitwiseAndExpression(yyResult.index);
04818: yyError = yyResult.select(yyError);
04819: if (yyResult.hasValue()) {
04820: final Node v$pt$2 = yyResult.semanticValue();
04821: final Node v$g$2 = Formatting.before1(v$pt$1, v$pt$2);
04822:
04823: yyValue = new Action<Node>() {
04824: public Node run(Node v$1) {
04825: return GNode.create("BitwiseXorExpression",
04826: v$1, v$g$2);
04827: }
04828: };
04829:
04830: return yyResult.createValue(yyValue, yyError);
04831: }
04832: }
04833:
04834: // Done.
04835: yyError = yyError.select("bitwise xor expression expected",
04836: yyStart);
04837: return yyError;
04838: }
04839:
04840: // =========================================================================
04841:
04842: /**
04843: * Parse nonterminal xtc.lang.JavaFive.BitwiseAndExpression.
04844: *
04845: * @param yyStart The index.
04846: * @return The result.
04847: * @throws IOException Signals an I/O error.
04848: */
04849: private Result pBitwiseAndExpression(final int yyStart)
04850: throws IOException {
04851: Result yyResult;
04852: int yyRepetition1;
04853: Pair<Action<Node>> yyRepValue1;
04854: Node yyValue;
04855: ParseError yyError = ParseError.DUMMY;
04856:
04857: // Alternative <Base>.
04858:
04859: yyResult = pEqualityExpression(yyStart);
04860: yyError = yyResult.select(yyError);
04861: if (yyResult.hasValue()) {
04862: final Node v$3 = yyResult.semanticValue();
04863:
04864: yyRepetition1 = yyResult.index;
04865: yyRepValue1 = Pair.empty();
04866: while (true) {
04867:
04868: yyResult = pBitwiseAndExpression$$Tail1(yyRepetition1);
04869: yyError = yyResult.select(yyError);
04870: if (yyResult.hasValue()) {
04871: final Action<Node> v$4 = yyResult.semanticValue();
04872:
04873: yyRepetition1 = yyResult.index;
04874: yyRepValue1 = new Pair<Action<Node>>(v$4,
04875: yyRepValue1);
04876: continue;
04877: }
04878: break;
04879: }
04880: { // Start scope for v$5.
04881: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
04882:
04883: yyValue = apply(v$5, v$3, yyStart);
04884:
04885: return new SemanticValue(yyValue, yyRepetition1,
04886: yyError);
04887: } // End scope for v$5.
04888: }
04889:
04890: // Done.
04891: return yyError;
04892: }
04893:
04894: // =========================================================================
04895:
04896: /**
04897: * Parse synthetic nonterminal
04898: * xtc.lang.JavaFive.BitwiseAndExpression$$Tail1.
04899: *
04900: * @param yyStart The index.
04901: * @return The result.
04902: * @throws IOException Signals an I/O error.
04903: */
04904: private Result pBitwiseAndExpression$$Tail1(final int yyStart)
04905: throws IOException {
04906:
04907: Result yyResult;
04908: Action<Node> yyValue;
04909: ParseError yyError = ParseError.DUMMY;
04910:
04911: // Alternative <And>.
04912:
04913: yyResult = pSymbol(yyStart);
04914: yyError = yyResult.select(yyError);
04915: if (yyResult.hasValue()
04916: && ((Node) yyResult.semanticValue()).getTokenText()
04917: .equals("&")) {
04918: final Node v$pt$1 = yyResult.semanticValue();
04919:
04920: yyResult = pEqualityExpression(yyResult.index);
04921: yyError = yyResult.select(yyError);
04922: if (yyResult.hasValue()) {
04923: final Node v$pt$2 = yyResult.semanticValue();
04924: final Node v$g$2 = Formatting.before1(v$pt$1, v$pt$2);
04925:
04926: yyValue = new Action<Node>() {
04927: public Node run(Node v$1) {
04928: return GNode.create("BitwiseAndExpression",
04929: v$1, v$g$2);
04930: }
04931: };
04932:
04933: return yyResult.createValue(yyValue, yyError);
04934: }
04935: }
04936:
04937: // Done.
04938: yyError = yyError.select("bitwise and expression expected",
04939: yyStart);
04940: return yyError;
04941: }
04942:
04943: // =========================================================================
04944:
04945: /**
04946: * Parse nonterminal xtc.lang.JavaFive.EqualityExpression.
04947: *
04948: * @param yyStart The index.
04949: * @return The result.
04950: * @throws IOException Signals an I/O error.
04951: */
04952: private Result pEqualityExpression(final int yyStart)
04953: throws IOException {
04954: Result yyResult;
04955: int yyRepetition1;
04956: Pair<Action<Node>> yyRepValue1;
04957: Node yyValue;
04958: ParseError yyError = ParseError.DUMMY;
04959:
04960: // Alternative <Base>.
04961:
04962: yyResult = pInstanceOfExpression(yyStart);
04963: yyError = yyResult.select(yyError);
04964: if (yyResult.hasValue()) {
04965: final Node v$4 = yyResult.semanticValue();
04966:
04967: yyRepetition1 = yyResult.index;
04968: yyRepValue1 = Pair.empty();
04969: while (true) {
04970:
04971: yyResult = pEqualityExpression$$Tail1(yyRepetition1);
04972: yyError = yyResult.select(yyError);
04973: if (yyResult.hasValue()) {
04974: final Action<Node> v$5 = yyResult.semanticValue();
04975:
04976: yyRepetition1 = yyResult.index;
04977: yyRepValue1 = new Pair<Action<Node>>(v$5,
04978: yyRepValue1);
04979: continue;
04980: }
04981: break;
04982: }
04983: { // Start scope for v$6.
04984: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
04985:
04986: yyValue = apply(v$6, v$4, yyStart);
04987:
04988: return new SemanticValue(yyValue, yyRepetition1,
04989: yyError);
04990: } // End scope for v$6.
04991: }
04992:
04993: // Done.
04994: return yyError;
04995: }
04996:
04997: // =========================================================================
04998:
04999: /**
05000: * Parse synthetic nonterminal xtc.lang.JavaFive.EqualityExpression$$Tail1.
05001: *
05002: * @param yyStart The index.
05003: * @return The result.
05004: * @throws IOException Signals an I/O error.
05005: */
05006: private Result pEqualityExpression$$Tail1(final int yyStart)
05007: throws IOException {
05008:
05009: Result yyResult;
05010: Action<Node> yyValue;
05011: ParseError yyError = ParseError.DUMMY;
05012:
05013: // Alternative <Recursion>.
05014:
05015: yyResult = pEqualityOperator(yyStart);
05016: yyError = yyResult.select(yyError);
05017: if (yyResult.hasValue()) {
05018: final Node v$g$2 = yyResult.semanticValue();
05019:
05020: yyResult = pInstanceOfExpression(yyResult.index);
05021: yyError = yyResult.select(yyError);
05022: if (yyResult.hasValue()) {
05023: final Node v$g$3 = yyResult.semanticValue();
05024:
05025: yyValue = new Action<Node>() {
05026: public Node run(Node v$1) {
05027: return GNode.create("EqualityExpression", v$1,
05028: v$g$2, v$g$3);
05029: }
05030: };
05031:
05032: return yyResult.createValue(yyValue, yyError);
05033: }
05034: }
05035:
05036: // Done.
05037: return yyError;
05038: }
05039:
05040: // =========================================================================
05041:
05042: /**
05043: * Parse nonterminal xtc.lang.JavaFive.EqualityOperator.
05044: *
05045: * @param yyStart The index.
05046: * @return The result.
05047: * @throws IOException Signals an I/O error.
05048: */
05049: private Result pEqualityOperator(final int yyStart)
05050: throws IOException {
05051: Result yyResult;
05052: Node yyValue;
05053: ParseError yyError = ParseError.DUMMY;
05054:
05055: // Alternative <Equal>.
05056:
05057: yyResult = pSymbol(yyStart);
05058: yyError = yyResult.select(yyError);
05059: if (yyResult.hasValue()
05060: && ((Node) yyResult.semanticValue()).getTokenText()
05061: .equals("==")) {
05062: yyValue = yyResult.semanticValue();
05063:
05064: return yyResult.createValue(yyValue, yyError);
05065: }
05066:
05067: // Alternative <NotEqual>.
05068:
05069: yyResult = pSymbol(yyStart);
05070: yyError = yyResult.select(yyError);
05071: if (yyResult.hasValue()
05072: && ((Node) yyResult.semanticValue()).getTokenText()
05073: .equals("!=")) {
05074: yyValue = yyResult.semanticValue();
05075:
05076: return yyResult.createValue(yyValue, yyError);
05077: }
05078:
05079: // Done.
05080: yyError = yyError.select("equality operator expected", yyStart);
05081: return yyError;
05082: }
05083:
05084: // =========================================================================
05085:
05086: /**
05087: * Parse nonterminal xtc.lang.JavaFive.InstanceOfExpression.
05088: *
05089: * @param yyStart The index.
05090: * @return The result.
05091: * @throws IOException Signals an I/O error.
05092: */
05093: private Result pInstanceOfExpression(final int yyStart)
05094: throws IOException {
05095: Result yyResult;
05096: int yyBase;
05097: Node yyValue;
05098: ParseError yyError = ParseError.DUMMY;
05099:
05100: // Alternative <Instanceof>.
05101:
05102: yyResult = pRelationalExpression(yyStart);
05103: yyError = yyResult.select(yyError);
05104: if (yyResult.hasValue()) {
05105: final Node v$pt$2 = yyResult.semanticValue();
05106:
05107: yyBase = yyResult.index;
05108: yyResult = pWord(yyBase);
05109: yyError = yyResult.select(yyError);
05110: if (yyResult.hasValue()
05111: && ((Node) yyResult.semanticValue()).getTokenText()
05112: .equals("instanceof")) {
05113: final Node v$pt$1 = yyResult.semanticValue();
05114: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
05115:
05116: yyResult = pType(yyResult.index);
05117: yyError = yyResult.select(yyError);
05118: if (yyResult.hasValue()) {
05119: final Node v$g$2 = yyResult.semanticValue();
05120:
05121: yyValue = GNode.create("InstanceOfExpression",
05122: v$g$1, v$g$2);
05123: yyValue.setLocation(location(yyStart));
05124:
05125: return yyResult.createValue(yyValue, yyError);
05126: }
05127: } else {
05128: yyError = yyError.select("\"instanceof\" expected",
05129: yyBase);
05130: }
05131: }
05132:
05133: // Alternative <Base>.
05134:
05135: yyResult = pRelationalExpression(yyStart);
05136: yyError = yyResult.select(yyError);
05137: if (yyResult.hasValue()) {
05138: yyValue = yyResult.semanticValue();
05139:
05140: return yyResult.createValue(yyValue, yyError);
05141: }
05142:
05143: // Done.
05144: return yyError;
05145: }
05146:
05147: // =========================================================================
05148:
05149: /**
05150: * Parse nonterminal xtc.lang.JavaFive.RelationalExpression.
05151: *
05152: * @param yyStart The index.
05153: * @return The result.
05154: * @throws IOException Signals an I/O error.
05155: */
05156: private Result pRelationalExpression(final int yyStart)
05157: throws IOException {
05158: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
05159: if (null == yyColumn.chunk2)
05160: yyColumn.chunk2 = new Chunk2();
05161: if (null == yyColumn.chunk2.fRelationalExpression)
05162: yyColumn.chunk2.fRelationalExpression = pRelationalExpression$1(yyStart);
05163: return yyColumn.chunk2.fRelationalExpression;
05164: }
05165:
05166: /** Actually parse xtc.lang.JavaFive.RelationalExpression. */
05167: private Result pRelationalExpression$1(final int yyStart)
05168: throws IOException {
05169:
05170: Result yyResult;
05171: int yyRepetition1;
05172: Pair<Action<Node>> yyRepValue1;
05173: Node yyValue;
05174: ParseError yyError = ParseError.DUMMY;
05175:
05176: // Alternative <Base>.
05177:
05178: yyResult = pShiftExpression(yyStart);
05179: yyError = yyResult.select(yyError);
05180: if (yyResult.hasValue()) {
05181: final Node v$4 = yyResult.semanticValue();
05182:
05183: yyRepetition1 = yyResult.index;
05184: yyRepValue1 = Pair.empty();
05185: while (true) {
05186:
05187: yyResult = pRelationalExpression$$Tail1(yyRepetition1);
05188: yyError = yyResult.select(yyError);
05189: if (yyResult.hasValue()) {
05190: final Action<Node> v$5 = yyResult.semanticValue();
05191:
05192: yyRepetition1 = yyResult.index;
05193: yyRepValue1 = new Pair<Action<Node>>(v$5,
05194: yyRepValue1);
05195: continue;
05196: }
05197: break;
05198: }
05199: { // Start scope for v$6.
05200: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
05201:
05202: yyValue = apply(v$6, v$4, yyStart);
05203:
05204: return new SemanticValue(yyValue, yyRepetition1,
05205: yyError);
05206: } // End scope for v$6.
05207: }
05208:
05209: // Done.
05210: return yyError;
05211: }
05212:
05213: // =========================================================================
05214:
05215: /**
05216: * Parse synthetic nonterminal
05217: * xtc.lang.JavaFive.RelationalExpression$$Tail1.
05218: *
05219: * @param yyStart The index.
05220: * @return The result.
05221: * @throws IOException Signals an I/O error.
05222: */
05223: private Result pRelationalExpression$$Tail1(final int yyStart)
05224: throws IOException {
05225:
05226: Result yyResult;
05227: Action<Node> yyValue;
05228: ParseError yyError = ParseError.DUMMY;
05229:
05230: // Alternative <Recursion>.
05231:
05232: yyResult = pRelationalOperator(yyStart);
05233: yyError = yyResult.select(yyError);
05234: if (yyResult.hasValue()) {
05235: final Node v$g$2 = yyResult.semanticValue();
05236:
05237: yyResult = pShiftExpression(yyResult.index);
05238: yyError = yyResult.select(yyError);
05239: if (yyResult.hasValue()) {
05240: final Node v$g$3 = yyResult.semanticValue();
05241:
05242: yyValue = new Action<Node>() {
05243: public Node run(Node v$1) {
05244: return GNode.create("RelationalExpression",
05245: v$1, v$g$2, v$g$3);
05246: }
05247: };
05248:
05249: return yyResult.createValue(yyValue, yyError);
05250: }
05251: }
05252:
05253: // Done.
05254: return yyError;
05255: }
05256:
05257: // =========================================================================
05258:
05259: /**
05260: * Parse nonterminal xtc.lang.JavaFive.RelationalOperator.
05261: *
05262: * @param yyStart The index.
05263: * @return The result.
05264: * @throws IOException Signals an I/O error.
05265: */
05266: private Result pRelationalOperator(final int yyStart)
05267: throws IOException {
05268: Result yyResult;
05269: Node yyValue;
05270: ParseError yyError = ParseError.DUMMY;
05271:
05272: // Alternative <Less>.
05273:
05274: yyResult = pSymbol(yyStart);
05275: yyError = yyResult.select(yyError);
05276: if (yyResult.hasValue()
05277: && ((Node) yyResult.semanticValue()).getTokenText()
05278: .equals("<")) {
05279: yyValue = yyResult.semanticValue();
05280:
05281: return yyResult.createValue(yyValue, yyError);
05282: }
05283:
05284: // Alternative <Greater>.
05285:
05286: yyResult = pSymbol(yyStart);
05287: yyError = yyResult.select(yyError);
05288: if (yyResult.hasValue()
05289: && ((Node) yyResult.semanticValue()).getTokenText()
05290: .equals(">")) {
05291: yyValue = yyResult.semanticValue();
05292:
05293: return yyResult.createValue(yyValue, yyError);
05294: }
05295:
05296: // Alternative <LessEqual>.
05297:
05298: yyResult = pSymbol(yyStart);
05299: yyError = yyResult.select(yyError);
05300: if (yyResult.hasValue()
05301: && ((Node) yyResult.semanticValue()).getTokenText()
05302: .equals("<=")) {
05303: yyValue = yyResult.semanticValue();
05304:
05305: return yyResult.createValue(yyValue, yyError);
05306: }
05307:
05308: // Alternative <GreaterEqual>.
05309:
05310: yyResult = pSymbol(yyStart);
05311: yyError = yyResult.select(yyError);
05312: if (yyResult.hasValue()
05313: && ((Node) yyResult.semanticValue()).getTokenText()
05314: .equals(">=")) {
05315: yyValue = yyResult.semanticValue();
05316:
05317: return yyResult.createValue(yyValue, yyError);
05318: }
05319:
05320: // Done.
05321: yyError = yyError.select("relational operator expected",
05322: yyStart);
05323: return yyError;
05324: }
05325:
05326: // =========================================================================
05327:
05328: /**
05329: * Parse nonterminal xtc.lang.JavaFive.ShiftExpression.
05330: *
05331: * @param yyStart The index.
05332: * @return The result.
05333: * @throws IOException Signals an I/O error.
05334: */
05335: private Result pShiftExpression(final int yyStart)
05336: throws IOException {
05337: Result yyResult;
05338: int yyRepetition1;
05339: Pair<Action<Node>> yyRepValue1;
05340: Node yyValue;
05341: ParseError yyError = ParseError.DUMMY;
05342:
05343: // Alternative <Base>.
05344:
05345: yyResult = pAdditiveExpression(yyStart);
05346: yyError = yyResult.select(yyError);
05347: if (yyResult.hasValue()) {
05348: final Node v$4 = yyResult.semanticValue();
05349:
05350: yyRepetition1 = yyResult.index;
05351: yyRepValue1 = Pair.empty();
05352: while (true) {
05353:
05354: yyResult = pShiftExpression$$Tail1(yyRepetition1);
05355: yyError = yyResult.select(yyError);
05356: if (yyResult.hasValue()) {
05357: final Action<Node> v$5 = yyResult.semanticValue();
05358:
05359: yyRepetition1 = yyResult.index;
05360: yyRepValue1 = new Pair<Action<Node>>(v$5,
05361: yyRepValue1);
05362: continue;
05363: }
05364: break;
05365: }
05366: { // Start scope for v$6.
05367: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
05368:
05369: yyValue = apply(v$6, v$4, yyStart);
05370:
05371: return new SemanticValue(yyValue, yyRepetition1,
05372: yyError);
05373: } // End scope for v$6.
05374: }
05375:
05376: // Done.
05377: return yyError;
05378: }
05379:
05380: // =========================================================================
05381:
05382: /**
05383: * Parse synthetic nonterminal xtc.lang.JavaFive.ShiftExpression$$Tail1.
05384: *
05385: * @param yyStart The index.
05386: * @return The result.
05387: * @throws IOException Signals an I/O error.
05388: */
05389: private Result pShiftExpression$$Tail1(final int yyStart)
05390: throws IOException {
05391:
05392: Result yyResult;
05393: Action<Node> yyValue;
05394: ParseError yyError = ParseError.DUMMY;
05395:
05396: // Alternative <Recursion>.
05397:
05398: yyResult = pShiftOperator(yyStart);
05399: yyError = yyResult.select(yyError);
05400: if (yyResult.hasValue()) {
05401: final Node v$g$2 = yyResult.semanticValue();
05402:
05403: yyResult = pAdditiveExpression(yyResult.index);
05404: yyError = yyResult.select(yyError);
05405: if (yyResult.hasValue()) {
05406: final Node v$g$3 = yyResult.semanticValue();
05407:
05408: yyValue = new Action<Node>() {
05409: public Node run(Node v$1) {
05410: return GNode.create("ShiftExpression", v$1,
05411: v$g$2, v$g$3);
05412: }
05413: };
05414:
05415: return yyResult.createValue(yyValue, yyError);
05416: }
05417: }
05418:
05419: // Done.
05420: return yyError;
05421: }
05422:
05423: // =========================================================================
05424:
05425: /**
05426: * Parse nonterminal xtc.lang.JavaFive.ShiftOperator.
05427: *
05428: * @param yyStart The index.
05429: * @return The result.
05430: * @throws IOException Signals an I/O error.
05431: */
05432: private Result pShiftOperator(final int yyStart) throws IOException {
05433: Result yyResult;
05434: Node yyValue;
05435: ParseError yyError = ParseError.DUMMY;
05436:
05437: // Alternative <Left>.
05438:
05439: yyResult = pSymbol(yyStart);
05440: yyError = yyResult.select(yyError);
05441: if (yyResult.hasValue()
05442: && ((Node) yyResult.semanticValue()).getTokenText()
05443: .equals("<<")) {
05444: yyValue = yyResult.semanticValue();
05445:
05446: return yyResult.createValue(yyValue, yyError);
05447: }
05448:
05449: // Alternative <Right>.
05450:
05451: yyResult = pSymbol(yyStart);
05452: yyError = yyResult.select(yyError);
05453: if (yyResult.hasValue()
05454: && ((Node) yyResult.semanticValue()).getTokenText()
05455: .equals(">>")) {
05456: yyValue = yyResult.semanticValue();
05457:
05458: return yyResult.createValue(yyValue, yyError);
05459: }
05460:
05461: // Alternative <UnsignedRight>.
05462:
05463: yyResult = pSymbol(yyStart);
05464: yyError = yyResult.select(yyError);
05465: if (yyResult.hasValue()
05466: && ((Node) yyResult.semanticValue()).getTokenText()
05467: .equals(">>>")) {
05468: yyValue = yyResult.semanticValue();
05469:
05470: return yyResult.createValue(yyValue, yyError);
05471: }
05472:
05473: // Done.
05474: yyError = yyError.select("shift operator expected", yyStart);
05475: return yyError;
05476: }
05477:
05478: // =========================================================================
05479:
05480: /**
05481: * Parse nonterminal xtc.lang.JavaFive.AdditiveExpression.
05482: *
05483: * @param yyStart The index.
05484: * @return The result.
05485: * @throws IOException Signals an I/O error.
05486: */
05487: private Result pAdditiveExpression(final int yyStart)
05488: throws IOException {
05489: Result yyResult;
05490: int yyRepetition1;
05491: Pair<Action<Node>> yyRepValue1;
05492: Node yyValue;
05493: ParseError yyError = ParseError.DUMMY;
05494:
05495: // Alternative <Base>.
05496:
05497: yyResult = pMultiplicativeExpression(yyStart);
05498: yyError = yyResult.select(yyError);
05499: if (yyResult.hasValue()) {
05500: final Node v$4 = yyResult.semanticValue();
05501:
05502: yyRepetition1 = yyResult.index;
05503: yyRepValue1 = Pair.empty();
05504: while (true) {
05505:
05506: yyResult = pAdditiveExpression$$Tail1(yyRepetition1);
05507: yyError = yyResult.select(yyError);
05508: if (yyResult.hasValue()) {
05509: final Action<Node> v$5 = yyResult.semanticValue();
05510:
05511: yyRepetition1 = yyResult.index;
05512: yyRepValue1 = new Pair<Action<Node>>(v$5,
05513: yyRepValue1);
05514: continue;
05515: }
05516: break;
05517: }
05518: { // Start scope for v$6.
05519: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
05520:
05521: yyValue = apply(v$6, v$4, yyStart);
05522:
05523: return new SemanticValue(yyValue, yyRepetition1,
05524: yyError);
05525: } // End scope for v$6.
05526: }
05527:
05528: // Done.
05529: return yyError;
05530: }
05531:
05532: // =========================================================================
05533:
05534: /**
05535: * Parse synthetic nonterminal xtc.lang.JavaFive.AdditiveExpression$$Tail1.
05536: *
05537: * @param yyStart The index.
05538: * @return The result.
05539: * @throws IOException Signals an I/O error.
05540: */
05541: private Result pAdditiveExpression$$Tail1(final int yyStart)
05542: throws IOException {
05543:
05544: Result yyResult;
05545: Action<Node> yyValue;
05546: ParseError yyError = ParseError.DUMMY;
05547:
05548: // Alternative <Recursion>.
05549:
05550: yyResult = pAdditiveOperator(yyStart);
05551: yyError = yyResult.select(yyError);
05552: if (yyResult.hasValue()) {
05553: final Node v$g$2 = yyResult.semanticValue();
05554:
05555: yyResult = pMultiplicativeExpression(yyResult.index);
05556: yyError = yyResult.select(yyError);
05557: if (yyResult.hasValue()) {
05558: final Node v$g$3 = yyResult.semanticValue();
05559:
05560: yyValue = new Action<Node>() {
05561: public Node run(Node v$1) {
05562: return GNode.create("AdditiveExpression", v$1,
05563: v$g$2, v$g$3);
05564: }
05565: };
05566:
05567: return yyResult.createValue(yyValue, yyError);
05568: }
05569: }
05570:
05571: // Done.
05572: return yyError;
05573: }
05574:
05575: // =========================================================================
05576:
05577: /**
05578: * Parse nonterminal xtc.lang.JavaFive.AdditiveOperator.
05579: *
05580: * @param yyStart The index.
05581: * @return The result.
05582: * @throws IOException Signals an I/O error.
05583: */
05584: private Result pAdditiveOperator(final int yyStart)
05585: throws IOException {
05586: Result yyResult;
05587: Node yyValue;
05588: ParseError yyError = ParseError.DUMMY;
05589:
05590: // Alternative <Plus>.
05591:
05592: yyResult = pSymbol(yyStart);
05593: yyError = yyResult.select(yyError);
05594: if (yyResult.hasValue()
05595: && ((Node) yyResult.semanticValue()).getTokenText()
05596: .equals("+")) {
05597: yyValue = yyResult.semanticValue();
05598:
05599: return yyResult.createValue(yyValue, yyError);
05600: }
05601:
05602: // Alternative <Minus>.
05603:
05604: yyResult = pSymbol(yyStart);
05605: yyError = yyResult.select(yyError);
05606: if (yyResult.hasValue()
05607: && ((Node) yyResult.semanticValue()).getTokenText()
05608: .equals("-")) {
05609: yyValue = yyResult.semanticValue();
05610:
05611: return yyResult.createValue(yyValue, yyError);
05612: }
05613:
05614: // Done.
05615: yyError = yyError.select("additive operator expected", yyStart);
05616: return yyError;
05617: }
05618:
05619: // =========================================================================
05620:
05621: /**
05622: * Parse nonterminal xtc.lang.JavaFive.MultiplicativeExpression.
05623: *
05624: * @param yyStart The index.
05625: * @return The result.
05626: * @throws IOException Signals an I/O error.
05627: */
05628: private Result pMultiplicativeExpression(final int yyStart)
05629: throws IOException {
05630:
05631: Result yyResult;
05632: int yyRepetition1;
05633: Pair<Action<Node>> yyRepValue1;
05634: Node yyValue;
05635: ParseError yyError = ParseError.DUMMY;
05636:
05637: // Alternative <Base>.
05638:
05639: yyResult = pUnaryExpression(yyStart);
05640: yyError = yyResult.select(yyError);
05641: if (yyResult.hasValue()) {
05642: final Node v$4 = yyResult.semanticValue();
05643:
05644: yyRepetition1 = yyResult.index;
05645: yyRepValue1 = Pair.empty();
05646: while (true) {
05647:
05648: yyResult = pMultiplicativeExpression$$Tail1(yyRepetition1);
05649: yyError = yyResult.select(yyError);
05650: if (yyResult.hasValue()) {
05651: final Action<Node> v$5 = yyResult.semanticValue();
05652:
05653: yyRepetition1 = yyResult.index;
05654: yyRepValue1 = new Pair<Action<Node>>(v$5,
05655: yyRepValue1);
05656: continue;
05657: }
05658: break;
05659: }
05660: { // Start scope for v$6.
05661: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
05662:
05663: yyValue = apply(v$6, v$4, yyStart);
05664:
05665: return new SemanticValue(yyValue, yyRepetition1,
05666: yyError);
05667: } // End scope for v$6.
05668: }
05669:
05670: // Done.
05671: return yyError;
05672: }
05673:
05674: // =========================================================================
05675:
05676: /**
05677: * Parse synthetic nonterminal
05678: * xtc.lang.JavaFive.MultiplicativeExpression$$Tail1.
05679: *
05680: * @param yyStart The index.
05681: * @return The result.
05682: * @throws IOException Signals an I/O error.
05683: */
05684: private Result pMultiplicativeExpression$$Tail1(final int yyStart)
05685: throws IOException {
05686:
05687: Result yyResult;
05688: Action<Node> yyValue;
05689: ParseError yyError = ParseError.DUMMY;
05690:
05691: // Alternative <Times>.
05692:
05693: yyResult = pMultiplicativeOperator(yyStart);
05694: yyError = yyResult.select(yyError);
05695: if (yyResult.hasValue()) {
05696: final Node v$g$2 = yyResult.semanticValue();
05697:
05698: yyResult = pUnaryExpression(yyResult.index);
05699: yyError = yyResult.select(yyError);
05700: if (yyResult.hasValue()) {
05701: final Node v$g$3 = yyResult.semanticValue();
05702:
05703: yyValue = new Action<Node>() {
05704: public Node run(Node v$1) {
05705: return GNode.create("MultiplicativeExpression",
05706: v$1, v$g$2, v$g$3);
05707: }
05708: };
05709:
05710: return yyResult.createValue(yyValue, yyError);
05711: }
05712: }
05713:
05714: // Done.
05715: return yyError;
05716: }
05717:
05718: // =========================================================================
05719:
05720: /**
05721: * Parse nonterminal xtc.lang.JavaFive.MultiplicativeOperator.
05722: *
05723: * @param yyStart The index.
05724: * @return The result.
05725: * @throws IOException Signals an I/O error.
05726: */
05727: private Result pMultiplicativeOperator(final int yyStart)
05728: throws IOException {
05729:
05730: Result yyResult;
05731: Node yyValue;
05732: ParseError yyError = ParseError.DUMMY;
05733:
05734: // Alternative <Times>.
05735:
05736: yyResult = pSymbol(yyStart);
05737: yyError = yyResult.select(yyError);
05738: if (yyResult.hasValue()
05739: && ((Node) yyResult.semanticValue()).getTokenText()
05740: .equals("*")) {
05741: yyValue = yyResult.semanticValue();
05742:
05743: return yyResult.createValue(yyValue, yyError);
05744: }
05745:
05746: // Alternative <Over>.
05747:
05748: yyResult = pSymbol(yyStart);
05749: yyError = yyResult.select(yyError);
05750: if (yyResult.hasValue()
05751: && ((Node) yyResult.semanticValue()).getTokenText()
05752: .equals("/")) {
05753: yyValue = yyResult.semanticValue();
05754:
05755: return yyResult.createValue(yyValue, yyError);
05756: }
05757:
05758: // Alternative <Modulo>.
05759:
05760: yyResult = pSymbol(yyStart);
05761: yyError = yyResult.select(yyError);
05762: if (yyResult.hasValue()
05763: && ((Node) yyResult.semanticValue()).getTokenText()
05764: .equals("%")) {
05765: yyValue = yyResult.semanticValue();
05766:
05767: return yyResult.createValue(yyValue, yyError);
05768: }
05769:
05770: // Done.
05771: yyError = yyError.select("multiplicative operator expected",
05772: yyStart);
05773: return yyError;
05774: }
05775:
05776: // =========================================================================
05777:
05778: /**
05779: * Parse nonterminal xtc.lang.JavaFive.UnaryExpression.
05780: *
05781: * @param yyStart The index.
05782: * @return The result.
05783: * @throws IOException Signals an I/O error.
05784: */
05785: private Result pUnaryExpression(final int yyStart)
05786: throws IOException {
05787: Result yyResult;
05788: Node yyValue;
05789: ParseError yyError = ParseError.DUMMY;
05790:
05791: // Alternative <Plus>.
05792:
05793: yyResult = pSymbol(yyStart);
05794: yyError = yyResult.select(yyError);
05795: if (yyResult.hasValue()
05796: && ((Node) yyResult.semanticValue()).getTokenText()
05797: .equals("+")) {
05798: final Node v$g$1 = yyResult.semanticValue();
05799:
05800: yyResult = pUnaryExpression(yyResult.index);
05801: yyError = yyResult.select(yyError);
05802: if (yyResult.hasValue()) {
05803: final Node v$g$2 = yyResult.semanticValue();
05804:
05805: yyValue = GNode.create("UnaryExpression", v$g$1, v$g$2);
05806: yyValue.setLocation(location(yyStart));
05807:
05808: return yyResult.createValue(yyValue, yyError);
05809: }
05810: }
05811:
05812: // Alternative <Minus>.
05813:
05814: yyResult = pSymbol(yyStart);
05815: yyError = yyResult.select(yyError);
05816: if (yyResult.hasValue()
05817: && ((Node) yyResult.semanticValue()).getTokenText()
05818: .equals("-")) {
05819: final Node v$g$3 = yyResult.semanticValue();
05820:
05821: yyResult = pUnaryExpression(yyResult.index);
05822: yyError = yyResult.select(yyError);
05823: if (yyResult.hasValue()) {
05824: final Node v$g$4 = yyResult.semanticValue();
05825:
05826: yyValue = GNode.create("UnaryExpression", v$g$3, v$g$4);
05827: yyValue.setLocation(location(yyStart));
05828:
05829: return yyResult.createValue(yyValue, yyError);
05830: }
05831: }
05832:
05833: // Alternative <Increment>.
05834:
05835: yyResult = pSymbol(yyStart);
05836: yyError = yyResult.select(yyError);
05837: if (yyResult.hasValue()
05838: && ((Node) yyResult.semanticValue()).getTokenText()
05839: .equals("++")) {
05840: final Node v$g$5 = yyResult.semanticValue();
05841:
05842: yyResult = pUnaryExpression(yyResult.index);
05843: yyError = yyResult.select(yyError);
05844: if (yyResult.hasValue()) {
05845: final Node v$g$6 = yyResult.semanticValue();
05846:
05847: yyValue = GNode.create("UnaryExpression", v$g$5, v$g$6);
05848: yyValue.setLocation(location(yyStart));
05849:
05850: return yyResult.createValue(yyValue, yyError);
05851: }
05852: }
05853:
05854: // Alternative <Decrement>.
05855:
05856: yyResult = pSymbol(yyStart);
05857: yyError = yyResult.select(yyError);
05858: if (yyResult.hasValue()
05859: && ((Node) yyResult.semanticValue()).getTokenText()
05860: .equals("--")) {
05861: final Node v$g$7 = yyResult.semanticValue();
05862:
05863: yyResult = pUnaryExpression(yyResult.index);
05864: yyError = yyResult.select(yyError);
05865: if (yyResult.hasValue()) {
05866: final Node v$g$8 = yyResult.semanticValue();
05867:
05868: yyValue = GNode.create("UnaryExpression", v$g$7, v$g$8);
05869: yyValue.setLocation(location(yyStart));
05870:
05871: return yyResult.createValue(yyValue, yyError);
05872: }
05873: }
05874:
05875: // Alternative <Base>.
05876:
05877: yyResult = pUnaryExpressionNotPlusMinus(yyStart);
05878: yyError = yyResult.select(yyError);
05879: if (yyResult.hasValue()) {
05880: yyValue = yyResult.semanticValue();
05881:
05882: return yyResult.createValue(yyValue, yyError);
05883: }
05884:
05885: // Done.
05886: yyError = yyError.select("unary expression expected", yyStart);
05887: return yyError;
05888: }
05889:
05890: // =========================================================================
05891:
05892: /**
05893: * Parse nonterminal xtc.lang.JavaFive.UnaryExpressionNotPlusMinus.
05894: *
05895: * @param yyStart The index.
05896: * @return The result.
05897: * @throws IOException Signals an I/O error.
05898: */
05899: private Result pUnaryExpressionNotPlusMinus(final int yyStart)
05900: throws IOException {
05901:
05902: Result yyResult;
05903: int yyBase;
05904: int yyOption1;
05905: Node yyOpValue1;
05906: Node yyValue;
05907: ParseError yyError = ParseError.DUMMY;
05908:
05909: // Alternative 1.
05910:
05911: yyResult = pSymbol(yyStart);
05912: yyError = yyResult.select(yyError);
05913: if (yyResult.hasValue()
05914: && ((Node) yyResult.semanticValue()).getTokenText()
05915: .equals("~")) {
05916: final Node v$pt$1 = yyResult.semanticValue();
05917:
05918: yyResult = pUnaryExpression(yyResult.index);
05919: yyError = yyResult.select(yyError);
05920: if (yyResult.hasValue()) {
05921: final Node v$pt$2 = yyResult.semanticValue();
05922: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
05923:
05924: yyValue = GNode.create("BitwiseNegationExpression",
05925: v$g$1);
05926: yyValue.setLocation(location(yyStart));
05927:
05928: return yyResult.createValue(yyValue, yyError);
05929: }
05930: }
05931:
05932: // Alternative 2.
05933:
05934: yyResult = pSymbol(yyStart);
05935: yyError = yyResult.select(yyError);
05936: if (yyResult.hasValue()
05937: && ((Node) yyResult.semanticValue()).getTokenText()
05938: .equals("!")) {
05939: final Node v$pt$1 = yyResult.semanticValue();
05940:
05941: yyResult = pUnaryExpression(yyResult.index);
05942: yyError = yyResult.select(yyError);
05943: if (yyResult.hasValue()) {
05944: final Node v$pt$2 = yyResult.semanticValue();
05945: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
05946:
05947: yyValue = GNode.create("LogicalNegationExpression",
05948: v$g$1);
05949: yyValue.setLocation(location(yyStart));
05950:
05951: return yyResult.createValue(yyValue, yyError);
05952: }
05953: }
05954:
05955: // Alternative 3.
05956:
05957: yyResult = pSymbol(yyStart);
05958: yyError = yyResult.select(yyError);
05959: if (yyResult.hasValue()
05960: && ((Node) yyResult.semanticValue()).getTokenText()
05961: .equals("(")) {
05962: final Node v$pt$1 = yyResult.semanticValue();
05963:
05964: final int yyChoice1 = yyResult.index;
05965:
05966: // Nested alternative 1.
05967:
05968: yyResult = pPrimitiveType(yyChoice1);
05969: yyError = yyResult.select(yyError);
05970: if (yyResult.hasValue()) {
05971: final Node v$pt$2 = yyResult.semanticValue();
05972: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
05973:
05974: yyOption1 = yyResult.index;
05975: yyOpValue1 = null;
05976:
05977: yyResult = pDimensions(yyOption1);
05978: yyError = yyResult.select(yyError);
05979: if (yyResult.hasValue()) {
05980: final Node v$el$1 = yyResult.semanticValue();
05981:
05982: yyOption1 = yyResult.index;
05983: yyOpValue1 = v$el$1;
05984: }
05985: { // Start scope for v$pt$4.
05986: final Node v$pt$4 = yyOpValue1;
05987:
05988: yyBase = yyOption1;
05989: yyResult = pSymbol(yyBase);
05990: yyError = yyResult.select(yyError);
05991: if (yyResult.hasValue()
05992: && ((Node) yyResult.semanticValue())
05993: .getTokenText().equals(")")) {
05994: final Node v$pt$3 = yyResult.semanticValue();
05995: final Node v$g$2 = Formatting.after1(v$pt$4,
05996: v$pt$3);
05997:
05998: yyResult = pUnaryExpression(yyResult.index);
05999: yyError = yyResult.select(yyError);
06000: if (yyResult.hasValue()) {
06001: final Node v$g$3 = yyResult.semanticValue();
06002:
06003: yyValue = GNode.create(
06004: "BasicCastExpression", v$g$1,
06005: v$g$2, v$g$3);
06006: yyValue.setLocation(location(yyStart));
06007:
06008: return yyResult.createValue(yyValue,
06009: yyError);
06010: }
06011: } else {
06012: yyError = yyError.select("\")\" expected",
06013: yyBase);
06014: }
06015: } // End scope for v$pt$4.
06016: }
06017:
06018: // Nested alternative 2.
06019:
06020: yyResult = pType(yyChoice1);
06021: yyError = yyResult.select(yyError);
06022: if (yyResult.hasValue()) {
06023: final Node v$pt$3 = yyResult.semanticValue();
06024:
06025: yyBase = yyResult.index;
06026: yyResult = pSymbol(yyBase);
06027: yyError = yyResult.select(yyError);
06028: if (yyResult.hasValue()
06029: && ((Node) yyResult.semanticValue())
06030: .getTokenText().equals(")")) {
06031: final Node v$pt$2 = yyResult.semanticValue();
06032: final Node v$g$1 = Formatting.round1(v$pt$1,
06033: v$pt$3, v$pt$2);
06034:
06035: yyResult = pUnaryExpressionNotPlusMinus(yyResult.index);
06036: yyError = yyResult.select(yyError);
06037: if (yyResult.hasValue()) {
06038: final Node v$g$2 = yyResult.semanticValue();
06039:
06040: yyValue = GNode.create("CastExpression", v$g$1,
06041: v$g$2);
06042: yyValue.setLocation(location(yyStart));
06043:
06044: return yyResult.createValue(yyValue, yyError);
06045: }
06046: } else {
06047: yyError = yyError.select("\")\" expected", yyBase);
06048: }
06049: }
06050: }
06051:
06052: // Alternative <Base>.
06053:
06054: yyResult = pPostfixExpression(yyStart);
06055: yyError = yyResult.select(yyError);
06056: if (yyResult.hasValue()) {
06057: yyValue = yyResult.semanticValue();
06058:
06059: return yyResult.createValue(yyValue, yyError);
06060: }
06061:
06062: // Done.
06063: yyError = yyError.select(
06064: "unary expression not plus minus expected", yyStart);
06065: return yyError;
06066: }
06067:
06068: // =========================================================================
06069:
06070: /**
06071: * Parse nonterminal xtc.lang.JavaFive.PostfixExpression.
06072: *
06073: * @param yyStart The index.
06074: * @return The result.
06075: * @throws IOException Signals an I/O error.
06076: */
06077: private Result pPostfixExpression(final int yyStart)
06078: throws IOException {
06079: Result yyResult;
06080: int yyRepetition1;
06081: Pair<Action<Node>> yyRepValue1;
06082: Node yyValue;
06083: ParseError yyError = ParseError.DUMMY;
06084:
06085: // Alternative <Base>.
06086:
06087: yyResult = pPrimaryExpression(yyStart);
06088: yyError = yyResult.select(yyError);
06089: if (yyResult.hasValue()) {
06090: final Node v$g$16 = yyResult.semanticValue();
06091:
06092: yyRepetition1 = yyResult.index;
06093: yyRepValue1 = Pair.empty();
06094: while (true) {
06095:
06096: yyResult = pPostfixExpression$$Tail1(yyRepetition1);
06097: yyError = yyResult.select(yyError);
06098: if (yyResult.hasValue()) {
06099: final Action<Node> v$17 = yyResult.semanticValue();
06100:
06101: yyRepetition1 = yyResult.index;
06102: yyRepValue1 = new Pair<Action<Node>>(v$17,
06103: yyRepValue1);
06104: continue;
06105: }
06106: break;
06107: }
06108: { // Start scope for v$18.
06109: final Pair<Action<Node>> v$18 = yyRepValue1.reverse();
06110:
06111: yyValue = apply(v$18, v$g$16, yyStart);
06112:
06113: return new SemanticValue(yyValue, yyRepetition1,
06114: yyError);
06115: } // End scope for v$18.
06116: }
06117:
06118: // Done.
06119: return yyError;
06120: }
06121:
06122: // =========================================================================
06123:
06124: /**
06125: * Parse synthetic nonterminal xtc.lang.JavaFive.PostfixExpression$$Tail1.
06126: *
06127: * @param yyStart The index.
06128: * @return The result.
06129: * @throws IOException Signals an I/O error.
06130: */
06131: private Result pPostfixExpression$$Tail1(final int yyStart)
06132: throws IOException {
06133:
06134: Result yyResult;
06135: int yyBase;
06136: int yyOption1;
06137: Node yyOpValue1;
06138: Action<Node> yyValue;
06139: ParseError yyError = ParseError.DUMMY;
06140:
06141: // Alternative 1.
06142:
06143: yyResult = pSymbol(yyStart);
06144: yyError = yyResult.select(yyError);
06145: if (yyResult.hasValue()
06146: && ((Node) yyResult.semanticValue()).getTokenText()
06147: .equals(".")) {
06148: final Node v$pt$1 = yyResult.semanticValue();
06149:
06150: final int yyChoice1 = yyResult.index;
06151:
06152: // Nested alternative 1.
06153:
06154: yyOption1 = yyChoice1;
06155: yyOpValue1 = null;
06156:
06157: yyResult = pTypeArguments(yyOption1);
06158: yyError = yyResult.select(yyError);
06159: if (yyResult.hasValue()) {
06160: final Node v$el$1 = yyResult.semanticValue();
06161:
06162: yyOption1 = yyResult.index;
06163: yyOpValue1 = v$el$1;
06164: }
06165: { // Start scope for v$pt$2.
06166: final Node v$pt$2 = yyOpValue1;
06167: final Node v$g$2 = Formatting.before1(v$pt$1, v$pt$2);
06168:
06169: yyResult = pIdentifier(yyOption1);
06170: yyError = yyResult.select(yyError);
06171: if (yyResult.hasValue()) {
06172: final Node v$g$3 = yyResult.semanticValue();
06173:
06174: yyResult = pArguments(yyResult.index);
06175: yyError = yyResult.select(yyError);
06176: if (yyResult.hasValue()) {
06177: final Node v$g$4 = yyResult.semanticValue();
06178:
06179: yyValue = new Action<Node>() {
06180: public Node run(Node v$1) {
06181: return GNode.create("CallExpression",
06182: v$1, v$g$2, v$g$3, v$g$4);
06183: }
06184: };
06185:
06186: return yyResult.createValue(yyValue, yyError);
06187: }
06188: }
06189: } // End scope for v$pt$2.
06190:
06191: // Nested alternative 2.
06192: final Node v$g$5 = Formatting.before1(v$pt$1, null);
06193:
06194: yyBase = yyChoice1;
06195: yyResult = pWord(yyBase);
06196: yyError = yyResult.select(yyError);
06197: if (yyResult.hasValue()
06198: && ((Node) yyResult.semanticValue()).getTokenText()
06199: .equals("super")) {
06200: final Node v$g$6 = yyResult.semanticValue();
06201:
06202: yyResult = pArguments(yyResult.index);
06203: yyError = yyResult.select(yyError);
06204: if (yyResult.hasValue()) {
06205: final Node v$g$7 = yyResult.semanticValue();
06206:
06207: yyValue = new Action<Node>() {
06208: public Node run(Node v$1) {
06209: return GNode.create("CallExpression", v$1,
06210: v$g$5, v$g$6, v$g$7);
06211: }
06212: };
06213:
06214: return yyResult.createValue(yyValue, yyError);
06215: }
06216: } else {
06217: yyError = yyError.select("\"super\" expected", yyBase);
06218: }
06219:
06220: // Nested alternative 3.
06221:
06222: yyBase = yyChoice1;
06223: yyResult = pWord(yyBase);
06224: yyError = yyResult.select(yyError);
06225: if (yyResult.hasValue()
06226: && ((Node) yyResult.semanticValue()).getTokenText()
06227: .equals("super")) {
06228: final Node v$pt$4 = yyResult.semanticValue();
06229:
06230: yyValue = new Action<Node>() {
06231: public Node run(Node v$1) {
06232: Node yyValue = GNode.create("SuperExpression",
06233: v$1);
06234: yyValue = Formatting.variable()
06235: .addNode(yyValue).add(v$pt$1).add(
06236: v$pt$4);
06237: return yyValue;
06238: }
06239: };
06240:
06241: return yyResult.createValue(yyValue, yyError);
06242: } else {
06243: yyError = yyError.select("\"super\" expected", yyBase);
06244: }
06245:
06246: // Nested alternative 4.
06247:
06248: yyResult = pIdentifier(yyChoice1);
06249: yyError = yyResult.select(yyError);
06250: if (yyResult.hasValue()) {
06251: final Node v$pt$5 = yyResult.semanticValue();
06252: final Node v$g$8 = Formatting.before1(v$pt$1, v$pt$5);
06253:
06254: yyValue = new Action<Node>() {
06255: public Node run(Node v$1) {
06256: return GNode.create("SelectionExpression", v$1,
06257: v$g$8);
06258: }
06259: };
06260:
06261: return yyResult.createValue(yyValue, yyError);
06262: }
06263: }
06264:
06265: // Alternative 2.
06266:
06267: yyResult = pSymbol(yyStart);
06268: yyError = yyResult.select(yyError);
06269: if (yyResult.hasValue()
06270: && ((Node) yyResult.semanticValue()).getTokenText()
06271: .equals("[")) {
06272: final Node v$pt$6 = yyResult.semanticValue();
06273:
06274: yyResult = pExpression(yyResult.index);
06275: yyError = yyResult.select(yyError);
06276: if (yyResult.hasValue()) {
06277: final Node v$pt$8 = yyResult.semanticValue();
06278:
06279: yyBase = yyResult.index;
06280: yyResult = pSymbol(yyBase);
06281: yyError = yyResult.select(yyError);
06282: if (yyResult.hasValue()
06283: && ((Node) yyResult.semanticValue())
06284: .getTokenText().equals("]")) {
06285: final Node v$pt$7 = yyResult.semanticValue();
06286: final Node v$g$9 = Formatting.round1(v$pt$6,
06287: v$pt$8, v$pt$7);
06288:
06289: yyValue = new Action<Node>() {
06290: public Node run(Node v$1) {
06291: return GNode.create("SubscriptExpression",
06292: v$1, v$g$9);
06293: }
06294: };
06295:
06296: return yyResult.createValue(yyValue, yyError);
06297: } else {
06298: yyError = yyError.select("\"]\" expected", yyBase);
06299: }
06300: }
06301: }
06302:
06303: // Alternative 3.
06304:
06305: yyResult = pSymbol(yyStart);
06306: yyError = yyResult.select(yyError);
06307: if (yyResult.hasValue()
06308: && ((Node) yyResult.semanticValue()).getTokenText()
06309: .equals("++")) {
06310: final Node v$g$10 = yyResult.semanticValue();
06311:
06312: yyValue = new Action<Node>() {
06313: public Node run(Node v$1) {
06314: return GNode.create("PostfixExpression", v$1,
06315: v$g$10);
06316: }
06317: };
06318:
06319: return yyResult.createValue(yyValue, yyError);
06320: }
06321:
06322: // Alternative 4.
06323:
06324: yyResult = pSymbol(yyStart);
06325: yyError = yyResult.select(yyError);
06326: if (yyResult.hasValue()
06327: && ((Node) yyResult.semanticValue()).getTokenText()
06328: .equals("--")) {
06329: final Node v$g$11 = yyResult.semanticValue();
06330:
06331: yyValue = new Action<Node>() {
06332: public Node run(Node v$1) {
06333: return GNode.create("PostfixExpression", v$1,
06334: v$g$11);
06335: }
06336: };
06337:
06338: return yyResult.createValue(yyValue, yyError);
06339: }
06340:
06341: // Alternative 5.
06342:
06343: yyResult = pSymbol(yyStart);
06344: yyError = yyResult.select(yyError);
06345: if (yyResult.hasValue()
06346: && ((Node) yyResult.semanticValue()).getTokenText()
06347: .equals(".")) {
06348: final Node v$pt$9 = yyResult.semanticValue();
06349:
06350: yyBase = yyResult.index;
06351: yyResult = pWord(yyBase);
06352: yyError = yyResult.select(yyError);
06353: if (yyResult.hasValue()
06354: && ((Node) yyResult.semanticValue()).getTokenText()
06355: .equals("new")) {
06356: final Node v$pt$10 = yyResult.semanticValue();
06357:
06358: yyOption1 = yyResult.index;
06359: yyOpValue1 = null;
06360:
06361: yyResult = pTypeArguments(yyOption1);
06362: yyError = yyResult.select(yyError);
06363: if (yyResult.hasValue()) {
06364: final Node v$el$2 = yyResult.semanticValue();
06365:
06366: yyOption1 = yyResult.index;
06367: yyOpValue1 = v$el$2;
06368: }
06369: { // Start scope for v$pt$11.
06370: final Node v$pt$11 = yyOpValue1;
06371: final Node v$g$12 = Formatting.variable().add(
06372: v$pt$9).add(v$pt$10).addNode(v$pt$11);
06373:
06374: yyResult = pTypeName(yyOption1);
06375: yyError = yyResult.select(yyError);
06376: if (yyResult.hasValue()) {
06377: final Node v$g$13 = yyResult.semanticValue();
06378:
06379: yyResult = pArguments(yyResult.index);
06380: yyError = yyResult.select(yyError);
06381: if (yyResult.hasValue()) {
06382: final Node v$g$14 = yyResult
06383: .semanticValue();
06384:
06385: yyOption1 = yyResult.index;
06386: yyOpValue1 = null;
06387:
06388: yyResult = pClassBody(yyOption1);
06389: yyError = yyResult.select(yyError);
06390: if (yyResult.hasValue()) {
06391: final Node v$el$3 = yyResult
06392: .semanticValue();
06393:
06394: yyOption1 = yyResult.index;
06395: yyOpValue1 = v$el$3;
06396: }
06397: { // Start scope for v$g$15.
06398: final Node v$g$15 = yyOpValue1;
06399:
06400: yyValue = new Action<Node>() {
06401: public Node run(Node v$1) {
06402: return GNode.create(
06403: "NewClassExpression",
06404: v$1, v$g$12, v$g$13,
06405: v$g$14, v$g$15);
06406: }
06407: };
06408:
06409: return new SemanticValue(yyValue,
06410: yyOption1, yyError);
06411: } // End scope for v$g$15.
06412: }
06413: }
06414: } // End scope for v$pt$11.
06415: } else {
06416: yyError = yyError.select("\"new\" expected", yyBase);
06417: }
06418: }
06419:
06420: // Done.
06421: yyError = yyError
06422: .select("postfix expression expected", yyStart);
06423: return yyError;
06424: }
06425:
06426: // =========================================================================
06427:
06428: /**
06429: * Parse nonterminal xtc.lang.JavaFive.PrimaryExpression.
06430: *
06431: * @param yyStart The index.
06432: * @return The result.
06433: * @throws IOException Signals an I/O error.
06434: */
06435: private Result pPrimaryExpression(final int yyStart)
06436: throws IOException {
06437: Result yyResult;
06438: int yyBase;
06439: int yyOption1;
06440: Node yyOpValue1;
06441: Node yyValue;
06442: ParseError yyError = ParseError.DUMMY;
06443:
06444: // Alternative <Literal>.
06445:
06446: yyResult = pLiteral(yyStart);
06447: yyError = yyResult.select(yyError);
06448: if (yyResult.hasValue()) {
06449: yyValue = yyResult.semanticValue();
06450:
06451: return yyResult.createValue(yyValue, yyError);
06452: }
06453:
06454: // Alternative <Expression>.
06455:
06456: yyOption1 = yyStart;
06457: yyOpValue1 = null;
06458:
06459: yyResult = pTypeArguments(yyOption1);
06460: yyError = yyResult.select(yyError);
06461: if (yyResult.hasValue()) {
06462: final Node v$el$1 = yyResult.semanticValue();
06463:
06464: yyOption1 = yyResult.index;
06465: yyOpValue1 = v$el$1;
06466: }
06467: { // Start scope for v$g$2.
06468: final Node v$g$2 = yyOpValue1;
06469:
06470: yyResult = pIdentifier(yyOption1);
06471: yyError = yyResult.select(yyError);
06472: if (yyResult.hasValue()) {
06473: final Node v$g$3 = yyResult.semanticValue();
06474:
06475: yyResult = pArguments(yyResult.index);
06476: yyError = yyResult.select(yyError);
06477: if (yyResult.hasValue()) {
06478: final Node v$g$4 = yyResult.semanticValue();
06479:
06480: yyValue = GNode.create("CallExpression", null,
06481: v$g$2, v$g$3, v$g$4);
06482: yyValue.setLocation(location(yyStart));
06483:
06484: return yyResult.createValue(yyValue, yyError);
06485: }
06486: }
06487: } // End scope for v$g$2.
06488:
06489: // Alternative <Expression>.
06490:
06491: yyResult = pResultType(yyStart);
06492: yyError = yyResult.select(yyError);
06493: if (yyResult.hasValue()) {
06494: final Node v$pt$3 = yyResult.semanticValue();
06495:
06496: yyBase = yyResult.index;
06497: yyResult = pSymbol(yyBase);
06498: yyError = yyResult.select(yyError);
06499: if (yyResult.hasValue()
06500: && ((Node) yyResult.semanticValue()).getTokenText()
06501: .equals(".")) {
06502: final Node v$pt$1 = yyResult.semanticValue();
06503:
06504: yyBase = yyResult.index;
06505: yyResult = pWord(yyBase);
06506: yyError = yyResult.select(yyError);
06507: if (yyResult.hasValue()
06508: && ((Node) yyResult.semanticValue())
06509: .getTokenText().equals("class")) {
06510: final Node v$pt$2 = yyResult.semanticValue();
06511: final Node v$g$1 = Formatting.variable().addNode(
06512: v$pt$3).add(v$pt$1).add(v$pt$2);
06513:
06514: yyValue = GNode.create("ClassLiteralExpression",
06515: v$g$1);
06516: yyValue.setLocation(location(yyStart));
06517:
06518: return yyResult.createValue(yyValue, yyError);
06519: } else {
06520: yyError = yyError.select("\"class\" expected",
06521: yyBase);
06522: }
06523: } else {
06524: yyError = yyError.select("\".\" expected", yyBase);
06525: }
06526: }
06527:
06528: // Alternative <Expression>.
06529:
06530: yyResult = pWord(yyStart);
06531: yyError = yyResult.select(yyError);
06532: if (yyResult.hasValue()
06533: && ((Node) yyResult.semanticValue()).getTokenText()
06534: .equals("this")) {
06535: final Node v$g$3 = yyResult.semanticValue();
06536:
06537: yyResult = pArguments(yyResult.index);
06538: yyError = yyResult.select(yyError);
06539: if (yyResult.hasValue()) {
06540: final Node v$g$4 = yyResult.semanticValue();
06541:
06542: yyValue = GNode.create("CallExpression", null, null,
06543: v$g$3, v$g$4);
06544: yyValue.setLocation(location(yyStart));
06545:
06546: return yyResult.createValue(yyValue, yyError);
06547: }
06548: }
06549:
06550: // Alternative <Expression>.
06551:
06552: yyOption1 = yyStart;
06553: yyOpValue1 = null;
06554:
06555: yyResult = pQualifiedIdentifier(yyOption1);
06556: yyError = yyResult.select(yyError);
06557: if (yyResult.hasValue()) {
06558: final Node v$pt$2 = yyResult.semanticValue();
06559:
06560: yyBase = yyResult.index;
06561: yyResult = pSymbol(yyBase);
06562: yyError = yyResult.select(yyError);
06563: if (yyResult.hasValue()
06564: && ((Node) yyResult.semanticValue()).getTokenText()
06565: .equals(".")) {
06566: final Node v$pt$1 = yyResult.semanticValue();
06567: final Node v$el$1 = Formatting.after1(v$pt$2, v$pt$1);
06568:
06569: yyOption1 = yyResult.index;
06570: yyOpValue1 = v$el$1;
06571: } else {
06572: yyError = yyError.select("\".\" expected", yyBase);
06573: }
06574: }
06575: { // Start scope for v$pt$4.
06576: final Node v$pt$4 = yyOpValue1;
06577:
06578: yyBase = yyOption1;
06579: yyResult = pWord(yyBase);
06580: yyError = yyResult.select(yyError);
06581: if (yyResult.hasValue()
06582: && ((Node) yyResult.semanticValue()).getTokenText()
06583: .equals("this")) {
06584: final Node v$pt$3 = yyResult.semanticValue();
06585: final Node v$g$1 = Formatting.after1(v$pt$4, v$pt$3);
06586:
06587: yyValue = GNode.create("ThisExpression", v$g$1);
06588: yyValue.setLocation(location(yyStart));
06589:
06590: return yyResult.createValue(yyValue, yyError);
06591: } else {
06592: yyError = yyError.select("\"this\" expected", yyBase);
06593: }
06594: } // End scope for v$pt$4.
06595:
06596: // Alternative <Expression>.
06597:
06598: yyResult = pWord(yyStart);
06599: yyError = yyResult.select(yyError);
06600: if (yyResult.hasValue()
06601: && ((Node) yyResult.semanticValue()).getTokenText()
06602: .equals("super")) {
06603: final Node v$g$3 = yyResult.semanticValue();
06604:
06605: yyResult = pArguments(yyResult.index);
06606: yyError = yyResult.select(yyError);
06607: if (yyResult.hasValue()) {
06608: final Node v$g$4 = yyResult.semanticValue();
06609:
06610: yyValue = GNode.create("CallExpression", null, null,
06611: v$g$3, v$g$4);
06612: yyValue.setLocation(location(yyStart));
06613:
06614: return yyResult.createValue(yyValue, yyError);
06615: }
06616: }
06617:
06618: // Alternative <Expression>.
06619:
06620: yyResult = pWord(yyStart);
06621: yyError = yyResult.select(yyError);
06622: if (yyResult.hasValue()
06623: && ((Node) yyResult.semanticValue()).getTokenText()
06624: .equals("super")) {
06625: final Node v$pt$1 = yyResult.semanticValue();
06626: final Node v$g$1 = Formatting.after1(null, v$pt$1);
06627:
06628: yyValue = GNode.create("SuperExpression", v$g$1);
06629: yyValue.setLocation(location(yyStart));
06630:
06631: return yyResult.createValue(yyValue, yyError);
06632: }
06633:
06634: // Alternative 8.
06635:
06636: yyResult = pIdentifier(yyStart);
06637: yyError = yyResult.select(yyError);
06638: if (yyResult.hasValue()) {
06639: final Node v$g$1 = yyResult.semanticValue();
06640:
06641: yyValue = GNode.create("PrimaryIdentifier", v$g$1);
06642: yyValue.setLocation(location(yyStart));
06643:
06644: return yyResult.createValue(yyValue, yyError);
06645: }
06646:
06647: // Alternative <Expression>.
06648:
06649: yyResult = pWord(yyStart);
06650: yyError = yyResult.select(yyError);
06651: if (yyResult.hasValue()
06652: && ((Node) yyResult.semanticValue()).getTokenText()
06653: .equals("new")) {
06654: final Node v$pt$1 = yyResult.semanticValue();
06655: final Node v$g$1 = Formatting.after1(null, v$pt$1);
06656:
06657: yyOption1 = yyResult.index;
06658: yyOpValue1 = null;
06659:
06660: yyResult = pTypeArguments(yyOption1);
06661: yyError = yyResult.select(yyError);
06662: if (yyResult.hasValue()) {
06663: final Node v$el$1 = yyResult.semanticValue();
06664:
06665: yyOption1 = yyResult.index;
06666: yyOpValue1 = v$el$1;
06667: }
06668: { // Start scope for v$g$2.
06669: final Node v$g$2 = yyOpValue1;
06670:
06671: yyResult = pTypeName(yyOption1);
06672: yyError = yyResult.select(yyError);
06673: if (yyResult.hasValue()) {
06674: final Node v$g$3 = yyResult.semanticValue();
06675:
06676: yyResult = pArguments(yyResult.index);
06677: yyError = yyResult.select(yyError);
06678: if (yyResult.hasValue()) {
06679: final Node v$g$4 = yyResult.semanticValue();
06680:
06681: yyOption1 = yyResult.index;
06682: yyOpValue1 = null;
06683:
06684: yyResult = pClassBody(yyOption1);
06685: yyError = yyResult.select(yyError);
06686: if (yyResult.hasValue()) {
06687: final Node v$el$2 = yyResult
06688: .semanticValue();
06689:
06690: yyOption1 = yyResult.index;
06691: yyOpValue1 = v$el$2;
06692: }
06693: { // Start scope for v$g$5.
06694: final Node v$g$5 = yyOpValue1;
06695:
06696: yyValue = GNode.create(
06697: "NewClassExpression", v$g$1, v$g$2,
06698: v$g$3, v$g$4, v$g$5);
06699: yyValue.setLocation(location(yyStart));
06700:
06701: return new SemanticValue(yyValue,
06702: yyOption1, yyError);
06703: } // End scope for v$g$5.
06704: }
06705: }
06706: } // End scope for v$g$2.
06707: }
06708:
06709: // Alternative 10.
06710:
06711: yyResult = pWord(yyStart);
06712: yyError = yyResult.select(yyError);
06713: if (yyResult.hasValue()
06714: && ((Node) yyResult.semanticValue()).getTokenText()
06715: .equals("new")) {
06716: final Node v$pt$1 = yyResult.semanticValue();
06717:
06718: yyResult = pTypeName(yyResult.index);
06719: yyError = yyResult.select(yyError);
06720: if (yyResult.hasValue()) {
06721: final Node v$pt$2 = yyResult.semanticValue();
06722: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
06723:
06724: final int yyChoice1 = yyResult.index;
06725:
06726: // Nested alternative 1.
06727:
06728: yyResult = pConcreteDimensions(yyChoice1);
06729: yyError = yyResult.select(yyError);
06730: if (yyResult.hasValue()) {
06731: final Node v$g$2 = yyResult.semanticValue();
06732:
06733: yyOption1 = yyResult.index;
06734: yyOpValue1 = null;
06735:
06736: yyResult = pDimensions(yyOption1);
06737: yyError = yyResult.select(yyError);
06738: if (yyResult.hasValue()) {
06739: final Node v$el$1 = yyResult.semanticValue();
06740:
06741: yyOption1 = yyResult.index;
06742: yyOpValue1 = v$el$1;
06743: }
06744: { // Start scope for v$g$3.
06745: final Node v$g$3 = yyOpValue1;
06746:
06747: yyValue = GNode.create("NewArrayExpression",
06748: v$g$1, v$g$2, v$g$3, null);
06749: yyValue.setLocation(location(yyStart));
06750:
06751: return new SemanticValue(yyValue, yyOption1,
06752: yyError);
06753: } // End scope for v$g$3.
06754: }
06755:
06756: // Nested alternative 2.
06757:
06758: yyOption1 = yyChoice1;
06759: yyOpValue1 = null;
06760:
06761: yyResult = pDimensions(yyOption1);
06762: yyError = yyResult.select(yyError);
06763: if (yyResult.hasValue()) {
06764: final Node v$el$2 = yyResult.semanticValue();
06765:
06766: yyOption1 = yyResult.index;
06767: yyOpValue1 = v$el$2;
06768: }
06769: { // Start scope for v$g$6.
06770: final Node v$g$6 = yyOpValue1;
06771:
06772: yyResult = pArrayInitializer(yyOption1);
06773: yyError = yyResult.select(yyError);
06774: if (yyResult.hasValue()) {
06775: final Node v$g$7 = yyResult.semanticValue();
06776:
06777: yyValue = GNode.create("NewArrayExpression",
06778: v$g$1, null, v$g$6, v$g$7);
06779: yyValue.setLocation(location(yyStart));
06780:
06781: return yyResult.createValue(yyValue, yyError);
06782: }
06783: } // End scope for v$g$6.
06784: }
06785: }
06786:
06787: // Alternative <Nested>.
06788:
06789: yyResult = pSymbol(yyStart);
06790: yyError = yyResult.select(yyError);
06791: if (yyResult.hasValue()
06792: && ((Node) yyResult.semanticValue()).getTokenText()
06793: .equals("(")) {
06794: final Node v$pt$1 = yyResult.semanticValue();
06795:
06796: yyResult = pExpression(yyResult.index);
06797: yyError = yyResult.select(yyError);
06798: if (yyResult.hasValue()) {
06799: final Node v$pt$3 = yyResult.semanticValue();
06800:
06801: yyBase = yyResult.index;
06802: yyResult = pSymbol(yyBase);
06803: yyError = yyResult.select(yyError);
06804: if (yyResult.hasValue()
06805: && ((Node) yyResult.semanticValue())
06806: .getTokenText().equals(")")) {
06807: final Node v$pt$2 = yyResult.semanticValue();
06808: yyValue = Formatting.round1(v$pt$1, v$pt$3, v$pt$2);
06809:
06810: return yyResult.createValue(yyValue, yyError);
06811: } else {
06812: yyError = yyError.select("\")\" expected", yyBase);
06813: }
06814: }
06815: }
06816:
06817: // Done.
06818: yyError = yyError
06819: .select("primary expression expected", yyStart);
06820: return yyError;
06821: }
06822:
06823: // =========================================================================
06824:
06825: /**
06826: * Parse nonterminal xtc.lang.JavaFive.ConcreteDimensions.
06827: *
06828: * @param yyStart The index.
06829: * @return The result.
06830: * @throws IOException Signals an I/O error.
06831: */
06832: private Result pConcreteDimensions(final int yyStart)
06833: throws IOException {
06834: Result yyResult;
06835: int yyRepetition1;
06836: boolean yyRepeated1;
06837: Pair<Node> yyRepValue1;
06838: Node yyValue;
06839: ParseError yyError = ParseError.DUMMY;
06840:
06841: // Alternative 1.
06842:
06843: yyRepetition1 = yyStart;
06844: yyRepeated1 = false;
06845: yyRepValue1 = Pair.empty();
06846: while (true) {
06847:
06848: yyResult = pConcreteDimension(yyRepetition1);
06849: yyError = yyResult.select(yyError);
06850: if (yyResult.hasValue()) {
06851: final Node v$el$1 = yyResult.semanticValue();
06852:
06853: yyRepetition1 = yyResult.index;
06854: yyRepeated1 = true;
06855: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
06856: continue;
06857: }
06858: break;
06859: }
06860:
06861: if (yyRepeated1) {
06862: final Pair<Node> v$g$1 = yyRepValue1.reverse();
06863:
06864: yyValue = GNode.createFromPair("ConcreteDimensions", v$g$1);
06865: yyValue.setLocation(location(yyStart));
06866:
06867: return new SemanticValue(yyValue, yyRepetition1, yyError);
06868: }
06869:
06870: // Done.
06871: return yyError;
06872: }
06873:
06874: // =========================================================================
06875:
06876: /**
06877: * Parse nonterminal xtc.lang.JavaFive.ConcreteDimension.
06878: *
06879: * @param yyStart The index.
06880: * @return The result.
06881: * @throws IOException Signals an I/O error.
06882: */
06883: private Result pConcreteDimension(final int yyStart)
06884: throws IOException {
06885: Result yyResult;
06886: int yyBase;
06887: Node yyValue;
06888: ParseError yyError = ParseError.DUMMY;
06889:
06890: // Alternative 1.
06891:
06892: yyResult = pSymbol(yyStart);
06893: yyError = yyResult.select(yyError);
06894: if (yyResult.hasValue()
06895: && ((Node) yyResult.semanticValue()).getTokenText()
06896: .equals("[")) {
06897: final Node v$pt$1 = yyResult.semanticValue();
06898:
06899: yyResult = pExpression(yyResult.index);
06900: yyError = yyResult.select(yyError);
06901: if (yyResult.hasValue()) {
06902: final Node v$pt$3 = yyResult.semanticValue();
06903:
06904: yyBase = yyResult.index;
06905: yyResult = pSymbol(yyBase);
06906: yyError = yyResult.select(yyError);
06907: if (yyResult.hasValue()
06908: && ((Node) yyResult.semanticValue())
06909: .getTokenText().equals("]")) {
06910: final Node v$pt$2 = yyResult.semanticValue();
06911: yyValue = Formatting.round1(v$pt$1, v$pt$3, v$pt$2);
06912:
06913: return yyResult.createValue(yyValue, yyError);
06914: } else {
06915: yyError = yyError.select("\"]\" expected", yyBase);
06916: }
06917: }
06918: }
06919:
06920: // Done.
06921: yyError = yyError
06922: .select("concrete dimension expected", yyStart);
06923: return yyError;
06924: }
06925:
06926: // =========================================================================
06927:
06928: /**
06929: * Parse nonterminal xtc.lang.JavaFive.ArrayInitializer.
06930: *
06931: * @param yyStart The index.
06932: * @return The result.
06933: * @throws IOException Signals an I/O error.
06934: */
06935: private Result pArrayInitializer(final int yyStart)
06936: throws IOException {
06937: Result yyResult;
06938: int yyBase;
06939: int yyOption1;
06940: Node yyOpValue1;
06941: Node yyValue;
06942: ParseError yyError = ParseError.DUMMY;
06943:
06944: // Alternative 1.
06945:
06946: yyResult = pArrayInitializer$$Split1(yyStart);
06947: yyError = yyResult.select(yyError);
06948: if (yyResult.hasValue()) {
06949: final Node v$pt$1 = yyResult.semanticValue();
06950:
06951: yyOption1 = yyResult.index;
06952: yyOpValue1 = null;
06953:
06954: yyBase = yyOption1;
06955: yyResult = pSymbol(yyBase);
06956: yyError = yyResult.select(yyError);
06957: if (yyResult.hasValue()
06958: && ((Node) yyResult.semanticValue()).getTokenText()
06959: .equals(",")) {
06960: final Node v$el$1 = yyResult.semanticValue();
06961:
06962: yyOption1 = yyResult.index;
06963: yyOpValue1 = v$el$1;
06964: } else {
06965: yyError = yyError.select("\",\" expected", yyBase);
06966: }
06967: { // Start scope for v$pt$2.
06968: final Node v$pt$2 = yyOpValue1;
06969:
06970: yyBase = yyOption1;
06971: yyResult = pSymbol(yyBase);
06972: yyError = yyResult.select(yyError);
06973: if (yyResult.hasValue()
06974: && ((Node) yyResult.semanticValue())
06975: .getTokenText().equals("}")) {
06976: final Node v$pt$3 = yyResult.semanticValue();
06977: yyValue = Formatting.variable().addNode(v$pt$1)
06978: .add(v$pt$2).add(v$pt$3);
06979:
06980: return yyResult.createValue(yyValue, yyError);
06981: } else {
06982: yyError = yyError.select("\"}\" expected", yyBase);
06983: }
06984: } // End scope for v$pt$2.
06985: }
06986:
06987: // Alternative 2.
06988:
06989: yyResult = pSymbol(yyStart);
06990: yyError = yyResult.select(yyError);
06991: if (yyResult.hasValue()
06992: && ((Node) yyResult.semanticValue()).getTokenText()
06993: .equals("{")) {
06994: final Node v$pt$4 = yyResult.semanticValue();
06995:
06996: yyOption1 = yyResult.index;
06997: yyOpValue1 = null;
06998:
06999: yyBase = yyOption1;
07000: yyResult = pSymbol(yyBase);
07001: yyError = yyResult.select(yyError);
07002: if (yyResult.hasValue()
07003: && ((Node) yyResult.semanticValue()).getTokenText()
07004: .equals(",")) {
07005: final Node v$el$2 = yyResult.semanticValue();
07006:
07007: yyOption1 = yyResult.index;
07008: yyOpValue1 = v$el$2;
07009: } else {
07010: yyError = yyError.select("\",\" expected", yyBase);
07011: }
07012: { // Start scope for v$pt$5.
07013: final Node v$pt$5 = yyOpValue1;
07014:
07015: yyBase = yyOption1;
07016: yyResult = pSymbol(yyBase);
07017: yyError = yyResult.select(yyError);
07018: if (yyResult.hasValue()
07019: && ((Node) yyResult.semanticValue())
07020: .getTokenText().equals("}")) {
07021: final Node v$pt$6 = yyResult.semanticValue();
07022:
07023: yyValue = GNode.create("ArrayInitializer", false);
07024: yyValue.setLocation(location(yyStart));
07025: yyValue = Formatting.variable().addNode(yyValue)
07026: .add(v$pt$4).add(v$pt$5).add(v$pt$6);
07027:
07028: return yyResult.createValue(yyValue, yyError);
07029: } else {
07030: yyError = yyError.select("\"}\" expected", yyBase);
07031: }
07032: } // End scope for v$pt$5.
07033: }
07034:
07035: // Done.
07036: yyError = yyError.select("array initializer expected", yyStart);
07037: return yyError;
07038: }
07039:
07040: // =========================================================================
07041:
07042: /**
07043: * Parse synthetic nonterminal xtc.lang.JavaFive.ArrayInitializer$$Split1.
07044: *
07045: * @param yyStart The index.
07046: * @return The result.
07047: * @throws IOException Signals an I/O error.
07048: */
07049: private Result pArrayInitializer$$Split1(final int yyStart)
07050: throws IOException {
07051:
07052: Result yyResult;
07053: int yyBase;
07054: int yyRepetition1;
07055: Pair<Node> yyRepValue1;
07056: Node yyValue;
07057: ParseError yyError = ParseError.DUMMY;
07058:
07059: // Alternative 1.
07060:
07061: yyResult = pSymbol(yyStart);
07062: yyError = yyResult.select(yyError);
07063: if (yyResult.hasValue()
07064: && ((Node) yyResult.semanticValue()).getTokenText()
07065: .equals("{")) {
07066: final Node v$pt$3 = yyResult.semanticValue();
07067:
07068: yyResult = pVariableInitializer(yyResult.index);
07069: yyError = yyResult.select(yyError);
07070: if (yyResult.hasValue()) {
07071: final Node v$pt$4 = yyResult.semanticValue();
07072: final Node v$g$1 = Formatting.before1(v$pt$3, v$pt$4);
07073:
07074: yyRepetition1 = yyResult.index;
07075: yyRepValue1 = Pair.empty();
07076: while (true) {
07077:
07078: yyBase = yyRepetition1;
07079: yyResult = pSymbol(yyBase);
07080: yyError = yyResult.select(yyError);
07081: if (yyResult.hasValue()
07082: && ((Node) yyResult.semanticValue())
07083: .getTokenText().equals(",")) {
07084: final Node v$pt$1 = yyResult.semanticValue();
07085:
07086: yyResult = pVariableInitializer(yyResult.index);
07087: yyError = yyResult.select(yyError);
07088: if (yyResult.hasValue()) {
07089: final Node v$pt$2 = yyResult
07090: .semanticValue();
07091: final Node v$el$1 = Formatting.before1(
07092: v$pt$1, v$pt$2);
07093:
07094: yyRepetition1 = yyResult.index;
07095: yyRepValue1 = new Pair<Node>(v$el$1,
07096: yyRepValue1);
07097: continue;
07098: }
07099: } else {
07100: yyError = yyError.select("\",\" expected",
07101: yyBase);
07102: }
07103: break;
07104: }
07105: { // Start scope for v$g$2.
07106: final Pair<Node> v$g$2 = yyRepValue1.reverse();
07107:
07108: yyValue = GNode.createFromPair("ArrayInitializer",
07109: v$g$1, v$g$2);
07110: yyValue.setLocation(location(yyStart));
07111:
07112: return new SemanticValue(yyValue, yyRepetition1,
07113: yyError);
07114: } // End scope for v$g$2.
07115: }
07116: }
07117:
07118: // Done.
07119: yyError = yyError.select("array initializer expected", yyStart);
07120: return yyError;
07121: }
07122:
07123: // =========================================================================
07124:
07125: /**
07126: * Parse nonterminal xtc.lang.JavaFive.VariableInitializer.
07127: *
07128: * @param yyStart The index.
07129: * @return The result.
07130: * @throws IOException Signals an I/O error.
07131: */
07132: private Result pVariableInitializer(final int yyStart)
07133: throws IOException {
07134: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
07135: if (null == yyColumn.chunk2)
07136: yyColumn.chunk2 = new Chunk2();
07137: if (null == yyColumn.chunk2.fVariableInitializer)
07138: yyColumn.chunk2.fVariableInitializer = pVariableInitializer$1(yyStart);
07139: return yyColumn.chunk2.fVariableInitializer;
07140: }
07141:
07142: /** Actually parse xtc.lang.JavaFive.VariableInitializer. */
07143: private Result pVariableInitializer$1(final int yyStart)
07144: throws IOException {
07145:
07146: Result yyResult;
07147: Node yyValue;
07148: ParseError yyError = ParseError.DUMMY;
07149:
07150: // Alternative <Array>.
07151:
07152: yyResult = pArrayInitializer(yyStart);
07153: yyError = yyResult.select(yyError);
07154: if (yyResult.hasValue()) {
07155: yyValue = yyResult.semanticValue();
07156:
07157: return yyResult.createValue(yyValue, yyError);
07158: }
07159:
07160: // Alternative <Expression>.
07161:
07162: yyResult = pExpression(yyStart);
07163: yyError = yyResult.select(yyError);
07164: if (yyResult.hasValue()) {
07165: yyValue = yyResult.semanticValue();
07166:
07167: return yyResult.createValue(yyValue, yyError);
07168: }
07169:
07170: // Done.
07171: return yyError;
07172: }
07173:
07174: // =========================================================================
07175:
07176: /**
07177: * Parse nonterminal xtc.lang.JavaFive.Arguments.
07178: *
07179: * @param yyStart The index.
07180: * @return The result.
07181: * @throws IOException Signals an I/O error.
07182: */
07183: private Result pArguments(final int yyStart) throws IOException {
07184: Result yyResult;
07185: int yyBase;
07186: Node yyValue;
07187: ParseError yyError = ParseError.DUMMY;
07188:
07189: // Alternative 1.
07190:
07191: yyResult = pArguments$$Split1(yyStart);
07192: yyError = yyResult.select(yyError);
07193: if (yyResult.hasValue()) {
07194: final Node v$pt$1 = yyResult.semanticValue();
07195:
07196: yyBase = yyResult.index;
07197: yyResult = pSymbol(yyBase);
07198: yyError = yyResult.select(yyError);
07199: if (yyResult.hasValue()
07200: && ((Node) yyResult.semanticValue()).getTokenText()
07201: .equals(")")) {
07202: final Node v$pt$2 = yyResult.semanticValue();
07203: yyValue = Formatting.after1(v$pt$1, v$pt$2);
07204:
07205: return yyResult.createValue(yyValue, yyError);
07206: } else {
07207: yyError = yyError.select("\")\" expected", yyBase);
07208: }
07209: }
07210:
07211: // Alternative 2.
07212:
07213: yyResult = pSymbol(yyStart);
07214: yyError = yyResult.select(yyError);
07215: if (yyResult.hasValue()
07216: && ((Node) yyResult.semanticValue()).getTokenText()
07217: .equals("(")) {
07218: final Node v$pt$3 = yyResult.semanticValue();
07219:
07220: yyBase = yyResult.index;
07221: yyResult = pSymbol(yyBase);
07222: yyError = yyResult.select(yyError);
07223: if (yyResult.hasValue()
07224: && ((Node) yyResult.semanticValue()).getTokenText()
07225: .equals(")")) {
07226: final Node v$pt$4 = yyResult.semanticValue();
07227:
07228: yyValue = GNode.create("Arguments", false);
07229: yyValue.setLocation(location(yyStart));
07230: yyValue = Formatting.variable().addNode(yyValue).add(
07231: v$pt$3).add(v$pt$4);
07232:
07233: return yyResult.createValue(yyValue, yyError);
07234: } else {
07235: yyError = yyError.select("\")\" expected", yyBase);
07236: }
07237: }
07238:
07239: // Done.
07240: yyError = yyError.select("arguments expected", yyStart);
07241: return yyError;
07242: }
07243:
07244: // =========================================================================
07245:
07246: /**
07247: * Parse synthetic nonterminal xtc.lang.JavaFive.Arguments$$Split1.
07248: *
07249: * @param yyStart The index.
07250: * @return The result.
07251: * @throws IOException Signals an I/O error.
07252: */
07253: private Result pArguments$$Split1(final int yyStart)
07254: throws IOException {
07255: Result yyResult;
07256: int yyBase;
07257: int yyRepetition1;
07258: Pair<Node> yyRepValue1;
07259: Node yyValue;
07260: ParseError yyError = ParseError.DUMMY;
07261:
07262: // Alternative 1.
07263:
07264: yyResult = pSymbol(yyStart);
07265: yyError = yyResult.select(yyError);
07266: if (yyResult.hasValue()
07267: && ((Node) yyResult.semanticValue()).getTokenText()
07268: .equals("(")) {
07269: final Node v$pt$3 = yyResult.semanticValue();
07270:
07271: yyResult = pExpression(yyResult.index);
07272: yyError = yyResult.select(yyError);
07273: if (yyResult.hasValue()) {
07274: final Node v$pt$4 = yyResult.semanticValue();
07275: final Node v$g$1 = Formatting.before1(v$pt$3, v$pt$4);
07276:
07277: yyRepetition1 = yyResult.index;
07278: yyRepValue1 = Pair.empty();
07279: while (true) {
07280:
07281: yyBase = yyRepetition1;
07282: yyResult = pSymbol(yyBase);
07283: yyError = yyResult.select(yyError);
07284: if (yyResult.hasValue()
07285: && ((Node) yyResult.semanticValue())
07286: .getTokenText().equals(",")) {
07287: final Node v$pt$1 = yyResult.semanticValue();
07288:
07289: yyResult = pExpression(yyResult.index);
07290: yyError = yyResult.select(yyError);
07291: if (yyResult.hasValue()) {
07292: final Node v$pt$2 = yyResult
07293: .semanticValue();
07294: final Node v$el$1 = Formatting.before1(
07295: v$pt$1, v$pt$2);
07296:
07297: yyRepetition1 = yyResult.index;
07298: yyRepValue1 = new Pair<Node>(v$el$1,
07299: yyRepValue1);
07300: continue;
07301: }
07302: } else {
07303: yyError = yyError.select("\",\" expected",
07304: yyBase);
07305: }
07306: break;
07307: }
07308: { // Start scope for v$g$2.
07309: final Pair<Node> v$g$2 = yyRepValue1.reverse();
07310:
07311: yyValue = GNode.createFromPair("Arguments", v$g$1,
07312: v$g$2);
07313: yyValue.setLocation(location(yyStart));
07314:
07315: return new SemanticValue(yyValue, yyRepetition1,
07316: yyError);
07317: } // End scope for v$g$2.
07318: }
07319: }
07320:
07321: // Done.
07322: yyError = yyError.select("arguments expected", yyStart);
07323: return yyError;
07324: }
07325:
07326: // =========================================================================
07327:
07328: /**
07329: * Parse nonterminal xtc.lang.JavaFive.VariableModifier.
07330: *
07331: * @param yyStart The index.
07332: * @return The result.
07333: * @throws IOException Signals an I/O error.
07334: */
07335: private Result pVariableModifier(final int yyStart)
07336: throws IOException {
07337: Result yyResult;
07338: Node yyValue;
07339: ParseError yyError = ParseError.DUMMY;
07340:
07341: // Alternative <Final>.
07342:
07343: yyResult = pFinalModifier(yyStart);
07344: yyError = yyResult.select(yyError);
07345: if (yyResult.hasValue()) {
07346: yyValue = yyResult.semanticValue();
07347:
07348: return yyResult.createValue(yyValue, yyError);
07349: }
07350:
07351: // Alternative <Annotation>.
07352:
07353: yyResult = pAnnotation(yyStart);
07354: yyError = yyResult.select(yyError);
07355: if (yyResult.hasValue()) {
07356: yyValue = yyResult.semanticValue();
07357:
07358: return yyResult.createValue(yyValue, yyError);
07359: }
07360:
07361: // Done.
07362: return yyError;
07363: }
07364:
07365: // =========================================================================
07366:
07367: /**
07368: * Parse nonterminal xtc.lang.JavaFive.Annotations.
07369: *
07370: * @param yyStart The index.
07371: * @return The result.
07372: * @throws IOException Signals an I/O error.
07373: */
07374: private Result pAnnotations(final int yyStart) throws IOException {
07375: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
07376: if (null == yyColumn.chunk2)
07377: yyColumn.chunk2 = new Chunk2();
07378: if (null == yyColumn.chunk2.fAnnotations)
07379: yyColumn.chunk2.fAnnotations = pAnnotations$1(yyStart);
07380: return yyColumn.chunk2.fAnnotations;
07381: }
07382:
07383: /** Actually parse xtc.lang.JavaFive.Annotations. */
07384: private Result pAnnotations$1(final int yyStart) throws IOException {
07385: Result yyResult;
07386: Node yyValue;
07387: ParseError yyError = ParseError.DUMMY;
07388:
07389: // Alternative 1.
07390:
07391: yyResult = pAnnotations$$Plus1(yyStart);
07392: yyError = yyResult.select(yyError);
07393: if (yyResult.hasValue()) {
07394: final Pair<Node> v$g$1 = yyResult.semanticValue();
07395:
07396: yyValue = GNode.createFromPair("Annotations", v$g$1);
07397: yyValue.setLocation(location(yyStart));
07398:
07399: return yyResult.createValue(yyValue, yyError);
07400: }
07401:
07402: // Done.
07403: return yyError;
07404: }
07405:
07406: // =========================================================================
07407:
07408: /**
07409: * Parse synthetic nonterminal xtc.lang.JavaFive.Annotations$$Plus1.
07410: *
07411: * @param yyStart The index.
07412: * @return The result.
07413: * @throws IOException Signals an I/O error.
07414: */
07415: private Result pAnnotations$$Plus1(final int yyStart)
07416: throws IOException {
07417: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
07418: if (null == yyColumn.chunk2)
07419: yyColumn.chunk2 = new Chunk2();
07420: if (null == yyColumn.chunk2.fAnnotations$$Plus1)
07421: yyColumn.chunk2.fAnnotations$$Plus1 = pAnnotations$$Plus1$1(yyStart);
07422: return yyColumn.chunk2.fAnnotations$$Plus1;
07423: }
07424:
07425: /** Actually parse xtc.lang.JavaFive.Annotations$$Plus1. */
07426: private Result pAnnotations$$Plus1$1(final int yyStart)
07427: throws IOException {
07428: Result yyResult;
07429: Pair<Node> yyValue;
07430: ParseError yyError = ParseError.DUMMY;
07431:
07432: // Alternative 1.
07433:
07434: yyResult = pAnnotation(yyStart);
07435: yyError = yyResult.select(yyError);
07436: if (yyResult.hasValue()) {
07437: final Node v$el$1 = yyResult.semanticValue();
07438:
07439: final int yyChoice1 = yyResult.index;
07440:
07441: // Nested alternative 1.
07442:
07443: yyResult = pAnnotations$$Plus1(yyChoice1);
07444: yyError = yyResult.select(yyError);
07445: if (yyResult.hasValue()) {
07446: final Pair<Node> v$2 = yyResult.semanticValue();
07447:
07448: yyValue = new Pair<Node>(v$el$1, v$2);
07449:
07450: return yyResult.createValue(yyValue, yyError);
07451: }
07452:
07453: // Nested alternative 2.
07454:
07455: yyValue = new Pair<Node>(v$el$1);
07456:
07457: return new SemanticValue(yyValue, yyChoice1, yyError);
07458: }
07459:
07460: // Done.
07461: return yyError;
07462: }
07463:
07464: // =========================================================================
07465:
07466: /**
07467: * Parse nonterminal xtc.lang.JavaFive.Annotation.
07468: *
07469: * @param yyStart The index.
07470: * @return The result.
07471: * @throws IOException Signals an I/O error.
07472: */
07473: private Result pAnnotation(final int yyStart) throws IOException {
07474: Result yyResult;
07475: Node yyValue;
07476: ParseError yyError = ParseError.DUMMY;
07477:
07478: // Alternative 1.
07479:
07480: yyResult = pSymbol(yyStart);
07481: yyError = yyResult.select(yyError);
07482: if (yyResult.hasValue()
07483: && ((Node) yyResult.semanticValue()).getTokenText()
07484: .equals("@")) {
07485: final Node v$pt$1 = yyResult.semanticValue();
07486:
07487: yyResult = pTypeName(yyResult.index);
07488: yyError = yyResult.select(yyError);
07489: if (yyResult.hasValue()) {
07490: final Node v$pt$2 = yyResult.semanticValue();
07491: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
07492:
07493: yyResult = pAnnotationValue(yyResult.index);
07494: yyError = yyResult.select(yyError);
07495: if (yyResult.hasValue()) {
07496: final Node v$g$2 = yyResult.semanticValue();
07497:
07498: yyValue = GNode.create("Annotation", v$g$1, v$g$2);
07499: yyValue.setLocation(location(yyStart));
07500:
07501: return yyResult.createValue(yyValue, yyError);
07502: }
07503: }
07504: }
07505:
07506: // Done.
07507: yyError = yyError.select("annotation expected", yyStart);
07508: return yyError;
07509: }
07510:
07511: // =========================================================================
07512:
07513: /**
07514: * Parse nonterminal xtc.lang.JavaFive.AnnotationValue.
07515: *
07516: * @param yyStart The index.
07517: * @return The result.
07518: * @throws IOException Signals an I/O error.
07519: */
07520: private Result pAnnotationValue(final int yyStart)
07521: throws IOException {
07522: Result yyResult;
07523: int yyBase;
07524: int yyOption1;
07525: Node yyOpValue1;
07526: Node yyValue;
07527: ParseError yyError = ParseError.DUMMY;
07528:
07529: // Alternative 1.
07530:
07531: yyResult = pSymbol(yyStart);
07532: yyError = yyResult.select(yyError);
07533: if (yyResult.hasValue()
07534: && ((Node) yyResult.semanticValue()).getTokenText()
07535: .equals("(")) {
07536: final Node v$pt$1 = yyResult.semanticValue();
07537:
07538: final int yyChoice1 = yyResult.index;
07539:
07540: // Nested alternative 1.
07541:
07542: yyOption1 = yyChoice1;
07543: yyOpValue1 = null;
07544:
07545: yyResult = pElementValuePairs(yyOption1);
07546: yyError = yyResult.select(yyError);
07547: if (yyResult.hasValue()) {
07548: final Node v$el$4 = yyResult.semanticValue();
07549:
07550: yyOption1 = yyResult.index;
07551: yyOpValue1 = v$el$4;
07552: }
07553: { // Start scope for v$pt$3.
07554: final Node v$pt$3 = yyOpValue1;
07555:
07556: yyBase = yyOption1;
07557: yyResult = pSymbol(yyBase);
07558: yyError = yyResult.select(yyError);
07559: if (yyResult.hasValue()
07560: && ((Node) yyResult.semanticValue())
07561: .getTokenText().equals(")")) {
07562: final Node v$pt$2 = yyResult.semanticValue();
07563: yyValue = Formatting.round1(v$pt$1, v$pt$3, v$pt$2);
07564:
07565: return yyResult.createValue(yyValue, yyError);
07566: } else {
07567: yyError = yyError.select("\")\" expected", yyBase);
07568: }
07569: } // End scope for v$pt$3.
07570:
07571: // Nested alternative 2.
07572:
07573: yyResult = pElementValue(yyChoice1);
07574: yyError = yyResult.select(yyError);
07575: if (yyResult.hasValue()) {
07576: final Node v$pt$5 = yyResult.semanticValue();
07577:
07578: yyBase = yyResult.index;
07579: yyResult = pSymbol(yyBase);
07580: yyError = yyResult.select(yyError);
07581: if (yyResult.hasValue()
07582: && ((Node) yyResult.semanticValue())
07583: .getTokenText().equals(")")) {
07584: final Node v$pt$4 = yyResult.semanticValue();
07585: yyValue = Formatting.round1(v$pt$1, v$pt$5, v$pt$4);
07586:
07587: return yyResult.createValue(yyValue, yyError);
07588: } else {
07589: yyError = yyError.select("\")\" expected", yyBase);
07590: }
07591: }
07592: }
07593:
07594: // Alternative <Empty>.
07595: { // Start scope for yyValue.
07596: yyValue = null;
07597:
07598: return new SemanticValue(yyValue, yyStart, yyError);
07599: } // End scope for yyValue.
07600: }
07601:
07602: // =========================================================================
07603:
07604: /**
07605: * Parse nonterminal xtc.lang.JavaFive.ElementValuePairs.
07606: *
07607: * @param yyStart The index.
07608: * @return The result.
07609: * @throws IOException Signals an I/O error.
07610: */
07611: private Result pElementValuePairs(final int yyStart)
07612: throws IOException {
07613: Result yyResult;
07614: int yyBase;
07615: int yyRepetition1;
07616: Pair<Node> yyRepValue1;
07617: Node yyValue;
07618: ParseError yyError = ParseError.DUMMY;
07619:
07620: // Alternative 1.
07621:
07622: yyResult = pElementValuePair(yyStart);
07623: yyError = yyResult.select(yyError);
07624: if (yyResult.hasValue()) {
07625: final Node v$g$1 = yyResult.semanticValue();
07626:
07627: yyRepetition1 = yyResult.index;
07628: yyRepValue1 = Pair.empty();
07629: while (true) {
07630:
07631: yyBase = yyRepetition1;
07632: yyResult = pSymbol(yyBase);
07633: yyError = yyResult.select(yyError);
07634: if (yyResult.hasValue()
07635: && ((Node) yyResult.semanticValue())
07636: .getTokenText().equals(",")) {
07637: final Node v$pt$1 = yyResult.semanticValue();
07638:
07639: yyResult = pElementValuePair(yyResult.index);
07640: yyError = yyResult.select(yyError);
07641: if (yyResult.hasValue()) {
07642: final Node v$pt$2 = yyResult.semanticValue();
07643: final Node v$el$1 = Formatting.before1(v$pt$1,
07644: v$pt$2);
07645:
07646: yyRepetition1 = yyResult.index;
07647: yyRepValue1 = new Pair<Node>(v$el$1,
07648: yyRepValue1);
07649: continue;
07650: }
07651: } else {
07652: yyError = yyError.select("\",\" expected", yyBase);
07653: }
07654: break;
07655: }
07656: { // Start scope for v$g$2.
07657: final Pair<Node> v$g$2 = yyRepValue1.reverse();
07658:
07659: yyValue = GNode.createFromPair("ElementValuePairs",
07660: v$g$1, v$g$2);
07661: yyValue.setLocation(location(yyStart));
07662:
07663: return new SemanticValue(yyValue, yyRepetition1,
07664: yyError);
07665: } // End scope for v$g$2.
07666: }
07667:
07668: // Done.
07669: return yyError;
07670: }
07671:
07672: // =========================================================================
07673:
07674: /**
07675: * Parse nonterminal xtc.lang.JavaFive.ElementValuePair.
07676: *
07677: * @param yyStart The index.
07678: * @return The result.
07679: * @throws IOException Signals an I/O error.
07680: */
07681: private Result pElementValuePair(final int yyStart)
07682: throws IOException {
07683: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
07684: if (null == yyColumn.chunk2)
07685: yyColumn.chunk2 = new Chunk2();
07686: if (null == yyColumn.chunk2.fElementValuePair)
07687: yyColumn.chunk2.fElementValuePair = pElementValuePair$1(yyStart);
07688: return yyColumn.chunk2.fElementValuePair;
07689: }
07690:
07691: /** Actually parse xtc.lang.JavaFive.ElementValuePair. */
07692: private Result pElementValuePair$1(final int yyStart)
07693: throws IOException {
07694: Result yyResult;
07695: int yyBase;
07696: Node yyValue;
07697: ParseError yyError = ParseError.DUMMY;
07698:
07699: // Alternative 1.
07700:
07701: yyResult = pIdentifier(yyStart);
07702: yyError = yyResult.select(yyError);
07703: if (yyResult.hasValue()) {
07704: final Node v$pt$2 = yyResult.semanticValue();
07705:
07706: yyBase = yyResult.index;
07707: yyResult = pSymbol(yyBase);
07708: yyError = yyResult.select(yyError);
07709: if (yyResult.hasValue()
07710: && ((Node) yyResult.semanticValue()).getTokenText()
07711: .equals("=")) {
07712: final Node v$pt$1 = yyResult.semanticValue();
07713: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
07714:
07715: yyResult = pElementValue(yyResult.index);
07716: yyError = yyResult.select(yyError);
07717: if (yyResult.hasValue()) {
07718: final Node v$g$2 = yyResult.semanticValue();
07719:
07720: yyValue = GNode.create("ElementValuePair", v$g$1,
07721: v$g$2);
07722: yyValue.setLocation(location(yyStart));
07723:
07724: return yyResult.createValue(yyValue, yyError);
07725: }
07726: } else {
07727: yyError = yyError.select("\"=\" expected", yyBase);
07728: }
07729: }
07730:
07731: // Done.
07732: return yyError;
07733: }
07734:
07735: // =========================================================================
07736:
07737: /**
07738: * Parse nonterminal xtc.lang.JavaFive.ElementValue.
07739: *
07740: * @param yyStart The index.
07741: * @return The result.
07742: * @throws IOException Signals an I/O error.
07743: */
07744: private Result pElementValue(final int yyStart) throws IOException {
07745: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
07746: if (null == yyColumn.chunk2)
07747: yyColumn.chunk2 = new Chunk2();
07748: if (null == yyColumn.chunk2.fElementValue)
07749: yyColumn.chunk2.fElementValue = pElementValue$1(yyStart);
07750: return yyColumn.chunk2.fElementValue;
07751: }
07752:
07753: /** Actually parse xtc.lang.JavaFive.ElementValue. */
07754: private Result pElementValue$1(final int yyStart)
07755: throws IOException {
07756: Result yyResult;
07757: Node yyValue;
07758: ParseError yyError = ParseError.DUMMY;
07759:
07760: // Alternative <Expression>.
07761:
07762: yyResult = pExpression(yyStart);
07763: yyError = yyResult.select(yyError);
07764: if (yyResult.hasValue()) {
07765: yyValue = yyResult.semanticValue();
07766:
07767: return yyResult.createValue(yyValue, yyError);
07768: }
07769:
07770: // Alternative <Annotation>.
07771:
07772: yyResult = pAnnotation(yyStart);
07773: yyError = yyResult.select(yyError);
07774: if (yyResult.hasValue()) {
07775: yyValue = yyResult.semanticValue();
07776:
07777: return yyResult.createValue(yyValue, yyError);
07778: }
07779:
07780: // Alternative <Array>.
07781:
07782: yyResult = pElementArrayInitializer(yyStart);
07783: yyError = yyResult.select(yyError);
07784: if (yyResult.hasValue()) {
07785: yyValue = yyResult.semanticValue();
07786:
07787: return yyResult.createValue(yyValue, yyError);
07788: }
07789:
07790: // Done.
07791: return yyError;
07792: }
07793:
07794: // =========================================================================
07795:
07796: /**
07797: * Parse nonterminal xtc.lang.JavaFive.ElementArrayInitializer.
07798: *
07799: * @param yyStart The index.
07800: * @return The result.
07801: * @throws IOException Signals an I/O error.
07802: */
07803: private Result pElementArrayInitializer(final int yyStart)
07804: throws IOException {
07805:
07806: Result yyResult;
07807: int yyBase;
07808: int yyOption1;
07809: Node yyOpValue1;
07810: Node yyValue;
07811: ParseError yyError = ParseError.DUMMY;
07812:
07813: // Alternative 1.
07814:
07815: yyResult = pElementArrayInitializer$$Split1(yyStart);
07816: yyError = yyResult.select(yyError);
07817: if (yyResult.hasValue()) {
07818: final Node v$pt$1 = yyResult.semanticValue();
07819:
07820: yyOption1 = yyResult.index;
07821: yyOpValue1 = null;
07822:
07823: yyBase = yyOption1;
07824: yyResult = pSymbol(yyBase);
07825: yyError = yyResult.select(yyError);
07826: if (yyResult.hasValue()
07827: && ((Node) yyResult.semanticValue()).getTokenText()
07828: .equals(",")) {
07829: final Node v$el$1 = yyResult.semanticValue();
07830:
07831: yyOption1 = yyResult.index;
07832: yyOpValue1 = v$el$1;
07833: } else {
07834: yyError = yyError.select("\",\" expected", yyBase);
07835: }
07836: { // Start scope for v$pt$2.
07837: final Node v$pt$2 = yyOpValue1;
07838:
07839: yyBase = yyOption1;
07840: yyResult = pSymbol(yyBase);
07841: yyError = yyResult.select(yyError);
07842: if (yyResult.hasValue()
07843: && ((Node) yyResult.semanticValue())
07844: .getTokenText().equals("}")) {
07845: final Node v$pt$3 = yyResult.semanticValue();
07846: yyValue = Formatting.variable().addNode(v$pt$1)
07847: .add(v$pt$2).add(v$pt$3);
07848:
07849: return yyResult.createValue(yyValue, yyError);
07850: } else {
07851: yyError = yyError.select("\"}\" expected", yyBase);
07852: }
07853: } // End scope for v$pt$2.
07854: }
07855:
07856: // Alternative 2.
07857:
07858: yyResult = pSymbol(yyStart);
07859: yyError = yyResult.select(yyError);
07860: if (yyResult.hasValue()
07861: && ((Node) yyResult.semanticValue()).getTokenText()
07862: .equals("{")) {
07863: final Node v$pt$4 = yyResult.semanticValue();
07864:
07865: yyOption1 = yyResult.index;
07866: yyOpValue1 = null;
07867:
07868: yyBase = yyOption1;
07869: yyResult = pSymbol(yyBase);
07870: yyError = yyResult.select(yyError);
07871: if (yyResult.hasValue()
07872: && ((Node) yyResult.semanticValue()).getTokenText()
07873: .equals(",")) {
07874: final Node v$el$2 = yyResult.semanticValue();
07875:
07876: yyOption1 = yyResult.index;
07877: yyOpValue1 = v$el$2;
07878: } else {
07879: yyError = yyError.select("\",\" expected", yyBase);
07880: }
07881: { // Start scope for v$pt$5.
07882: final Node v$pt$5 = yyOpValue1;
07883:
07884: yyBase = yyOption1;
07885: yyResult = pSymbol(yyBase);
07886: yyError = yyResult.select(yyError);
07887: if (yyResult.hasValue()
07888: && ((Node) yyResult.semanticValue())
07889: .getTokenText().equals("}")) {
07890: final Node v$pt$6 = yyResult.semanticValue();
07891:
07892: yyValue = GNode.create("ArrayInitializer", false);
07893: yyValue.setLocation(location(yyStart));
07894: yyValue = Formatting.variable().addNode(yyValue)
07895: .add(v$pt$4).add(v$pt$5).add(v$pt$6);
07896:
07897: return yyResult.createValue(yyValue, yyError);
07898: } else {
07899: yyError = yyError.select("\"}\" expected", yyBase);
07900: }
07901: } // End scope for v$pt$5.
07902: }
07903:
07904: // Done.
07905: yyError = yyError.select("element array initializer expected",
07906: yyStart);
07907: return yyError;
07908: }
07909:
07910: // =========================================================================
07911:
07912: /**
07913: * Parse synthetic nonterminal
07914: * xtc.lang.JavaFive.ElementArrayInitializer$$Split1.
07915: *
07916: * @param yyStart The index.
07917: * @return The result.
07918: * @throws IOException Signals an I/O error.
07919: */
07920: private Result pElementArrayInitializer$$Split1(final int yyStart)
07921: throws IOException {
07922:
07923: Result yyResult;
07924: int yyBase;
07925: int yyRepetition1;
07926: Pair<Node> yyRepValue1;
07927: Node yyValue;
07928: ParseError yyError = ParseError.DUMMY;
07929:
07930: // Alternative 1.
07931:
07932: yyResult = pSymbol(yyStart);
07933: yyError = yyResult.select(yyError);
07934: if (yyResult.hasValue()
07935: && ((Node) yyResult.semanticValue()).getTokenText()
07936: .equals("{")) {
07937: final Node v$pt$3 = yyResult.semanticValue();
07938:
07939: yyResult = pElementValue(yyResult.index);
07940: yyError = yyResult.select(yyError);
07941: if (yyResult.hasValue()) {
07942: final Node v$pt$4 = yyResult.semanticValue();
07943: final Node v$g$1 = Formatting.before1(v$pt$3, v$pt$4);
07944:
07945: yyRepetition1 = yyResult.index;
07946: yyRepValue1 = Pair.empty();
07947: while (true) {
07948:
07949: yyBase = yyRepetition1;
07950: yyResult = pSymbol(yyBase);
07951: yyError = yyResult.select(yyError);
07952: if (yyResult.hasValue()
07953: && ((Node) yyResult.semanticValue())
07954: .getTokenText().equals(",")) {
07955: final Node v$pt$1 = yyResult.semanticValue();
07956:
07957: yyResult = pElementValue(yyResult.index);
07958: yyError = yyResult.select(yyError);
07959: if (yyResult.hasValue()) {
07960: final Node v$pt$2 = yyResult
07961: .semanticValue();
07962: final Node v$el$1 = Formatting.before1(
07963: v$pt$1, v$pt$2);
07964:
07965: yyRepetition1 = yyResult.index;
07966: yyRepValue1 = new Pair<Node>(v$el$1,
07967: yyRepValue1);
07968: continue;
07969: }
07970: } else {
07971: yyError = yyError.select("\",\" expected",
07972: yyBase);
07973: }
07974: break;
07975: }
07976: { // Start scope for v$g$2.
07977: final Pair<Node> v$g$2 = yyRepValue1.reverse();
07978:
07979: yyValue = GNode.createFromPair("ArrayInitializer",
07980: v$g$1, v$g$2);
07981: yyValue.setLocation(location(yyStart));
07982:
07983: return new SemanticValue(yyValue, yyRepetition1,
07984: yyError);
07985: } // End scope for v$g$2.
07986: }
07987: }
07988:
07989: // Done.
07990: yyError = yyError.select("element array initializer expected",
07991: yyStart);
07992: return yyError;
07993: }
07994:
07995: // =========================================================================
07996:
07997: /**
07998: * Parse nonterminal xtc.lang.JavaFive.AnnotationBody.
07999: *
08000: * @param yyStart The index.
08001: * @return The result.
08002: * @throws IOException Signals an I/O error.
08003: */
08004: private Result pAnnotationBody(final int yyStart)
08005: throws IOException {
08006: Result yyResult;
08007: int yyBase;
08008: Node yyValue;
08009: ParseError yyError = ParseError.DUMMY;
08010:
08011: // Alternative <Body>.
08012:
08013: yyResult = pSymbol(yyStart);
08014: yyError = yyResult.select(yyError);
08015: if (yyResult.hasValue()
08016: && ((Node) yyResult.semanticValue()).getTokenText()
08017: .equals("{")) {
08018: final Node v$pt$1 = yyResult.semanticValue();
08019:
08020: yyResult = pAnnotationBody$$Split1(yyResult.index);
08021: yyError = yyResult.select(yyError);
08022: if (yyResult.hasValue()) {
08023: final Node v$pt$2 = yyResult.semanticValue();
08024:
08025: yyBase = yyResult.index;
08026: yyResult = pSymbol(yyBase);
08027: yyError = yyResult.select(yyError);
08028: if (yyResult.hasValue()
08029: && ((Node) yyResult.semanticValue())
08030: .getTokenText().equals("}")) {
08031: final Node v$pt$3 = yyResult.semanticValue();
08032: yyValue = Formatting.round1(v$pt$1, v$pt$2, v$pt$3);
08033:
08034: return yyResult.createValue(yyValue, yyError);
08035: } else {
08036: yyError = yyError.select("\"}\" expected", yyBase);
08037: }
08038: }
08039: }
08040:
08041: // Done.
08042: yyError = yyError.select("annotation body expected", yyStart);
08043: return yyError;
08044: }
08045:
08046: // =========================================================================
08047:
08048: /**
08049: * Parse synthetic nonterminal xtc.lang.JavaFive.AnnotationBody$$Split1.
08050: *
08051: * @param yyStart The index.
08052: * @return The result.
08053: * @throws IOException Signals an I/O error.
08054: */
08055: private Result pAnnotationBody$$Split1(final int yyStart)
08056: throws IOException {
08057:
08058: Result yyResult;
08059: int yyRepetition1;
08060: Pair<Node> yyRepValue1;
08061: Node yyValue;
08062: ParseError yyError = ParseError.DUMMY;
08063:
08064: // Alternative <Body>.
08065:
08066: yyRepetition1 = yyStart;
08067: yyRepValue1 = Pair.empty();
08068: while (true) {
08069:
08070: yyResult = pAnnotationElement(yyRepetition1);
08071: yyError = yyResult.select(yyError);
08072: if (yyResult.hasValue()) {
08073: final Node v$el$1 = yyResult.semanticValue();
08074:
08075: yyRepetition1 = yyResult.index;
08076: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
08077: continue;
08078: }
08079: break;
08080: }
08081: { // Start scope for v$g$1.
08082: final Pair<Node> v$g$1 = yyRepValue1.reverse();
08083:
08084: yyValue = GNode.createFromPair("ClassBody", v$g$1);
08085: yyValue.setLocation(location(yyStart));
08086:
08087: return new SemanticValue(yyValue, yyRepetition1, yyError);
08088: } // End scope for v$g$1.
08089: }
08090:
08091: // =========================================================================
08092:
08093: /**
08094: * Parse nonterminal xtc.lang.JavaFive.AnnotationElement.
08095: *
08096: * @param yyStart The index.
08097: * @return The result.
08098: * @throws IOException Signals an I/O error.
08099: */
08100: private Result pAnnotationElement(final int yyStart)
08101: throws IOException {
08102: Result yyResult;
08103: int yyBase;
08104: int yyOption1;
08105: Node yyOpValue1;
08106: Node yyValue;
08107: ParseError yyError = ParseError.DUMMY;
08108:
08109: // Alternative 1.
08110:
08111: yyResult = pModifiers(yyStart);
08112: yyError = yyResult.select(yyError);
08113: if (yyResult.hasValue()) {
08114: final Node v$g$1 = yyResult.semanticValue();
08115:
08116: yyResult = pType(yyResult.index);
08117: yyError = yyResult.select(yyError);
08118: if (yyResult.hasValue()) {
08119: final Node v$g$2 = yyResult.semanticValue();
08120:
08121: final int yyChoice1 = yyResult.index;
08122:
08123: // Nested alternative 1.
08124:
08125: yyResult = pIdentifier(yyChoice1);
08126: yyError = yyResult.select(yyError);
08127: if (yyResult.hasValue()) {
08128: final Node v$pt$3 = yyResult.semanticValue();
08129:
08130: yyBase = yyResult.index;
08131: yyResult = pSymbol(yyBase);
08132: yyError = yyResult.select(yyError);
08133: if (yyResult.hasValue()
08134: && ((Node) yyResult.semanticValue())
08135: .getTokenText().equals("(")) {
08136: final Node v$pt$1 = yyResult.semanticValue();
08137:
08138: yyBase = yyResult.index;
08139: yyResult = pSymbol(yyBase);
08140: yyError = yyResult.select(yyError);
08141: if (yyResult.hasValue()
08142: && ((Node) yyResult.semanticValue())
08143: .getTokenText().equals(")")) {
08144: final Node v$pt$2 = yyResult
08145: .semanticValue();
08146: final Node v$g$3 = Formatting.variable()
08147: .addNode(v$pt$3).add(v$pt$1).add(
08148: v$pt$2);
08149:
08150: yyOption1 = yyResult.index;
08151: yyOpValue1 = null;
08152:
08153: yyResult = pDefaultValue(yyOption1);
08154: yyError = yyResult.select(yyError);
08155: if (yyResult.hasValue()) {
08156: final Node v$el$1 = yyResult
08157: .semanticValue();
08158:
08159: yyOption1 = yyResult.index;
08160: yyOpValue1 = v$el$1;
08161: }
08162: { // Start scope for v$pt$5.
08163: final Node v$pt$5 = yyOpValue1;
08164:
08165: yyBase = yyOption1;
08166: yyResult = pSymbol(yyBase);
08167: yyError = yyResult.select(yyError);
08168: if (yyResult.hasValue()
08169: && ((Node) yyResult
08170: .semanticValue())
08171: .getTokenText().equals(
08172: ";")) {
08173: final Node v$pt$4 = yyResult
08174: .semanticValue();
08175: final Node v$g$4 = Formatting
08176: .after1(v$pt$5, v$pt$4);
08177:
08178: yyValue = GNode.create(
08179: "AnnotationMethod", v$g$1,
08180: v$g$2, v$g$3, v$g$4);
08181: yyValue
08182: .setLocation(location(yyStart));
08183:
08184: return yyResult.createValue(
08185: yyValue, yyError);
08186: } else {
08187: yyError = yyError.select(
08188: "\";\" expected", yyBase);
08189: }
08190: } // End scope for v$pt$5.
08191: } else {
08192: yyError = yyError.select("\")\" expected",
08193: yyBase);
08194: }
08195: } else {
08196: yyError = yyError.select("\"(\" expected",
08197: yyBase);
08198: }
08199: }
08200:
08201: // Nested alternative 2.
08202:
08203: yyResult = pDeclarators(yyChoice1);
08204: yyError = yyResult.select(yyError);
08205: if (yyResult.hasValue()) {
08206: final Node v$pt$2 = yyResult.semanticValue();
08207:
08208: yyBase = yyResult.index;
08209: yyResult = pSymbol(yyBase);
08210: yyError = yyResult.select(yyError);
08211: if (yyResult.hasValue()
08212: && ((Node) yyResult.semanticValue())
08213: .getTokenText().equals(";")) {
08214: final Node v$pt$1 = yyResult.semanticValue();
08215: final Node v$g$3 = Formatting.after1(v$pt$2,
08216: v$pt$1);
08217:
08218: yyValue = GNode.create("FieldDeclaration",
08219: v$g$1, v$g$2, v$g$3);
08220: yyValue.setLocation(location(yyStart));
08221:
08222: return yyResult.createValue(yyValue, yyError);
08223: } else {
08224: yyError = yyError.select("\";\" expected",
08225: yyBase);
08226: }
08227: }
08228: }
08229: }
08230:
08231: // Alternative 2.
08232:
08233: yyResult = pModifiers(yyStart);
08234: yyError = yyResult.select(yyError);
08235: if (yyResult.hasValue()) {
08236: final Node v$pt$2 = yyResult.semanticValue();
08237:
08238: final int yyChoice1 = yyResult.index;
08239:
08240: // Nested alternative 1.
08241:
08242: yyBase = yyChoice1;
08243: yyResult = pWord(yyBase);
08244: yyError = yyResult.select(yyError);
08245: if (yyResult.hasValue()
08246: && ((Node) yyResult.semanticValue()).getTokenText()
08247: .equals("class")) {
08248: final Node v$pt$1 = yyResult.semanticValue();
08249: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
08250:
08251: yyResult = pIdentifier(yyResult.index);
08252: yyError = yyResult.select(yyError);
08253: if (yyResult.hasValue()) {
08254: final Node v$g$2 = yyResult.semanticValue();
08255:
08256: yyOption1 = yyResult.index;
08257: yyOpValue1 = null;
08258:
08259: yyResult = pTypeParameters(yyOption1);
08260: yyError = yyResult.select(yyError);
08261: if (yyResult.hasValue()) {
08262: final Node v$el$1 = yyResult.semanticValue();
08263:
08264: yyOption1 = yyResult.index;
08265: yyOpValue1 = v$el$1;
08266: }
08267: { // Start scope for v$g$3.
08268: final Node v$g$3 = yyOpValue1;
08269:
08270: yyOpValue1 = null;
08271:
08272: yyResult = pExtension(yyOption1);
08273: yyError = yyResult.select(yyError);
08274: if (yyResult.hasValue()) {
08275: final Node v$el$2 = yyResult
08276: .semanticValue();
08277:
08278: yyOption1 = yyResult.index;
08279: yyOpValue1 = v$el$2;
08280: }
08281: { // Start scope for v$g$4.
08282: final Node v$g$4 = yyOpValue1;
08283:
08284: yyOpValue1 = null;
08285:
08286: yyResult = pImplementation(yyOption1);
08287: yyError = yyResult.select(yyError);
08288: if (yyResult.hasValue()) {
08289: final Node v$el$3 = yyResult
08290: .semanticValue();
08291:
08292: yyOption1 = yyResult.index;
08293: yyOpValue1 = v$el$3;
08294: }
08295: { // Start scope for v$g$5.
08296: final Node v$g$5 = yyOpValue1;
08297:
08298: yyResult = pClassBody(yyOption1);
08299: yyError = yyResult.select(yyError);
08300: if (yyResult.hasValue()) {
08301: final Node v$g$6 = yyResult
08302: .semanticValue();
08303:
08304: yyValue = GNode.create(
08305: "ClassDeclaration", v$g$1,
08306: v$g$2, v$g$3, v$g$4, v$g$5,
08307: v$g$6);
08308: yyValue
08309: .setLocation(location(yyStart));
08310:
08311: return yyResult.createValue(
08312: yyValue, yyError);
08313: }
08314: } // End scope for v$g$5.
08315: } // End scope for v$g$4.
08316: } // End scope for v$g$3.
08317: }
08318: } else {
08319: yyError = yyError.select("\"class\" expected", yyBase);
08320: }
08321:
08322: // Nested alternative 2.
08323:
08324: yyBase = yyChoice1;
08325: yyResult = pWord(yyBase);
08326: yyError = yyResult.select(yyError);
08327: if (yyResult.hasValue()
08328: && ((Node) yyResult.semanticValue()).getTokenText()
08329: .equals("interface")) {
08330: final Node v$pt$1 = yyResult.semanticValue();
08331: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
08332:
08333: yyResult = pIdentifier(yyResult.index);
08334: yyError = yyResult.select(yyError);
08335: if (yyResult.hasValue()) {
08336: final Node v$g$2 = yyResult.semanticValue();
08337:
08338: yyOption1 = yyResult.index;
08339: yyOpValue1 = null;
08340:
08341: yyResult = pTypeParameters(yyOption1);
08342: yyError = yyResult.select(yyError);
08343: if (yyResult.hasValue()) {
08344: final Node v$el$1 = yyResult.semanticValue();
08345:
08346: yyOption1 = yyResult.index;
08347: yyOpValue1 = v$el$1;
08348: }
08349: { // Start scope for v$g$3.
08350: final Node v$g$3 = yyOpValue1;
08351:
08352: yyOpValue1 = null;
08353:
08354: yyResult = pExtension(yyOption1);
08355: yyError = yyResult.select(yyError);
08356: if (yyResult.hasValue()) {
08357: final Node v$el$2 = yyResult
08358: .semanticValue();
08359:
08360: yyOption1 = yyResult.index;
08361: yyOpValue1 = v$el$2;
08362: }
08363: { // Start scope for v$g$4.
08364: final Node v$g$4 = yyOpValue1;
08365:
08366: yyResult = pClassBody(yyOption1);
08367: yyError = yyResult.select(yyError);
08368: if (yyResult.hasValue()) {
08369: final Node v$g$5 = yyResult
08370: .semanticValue();
08371:
08372: yyValue = GNode.create(
08373: "InterfaceDeclaration", v$g$1,
08374: v$g$2, v$g$3, v$g$4, v$g$5);
08375: yyValue.setLocation(location(yyStart));
08376:
08377: return yyResult.createValue(yyValue,
08378: yyError);
08379: }
08380: } // End scope for v$g$4.
08381: } // End scope for v$g$3.
08382: }
08383: } else {
08384: yyError = yyError.select("\"interface\" expected",
08385: yyBase);
08386: }
08387:
08388: // Nested alternative 3.
08389:
08390: yyBase = yyChoice1;
08391: yyResult = pWord(yyBase);
08392: yyError = yyResult.select(yyError);
08393: if (yyResult.hasValue()
08394: && ((Node) yyResult.semanticValue()).getTokenText()
08395: .equals("enum")) {
08396: final Node v$pt$1 = yyResult.semanticValue();
08397: final Node v$g$1 = Formatting.after1(v$pt$2, v$pt$1);
08398:
08399: yyResult = pIdentifier(yyResult.index);
08400: yyError = yyResult.select(yyError);
08401: if (yyResult.hasValue()) {
08402: final Node v$g$2 = yyResult.semanticValue();
08403:
08404: yyOption1 = yyResult.index;
08405: yyOpValue1 = null;
08406:
08407: yyResult = pImplementation(yyOption1);
08408: yyError = yyResult.select(yyError);
08409: if (yyResult.hasValue()) {
08410: final Node v$el$1 = yyResult.semanticValue();
08411:
08412: yyOption1 = yyResult.index;
08413: yyOpValue1 = v$el$1;
08414: }
08415: { // Start scope for v$pt$4.
08416: final Node v$pt$4 = yyOpValue1;
08417:
08418: yyBase = yyOption1;
08419: yyResult = pSymbol(yyBase);
08420: yyError = yyResult.select(yyError);
08421: if (yyResult.hasValue()
08422: && ((Node) yyResult.semanticValue())
08423: .getTokenText().equals("{")) {
08424: final Node v$pt$3 = yyResult
08425: .semanticValue();
08426: final Node v$g$3 = Formatting.after1(
08427: v$pt$4, v$pt$3);
08428:
08429: yyOption1 = yyResult.index;
08430: yyOpValue1 = null;
08431:
08432: yyResult = pEnumConstants(yyOption1);
08433: yyError = yyResult.select(yyError);
08434: if (yyResult.hasValue()) {
08435: final Node v$el$2 = yyResult
08436: .semanticValue();
08437:
08438: yyOption1 = yyResult.index;
08439: yyOpValue1 = v$el$2;
08440: }
08441: { // Start scope for v$pt$6.
08442: final Node v$pt$6 = yyOpValue1;
08443:
08444: yyOpValue1 = null;
08445:
08446: yyBase = yyOption1;
08447: yyResult = pSymbol(yyBase);
08448: yyError = yyResult.select(yyError);
08449: if (yyResult.hasValue()
08450: && ((Node) yyResult
08451: .semanticValue())
08452: .getTokenText().equals(
08453: ",")) {
08454: final Node v$el$3 = yyResult
08455: .semanticValue();
08456:
08457: yyOption1 = yyResult.index;
08458: yyOpValue1 = v$el$3;
08459: } else {
08460: yyError = yyError.select(
08461: "\",\" expected", yyBase);
08462: }
08463: { // Start scope for v$pt$5.
08464: final Node v$pt$5 = yyOpValue1;
08465: final Node v$g$4 = Formatting
08466: .after1(v$pt$6, v$pt$5);
08467:
08468: yyOpValue1 = null;
08469:
08470: yyResult = pEnumMembers(yyOption1);
08471: yyError = yyResult.select(yyError);
08472: if (yyResult.hasValue()) {
08473: final Node v$el$4 = yyResult
08474: .semanticValue();
08475:
08476: yyOption1 = yyResult.index;
08477: yyOpValue1 = v$el$4;
08478: }
08479: { // Start scope for v$pt$8.
08480: final Node v$pt$8 = yyOpValue1;
08481:
08482: yyBase = yyOption1;
08483: yyResult = pSymbol(yyBase);
08484: yyError = yyResult
08485: .select(yyError);
08486: if (yyResult.hasValue()
08487: && ((Node) yyResult
08488: .semanticValue())
08489: .getTokenText()
08490: .equals("}")) {
08491: final Node v$pt$7 = yyResult
08492: .semanticValue();
08493: final Node v$g$5 = Formatting
08494: .after1(v$pt$8,
08495: v$pt$7);
08496:
08497: yyValue = GNode
08498: .create(
08499: "EnumDeclaration",
08500: v$g$1,
08501: v$g$2,
08502: v$g$3,
08503: v$g$4,
08504: v$g$5);
08505: yyValue
08506: .setLocation(location(yyStart));
08507:
08508: return yyResult
08509: .createValue(
08510: yyValue,
08511: yyError);
08512: } else {
08513: yyError = yyError.select(
08514: "\"}\" expected",
08515: yyBase);
08516: }
08517: } // End scope for v$pt$8.
08518: } // End scope for v$pt$5.
08519: } // End scope for v$pt$6.
08520: } else {
08521: yyError = yyError.select("\"{\" expected",
08522: yyBase);
08523: }
08524: } // End scope for v$pt$4.
08525: }
08526: } else {
08527: yyError = yyError.select("\"enum\" expected", yyBase);
08528: }
08529: }
08530:
08531: // Alternative <Declaration>.
08532:
08533: yyResult = pModifiers(yyStart);
08534: yyError = yyResult.select(yyError);
08535: if (yyResult.hasValue()) {
08536: final Node v$pt$3 = yyResult.semanticValue();
08537:
08538: yyBase = yyResult.index;
08539: yyResult = pSymbol(yyBase);
08540: yyError = yyResult.select(yyError);
08541: if (yyResult.hasValue()
08542: && ((Node) yyResult.semanticValue()).getTokenText()
08543: .equals("@")) {
08544: final Node v$pt$1 = yyResult.semanticValue();
08545:
08546: yyBase = yyResult.index;
08547: yyResult = pWord(yyBase);
08548: yyError = yyResult.select(yyError);
08549: if (yyResult.hasValue()
08550: && ((Node) yyResult.semanticValue())
08551: .getTokenText().equals("interface")) {
08552: final Node v$pt$2 = yyResult.semanticValue();
08553: final Node v$g$1 = Formatting.variable().addNode(
08554: v$pt$3).add(v$pt$1).add(v$pt$2);
08555:
08556: yyResult = pIdentifier(yyResult.index);
08557: yyError = yyResult.select(yyError);
08558: if (yyResult.hasValue()) {
08559: final Node v$g$2 = yyResult.semanticValue();
08560:
08561: yyResult = pAnnotationBody(yyResult.index);
08562: yyError = yyResult.select(yyError);
08563: if (yyResult.hasValue()) {
08564: final Node v$g$3 = yyResult.semanticValue();
08565:
08566: yyValue = GNode.create(
08567: "AnnotationDeclaration", v$g$1,
08568: v$g$2, v$g$3);
08569: yyValue.setLocation(location(yyStart));
08570:
08571: return yyResult.createValue(yyValue,
08572: yyError);
08573: }
08574: }
08575: } else {
08576: yyError = yyError.select("\"interface\" expected",
08577: yyBase);
08578: }
08579: } else {
08580: yyError = yyError.select("\"@\" expected", yyBase);
08581: }
08582: }
08583:
08584: // Done.
08585: return yyError;
08586: }
08587:
08588: // =========================================================================
08589:
08590: /**
08591: * Parse nonterminal xtc.lang.JavaFive.DefaultValue.
08592: *
08593: * @param yyStart The index.
08594: * @return The result.
08595: * @throws IOException Signals an I/O error.
08596: */
08597: private Result pDefaultValue(final int yyStart) throws IOException {
08598: Result yyResult;
08599: Node yyValue;
08600: ParseError yyError = ParseError.DUMMY;
08601:
08602: // Alternative <Default>.
08603:
08604: yyResult = pWord(yyStart);
08605: yyError = yyResult.select(yyError);
08606: if (yyResult.hasValue()
08607: && ((Node) yyResult.semanticValue()).getTokenText()
08608: .equals("default")) {
08609: final Node v$pt$1 = yyResult.semanticValue();
08610:
08611: yyResult = pElementValue(yyResult.index);
08612: yyError = yyResult.select(yyError);
08613: if (yyResult.hasValue()) {
08614: final Node v$pt$2 = yyResult.semanticValue();
08615: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
08616:
08617: yyValue = GNode.create("DefaultValue", v$g$1);
08618: yyValue.setLocation(location(yyStart));
08619:
08620: return yyResult.createValue(yyValue, yyError);
08621: }
08622: }
08623:
08624: // Done.
08625: yyError = yyError.select("default value expected", yyStart);
08626: return yyError;
08627: }
08628:
08629: // =========================================================================
08630:
08631: /**
08632: * Parse nonterminal xtc.lang.JavaFive.EnumConstants.
08633: *
08634: * @param yyStart The index.
08635: * @return The result.
08636: * @throws IOException Signals an I/O error.
08637: */
08638: private Result pEnumConstants(final int yyStart) throws IOException {
08639: Result yyResult;
08640: int yyBase;
08641: int yyRepetition1;
08642: Pair<Node> yyRepValue1;
08643: Node yyValue;
08644: ParseError yyError = ParseError.DUMMY;
08645:
08646: // Alternative <Constants>.
08647:
08648: yyResult = pEnumConstant(yyStart);
08649: yyError = yyResult.select(yyError);
08650: if (yyResult.hasValue()) {
08651: final Node v$g$1 = yyResult.semanticValue();
08652:
08653: yyRepetition1 = yyResult.index;
08654: yyRepValue1 = Pair.empty();
08655: while (true) {
08656:
08657: yyBase = yyRepetition1;
08658: yyResult = pSymbol(yyBase);
08659: yyError = yyResult.select(yyError);
08660: if (yyResult.hasValue()
08661: && ((Node) yyResult.semanticValue())
08662: .getTokenText().equals(",")) {
08663: final Node v$pt$1 = yyResult.semanticValue();
08664:
08665: yyResult = pEnumConstant(yyResult.index);
08666: yyError = yyResult.select(yyError);
08667: if (yyResult.hasValue()) {
08668: final Node v$pt$2 = yyResult.semanticValue();
08669: final Node v$el$1 = Formatting.before1(v$pt$1,
08670: v$pt$2);
08671:
08672: yyRepetition1 = yyResult.index;
08673: yyRepValue1 = new Pair<Node>(v$el$1,
08674: yyRepValue1);
08675: continue;
08676: }
08677: } else {
08678: yyError = yyError.select("\",\" expected", yyBase);
08679: }
08680: break;
08681: }
08682: { // Start scope for v$g$2.
08683: final Pair<Node> v$g$2 = yyRepValue1.reverse();
08684:
08685: yyValue = GNode.createFromPair("EnumConstants", v$g$1,
08686: v$g$2);
08687: yyValue.setLocation(location(yyStart));
08688:
08689: return new SemanticValue(yyValue, yyRepetition1,
08690: yyError);
08691: } // End scope for v$g$2.
08692: }
08693:
08694: // Done.
08695: return yyError;
08696: }
08697:
08698: // =========================================================================
08699:
08700: /**
08701: * Parse nonterminal xtc.lang.JavaFive.EnumConstant.
08702: *
08703: * @param yyStart The index.
08704: * @return The result.
08705: * @throws IOException Signals an I/O error.
08706: */
08707: private Result pEnumConstant(final int yyStart) throws IOException {
08708: Result yyResult;
08709: int yyOption1;
08710: Node yyOpValue1;
08711: Node yyValue;
08712: ParseError yyError = ParseError.DUMMY;
08713:
08714: // Alternative 1.
08715:
08716: yyOption1 = yyStart;
08717: yyOpValue1 = null;
08718:
08719: yyResult = pAnnotations(yyOption1);
08720: yyError = yyResult.select(yyError);
08721: if (yyResult.hasValue()) {
08722: final Node v$el$1 = yyResult.semanticValue();
08723:
08724: yyOption1 = yyResult.index;
08725: yyOpValue1 = v$el$1;
08726: }
08727: { // Start scope for v$g$1.
08728: final Node v$g$1 = yyOpValue1;
08729:
08730: yyResult = pIdentifier(yyOption1);
08731: yyError = yyResult.select(yyError);
08732: if (yyResult.hasValue()) {
08733: final Node v$g$2 = yyResult.semanticValue();
08734:
08735: yyOption1 = yyResult.index;
08736: yyOpValue1 = null;
08737:
08738: yyResult = pArguments(yyOption1);
08739: yyError = yyResult.select(yyError);
08740: if (yyResult.hasValue()) {
08741: final Node v$el$2 = yyResult.semanticValue();
08742:
08743: yyOption1 = yyResult.index;
08744: yyOpValue1 = v$el$2;
08745: }
08746: { // Start scope for v$g$3.
08747: final Node v$g$3 = yyOpValue1;
08748:
08749: yyOpValue1 = null;
08750:
08751: yyResult = pClassBody(yyOption1);
08752: yyError = yyResult.select(yyError);
08753: if (yyResult.hasValue()) {
08754: final Node v$el$3 = yyResult.semanticValue();
08755:
08756: yyOption1 = yyResult.index;
08757: yyOpValue1 = v$el$3;
08758: }
08759: { // Start scope for v$g$4.
08760: final Node v$g$4 = yyOpValue1;
08761:
08762: yyValue = GNode.create("EnumConstant", v$g$1,
08763: v$g$2, v$g$3, v$g$4);
08764: yyValue.setLocation(location(yyStart));
08765:
08766: return new SemanticValue(yyValue, yyOption1,
08767: yyError);
08768: } // End scope for v$g$4.
08769: } // End scope for v$g$3.
08770: }
08771: } // End scope for v$g$1.
08772:
08773: // Done.
08774: return yyError;
08775: }
08776:
08777: // =========================================================================
08778:
08779: /**
08780: * Parse nonterminal xtc.lang.JavaFive.EnumMembers.
08781: *
08782: * @param yyStart The index.
08783: * @return The result.
08784: * @throws IOException Signals an I/O error.
08785: */
08786: private Result pEnumMembers(final int yyStart) throws IOException {
08787: Result yyResult;
08788: Node yyValue;
08789: ParseError yyError = ParseError.DUMMY;
08790:
08791: // Alternative 1.
08792:
08793: yyResult = pSymbol(yyStart);
08794: yyError = yyResult.select(yyError);
08795: if (yyResult.hasValue()
08796: && ((Node) yyResult.semanticValue()).getTokenText()
08797: .equals(";")) {
08798: final Node v$pt$1 = yyResult.semanticValue();
08799:
08800: yyResult = pEnumMembers$$Split1(yyResult.index);
08801: yyError = yyResult.select(yyError);
08802: if (yyResult.hasValue()) {
08803: final Node v$pt$2 = yyResult.semanticValue();
08804: yyValue = Formatting.before1(v$pt$1, v$pt$2);
08805:
08806: return yyResult.createValue(yyValue, yyError);
08807: }
08808: }
08809:
08810: // Done.
08811: yyError = yyError.select("enum members expected", yyStart);
08812: return yyError;
08813: }
08814:
08815: // =========================================================================
08816:
08817: /**
08818: * Parse synthetic nonterminal xtc.lang.JavaFive.EnumMembers$$Split1.
08819: *
08820: * @param yyStart The index.
08821: * @return The result.
08822: * @throws IOException Signals an I/O error.
08823: */
08824: private Result pEnumMembers$$Split1(final int yyStart)
08825: throws IOException {
08826: Result yyResult;
08827: int yyRepetition1;
08828: Pair<Node> yyRepValue1;
08829: Node yyValue;
08830: ParseError yyError = ParseError.DUMMY;
08831:
08832: // Alternative 1.
08833:
08834: yyRepetition1 = yyStart;
08835: yyRepValue1 = Pair.empty();
08836: while (true) {
08837:
08838: yyResult = pDeclaration(yyRepetition1);
08839: yyError = yyResult.select(yyError);
08840: if (yyResult.hasValue()) {
08841: final Node v$el$1 = yyResult.semanticValue();
08842:
08843: yyRepetition1 = yyResult.index;
08844: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
08845: continue;
08846: }
08847: break;
08848: }
08849: { // Start scope for v$g$1.
08850: final Pair<Node> v$g$1 = yyRepValue1.reverse();
08851:
08852: yyValue = GNode.createFromPair("EnumMembers", v$g$1);
08853: yyValue.setLocation(location(yyStart));
08854:
08855: return new SemanticValue(yyValue, yyRepetition1, yyError);
08856: } // End scope for v$g$1.
08857: }
08858:
08859: // =========================================================================
08860:
08861: /**
08862: * Parse nonterminal xtc.lang.JavaFiveType.ResultType.
08863: *
08864: * @param yyStart The index.
08865: * @return The result.
08866: * @throws IOException Signals an I/O error.
08867: */
08868: private Result pResultType(final int yyStart) throws IOException {
08869: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
08870: if (null == yyColumn.chunk2)
08871: yyColumn.chunk2 = new Chunk2();
08872: if (null == yyColumn.chunk2.fResultType)
08873: yyColumn.chunk2.fResultType = pResultType$1(yyStart);
08874: return yyColumn.chunk2.fResultType;
08875: }
08876:
08877: /** Actually parse xtc.lang.JavaFiveType.ResultType. */
08878: private Result pResultType$1(final int yyStart) throws IOException {
08879: Result yyResult;
08880: Node yyValue;
08881: ParseError yyError = ParseError.DUMMY;
08882:
08883: // Alternative <Void>.
08884:
08885: yyResult = pVoidType(yyStart);
08886: yyError = yyResult.select(yyError);
08887: if (yyResult.hasValue()) {
08888: yyValue = yyResult.semanticValue();
08889:
08890: return yyResult.createValue(yyValue, yyError);
08891: }
08892:
08893: // Alternative <Regular>.
08894:
08895: yyResult = pType(yyStart);
08896: yyError = yyResult.select(yyError);
08897: if (yyResult.hasValue()) {
08898: yyValue = yyResult.semanticValue();
08899:
08900: return yyResult.createValue(yyValue, yyError);
08901: }
08902:
08903: // Done.
08904: return yyError;
08905: }
08906:
08907: // =========================================================================
08908:
08909: /**
08910: * Parse nonterminal xtc.lang.JavaFiveType.VoidType.
08911: *
08912: * @param yyStart The index.
08913: * @return The result.
08914: * @throws IOException Signals an I/O error.
08915: */
08916: private Result pVoidType(final int yyStart) throws IOException {
08917: Result yyResult;
08918: Node yyValue;
08919: ParseError yyError = ParseError.DUMMY;
08920:
08921: // Alternative <Void>.
08922:
08923: yyResult = pWord(yyStart);
08924: yyError = yyResult.select(yyError);
08925: if (yyResult.hasValue()
08926: && ((Node) yyResult.semanticValue()).getTokenText()
08927: .equals("void")) {
08928: final Node v$pt$1 = yyResult.semanticValue();
08929:
08930: yyValue = GNode.create("VoidType", false);
08931: yyValue.setLocation(location(yyStart));
08932: yyValue = Formatting.after1(yyValue, v$pt$1);
08933:
08934: return yyResult.createValue(yyValue, yyError);
08935: }
08936:
08937: // Done.
08938: yyError = yyError.select("void type expected", yyStart);
08939: return yyError;
08940: }
08941:
08942: // =========================================================================
08943:
08944: /**
08945: * Parse nonterminal xtc.lang.JavaFiveType.Type.
08946: *
08947: * @param yyStart The index.
08948: * @return The result.
08949: * @throws IOException Signals an I/O error.
08950: */
08951: private Result pType(final int yyStart) throws IOException {
08952: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
08953: if (null == yyColumn.chunk2)
08954: yyColumn.chunk2 = new Chunk2();
08955: if (null == yyColumn.chunk2.fType)
08956: yyColumn.chunk2.fType = pType$1(yyStart);
08957: return yyColumn.chunk2.fType;
08958: }
08959:
08960: /** Actually parse xtc.lang.JavaFiveType.Type. */
08961: private Result pType$1(final int yyStart) throws IOException {
08962: Result yyResult;
08963: int yyOption1;
08964: Node yyOpValue1;
08965: Node yyValue;
08966: ParseError yyError = ParseError.DUMMY;
08967:
08968: // Alternative <Type>.
08969:
08970: yyResult = pTypeName(yyStart);
08971: yyError = yyResult.select(yyError);
08972: if (yyResult.hasValue()) {
08973: final Node v$g$1 = yyResult.semanticValue();
08974:
08975: yyOption1 = yyResult.index;
08976: yyOpValue1 = null;
08977:
08978: yyResult = pDimensions(yyOption1);
08979: yyError = yyResult.select(yyError);
08980: if (yyResult.hasValue()) {
08981: final Node v$el$1 = yyResult.semanticValue();
08982:
08983: yyOption1 = yyResult.index;
08984: yyOpValue1 = v$el$1;
08985: }
08986: { // Start scope for v$g$2.
08987: final Node v$g$2 = yyOpValue1;
08988:
08989: yyValue = GNode.create("Type", v$g$1, v$g$2);
08990: yyValue.setLocation(location(yyStart));
08991:
08992: return new SemanticValue(yyValue, yyOption1, yyError);
08993: } // End scope for v$g$2.
08994: }
08995:
08996: // Done.
08997: return yyError;
08998: }
08999:
09000: // =========================================================================
09001:
09002: /**
09003: * Parse nonterminal xtc.lang.JavaFiveType.TypeName.
09004: *
09005: * @param yyStart The index.
09006: * @return The result.
09007: * @throws IOException Signals an I/O error.
09008: */
09009: private Result pTypeName(final int yyStart) throws IOException {
09010: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
09011: if (null == yyColumn.chunk3)
09012: yyColumn.chunk3 = new Chunk3();
09013: if (null == yyColumn.chunk3.fTypeName)
09014: yyColumn.chunk3.fTypeName = pTypeName$1(yyStart);
09015: return yyColumn.chunk3.fTypeName;
09016: }
09017:
09018: /** Actually parse xtc.lang.JavaFiveType.TypeName. */
09019: private Result pTypeName$1(final int yyStart) throws IOException {
09020: Result yyResult;
09021: Node yyValue;
09022: ParseError yyError = ParseError.DUMMY;
09023:
09024: // Alternative <Basic>.
09025:
09026: yyResult = pPrimitiveType(yyStart);
09027: yyError = yyResult.select(yyError);
09028: if (yyResult.hasValue()) {
09029: yyValue = yyResult.semanticValue();
09030:
09031: return yyResult.createValue(yyValue, yyError);
09032: }
09033:
09034: // Alternative <Class>.
09035:
09036: yyResult = pClassType(yyStart);
09037: yyError = yyResult.select(yyError);
09038: if (yyResult.hasValue()) {
09039: yyValue = yyResult.semanticValue();
09040:
09041: return yyResult.createValue(yyValue, yyError);
09042: }
09043:
09044: // Done.
09045: return yyError;
09046: }
09047:
09048: // =========================================================================
09049:
09050: /**
09051: * Parse nonterminal xtc.lang.JavaFiveType.PrimitiveType.
09052: *
09053: * @param yyStart The index.
09054: * @return The result.
09055: * @throws IOException Signals an I/O error.
09056: */
09057: private Result pPrimitiveType(final int yyStart) throws IOException {
09058: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
09059: if (null == yyColumn.chunk3)
09060: yyColumn.chunk3 = new Chunk3();
09061: if (null == yyColumn.chunk3.fPrimitiveType)
09062: yyColumn.chunk3.fPrimitiveType = pPrimitiveType$1(yyStart);
09063: return yyColumn.chunk3.fPrimitiveType;
09064: }
09065:
09066: /** Actually parse xtc.lang.JavaFiveType.PrimitiveType. */
09067: private Result pPrimitiveType$1(final int yyStart)
09068: throws IOException {
09069: Result yyResult;
09070: Node yyValue;
09071: ParseError yyError = ParseError.DUMMY;
09072:
09073: // Alternative <Byte>.
09074:
09075: yyResult = pWord(yyStart);
09076: yyError = yyResult.select(yyError);
09077: if (yyResult.hasValue()
09078: && ((Node) yyResult.semanticValue()).getTokenText()
09079: .equals("byte")) {
09080: final Node v$g$1 = yyResult.semanticValue();
09081:
09082: yyValue = GNode.create("PrimitiveType", v$g$1);
09083: yyValue.setLocation(location(yyStart));
09084:
09085: return yyResult.createValue(yyValue, yyError);
09086: }
09087:
09088: // Alternative <Short>.
09089:
09090: yyResult = pWord(yyStart);
09091: yyError = yyResult.select(yyError);
09092: if (yyResult.hasValue()
09093: && ((Node) yyResult.semanticValue()).getTokenText()
09094: .equals("short")) {
09095: final Node v$g$2 = yyResult.semanticValue();
09096:
09097: yyValue = GNode.create("PrimitiveType", v$g$2);
09098: yyValue.setLocation(location(yyStart));
09099:
09100: return yyResult.createValue(yyValue, yyError);
09101: }
09102:
09103: // Alternative <Char>.
09104:
09105: yyResult = pWord(yyStart);
09106: yyError = yyResult.select(yyError);
09107: if (yyResult.hasValue()
09108: && ((Node) yyResult.semanticValue()).getTokenText()
09109: .equals("char")) {
09110: final Node v$g$3 = yyResult.semanticValue();
09111:
09112: yyValue = GNode.create("PrimitiveType", v$g$3);
09113: yyValue.setLocation(location(yyStart));
09114:
09115: return yyResult.createValue(yyValue, yyError);
09116: }
09117:
09118: // Alternative <Int>.
09119:
09120: yyResult = pWord(yyStart);
09121: yyError = yyResult.select(yyError);
09122: if (yyResult.hasValue()
09123: && ((Node) yyResult.semanticValue()).getTokenText()
09124: .equals("int")) {
09125: final Node v$g$4 = yyResult.semanticValue();
09126:
09127: yyValue = GNode.create("PrimitiveType", v$g$4);
09128: yyValue.setLocation(location(yyStart));
09129:
09130: return yyResult.createValue(yyValue, yyError);
09131: }
09132:
09133: // Alternative <Long>.
09134:
09135: yyResult = pWord(yyStart);
09136: yyError = yyResult.select(yyError);
09137: if (yyResult.hasValue()
09138: && ((Node) yyResult.semanticValue()).getTokenText()
09139: .equals("long")) {
09140: final Node v$g$5 = yyResult.semanticValue();
09141:
09142: yyValue = GNode.create("PrimitiveType", v$g$5);
09143: yyValue.setLocation(location(yyStart));
09144:
09145: return yyResult.createValue(yyValue, yyError);
09146: }
09147:
09148: // Alternative <Float>.
09149:
09150: yyResult = pWord(yyStart);
09151: yyError = yyResult.select(yyError);
09152: if (yyResult.hasValue()
09153: && ((Node) yyResult.semanticValue()).getTokenText()
09154: .equals("float")) {
09155: final Node v$g$6 = yyResult.semanticValue();
09156:
09157: yyValue = GNode.create("PrimitiveType", v$g$6);
09158: yyValue.setLocation(location(yyStart));
09159:
09160: return yyResult.createValue(yyValue, yyError);
09161: }
09162:
09163: // Alternative <Double>.
09164:
09165: yyResult = pWord(yyStart);
09166: yyError = yyResult.select(yyError);
09167: if (yyResult.hasValue()
09168: && ((Node) yyResult.semanticValue()).getTokenText()
09169: .equals("double")) {
09170: final Node v$g$7 = yyResult.semanticValue();
09171:
09172: yyValue = GNode.create("PrimitiveType", v$g$7);
09173: yyValue.setLocation(location(yyStart));
09174:
09175: return yyResult.createValue(yyValue, yyError);
09176: }
09177:
09178: // Alternative <Boolean>.
09179:
09180: yyResult = pWord(yyStart);
09181: yyError = yyResult.select(yyError);
09182: if (yyResult.hasValue()
09183: && ((Node) yyResult.semanticValue()).getTokenText()
09184: .equals("boolean")) {
09185: final Node v$g$8 = yyResult.semanticValue();
09186:
09187: yyValue = GNode.create("PrimitiveType", v$g$8);
09188: yyValue.setLocation(location(yyStart));
09189:
09190: return yyResult.createValue(yyValue, yyError);
09191: }
09192:
09193: // Done.
09194: yyError = yyError.select("primitive type expected", yyStart);
09195: return yyError;
09196: }
09197:
09198: // =========================================================================
09199:
09200: /**
09201: * Parse nonterminal xtc.lang.JavaFiveType.ClassType.
09202: *
09203: * @param yyStart The index.
09204: * @return The result.
09205: * @throws IOException Signals an I/O error.
09206: */
09207: private Result pClassType(final int yyStart) throws IOException {
09208: int yyC;
09209: Result yyResult;
09210: boolean yyPredMatched;
09211: Node yyValue;
09212: ParseError yyError = ParseError.DUMMY;
09213:
09214: // Alternative <Name>.
09215:
09216: yyResult = pQualifiedIdentifier(yyStart);
09217: yyError = yyResult.select(yyError);
09218: if (yyResult.hasValue()) {
09219: yyValue = yyResult.semanticValue();
09220:
09221: yyPredMatched = false;
09222:
09223: yyC = character(yyResult.index);
09224: if ('<' == yyC) {
09225:
09226: yyPredMatched = true;
09227: }
09228:
09229: if (!yyPredMatched) {
09230:
09231: return yyResult.createValue(yyValue, yyError);
09232: } else {
09233: yyError = yyError
09234: .select("class type expected", yyStart);
09235: }
09236: }
09237:
09238: // Alternative <Instantiated>.
09239:
09240: yyResult = pInstantiatedType(yyStart);
09241: yyError = yyResult.select(yyError);
09242: if (yyResult.hasValue()) {
09243: yyValue = yyResult.semanticValue();
09244:
09245: return yyResult.createValue(yyValue, yyError);
09246: }
09247:
09248: // Done.
09249: return yyError;
09250: }
09251:
09252: // =========================================================================
09253:
09254: /**
09255: * Parse nonterminal xtc.lang.JavaFiveType.Dimensions.
09256: *
09257: * @param yyStart The index.
09258: * @return The result.
09259: * @throws IOException Signals an I/O error.
09260: */
09261: private Result pDimensions(final int yyStart) throws IOException {
09262: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
09263: if (null == yyColumn.chunk3)
09264: yyColumn.chunk3 = new Chunk3();
09265: if (null == yyColumn.chunk3.fDimensions)
09266: yyColumn.chunk3.fDimensions = pDimensions$1(yyStart);
09267: return yyColumn.chunk3.fDimensions;
09268: }
09269:
09270: /** Actually parse xtc.lang.JavaFiveType.Dimensions. */
09271: private Result pDimensions$1(final int yyStart) throws IOException {
09272: Result yyResult;
09273: Node yyValue;
09274: ParseError yyError = ParseError.DUMMY;
09275:
09276: // Alternative 1.
09277:
09278: yyResult = pDimensions$$Plus1(yyStart);
09279: yyError = yyResult.select(yyError);
09280: if (yyResult.hasValue()) {
09281: final Pair<Node> v$g$1 = yyResult.semanticValue();
09282:
09283: yyValue = GNode.createFromPair("Dimensions", v$g$1);
09284: yyValue.setLocation(location(yyStart));
09285:
09286: return yyResult.createValue(yyValue, yyError);
09287: }
09288:
09289: // Done.
09290: return yyError;
09291: }
09292:
09293: // =========================================================================
09294:
09295: /**
09296: * Parse synthetic nonterminal xtc.lang.JavaFive.Dimensions$$Plus1.
09297: *
09298: * @param yyStart The index.
09299: * @return The result.
09300: * @throws IOException Signals an I/O error.
09301: */
09302: private Result pDimensions$$Plus1(final int yyStart)
09303: throws IOException {
09304: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
09305: if (null == yyColumn.chunk3)
09306: yyColumn.chunk3 = new Chunk3();
09307: if (null == yyColumn.chunk3.fDimensions$$Plus1)
09308: yyColumn.chunk3.fDimensions$$Plus1 = pDimensions$$Plus1$1(yyStart);
09309: return yyColumn.chunk3.fDimensions$$Plus1;
09310: }
09311:
09312: /** Actually parse xtc.lang.JavaFive.Dimensions$$Plus1. */
09313: private Result pDimensions$$Plus1$1(final int yyStart)
09314: throws IOException {
09315: Result yyResult;
09316: int yyBase;
09317: Pair<Node> yyValue;
09318: ParseError yyError = ParseError.DUMMY;
09319:
09320: // Alternative 1.
09321:
09322: yyResult = pSymbol(yyStart);
09323: yyError = yyResult.select(yyError);
09324: if (yyResult.hasValue()
09325: && ((Node) yyResult.semanticValue()).getTokenText()
09326: .equals("[")) {
09327: final Node v$pt$2 = yyResult.semanticValue();
09328:
09329: yyBase = yyResult.index;
09330: yyResult = pSymbol(yyBase);
09331: yyError = yyResult.select(yyError);
09332: if (yyResult.hasValue()
09333: && ((Node) yyResult.semanticValue()).getTokenText()
09334: .equals("]")) {
09335: final Node v$pt$1 = yyResult.semanticValue();
09336: final Node v$el$1 = Formatting.after1(v$pt$2, v$pt$1);
09337:
09338: final int yyChoice1 = yyResult.index;
09339:
09340: // Nested alternative 1.
09341:
09342: yyResult = pDimensions$$Plus1(yyChoice1);
09343: yyError = yyResult.select(yyError);
09344: if (yyResult.hasValue()) {
09345: final Pair<Node> v$2 = yyResult.semanticValue();
09346:
09347: yyValue = new Pair<Node>(v$el$1, v$2);
09348:
09349: return yyResult.createValue(yyValue, yyError);
09350: }
09351:
09352: // Nested alternative 2.
09353:
09354: yyValue = new Pair<Node>(v$el$1);
09355:
09356: return new SemanticValue(yyValue, yyChoice1, yyError);
09357: } else {
09358: yyError = yyError.select("\"]\" expected", yyBase);
09359: }
09360: }
09361:
09362: // Done.
09363: yyError = yyError.select("dimensions expected", yyStart);
09364: return yyError;
09365: }
09366:
09367: // =========================================================================
09368:
09369: /**
09370: * Parse nonterminal xtc.lang.JavaFiveType.TypeParameters.
09371: *
09372: * @param yyStart The index.
09373: * @return The result.
09374: * @throws IOException Signals an I/O error.
09375: */
09376: private Result pTypeParameters(final int yyStart)
09377: throws IOException {
09378: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
09379: if (null == yyColumn.chunk3)
09380: yyColumn.chunk3 = new Chunk3();
09381: if (null == yyColumn.chunk3.fTypeParameters)
09382: yyColumn.chunk3.fTypeParameters = pTypeParameters$1(yyStart);
09383: return yyColumn.chunk3.fTypeParameters;
09384: }
09385:
09386: /** Actually parse xtc.lang.JavaFiveType.TypeParameters. */
09387: private Result pTypeParameters$1(final int yyStart)
09388: throws IOException {
09389: int yyC;
09390: int yyIndex;
09391: Result yyResult;
09392: int yyBase;
09393: Node yyValue;
09394: ParseError yyError = ParseError.DUMMY;
09395:
09396: // Alternative <Parameters>.
09397:
09398: yyResult = pTypeParameters$$Split1(yyStart);
09399: yyError = yyResult.select(yyError);
09400: if (yyResult.hasValue()) {
09401: final Node v$pt$1 = yyResult.semanticValue();
09402:
09403: yyBase = yyResult.index;
09404: yyC = character(yyBase);
09405: if ('>' == yyC) {
09406: yyIndex = yyResult.index + 1;
09407: final String v$pt$2 = ">";
09408:
09409: yyResult = pSpacing(yyIndex);
09410: yyError = yyResult.select(yyError);
09411: if (yyResult.hasValue()) {
09412: final Token v$pt$3 = yyResult.semanticValue();
09413: yyValue = Formatting.variable().addNode(v$pt$1)
09414: .add(v$pt$2).add(v$pt$3);
09415:
09416: return yyResult.createValue(yyValue, yyError);
09417: }
09418: } else {
09419: yyError = yyError.select("\">\" expected", yyBase);
09420: }
09421: }
09422:
09423: // Done.
09424: return yyError;
09425: }
09426:
09427: // =========================================================================
09428:
09429: /**
09430: * Parse synthetic nonterminal xtc.lang.JavaFive.TypeParameters$$Split1.
09431: *
09432: * @param yyStart The index.
09433: * @return The result.
09434: * @throws IOException Signals an I/O error.
09435: */
09436: private Result pTypeParameters$$Split1(final int yyStart)
09437: throws IOException {
09438:
09439: int yyC;
09440: int yyIndex;
09441: Result yyResult;
09442: int yyBase;
09443: int yyRepetition1;
09444: Pair<Node> yyRepValue1;
09445: Node yyValue;
09446: ParseError yyError = ParseError.DUMMY;
09447:
09448: // Alternative <Parameters>.
09449:
09450: yyC = character(yyStart);
09451: if ('<' == yyC) {
09452: yyIndex = yyStart + 1;
09453: final String v$pt$3 = "<";
09454:
09455: yyResult = pSpacing(yyIndex);
09456: yyError = yyResult.select(yyError);
09457: if (yyResult.hasValue()) {
09458: final Token v$pt$4 = yyResult.semanticValue();
09459:
09460: yyResult = pTypeParameter(yyResult.index);
09461: yyError = yyResult.select(yyError);
09462: if (yyResult.hasValue()) {
09463: final Node v$pt$5 = yyResult.semanticValue();
09464: final Node v$g$1 = Formatting.variable()
09465: .add(v$pt$3).add(v$pt$4).addNode(v$pt$5);
09466:
09467: yyRepetition1 = yyResult.index;
09468: yyRepValue1 = Pair.empty();
09469: while (true) {
09470:
09471: yyBase = yyRepetition1;
09472: yyResult = pSymbol(yyBase);
09473: yyError = yyResult.select(yyError);
09474: if (yyResult.hasValue()
09475: && ((Node) yyResult.semanticValue())
09476: .getTokenText().equals(",")) {
09477: final Node v$pt$1 = yyResult
09478: .semanticValue();
09479:
09480: yyResult = pTypeParameter(yyResult.index);
09481: yyError = yyResult.select(yyError);
09482: if (yyResult.hasValue()) {
09483: final Node v$pt$2 = yyResult
09484: .semanticValue();
09485: final Node v$el$1 = Formatting.before1(
09486: v$pt$1, v$pt$2);
09487:
09488: yyRepetition1 = yyResult.index;
09489: yyRepValue1 = new Pair<Node>(v$el$1,
09490: yyRepValue1);
09491: continue;
09492: }
09493: } else {
09494: yyError = yyError.select("\",\" expected",
09495: yyBase);
09496: }
09497: break;
09498: }
09499: { // Start scope for v$g$2.
09500: final Pair<Node> v$g$2 = yyRepValue1.reverse();
09501:
09502: yyValue = GNode.createFromPair(
09503: "TypeParameters", v$g$1, v$g$2);
09504: yyValue.setLocation(location(yyStart));
09505:
09506: return new SemanticValue(yyValue,
09507: yyRepetition1, yyError);
09508: } // End scope for v$g$2.
09509: }
09510: }
09511: }
09512:
09513: // Done.
09514: yyError = yyError.select("type parameters expected", yyStart);
09515: return yyError;
09516: }
09517:
09518: // =========================================================================
09519:
09520: /**
09521: * Parse nonterminal xtc.lang.JavaFiveType.TypeParameter.
09522: *
09523: * @param yyStart The index.
09524: * @return The result.
09525: * @throws IOException Signals an I/O error.
09526: */
09527: private Result pTypeParameter(final int yyStart) throws IOException {
09528: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
09529: if (null == yyColumn.chunk3)
09530: yyColumn.chunk3 = new Chunk3();
09531: if (null == yyColumn.chunk3.fTypeParameter)
09532: yyColumn.chunk3.fTypeParameter = pTypeParameter$1(yyStart);
09533: return yyColumn.chunk3.fTypeParameter;
09534: }
09535:
09536: /** Actually parse xtc.lang.JavaFiveType.TypeParameter. */
09537: private Result pTypeParameter$1(final int yyStart)
09538: throws IOException {
09539: Result yyResult;
09540: int yyBase;
09541: int yyOption1;
09542: Node yyOpValue1;
09543: Node yyValue;
09544: ParseError yyError = ParseError.DUMMY;
09545:
09546: // Alternative <Parameter>.
09547:
09548: yyResult = pIdentifier(yyStart);
09549: yyError = yyResult.select(yyError);
09550: if (yyResult.hasValue()) {
09551: final Node v$g$1 = yyResult.semanticValue();
09552:
09553: yyOption1 = yyResult.index;
09554: yyOpValue1 = null;
09555:
09556: yyBase = yyOption1;
09557: yyResult = pWord(yyBase);
09558: yyError = yyResult.select(yyError);
09559: if (yyResult.hasValue()
09560: && ((Node) yyResult.semanticValue()).getTokenText()
09561: .equals("extends")) {
09562: final Node v$pt$1 = yyResult.semanticValue();
09563:
09564: yyResult = pBound(yyResult.index);
09565: yyError = yyResult.select(yyError);
09566: if (yyResult.hasValue()) {
09567: final Node v$pt$2 = yyResult.semanticValue();
09568: final Node v$el$1 = Formatting.before1(v$pt$1,
09569: v$pt$2);
09570:
09571: yyOption1 = yyResult.index;
09572: yyOpValue1 = v$el$1;
09573: }
09574: } else {
09575: yyError = yyError
09576: .select("\"extends\" expected", yyBase);
09577: }
09578: { // Start scope for v$g$2.
09579: final Node v$g$2 = yyOpValue1;
09580:
09581: yyValue = GNode.create("TypeParameter", v$g$1, v$g$2);
09582: yyValue.setLocation(location(yyStart));
09583:
09584: return new SemanticValue(yyValue, yyOption1, yyError);
09585: } // End scope for v$g$2.
09586: }
09587:
09588: // Done.
09589: return yyError;
09590: }
09591:
09592: // =========================================================================
09593:
09594: /**
09595: * Parse nonterminal xtc.lang.JavaFiveType.Bound.
09596: *
09597: * @param yyStart The index.
09598: * @return The result.
09599: * @throws IOException Signals an I/O error.
09600: */
09601: private Result pBound(final int yyStart) throws IOException {
09602: Result yyResult;
09603: int yyBase;
09604: int yyRepetition1;
09605: Pair<Node> yyRepValue1;
09606: Node yyValue;
09607: ParseError yyError = ParseError.DUMMY;
09608:
09609: // Alternative <Bound>.
09610:
09611: yyResult = pType(yyStart);
09612: yyError = yyResult.select(yyError);
09613: if (yyResult.hasValue()) {
09614: final Node v$g$1 = yyResult.semanticValue();
09615:
09616: yyRepetition1 = yyResult.index;
09617: yyRepValue1 = Pair.empty();
09618: while (true) {
09619:
09620: yyBase = yyRepetition1;
09621: yyResult = pSymbol(yyBase);
09622: yyError = yyResult.select(yyError);
09623: if (yyResult.hasValue()
09624: && ((Node) yyResult.semanticValue())
09625: .getTokenText().equals("&")) {
09626: final Node v$pt$1 = yyResult.semanticValue();
09627:
09628: yyResult = pType(yyResult.index);
09629: yyError = yyResult.select(yyError);
09630: if (yyResult.hasValue()) {
09631: final Node v$pt$2 = yyResult.semanticValue();
09632: final Node v$el$1 = Formatting.before1(v$pt$1,
09633: v$pt$2);
09634:
09635: yyRepetition1 = yyResult.index;
09636: yyRepValue1 = new Pair<Node>(v$el$1,
09637: yyRepValue1);
09638: continue;
09639: }
09640: } else {
09641: yyError = yyError.select("\"&\" expected", yyBase);
09642: }
09643: break;
09644: }
09645: { // Start scope for v$g$2.
09646: final Pair<Node> v$g$2 = yyRepValue1.reverse();
09647:
09648: yyValue = GNode.createFromPair("Bound", v$g$1, v$g$2);
09649: yyValue.setLocation(location(yyStart));
09650:
09651: return new SemanticValue(yyValue, yyRepetition1,
09652: yyError);
09653: } // End scope for v$g$2.
09654: }
09655:
09656: // Done.
09657: return yyError;
09658: }
09659:
09660: // =========================================================================
09661:
09662: /**
09663: * Parse nonterminal xtc.lang.JavaFiveType.TypeArguments.
09664: *
09665: * @param yyStart The index.
09666: * @return The result.
09667: * @throws IOException Signals an I/O error.
09668: */
09669: private Result pTypeArguments(final int yyStart) throws IOException {
09670: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
09671: if (null == yyColumn.chunk3)
09672: yyColumn.chunk3 = new Chunk3();
09673: if (null == yyColumn.chunk3.fTypeArguments)
09674: yyColumn.chunk3.fTypeArguments = pTypeArguments$1(yyStart);
09675: return yyColumn.chunk3.fTypeArguments;
09676: }
09677:
09678: /** Actually parse xtc.lang.JavaFiveType.TypeArguments. */
09679: private Result pTypeArguments$1(final int yyStart)
09680: throws IOException {
09681: int yyC;
09682: int yyIndex;
09683: Result yyResult;
09684: int yyBase;
09685: Node yyValue;
09686: ParseError yyError = ParseError.DUMMY;
09687:
09688: // Alternative <Arguments>.
09689:
09690: yyResult = pTypeArguments$$Split1(yyStart);
09691: yyError = yyResult.select(yyError);
09692: if (yyResult.hasValue()) {
09693: final Node v$pt$1 = yyResult.semanticValue();
09694:
09695: yyBase = yyResult.index;
09696: yyC = character(yyBase);
09697: if ('>' == yyC) {
09698: yyIndex = yyResult.index + 1;
09699: final String v$pt$2 = ">";
09700:
09701: yyResult = pSpacing(yyIndex);
09702: yyError = yyResult.select(yyError);
09703: if (yyResult.hasValue()) {
09704: final Token v$pt$3 = yyResult.semanticValue();
09705: yyValue = Formatting.variable().addNode(v$pt$1)
09706: .add(v$pt$2).add(v$pt$3);
09707:
09708: return yyResult.createValue(yyValue, yyError);
09709: }
09710: } else {
09711: yyError = yyError.select("\">\" expected", yyBase);
09712: }
09713: }
09714:
09715: // Done.
09716: return yyError;
09717: }
09718:
09719: // =========================================================================
09720:
09721: /**
09722: * Parse synthetic nonterminal xtc.lang.JavaFive.TypeArguments$$Split1.
09723: *
09724: * @param yyStart The index.
09725: * @return The result.
09726: * @throws IOException Signals an I/O error.
09727: */
09728: private Result pTypeArguments$$Split1(final int yyStart)
09729: throws IOException {
09730:
09731: int yyC;
09732: int yyIndex;
09733: Result yyResult;
09734: int yyBase;
09735: int yyRepetition1;
09736: Pair<Node> yyRepValue1;
09737: Node yyValue;
09738: ParseError yyError = ParseError.DUMMY;
09739:
09740: // Alternative <Arguments>.
09741:
09742: yyC = character(yyStart);
09743: if ('<' == yyC) {
09744: yyIndex = yyStart + 1;
09745: final String v$pt$3 = "<";
09746:
09747: yyResult = pSpacing(yyIndex);
09748: yyError = yyResult.select(yyError);
09749: if (yyResult.hasValue()) {
09750: final Token v$pt$4 = yyResult.semanticValue();
09751:
09752: yyResult = pTypeArgument(yyResult.index);
09753: yyError = yyResult.select(yyError);
09754: if (yyResult.hasValue()) {
09755: final Node v$pt$5 = yyResult.semanticValue();
09756: final Node v$g$1 = Formatting.variable()
09757: .add(v$pt$3).add(v$pt$4).addNode(v$pt$5);
09758:
09759: yyRepetition1 = yyResult.index;
09760: yyRepValue1 = Pair.empty();
09761: while (true) {
09762:
09763: yyBase = yyRepetition1;
09764: yyResult = pSymbol(yyBase);
09765: yyError = yyResult.select(yyError);
09766: if (yyResult.hasValue()
09767: && ((Node) yyResult.semanticValue())
09768: .getTokenText().equals(",")) {
09769: final Node v$pt$1 = yyResult
09770: .semanticValue();
09771:
09772: yyResult = pTypeArgument(yyResult.index);
09773: yyError = yyResult.select(yyError);
09774: if (yyResult.hasValue()) {
09775: final Node v$pt$2 = yyResult
09776: .semanticValue();
09777: final Node v$el$1 = Formatting.before1(
09778: v$pt$1, v$pt$2);
09779:
09780: yyRepetition1 = yyResult.index;
09781: yyRepValue1 = new Pair<Node>(v$el$1,
09782: yyRepValue1);
09783: continue;
09784: }
09785: } else {
09786: yyError = yyError.select("\",\" expected",
09787: yyBase);
09788: }
09789: break;
09790: }
09791: { // Start scope for v$g$2.
09792: final Pair<Node> v$g$2 = yyRepValue1.reverse();
09793:
09794: yyValue = GNode.createFromPair("TypeArguments",
09795: v$g$1, v$g$2);
09796: yyValue.setLocation(location(yyStart));
09797:
09798: return new SemanticValue(yyValue,
09799: yyRepetition1, yyError);
09800: } // End scope for v$g$2.
09801: }
09802: }
09803: }
09804:
09805: // Done.
09806: yyError = yyError.select("type arguments expected", yyStart);
09807: return yyError;
09808: }
09809:
09810: // =========================================================================
09811:
09812: /**
09813: * Parse nonterminal xtc.lang.JavaFiveType.TypeArgument.
09814: *
09815: * @param yyStart The index.
09816: * @return The result.
09817: * @throws IOException Signals an I/O error.
09818: */
09819: private Result pTypeArgument(final int yyStart) throws IOException {
09820: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
09821: if (null == yyColumn.chunk3)
09822: yyColumn.chunk3 = new Chunk3();
09823: if (null == yyColumn.chunk3.fTypeArgument)
09824: yyColumn.chunk3.fTypeArgument = pTypeArgument$1(yyStart);
09825: return yyColumn.chunk3.fTypeArgument;
09826: }
09827:
09828: /** Actually parse xtc.lang.JavaFiveType.TypeArgument. */
09829: private Result pTypeArgument$1(final int yyStart)
09830: throws IOException {
09831: Result yyResult;
09832: Node yyValue;
09833: ParseError yyError = ParseError.DUMMY;
09834:
09835: // Alternative <Type>.
09836:
09837: yyResult = pType(yyStart);
09838: yyError = yyResult.select(yyError);
09839: if (yyResult.hasValue()) {
09840: yyValue = yyResult.semanticValue();
09841:
09842: return yyResult.createValue(yyValue, yyError);
09843: }
09844:
09845: // Alternative <Wildcard>.
09846:
09847: yyResult = pWildcard(yyStart);
09848: yyError = yyResult.select(yyError);
09849: if (yyResult.hasValue()) {
09850: yyValue = yyResult.semanticValue();
09851:
09852: return yyResult.createValue(yyValue, yyError);
09853: }
09854:
09855: // Done.
09856: return yyError;
09857: }
09858:
09859: // =========================================================================
09860:
09861: /**
09862: * Parse nonterminal xtc.lang.JavaFiveType.Wildcard.
09863: *
09864: * @param yyStart The index.
09865: * @return The result.
09866: * @throws IOException Signals an I/O error.
09867: */
09868: private Result pWildcard(final int yyStart) throws IOException {
09869: Result yyResult;
09870: int yyOption1;
09871: Node yyOpValue1;
09872: Node yyValue;
09873: ParseError yyError = ParseError.DUMMY;
09874:
09875: // Alternative <Wildcard>.
09876:
09877: yyResult = pSymbol(yyStart);
09878: yyError = yyResult.select(yyError);
09879: if (yyResult.hasValue()
09880: && ((Node) yyResult.semanticValue()).getTokenText()
09881: .equals("?")) {
09882: final Node v$pt$1 = yyResult.semanticValue();
09883:
09884: yyOption1 = yyResult.index;
09885: yyOpValue1 = null;
09886:
09887: yyResult = pWildcardBound(yyOption1);
09888: yyError = yyResult.select(yyError);
09889: if (yyResult.hasValue()) {
09890: final Node v$el$1 = yyResult.semanticValue();
09891:
09892: yyOption1 = yyResult.index;
09893: yyOpValue1 = v$el$1;
09894: }
09895: { // Start scope for v$pt$2.
09896: final Node v$pt$2 = yyOpValue1;
09897: final Node v$g$1 = Formatting.before1(v$pt$1, v$pt$2);
09898:
09899: yyValue = GNode.create("Wildcard", v$g$1);
09900: yyValue.setLocation(location(yyStart));
09901:
09902: return new SemanticValue(yyValue, yyOption1, yyError);
09903: } // End scope for v$pt$2.
09904: }
09905:
09906: // Done.
09907: yyError = yyError.select("wildcard expected", yyStart);
09908: return yyError;
09909: }
09910:
09911: // =========================================================================
09912:
09913: /**
09914: * Parse nonterminal xtc.lang.JavaFiveType.WildcardBound.
09915: *
09916: * @param yyStart The index.
09917: * @return The result.
09918: * @throws IOException Signals an I/O error.
09919: */
09920: private Result pWildcardBound(final int yyStart) throws IOException {
09921: Result yyResult;
09922: Node yyValue;
09923: ParseError yyError = ParseError.DUMMY;
09924:
09925: // Alternative <Extends>.
09926:
09927: yyResult = pWord(yyStart);
09928: yyError = yyResult.select(yyError);
09929: if (yyResult.hasValue()
09930: && ((Node) yyResult.semanticValue()).getTokenText()
09931: .equals("extends")) {
09932: final Node v$g$1 = yyResult.semanticValue();
09933:
09934: yyResult = pType(yyResult.index);
09935: yyError = yyResult.select(yyError);
09936: if (yyResult.hasValue()) {
09937: final Node v$g$2 = yyResult.semanticValue();
09938:
09939: yyValue = GNode.create("WildcardBound", v$g$1, v$g$2);
09940: yyValue.setLocation(location(yyStart));
09941:
09942: return yyResult.createValue(yyValue, yyError);
09943: }
09944: }
09945:
09946: // Alternative <Super>.
09947:
09948: yyResult = pWord(yyStart);
09949: yyError = yyResult.select(yyError);
09950: if (yyResult.hasValue()
09951: && ((Node) yyResult.semanticValue()).getTokenText()
09952: .equals("super")) {
09953: final Node v$g$3 = yyResult.semanticValue();
09954:
09955: yyResult = pType(yyResult.index);
09956: yyError = yyResult.select(yyError);
09957: if (yyResult.hasValue()) {
09958: final Node v$g$4 = yyResult.semanticValue();
09959:
09960: yyValue = GNode.create("WildcardBound", v$g$3, v$g$4);
09961: yyValue.setLocation(location(yyStart));
09962:
09963: return yyResult.createValue(yyValue, yyError);
09964: }
09965: }
09966:
09967: // Done.
09968: yyError = yyError.select("wildcard bound expected", yyStart);
09969: return yyError;
09970: }
09971:
09972: // =========================================================================
09973:
09974: /**
09975: * Parse nonterminal xtc.lang.JavaFiveType.InstantiatedType.
09976: *
09977: * @param yyStart The index.
09978: * @return The result.
09979: * @throws IOException Signals an I/O error.
09980: */
09981: private Result pInstantiatedType(final int yyStart)
09982: throws IOException {
09983: Result yyResult;
09984: int yyBase;
09985: int yyRepetition1;
09986: Pair<Node> yyRepValue1;
09987: Node yyValue;
09988: ParseError yyError = ParseError.DUMMY;
09989:
09990: // Alternative <Reference>.
09991:
09992: yyResult = pTypeInstantiation(yyStart);
09993: yyError = yyResult.select(yyError);
09994: if (yyResult.hasValue()) {
09995: final Node v$g$1 = yyResult.semanticValue();
09996:
09997: yyRepetition1 = yyResult.index;
09998: yyRepValue1 = Pair.empty();
09999: while (true) {
10000:
10001: yyBase = yyRepetition1;
10002: yyResult = pSymbol(yyBase);
10003: yyError = yyResult.select(yyError);
10004: if (yyResult.hasValue()
10005: && ((Node) yyResult.semanticValue())
10006: .getTokenText().equals(".")) {
10007: final Node v$pt$1 = yyResult.semanticValue();
10008:
10009: yyResult = pTypeInstantiation(yyResult.index);
10010: yyError = yyResult.select(yyError);
10011: if (yyResult.hasValue()) {
10012: final Node v$pt$2 = yyResult.semanticValue();
10013: final Node v$el$1 = Formatting.before1(v$pt$1,
10014: v$pt$2);
10015:
10016: yyRepetition1 = yyResult.index;
10017: yyRepValue1 = new Pair<Node>(v$el$1,
10018: yyRepValue1);
10019: continue;
10020: }
10021: } else {
10022: yyError = yyError.select("\".\" expected", yyBase);
10023: }
10024: break;
10025: }
10026: { // Start scope for v$g$2.
10027: final Pair<Node> v$g$2 = yyRepValue1.reverse();
10028:
10029: yyValue = GNode.createFromPair("InstantiatedType",
10030: v$g$1, v$g$2);
10031: yyValue.setLocation(location(yyStart));
10032:
10033: return new SemanticValue(yyValue, yyRepetition1,
10034: yyError);
10035: } // End scope for v$g$2.
10036: }
10037:
10038: // Done.
10039: return yyError;
10040: }
10041:
10042: // =========================================================================
10043:
10044: /**
10045: * Parse nonterminal xtc.lang.JavaFiveType.TypeInstantiation.
10046: *
10047: * @param yyStart The index.
10048: * @return The result.
10049: * @throws IOException Signals an I/O error.
10050: */
10051: private Result pTypeInstantiation(final int yyStart)
10052: throws IOException {
10053: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
10054: if (null == yyColumn.chunk3)
10055: yyColumn.chunk3 = new Chunk3();
10056: if (null == yyColumn.chunk3.fTypeInstantiation)
10057: yyColumn.chunk3.fTypeInstantiation = pTypeInstantiation$1(yyStart);
10058: return yyColumn.chunk3.fTypeInstantiation;
10059: }
10060:
10061: /** Actually parse xtc.lang.JavaFiveType.TypeInstantiation. */
10062: private Result pTypeInstantiation$1(final int yyStart)
10063: throws IOException {
10064: Result yyResult;
10065: int yyOption1;
10066: Node yyOpValue1;
10067: Node yyValue;
10068: ParseError yyError = ParseError.DUMMY;
10069:
10070: // Alternative <Instantiation>.
10071:
10072: yyResult = pIdentifier(yyStart);
10073: yyError = yyResult.select(yyError);
10074: if (yyResult.hasValue()) {
10075: final Node v$g$1 = yyResult.semanticValue();
10076:
10077: yyOption1 = yyResult.index;
10078: yyOpValue1 = null;
10079:
10080: yyResult = pTypeArguments(yyOption1);
10081: yyError = yyResult.select(yyError);
10082: if (yyResult.hasValue()) {
10083: final Node v$el$1 = yyResult.semanticValue();
10084:
10085: yyOption1 = yyResult.index;
10086: yyOpValue1 = v$el$1;
10087: }
10088: { // Start scope for v$g$2.
10089: final Node v$g$2 = yyOpValue1;
10090:
10091: yyValue = GNode.create("TypeInstantiation", v$g$1,
10092: v$g$2);
10093: yyValue.setLocation(location(yyStart));
10094:
10095: return new SemanticValue(yyValue, yyOption1, yyError);
10096: } // End scope for v$g$2.
10097: }
10098:
10099: // Done.
10100: return yyError;
10101: }
10102:
10103: // =========================================================================
10104:
10105: /**
10106: * Parse nonterminal xtc.lang.JavaConstant.Literal.
10107: *
10108: * @param yyStart The index.
10109: * @return The result.
10110: * @throws IOException Signals an I/O error.
10111: */
10112: private Result pLiteral(final int yyStart) throws IOException {
10113: Result yyResult;
10114: Node yyValue;
10115: ParseError yyError = ParseError.DUMMY;
10116:
10117: // Alternative 1.
10118:
10119: yyResult = pFloatingPointLiteral(yyStart);
10120: yyError = yyResult.select(yyError);
10121: if (yyResult.hasValue()) {
10122: final Node v$pt$2 = yyResult.semanticValue();
10123:
10124: yyResult = pSpacing(yyResult.index);
10125: yyError = yyResult.select(yyError);
10126: if (yyResult.hasValue()) {
10127: final Token v$pt$1 = yyResult.semanticValue();
10128: yyValue = Formatting.after1(v$pt$2, v$pt$1);
10129:
10130: return yyResult.createValue(yyValue, yyError);
10131: }
10132: }
10133:
10134: // Alternative 2.
10135:
10136: yyResult = pIntegerLiteral(yyStart);
10137: yyError = yyResult.select(yyError);
10138: if (yyResult.hasValue()) {
10139: final Node v$pt$4 = yyResult.semanticValue();
10140:
10141: yyResult = pSpacing(yyResult.index);
10142: yyError = yyResult.select(yyError);
10143: if (yyResult.hasValue()) {
10144: final Token v$pt$3 = yyResult.semanticValue();
10145: yyValue = Formatting.after1(v$pt$4, v$pt$3);
10146:
10147: return yyResult.createValue(yyValue, yyError);
10148: }
10149: }
10150:
10151: // Alternative 3.
10152:
10153: yyResult = pCharacterLiteral(yyStart);
10154: yyError = yyResult.select(yyError);
10155: if (yyResult.hasValue()) {
10156: final Node v$pt$6 = yyResult.semanticValue();
10157:
10158: yyResult = pSpacing(yyResult.index);
10159: yyError = yyResult.select(yyError);
10160: if (yyResult.hasValue()) {
10161: final Token v$pt$5 = yyResult.semanticValue();
10162: yyValue = Formatting.after1(v$pt$6, v$pt$5);
10163:
10164: return yyResult.createValue(yyValue, yyError);
10165: }
10166: }
10167:
10168: // Alternative 4.
10169:
10170: yyResult = pStringLiteral(yyStart);
10171: yyError = yyResult.select(yyError);
10172: if (yyResult.hasValue()) {
10173: final Node v$pt$8 = yyResult.semanticValue();
10174:
10175: yyResult = pSpacing(yyResult.index);
10176: yyError = yyResult.select(yyError);
10177: if (yyResult.hasValue()) {
10178: final Token v$pt$7 = yyResult.semanticValue();
10179: yyValue = Formatting.after1(v$pt$8, v$pt$7);
10180:
10181: return yyResult.createValue(yyValue, yyError);
10182: }
10183: }
10184:
10185: // Alternative 5.
10186:
10187: yyResult = pWord(yyStart);
10188: yyError = yyResult.select(yyError);
10189: if (yyResult.hasValue()
10190: && ((Node) yyResult.semanticValue()).getTokenText()
10191: .equals("true")) {
10192: final Node v$g$1 = yyResult.semanticValue();
10193:
10194: yyValue = GNode.create("BooleanLiteral", v$g$1);
10195: yyValue.setLocation(location(yyStart));
10196:
10197: return yyResult.createValue(yyValue, yyError);
10198: }
10199:
10200: // Alternative 6.
10201:
10202: yyResult = pWord(yyStart);
10203: yyError = yyResult.select(yyError);
10204: if (yyResult.hasValue()
10205: && ((Node) yyResult.semanticValue()).getTokenText()
10206: .equals("false")) {
10207: final Node v$g$2 = yyResult.semanticValue();
10208:
10209: yyValue = GNode.create("BooleanLiteral", v$g$2);
10210: yyValue.setLocation(location(yyStart));
10211:
10212: return yyResult.createValue(yyValue, yyError);
10213: }
10214:
10215: // Alternative 7.
10216:
10217: yyResult = pWord(yyStart);
10218: yyError = yyResult.select(yyError);
10219: if (yyResult.hasValue()
10220: && ((Node) yyResult.semanticValue()).getTokenText()
10221: .equals("null")) {
10222: final Node v$pt$1 = yyResult.semanticValue();
10223:
10224: yyValue = GNode.create("NullLiteral", false);
10225: yyValue.setLocation(location(yyStart));
10226: yyValue = Formatting.after1(yyValue, v$pt$1);
10227:
10228: return yyResult.createValue(yyValue, yyError);
10229: }
10230:
10231: // Done.
10232: yyError = yyError.select("literal expected", yyStart);
10233: return yyError;
10234: }
10235:
10236: // =========================================================================
10237:
10238: /**
10239: * Parse nonterminal xtc.lang.JavaConstant.IntegerLiteral.
10240: *
10241: * @param yyStart The index.
10242: * @return The result.
10243: * @throws IOException Signals an I/O error.
10244: */
10245: private Result pIntegerLiteral(final int yyStart)
10246: throws IOException {
10247: Result yyResult;
10248: Node yyValue;
10249: ParseError yyError = ParseError.DUMMY;
10250:
10251: // Alternative <Hex>.
10252:
10253: yyResult = pHexLiteral(yyStart);
10254: yyError = yyResult.select(yyError);
10255: if (yyResult.hasValue()) {
10256: final Token v$g$1 = yyResult.semanticValue();
10257:
10258: yyValue = GNode.create("IntegerLiteral", v$g$1);
10259: yyValue.setLocation(location(yyStart));
10260:
10261: return yyResult.createValue(yyValue, yyError);
10262: }
10263:
10264: // Alternative <Octal>.
10265:
10266: yyResult = pOctalLiteral(yyStart);
10267: yyError = yyResult.select(yyError);
10268: if (yyResult.hasValue()) {
10269: final Token v$g$2 = yyResult.semanticValue();
10270:
10271: yyValue = GNode.create("IntegerLiteral", v$g$2);
10272: yyValue.setLocation(location(yyStart));
10273:
10274: return yyResult.createValue(yyValue, yyError);
10275: }
10276:
10277: // Alternative <Decimal>.
10278:
10279: yyResult = pDecimalLiteral(yyStart);
10280: yyError = yyResult.select(yyError);
10281: if (yyResult.hasValue()) {
10282: final Token v$g$3 = yyResult.semanticValue();
10283:
10284: yyValue = GNode.create("IntegerLiteral", v$g$3);
10285: yyValue.setLocation(location(yyStart));
10286:
10287: return yyResult.createValue(yyValue, yyError);
10288: }
10289:
10290: // Done.
10291: return yyError;
10292: }
10293:
10294: // =========================================================================
10295:
10296: /**
10297: * Parse nonterminal xtc.lang.JavaConstant.HexLiteral.
10298: *
10299: * @param yyStart The index.
10300: * @return The result.
10301: * @throws IOException Signals an I/O error.
10302: */
10303: private Result pHexLiteral(final int yyStart) throws IOException {
10304: int yyC;
10305: int yyIndex;
10306: Result yyResult;
10307: int yyOption1;
10308: Token yyValue;
10309: ParseError yyError = ParseError.DUMMY;
10310:
10311: // Alternative 1.
10312:
10313: yyResult = pHexNumeral(yyStart);
10314: yyError = yyResult.select(yyError);
10315: if (yyResult.hasValue()) {
10316:
10317: yyOption1 = yyResult.index;
10318:
10319: yyC = character(yyOption1);
10320: if (-1 != yyC) {
10321: yyIndex = yyOption1 + 1;
10322:
10323: switch (yyC) {
10324: case 'L':
10325: case 'l': {
10326: yyOption1 = yyIndex;
10327: }
10328:
10329: default:
10330: /* No match. */
10331: }
10332: }
10333:
10334: yyValue = new Token(difference(yyStart, yyOption1));
10335: yyValue.setLocation(location(yyStart));
10336:
10337: return new SemanticValue(yyValue, yyOption1, yyError);
10338: }
10339:
10340: // Done.
10341: yyError = yyError.select("hex literal expected", yyStart);
10342: return yyError;
10343: }
10344:
10345: // =========================================================================
10346:
10347: /**
10348: * Parse nonterminal xtc.lang.JavaConstant.OctalLiteral.
10349: *
10350: * @param yyStart The index.
10351: * @return The result.
10352: * @throws IOException Signals an I/O error.
10353: */
10354: private Result pOctalLiteral(final int yyStart) throws IOException {
10355: int yyC;
10356: int yyIndex;
10357: Result yyResult;
10358: int yyOption1;
10359: Token yyValue;
10360: ParseError yyError = ParseError.DUMMY;
10361:
10362: // Alternative 1.
10363:
10364: yyResult = pOctalNumeral(yyStart);
10365: yyError = yyResult.select(yyError);
10366: if (yyResult.hasValue()) {
10367:
10368: yyOption1 = yyResult.index;
10369:
10370: yyC = character(yyOption1);
10371: if (-1 != yyC) {
10372: yyIndex = yyOption1 + 1;
10373:
10374: switch (yyC) {
10375: case 'L':
10376: case 'l': {
10377: yyOption1 = yyIndex;
10378: }
10379:
10380: default:
10381: /* No match. */
10382: }
10383: }
10384:
10385: yyValue = new Token(difference(yyStart, yyOption1));
10386: yyValue.setLocation(location(yyStart));
10387:
10388: return new SemanticValue(yyValue, yyOption1, yyError);
10389: }
10390:
10391: // Done.
10392: yyError = yyError.select("octal literal expected", yyStart);
10393: return yyError;
10394: }
10395:
10396: // =========================================================================
10397:
10398: /**
10399: * Parse nonterminal xtc.lang.JavaConstant.DecimalLiteral.
10400: *
10401: * @param yyStart The index.
10402: * @return The result.
10403: * @throws IOException Signals an I/O error.
10404: */
10405: private Result pDecimalLiteral(final int yyStart)
10406: throws IOException {
10407: int yyC;
10408: int yyIndex;
10409: Result yyResult;
10410: int yyOption1;
10411: Token yyValue;
10412: ParseError yyError = ParseError.DUMMY;
10413:
10414: // Alternative 1.
10415:
10416: yyResult = pDecimalNumeral(yyStart);
10417: yyError = yyResult.select(yyError);
10418: if (yyResult.hasValue()) {
10419:
10420: yyOption1 = yyResult.index;
10421:
10422: yyC = character(yyOption1);
10423: if (-1 != yyC) {
10424: yyIndex = yyOption1 + 1;
10425:
10426: switch (yyC) {
10427: case 'L':
10428: case 'l': {
10429: yyOption1 = yyIndex;
10430: }
10431:
10432: default:
10433: /* No match. */
10434: }
10435: }
10436:
10437: yyValue = new Token(difference(yyStart, yyOption1));
10438: yyValue.setLocation(location(yyStart));
10439:
10440: return new SemanticValue(yyValue, yyOption1, yyError);
10441: }
10442:
10443: // Done.
10444: yyError = yyError.select("decimal literal expected", yyStart);
10445: return yyError;
10446: }
10447:
10448: // =========================================================================
10449:
10450: /**
10451: * Parse nonterminal xtc.lang.JavaConstant.DecimalNumeral.
10452: *
10453: * @param yyStart The index.
10454: * @return The result.
10455: * @throws IOException Signals an I/O error.
10456: */
10457: private Result pDecimalNumeral(final int yyStart)
10458: throws IOException {
10459: int yyC;
10460: int yyIndex;
10461: int yyRepetition1;
10462: Void yyValue;
10463: ParseError yyError = ParseError.DUMMY;
10464:
10465: // Alternative 1.
10466:
10467: yyC = character(yyStart);
10468: if (-1 != yyC) {
10469: yyIndex = yyStart + 1;
10470:
10471: switch (yyC) {
10472: case '0': {
10473: yyValue = null;
10474:
10475: return new SemanticValue(yyValue, yyIndex, yyError);
10476: }
10477:
10478: case '1':
10479: case '2':
10480: case '3':
10481: case '4':
10482: case '5':
10483: case '6':
10484: case '7':
10485: case '8':
10486: case '9': {
10487: yyRepetition1 = yyIndex;
10488: while (true) {
10489:
10490: yyC = character(yyRepetition1);
10491: if (-1 != yyC) {
10492: yyIndex = yyRepetition1 + 1;
10493:
10494: switch (yyC) {
10495: case '0':
10496: case '1':
10497: case '2':
10498: case '3':
10499: case '4':
10500: case '5':
10501: case '6':
10502: case '7':
10503: case '8':
10504: case '9': {
10505: yyRepetition1 = yyIndex;
10506: continue;
10507: }
10508:
10509: default:
10510: /* No match. */
10511: }
10512: }
10513: break;
10514: }
10515:
10516: yyValue = null;
10517:
10518: return new SemanticValue(yyValue, yyRepetition1,
10519: yyError);
10520: }
10521:
10522: default:
10523: /* No match. */
10524: }
10525: }
10526:
10527: // Done.
10528: yyError = yyError.select("decimal numeral expected", yyStart);
10529: return yyError;
10530: }
10531:
10532: // =========================================================================
10533:
10534: /**
10535: * Parse nonterminal xtc.lang.JavaConstant.HexNumeral.
10536: *
10537: * @param yyStart The index.
10538: * @return The result.
10539: * @throws IOException Signals an I/O error.
10540: */
10541: private Result pHexNumeral(final int yyStart) throws IOException {
10542: int yyC;
10543: int yyIndex;
10544: int yyRepetition1;
10545: boolean yyRepeated1;
10546: Void yyValue;
10547: ParseError yyError = ParseError.DUMMY;
10548:
10549: // Alternative 1.
10550:
10551: yyC = character(yyStart);
10552: if ('0' == yyC) {
10553: yyIndex = yyStart + 1;
10554:
10555: yyC = character(yyIndex);
10556: if (-1 != yyC) {
10557: yyIndex = yyIndex + 1;
10558:
10559: switch (yyC) {
10560: case 'X':
10561: case 'x': {
10562: yyRepetition1 = yyIndex;
10563: yyRepeated1 = false;
10564: while (true) {
10565:
10566: yyC = character(yyRepetition1);
10567: if (-1 != yyC) {
10568: yyIndex = yyRepetition1 + 1;
10569:
10570: switch (yyC) {
10571: case '0':
10572: case '1':
10573: case '2':
10574: case '3':
10575: case '4':
10576: case '5':
10577: case '6':
10578: case '7':
10579: case '8':
10580: case '9':
10581: case 'A':
10582: case 'B':
10583: case 'C':
10584: case 'D':
10585: case 'E':
10586: case 'F':
10587: case 'a':
10588: case 'b':
10589: case 'c':
10590: case 'd':
10591: case 'e':
10592: case 'f': {
10593: yyRepetition1 = yyIndex;
10594: yyRepeated1 = true;
10595: continue;
10596: }
10597:
10598: default:
10599: /* No match. */
10600: }
10601: }
10602: break;
10603: }
10604:
10605: if (yyRepeated1) {
10606:
10607: yyValue = null;
10608:
10609: return new SemanticValue(yyValue,
10610: yyRepetition1, yyError);
10611: }
10612: }
10613: break;
10614:
10615: default:
10616: /* No match. */
10617: }
10618: }
10619: }
10620:
10621: // Done.
10622: yyError = yyError.select("hex numeral expected", yyStart);
10623: return yyError;
10624: }
10625:
10626: // =========================================================================
10627:
10628: /**
10629: * Parse nonterminal xtc.lang.JavaConstant.OctalNumeral.
10630: *
10631: * @param yyStart The index.
10632: * @return The result.
10633: * @throws IOException Signals an I/O error.
10634: */
10635: private Result pOctalNumeral(final int yyStart) throws IOException {
10636: int yyC;
10637: int yyIndex;
10638: int yyRepetition1;
10639: boolean yyRepeated1;
10640: Void yyValue;
10641: ParseError yyError = ParseError.DUMMY;
10642:
10643: // Alternative 1.
10644:
10645: yyC = character(yyStart);
10646: if ('0' == yyC) {
10647: yyIndex = yyStart + 1;
10648:
10649: yyRepetition1 = yyIndex;
10650: yyRepeated1 = false;
10651: while (true) {
10652:
10653: yyC = character(yyRepetition1);
10654: if (-1 != yyC) {
10655: yyIndex = yyRepetition1 + 1;
10656:
10657: switch (yyC) {
10658: case '0':
10659: case '1':
10660: case '2':
10661: case '3':
10662: case '4':
10663: case '5':
10664: case '6':
10665: case '7': {
10666: yyRepetition1 = yyIndex;
10667: yyRepeated1 = true;
10668: continue;
10669: }
10670:
10671: default:
10672: /* No match. */
10673: }
10674: }
10675: break;
10676: }
10677:
10678: if (yyRepeated1) {
10679:
10680: yyValue = null;
10681:
10682: return new SemanticValue(yyValue, yyRepetition1,
10683: yyError);
10684: }
10685: }
10686:
10687: // Done.
10688: yyError = yyError.select("octal numeral expected", yyStart);
10689: return yyError;
10690: }
10691:
10692: // =========================================================================
10693:
10694: /**
10695: * Parse nonterminal xtc.lang.JavaConstant.FloatingPointLiteral.
10696: *
10697: * @param yyStart The index.
10698: * @return The result.
10699: * @throws IOException Signals an I/O error.
10700: */
10701: private Result pFloatingPointLiteral(final int yyStart)
10702: throws IOException {
10703: Result yyResult;
10704: Node yyValue;
10705: ParseError yyError = ParseError.DUMMY;
10706:
10707: // Alternative 1.
10708:
10709: yyResult = pFloatingPointString(yyStart);
10710: yyError = yyResult.select(yyError);
10711: if (yyResult.hasValue()) {
10712: final Token v$g$1 = yyResult.semanticValue();
10713:
10714: yyValue = GNode.create("FloatingPointLiteral", v$g$1);
10715: yyValue.setLocation(location(yyStart));
10716:
10717: return yyResult.createValue(yyValue, yyError);
10718: }
10719:
10720: // Done.
10721: return yyError;
10722: }
10723:
10724: // =========================================================================
10725:
10726: /**
10727: * Parse nonterminal xtc.lang.JavaConstant.FloatingPointString.
10728: *
10729: * @param yyStart The index.
10730: * @return The result.
10731: * @throws IOException Signals an I/O error.
10732: */
10733: private Result pFloatingPointString(final int yyStart)
10734: throws IOException {
10735: int yyC;
10736: int yyIndex;
10737: Result yyResult;
10738: int yyRepetition1;
10739: boolean yyRepeated1;
10740: int yyOption1;
10741: Token yyValue;
10742: ParseError yyError = ParseError.DUMMY;
10743:
10744: // Alternative 1.
10745:
10746: yyRepetition1 = yyStart;
10747: yyRepeated1 = false;
10748: while (true) {
10749:
10750: yyC = character(yyRepetition1);
10751: if (-1 != yyC) {
10752: yyIndex = yyRepetition1 + 1;
10753:
10754: switch (yyC) {
10755: case '0':
10756: case '1':
10757: case '2':
10758: case '3':
10759: case '4':
10760: case '5':
10761: case '6':
10762: case '7':
10763: case '8':
10764: case '9': {
10765: yyRepetition1 = yyIndex;
10766: yyRepeated1 = true;
10767: continue;
10768: }
10769:
10770: default:
10771: /* No match. */
10772: }
10773: }
10774: break;
10775: }
10776:
10777: if (yyRepeated1) {
10778:
10779: yyC = character(yyRepetition1);
10780: if ('.' == yyC) {
10781: yyIndex = yyRepetition1 + 1;
10782:
10783: yyRepetition1 = yyIndex;
10784: while (true) {
10785:
10786: yyC = character(yyRepetition1);
10787: if (-1 != yyC) {
10788: yyIndex = yyRepetition1 + 1;
10789:
10790: switch (yyC) {
10791: case '0':
10792: case '1':
10793: case '2':
10794: case '3':
10795: case '4':
10796: case '5':
10797: case '6':
10798: case '7':
10799: case '8':
10800: case '9': {
10801: yyRepetition1 = yyIndex;
10802: continue;
10803: }
10804:
10805: default:
10806: /* No match. */
10807: }
10808: }
10809: break;
10810: }
10811:
10812: yyOption1 = yyRepetition1;
10813:
10814: yyResult = pExponent(yyOption1);
10815: yyError = yyResult.select(yyError);
10816: if (yyResult.hasValue()) {
10817:
10818: yyOption1 = yyResult.index;
10819: }
10820:
10821: yyC = character(yyOption1);
10822: if (-1 != yyC) {
10823: yyIndex = yyOption1 + 1;
10824:
10825: switch (yyC) {
10826: case 'D':
10827: case 'F':
10828: case 'd':
10829: case 'f': {
10830: yyOption1 = yyIndex;
10831: }
10832:
10833: default:
10834: /* No match. */
10835: }
10836: }
10837:
10838: yyValue = new Token(difference(yyStart, yyOption1));
10839: yyValue.setLocation(location(yyStart));
10840:
10841: return new SemanticValue(yyValue, yyOption1, yyError);
10842: }
10843: }
10844:
10845: // Alternative 2.
10846:
10847: yyC = character(yyStart);
10848: if ('.' == yyC) {
10849: yyIndex = yyStart + 1;
10850:
10851: yyRepetition1 = yyIndex;
10852: yyRepeated1 = false;
10853: while (true) {
10854:
10855: yyC = character(yyRepetition1);
10856: if (-1 != yyC) {
10857: yyIndex = yyRepetition1 + 1;
10858:
10859: switch (yyC) {
10860: case '0':
10861: case '1':
10862: case '2':
10863: case '3':
10864: case '4':
10865: case '5':
10866: case '6':
10867: case '7':
10868: case '8':
10869: case '9': {
10870: yyRepetition1 = yyIndex;
10871: yyRepeated1 = true;
10872: continue;
10873: }
10874:
10875: default:
10876: /* No match. */
10877: }
10878: }
10879: break;
10880: }
10881:
10882: if (yyRepeated1) {
10883:
10884: yyOption1 = yyRepetition1;
10885:
10886: yyResult = pExponent(yyOption1);
10887: yyError = yyResult.select(yyError);
10888: if (yyResult.hasValue()) {
10889:
10890: yyOption1 = yyResult.index;
10891: }
10892:
10893: yyC = character(yyOption1);
10894: if (-1 != yyC) {
10895: yyIndex = yyOption1 + 1;
10896:
10897: switch (yyC) {
10898: case 'D':
10899: case 'F':
10900: case 'd':
10901: case 'f': {
10902: yyOption1 = yyIndex;
10903: }
10904:
10905: default:
10906: /* No match. */
10907: }
10908: }
10909:
10910: yyValue = new Token(difference(yyStart, yyOption1));
10911: yyValue.setLocation(location(yyStart));
10912:
10913: return new SemanticValue(yyValue, yyOption1, yyError);
10914: }
10915: }
10916:
10917: // Alternative 3.
10918:
10919: yyRepetition1 = yyStart;
10920: yyRepeated1 = false;
10921: while (true) {
10922:
10923: yyC = character(yyRepetition1);
10924: if (-1 != yyC) {
10925: yyIndex = yyRepetition1 + 1;
10926:
10927: switch (yyC) {
10928: case '0':
10929: case '1':
10930: case '2':
10931: case '3':
10932: case '4':
10933: case '5':
10934: case '6':
10935: case '7':
10936: case '8':
10937: case '9': {
10938: yyRepetition1 = yyIndex;
10939: yyRepeated1 = true;
10940: continue;
10941: }
10942:
10943: default:
10944: /* No match. */
10945: }
10946: }
10947: break;
10948: }
10949:
10950: if (yyRepeated1) {
10951:
10952: final int yyChoice1 = yyRepetition1;
10953:
10954: // Nested alternative 1.
10955:
10956: yyResult = pExponent(yyChoice1);
10957: yyError = yyResult.select(yyError);
10958: if (yyResult.hasValue()) {
10959:
10960: yyOption1 = yyResult.index;
10961:
10962: yyC = character(yyOption1);
10963: if (-1 != yyC) {
10964: yyIndex = yyOption1 + 1;
10965:
10966: switch (yyC) {
10967: case 'D':
10968: case 'F':
10969: case 'd':
10970: case 'f': {
10971: yyOption1 = yyIndex;
10972: }
10973:
10974: default:
10975: /* No match. */
10976: }
10977: }
10978:
10979: yyValue = new Token(difference(yyStart, yyOption1));
10980: yyValue.setLocation(location(yyStart));
10981:
10982: return new SemanticValue(yyValue, yyOption1, yyError);
10983: }
10984:
10985: // Nested alternative 2.
10986:
10987: yyOption1 = yyChoice1;
10988:
10989: yyResult = pExponent(yyOption1);
10990: yyError = yyResult.select(yyError);
10991: if (yyResult.hasValue()) {
10992:
10993: yyOption1 = yyResult.index;
10994: }
10995:
10996: yyC = character(yyOption1);
10997: if (-1 != yyC) {
10998: yyIndex = yyOption1 + 1;
10999:
11000: switch (yyC) {
11001: case 'D':
11002: case 'F':
11003: case 'd':
11004: case 'f': {
11005: yyValue = new Token(difference(yyStart, yyIndex));
11006: yyValue.setLocation(location(yyStart));
11007:
11008: return new SemanticValue(yyValue, yyIndex, yyError);
11009: }
11010:
11011: default:
11012: /* No match. */
11013: }
11014: }
11015: }
11016:
11017: // Done.
11018: yyError = yyError.select("floating point string expected",
11019: yyStart);
11020: return yyError;
11021: }
11022:
11023: // =========================================================================
11024:
11025: /**
11026: * Parse nonterminal xtc.lang.JavaConstant.Exponent.
11027: *
11028: * @param yyStart The index.
11029: * @return The result.
11030: * @throws IOException Signals an I/O error.
11031: */
11032: private Result pExponent(final int yyStart) throws IOException {
11033: int yyC;
11034: int yyIndex;
11035: int yyRepetition1;
11036: boolean yyRepeated1;
11037: int yyOption1;
11038: Void yyValue;
11039: ParseError yyError = ParseError.DUMMY;
11040:
11041: // Alternative 1.
11042:
11043: yyC = character(yyStart);
11044: if (-1 != yyC) {
11045: yyIndex = yyStart + 1;
11046:
11047: switch (yyC) {
11048: case 'E':
11049: case 'e': {
11050: yyOption1 = yyIndex;
11051:
11052: yyC = character(yyOption1);
11053: if (-1 != yyC) {
11054: yyIndex = yyOption1 + 1;
11055:
11056: switch (yyC) {
11057: case '+':
11058: case '-': {
11059: yyOption1 = yyIndex;
11060: }
11061:
11062: default:
11063: /* No match. */
11064: }
11065: }
11066:
11067: yyRepetition1 = yyOption1;
11068: yyRepeated1 = false;
11069: while (true) {
11070:
11071: yyC = character(yyRepetition1);
11072: if (-1 != yyC) {
11073: yyIndex = yyRepetition1 + 1;
11074:
11075: switch (yyC) {
11076: case '0':
11077: case '1':
11078: case '2':
11079: case '3':
11080: case '4':
11081: case '5':
11082: case '6':
11083: case '7':
11084: case '8':
11085: case '9': {
11086: yyRepetition1 = yyIndex;
11087: yyRepeated1 = true;
11088: continue;
11089: }
11090:
11091: default:
11092: /* No match. */
11093: }
11094: }
11095: break;
11096: }
11097:
11098: if (yyRepeated1) {
11099:
11100: yyValue = null;
11101:
11102: return new SemanticValue(yyValue, yyRepetition1,
11103: yyError);
11104: }
11105: }
11106: break;
11107:
11108: default:
11109: /* No match. */
11110: }
11111: }
11112:
11113: // Done.
11114: yyError = yyError.select("exponent expected", yyStart);
11115: return yyError;
11116: }
11117:
11118: // =========================================================================
11119:
11120: /**
11121: * Parse nonterminal xtc.lang.JavaConstant.CharacterLiteral.
11122: *
11123: * @param yyStart The index.
11124: * @return The result.
11125: * @throws IOException Signals an I/O error.
11126: */
11127: private Result pCharacterLiteral(final int yyStart)
11128: throws IOException {
11129: Result yyResult;
11130: Node yyValue;
11131: ParseError yyError = ParseError.DUMMY;
11132:
11133: // Alternative 1.
11134:
11135: yyResult = pCharacterConstant(yyStart);
11136: yyError = yyResult.select(yyError);
11137: if (yyResult.hasValue()) {
11138: final Token v$g$1 = yyResult.semanticValue();
11139:
11140: yyValue = GNode.create("CharacterLiteral", v$g$1);
11141: yyValue.setLocation(location(yyStart));
11142:
11143: return yyResult.createValue(yyValue, yyError);
11144: }
11145:
11146: // Done.
11147: return yyError;
11148: }
11149:
11150: // =========================================================================
11151:
11152: /**
11153: * Parse nonterminal xtc.lang.JavaConstant.StringLiteral.
11154: *
11155: * @param yyStart The index.
11156: * @return The result.
11157: * @throws IOException Signals an I/O error.
11158: */
11159: private Result pStringLiteral(final int yyStart) throws IOException {
11160: Result yyResult;
11161: Node yyValue;
11162: ParseError yyError = ParseError.DUMMY;
11163:
11164: // Alternative 1.
11165:
11166: yyResult = pStringConstant(yyStart);
11167: yyError = yyResult.select(yyError);
11168: if (yyResult.hasValue()) {
11169: final Token v$g$1 = yyResult.semanticValue();
11170:
11171: yyValue = GNode.create("StringLiteral", v$g$1);
11172: yyValue.setLocation(location(yyStart));
11173:
11174: return yyResult.createValue(yyValue, yyError);
11175: }
11176:
11177: // Done.
11178: return yyError;
11179: }
11180:
11181: // =========================================================================
11182:
11183: /**
11184: * Parse nonterminal xtc.lang.JavaConstant.CharacterConstant.
11185: *
11186: * @param yyStart The index.
11187: * @return The result.
11188: * @throws IOException Signals an I/O error.
11189: */
11190: private Result pCharacterConstant(final int yyStart)
11191: throws IOException {
11192: int yyC;
11193: int yyIndex;
11194: Result yyResult;
11195: Token yyValue;
11196: ParseError yyError = ParseError.DUMMY;
11197:
11198: // Alternative 1.
11199:
11200: yyC = character(yyStart);
11201: if ('\'' == yyC) {
11202: yyIndex = yyStart + 1;
11203:
11204: yyResult = pCharacterConstant$$Choice1(yyIndex);
11205: yyError = yyResult.select(yyError);
11206: if (yyResult.hasValue()) {
11207:
11208: yyC = character(yyResult.index);
11209: if ('\'' == yyC) {
11210: yyIndex = yyResult.index + 1;
11211:
11212: yyValue = new Token(difference(yyStart, yyIndex));
11213: yyValue.setLocation(location(yyStart));
11214:
11215: return new SemanticValue(yyValue, yyIndex, yyError);
11216: }
11217: }
11218: }
11219:
11220: // Done.
11221: yyError = yyError
11222: .select("character constant expected", yyStart);
11223: return yyError;
11224: }
11225:
11226: // =========================================================================
11227:
11228: /**
11229: * Parse synthetic nonterminal xtc.lang.JavaFive.CharacterConstant$$Choice1.
11230: *
11231: * @param yyStart The index.
11232: * @return The result.
11233: * @throws IOException Signals an I/O error.
11234: */
11235: private Result pCharacterConstant$$Choice1(final int yyStart)
11236: throws IOException {
11237:
11238: int yyC;
11239: int yyIndex;
11240: Void yyValue;
11241: ParseError yyError = ParseError.DUMMY;
11242:
11243: // Alternative 1.
11244:
11245: yyC = character(yyStart);
11246: if (-1 != yyC) {
11247: yyIndex = yyStart + 1;
11248:
11249: switch (yyC) {
11250: case '\\': {
11251: final int yyChoice1 = yyIndex;
11252:
11253: // Nested alternative 1.
11254:
11255: yyC = character(yyChoice1);
11256: if (-1 != yyC) {
11257: yyIndex = yyChoice1 + 1;
11258:
11259: switch (yyC) {
11260: case '\"':
11261: case '\'':
11262: case '\\':
11263: case 'b':
11264: case 'f':
11265: case 'n':
11266: case 'r':
11267: case 't': {
11268: yyValue = null;
11269:
11270: return new SemanticValue(yyValue, yyIndex,
11271: yyError);
11272: }
11273:
11274: case 'u': {
11275: yyC = character(yyIndex);
11276: if (-1 != yyC) {
11277: yyIndex = yyIndex + 1;
11278:
11279: switch (yyC) {
11280: case '0':
11281: case '1':
11282: case '2':
11283: case '3':
11284: case '4':
11285: case '5':
11286: case '6':
11287: case '7':
11288: case '8':
11289: case '9':
11290: case 'A':
11291: case 'B':
11292: case 'C':
11293: case 'D':
11294: case 'E':
11295: case 'F':
11296: case 'a':
11297: case 'b':
11298: case 'c':
11299: case 'd':
11300: case 'e':
11301: case 'f': {
11302: yyC = character(yyIndex);
11303: if (-1 != yyC) {
11304: yyIndex = yyIndex + 1;
11305:
11306: switch (yyC) {
11307: case '0':
11308: case '1':
11309: case '2':
11310: case '3':
11311: case '4':
11312: case '5':
11313: case '6':
11314: case '7':
11315: case '8':
11316: case '9':
11317: case 'A':
11318: case 'B':
11319: case 'C':
11320: case 'D':
11321: case 'E':
11322: case 'F':
11323: case 'a':
11324: case 'b':
11325: case 'c':
11326: case 'd':
11327: case 'e':
11328: case 'f': {
11329: yyC = character(yyIndex);
11330: if (-1 != yyC) {
11331: yyIndex = yyIndex + 1;
11332:
11333: switch (yyC) {
11334: case '0':
11335: case '1':
11336: case '2':
11337: case '3':
11338: case '4':
11339: case '5':
11340: case '6':
11341: case '7':
11342: case '8':
11343: case '9':
11344: case 'A':
11345: case 'B':
11346: case 'C':
11347: case 'D':
11348: case 'E':
11349: case 'F':
11350: case 'a':
11351: case 'b':
11352: case 'c':
11353: case 'd':
11354: case 'e':
11355: case 'f': {
11356: yyC = character(yyIndex);
11357: if (-1 != yyC) {
11358: yyIndex = yyIndex + 1;
11359:
11360: switch (yyC) {
11361: case '0':
11362: case '1':
11363: case '2':
11364: case '3':
11365: case '4':
11366: case '5':
11367: case '6':
11368: case '7':
11369: case '8':
11370: case '9':
11371: case 'A':
11372: case 'B':
11373: case 'C':
11374: case 'D':
11375: case 'E':
11376: case 'F':
11377: case 'a':
11378: case 'b':
11379: case 'c':
11380: case 'd':
11381: case 'e':
11382: case 'f': {
11383: yyValue = null;
11384:
11385: return new SemanticValue(
11386: yyValue,
11387: yyIndex,
11388: yyError);
11389: }
11390:
11391: default:
11392: /* No match. */
11393: }
11394: }
11395: }
11396: break;
11397:
11398: default:
11399: /* No match. */
11400: }
11401: }
11402: }
11403: break;
11404:
11405: default:
11406: /* No match. */
11407: }
11408: }
11409: }
11410: break;
11411:
11412: default:
11413: /* No match. */
11414: }
11415: }
11416: }
11417: break;
11418:
11419: default:
11420: /* No match. */
11421: }
11422: }
11423:
11424: // Nested alternative 2.
11425: { // Start scope for nested choice.
11426:
11427: final int yyChoice2 = yyChoice1;
11428:
11429: // Nested alternative 1.
11430:
11431: yyC = character(yyChoice2);
11432: if (-1 != yyC) {
11433: yyIndex = yyChoice2 + 1;
11434:
11435: switch (yyC) {
11436: case '0':
11437: case '1':
11438: case '2':
11439: case '3': {
11440: yyC = character(yyIndex);
11441: if (-1 != yyC) {
11442: yyIndex = yyIndex + 1;
11443:
11444: switch (yyC) {
11445: case '0':
11446: case '1':
11447: case '2':
11448: case '3':
11449: case '4':
11450: case '5':
11451: case '6':
11452: case '7': {
11453: yyC = character(yyIndex);
11454: if (-1 != yyC) {
11455: yyIndex = yyIndex + 1;
11456:
11457: switch (yyC) {
11458: case '0':
11459: case '1':
11460: case '2':
11461: case '3':
11462: case '4':
11463: case '5':
11464: case '6':
11465: case '7': {
11466: yyValue = null;
11467:
11468: return new SemanticValue(
11469: yyValue, yyIndex,
11470: yyError);
11471: }
11472:
11473: default:
11474: /* No match. */
11475: }
11476: }
11477: }
11478: break;
11479:
11480: default:
11481: /* No match. */
11482: }
11483: }
11484: }
11485: break;
11486:
11487: default:
11488: /* No match. */
11489: }
11490: }
11491:
11492: // Nested alternative 2.
11493:
11494: yyC = character(yyChoice2);
11495: if (-1 != yyC) {
11496: yyIndex = yyChoice2 + 1;
11497:
11498: switch (yyC) {
11499: case '0':
11500: case '1':
11501: case '2':
11502: case '3':
11503: case '4':
11504: case '5':
11505: case '6':
11506: case '7': {
11507: final int yyChoice3 = yyIndex;
11508:
11509: // Nested alternative 1.
11510:
11511: yyC = character(yyChoice3);
11512: if (-1 != yyC) {
11513: yyIndex = yyChoice3 + 1;
11514:
11515: switch (yyC) {
11516: case '0':
11517: case '1':
11518: case '2':
11519: case '3':
11520: case '4':
11521: case '5':
11522: case '6':
11523: case '7': {
11524: yyValue = null;
11525:
11526: return new SemanticValue(yyValue,
11527: yyIndex, yyError);
11528: }
11529:
11530: default:
11531: /* No match. */
11532: }
11533: }
11534:
11535: // Nested alternative 2.
11536:
11537: yyValue = null;
11538:
11539: return new SemanticValue(yyValue,
11540: yyChoice3, yyError);
11541: }
11542:
11543: default:
11544: /* No match. */
11545: }
11546: }
11547: } // End scope for nested choice.
11548: }
11549: break;
11550:
11551: default:
11552: /* No match. */
11553: }
11554: }
11555:
11556: // Alternative 2.
11557:
11558: yyC = character(yyStart);
11559: if (-1 != yyC) {
11560: yyIndex = yyStart + 1;
11561:
11562: switch (yyC) {
11563: case '\'':
11564: case '\\':
11565: /* No match. */
11566: break;
11567:
11568: default: {
11569: yyValue = null;
11570:
11571: return new SemanticValue(yyValue, yyIndex, yyError);
11572: }
11573: }
11574: }
11575:
11576: // Done.
11577: yyError = yyError
11578: .select("character constant expected", yyStart);
11579: return yyError;
11580: }
11581:
11582: // =========================================================================
11583:
11584: /**
11585: * Parse nonterminal xtc.lang.JavaConstant.StringConstant.
11586: *
11587: * @param yyStart The index.
11588: * @return The result.
11589: * @throws IOException Signals an I/O error.
11590: */
11591: private Result pStringConstant(final int yyStart)
11592: throws IOException {
11593: int yyC;
11594: int yyIndex;
11595: int yyRepetition1;
11596: Token yyValue;
11597: ParseError yyError = ParseError.DUMMY;
11598:
11599: // Alternative 1.
11600:
11601: yyC = character(yyStart);
11602: if ('\"' == yyC) {
11603: yyIndex = yyStart + 1;
11604:
11605: yyRepetition1 = yyIndex;
11606: while (true) {
11607:
11608: final int yyChoice1 = yyRepetition1;
11609:
11610: // Nested alternative 1.
11611:
11612: yyC = character(yyChoice1);
11613: if (-1 != yyC) {
11614: yyIndex = yyChoice1 + 1;
11615:
11616: switch (yyC) {
11617: case '\\': {
11618: final int yyChoice2 = yyIndex;
11619:
11620: // Nested alternative 1.
11621:
11622: yyC = character(yyChoice2);
11623: if (-1 != yyC) {
11624: yyIndex = yyChoice2 + 1;
11625:
11626: switch (yyC) {
11627: case '\"':
11628: case '\'':
11629: case '\\':
11630: case 'b':
11631: case 'f':
11632: case 'n':
11633: case 'r':
11634: case 't': {
11635: yyRepetition1 = yyIndex;
11636: continue;
11637: }
11638:
11639: case 'u': {
11640: yyC = character(yyIndex);
11641: if (-1 != yyC) {
11642: yyIndex = yyIndex + 1;
11643:
11644: switch (yyC) {
11645: case '0':
11646: case '1':
11647: case '2':
11648: case '3':
11649: case '4':
11650: case '5':
11651: case '6':
11652: case '7':
11653: case '8':
11654: case '9':
11655: case 'A':
11656: case 'B':
11657: case 'C':
11658: case 'D':
11659: case 'E':
11660: case 'F':
11661: case 'a':
11662: case 'b':
11663: case 'c':
11664: case 'd':
11665: case 'e':
11666: case 'f': {
11667: yyC = character(yyIndex);
11668: if (-1 != yyC) {
11669: yyIndex = yyIndex + 1;
11670:
11671: switch (yyC) {
11672: case '0':
11673: case '1':
11674: case '2':
11675: case '3':
11676: case '4':
11677: case '5':
11678: case '6':
11679: case '7':
11680: case '8':
11681: case '9':
11682: case 'A':
11683: case 'B':
11684: case 'C':
11685: case 'D':
11686: case 'E':
11687: case 'F':
11688: case 'a':
11689: case 'b':
11690: case 'c':
11691: case 'd':
11692: case 'e':
11693: case 'f': {
11694: yyC = character(yyIndex);
11695: if (-1 != yyC) {
11696: yyIndex = yyIndex + 1;
11697:
11698: switch (yyC) {
11699: case '0':
11700: case '1':
11701: case '2':
11702: case '3':
11703: case '4':
11704: case '5':
11705: case '6':
11706: case '7':
11707: case '8':
11708: case '9':
11709: case 'A':
11710: case 'B':
11711: case 'C':
11712: case 'D':
11713: case 'E':
11714: case 'F':
11715: case 'a':
11716: case 'b':
11717: case 'c':
11718: case 'd':
11719: case 'e':
11720: case 'f': {
11721: yyC = character(yyIndex);
11722: if (-1 != yyC) {
11723: yyIndex = yyIndex + 1;
11724:
11725: switch (yyC) {
11726: case '0':
11727: case '1':
11728: case '2':
11729: case '3':
11730: case '4':
11731: case '5':
11732: case '6':
11733: case '7':
11734: case '8':
11735: case '9':
11736: case 'A':
11737: case 'B':
11738: case 'C':
11739: case 'D':
11740: case 'E':
11741: case 'F':
11742: case 'a':
11743: case 'b':
11744: case 'c':
11745: case 'd':
11746: case 'e':
11747: case 'f': {
11748: yyRepetition1 = yyIndex;
11749: continue;
11750: }
11751:
11752: default:
11753: /* No match. */
11754: }
11755: }
11756: }
11757: break;
11758:
11759: default:
11760: /* No match. */
11761: }
11762: }
11763: }
11764: break;
11765:
11766: default:
11767: /* No match. */
11768: }
11769: }
11770: }
11771: break;
11772:
11773: default:
11774: /* No match. */
11775: }
11776: }
11777: }
11778: break;
11779:
11780: default:
11781: /* No match. */
11782: }
11783: }
11784:
11785: // Nested alternative 2.
11786: { // Start scope for nested choice.
11787:
11788: final int yyChoice3 = yyChoice2;
11789:
11790: // Nested alternative 1.
11791:
11792: yyC = character(yyChoice3);
11793: if (-1 != yyC) {
11794: yyIndex = yyChoice3 + 1;
11795:
11796: switch (yyC) {
11797: case '0':
11798: case '1':
11799: case '2':
11800: case '3': {
11801: yyC = character(yyIndex);
11802: if (-1 != yyC) {
11803: yyIndex = yyIndex + 1;
11804:
11805: switch (yyC) {
11806: case '0':
11807: case '1':
11808: case '2':
11809: case '3':
11810: case '4':
11811: case '5':
11812: case '6':
11813: case '7': {
11814: yyC = character(yyIndex);
11815: if (-1 != yyC) {
11816: yyIndex = yyIndex + 1;
11817:
11818: switch (yyC) {
11819: case '0':
11820: case '1':
11821: case '2':
11822: case '3':
11823: case '4':
11824: case '5':
11825: case '6':
11826: case '7': {
11827: yyRepetition1 = yyIndex;
11828: continue;
11829: }
11830:
11831: default:
11832: /* No match. */
11833: }
11834: }
11835: }
11836: break;
11837:
11838: default:
11839: /* No match. */
11840: }
11841: }
11842: }
11843: break;
11844:
11845: default:
11846: /* No match. */
11847: }
11848: }
11849:
11850: // Nested alternative 2.
11851:
11852: yyC = character(yyChoice3);
11853: if (-1 != yyC) {
11854: yyIndex = yyChoice3 + 1;
11855:
11856: switch (yyC) {
11857: case '0':
11858: case '1':
11859: case '2':
11860: case '3':
11861: case '4':
11862: case '5':
11863: case '6':
11864: case '7': {
11865: final int yyChoice4 = yyIndex;
11866:
11867: // Nested alternative 1.
11868:
11869: yyC = character(yyChoice4);
11870: if (-1 != yyC) {
11871: yyIndex = yyChoice4 + 1;
11872:
11873: switch (yyC) {
11874: case '0':
11875: case '1':
11876: case '2':
11877: case '3':
11878: case '4':
11879: case '5':
11880: case '6':
11881: case '7': {
11882: yyRepetition1 = yyIndex;
11883: continue;
11884: }
11885:
11886: default:
11887: /* No match. */
11888: }
11889: }
11890:
11891: // Nested alternative 2.
11892:
11893: yyRepetition1 = yyChoice4;
11894: continue;
11895: }
11896:
11897: default:
11898: /* No match. */
11899: }
11900: }
11901: } // End scope for nested choice.
11902: }
11903: break;
11904:
11905: default:
11906: /* No match. */
11907: }
11908: }
11909:
11910: // Nested alternative 2.
11911:
11912: yyC = character(yyChoice1);
11913: if (-1 != yyC) {
11914: yyIndex = yyChoice1 + 1;
11915:
11916: switch (yyC) {
11917: case '\"':
11918: case '\\':
11919: /* No match. */
11920: break;
11921:
11922: default: {
11923: yyRepetition1 = yyIndex;
11924: continue;
11925: }
11926: }
11927: }
11928: break;
11929: }
11930:
11931: yyC = character(yyRepetition1);
11932: if ('\"' == yyC) {
11933: yyIndex = yyRepetition1 + 1;
11934:
11935: yyValue = new Token(difference(yyStart, yyIndex));
11936: yyValue.setLocation(location(yyStart));
11937:
11938: return new SemanticValue(yyValue, yyIndex, yyError);
11939: }
11940: }
11941:
11942: // Done.
11943: yyError = yyError.select("string constant expected", yyStart);
11944: return yyError;
11945: }
11946:
11947: // =========================================================================
11948:
11949: /**
11950: * Parse nonterminal xtc.lang.JavaFiveIdentifier.QualifiedIdentifier.
11951: *
11952: * @param yyStart The index.
11953: * @return The result.
11954: * @throws IOException Signals an I/O error.
11955: */
11956: private Result pQualifiedIdentifier(final int yyStart)
11957: throws IOException {
11958: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
11959: if (null == yyColumn.chunk3)
11960: yyColumn.chunk3 = new Chunk3();
11961: if (null == yyColumn.chunk3.fQualifiedIdentifier)
11962: yyColumn.chunk3.fQualifiedIdentifier = pQualifiedIdentifier$1(yyStart);
11963: return yyColumn.chunk3.fQualifiedIdentifier;
11964: }
11965:
11966: /** Actually parse xtc.lang.JavaFiveIdentifier.QualifiedIdentifier. */
11967: private Result pQualifiedIdentifier$1(final int yyStart)
11968: throws IOException {
11969:
11970: Result yyResult;
11971: Node yyValue;
11972: ParseError yyError = ParseError.DUMMY;
11973:
11974: // Alternative 1.
11975:
11976: yyResult = pIdentifier(yyStart);
11977: yyError = yyResult.select(yyError);
11978: if (yyResult.hasValue()) {
11979: final Node v$g$1 = yyResult.semanticValue();
11980:
11981: yyResult = pQualifiedIdentifier$$Star1(yyResult.index);
11982: yyError = yyResult.select(yyError);
11983: if (yyResult.hasValue()) {
11984: final Pair<Node> v$g$2 = yyResult.semanticValue();
11985:
11986: yyValue = GNode.createFromPair("QualifiedIdentifier",
11987: v$g$1, v$g$2);
11988: yyValue.setLocation(location(yyStart));
11989:
11990: return yyResult.createValue(yyValue, yyError);
11991: }
11992: }
11993:
11994: // Done.
11995: return yyError;
11996: }
11997:
11998: // =========================================================================
11999:
12000: /**
12001: * Parse synthetic nonterminal xtc.lang.JavaFive.QualifiedIdentifier$$Star1.
12002: *
12003: * @param yyStart The index.
12004: * @return The result.
12005: * @throws IOException Signals an I/O error.
12006: */
12007: private Result pQualifiedIdentifier$$Star1(final int yyStart)
12008: throws IOException {
12009:
12010: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
12011: if (null == yyColumn.chunk4)
12012: yyColumn.chunk4 = new Chunk4();
12013: if (null == yyColumn.chunk4.fQualifiedIdentifier$$Star1)
12014: yyColumn.chunk4.fQualifiedIdentifier$$Star1 = pQualifiedIdentifier$$Star1$1(yyStart);
12015: return yyColumn.chunk4.fQualifiedIdentifier$$Star1;
12016: }
12017:
12018: /** Actually parse xtc.lang.JavaFive.QualifiedIdentifier$$Star1. */
12019: private Result pQualifiedIdentifier$$Star1$1(final int yyStart)
12020: throws IOException {
12021:
12022: Result yyResult;
12023: Pair<Node> yyValue;
12024: ParseError yyError = ParseError.DUMMY;
12025:
12026: // Alternative 1.
12027:
12028: yyResult = pSymbol(yyStart);
12029: yyError = yyResult.select(yyError);
12030: if (yyResult.hasValue()
12031: && ((Node) yyResult.semanticValue()).getTokenText()
12032: .equals(".")) {
12033: final Node v$pt$1 = yyResult.semanticValue();
12034:
12035: yyResult = pIdentifier(yyResult.index);
12036: yyError = yyResult.select(yyError);
12037: if (yyResult.hasValue()) {
12038: final Node v$pt$2 = yyResult.semanticValue();
12039: final Node v$el$1 = Formatting.before1(v$pt$1, v$pt$2);
12040:
12041: yyResult = pQualifiedIdentifier$$Star1(yyResult.index);
12042: yyError = yyResult.select(yyError);
12043: if (yyResult.hasValue()) {
12044: final Pair<Node> v$2 = yyResult.semanticValue();
12045:
12046: yyValue = new Pair<Node>(v$el$1, v$2);
12047:
12048: return yyResult.createValue(yyValue, yyError);
12049: }
12050: }
12051: }
12052:
12053: // Alternative 2.
12054:
12055: yyValue = Pair.empty();
12056:
12057: return new SemanticValue(yyValue, yyStart, yyError);
12058: }
12059:
12060: // =========================================================================
12061:
12062: /**
12063: * Parse nonterminal xtc.lang.JavaFiveIdentifier.Identifier.
12064: *
12065: * @param yyStart The index.
12066: * @return The result.
12067: * @throws IOException Signals an I/O error.
12068: */
12069: private Result pIdentifier(final int yyStart) throws IOException {
12070: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
12071: if (null == yyColumn.chunk4)
12072: yyColumn.chunk4 = new Chunk4();
12073: if (null == yyColumn.chunk4.fIdentifier)
12074: yyColumn.chunk4.fIdentifier = pIdentifier$1(yyStart);
12075: return yyColumn.chunk4.fIdentifier;
12076: }
12077:
12078: /** Actually parse xtc.lang.JavaFiveIdentifier.Identifier. */
12079: private Result pIdentifier$1(final int yyStart) throws IOException {
12080: Result yyResult;
12081: Node yyValue;
12082: ParseError yyError = ParseError.DUMMY;
12083:
12084: // Alternative 1.
12085:
12086: yyResult = pWord(yyStart);
12087: yyError = yyResult.select(yyError);
12088: if (yyResult.hasValue()) {
12089: yyValue = yyResult.semanticValue();
12090:
12091: if (!contains(JAVA_KEYWORDS, toText(yyValue))) {
12092:
12093: return yyResult.createValue(yyValue, yyError);
12094: }
12095: }
12096:
12097: // Done.
12098: yyError = yyError.select("identifier expected", yyStart);
12099: return yyError;
12100: }
12101:
12102: // =========================================================================
12103:
12104: /**
12105: * Parse nonterminal xtc.lang.JavaFiveIdentifier.Word.
12106: *
12107: * @param yyStart The index.
12108: * @return The result.
12109: * @throws IOException Signals an I/O error.
12110: */
12111: private Result pWord(final int yyStart) throws IOException {
12112: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
12113: if (null == yyColumn.chunk4)
12114: yyColumn.chunk4 = new Chunk4();
12115: if (null == yyColumn.chunk4.fWord)
12116: yyColumn.chunk4.fWord = pWord$1(yyStart);
12117: return yyColumn.chunk4.fWord;
12118: }
12119:
12120: /** Actually parse xtc.lang.JavaFiveIdentifier.Word. */
12121: private Result pWord$1(final int yyStart) throws IOException {
12122: Result yyResult;
12123: Node yyValue;
12124: ParseError yyError = ParseError.DUMMY;
12125:
12126: // Alternative 1.
12127:
12128: yyResult = pWordCharacters(yyStart);
12129: yyError = yyResult.select(yyError);
12130: if (yyResult.hasValue()) {
12131: final Token v$pt$2 = yyResult.semanticValue();
12132:
12133: yyResult = pSpacing(yyResult.index);
12134: yyError = yyResult.select(yyError);
12135: if (yyResult.hasValue()) {
12136: final Token v$pt$1 = yyResult.semanticValue();
12137: yyValue = Formatting.after1(v$pt$2, v$pt$1);
12138:
12139: return yyResult.createValue(yyValue, yyError);
12140: }
12141: }
12142:
12143: // Done.
12144: return yyError;
12145: }
12146:
12147: // =========================================================================
12148:
12149: /**
12150: * Parse nonterminal xtc.lang.JavaFiveIdentifier.WordCharacters.
12151: *
12152: * @param yyStart The index.
12153: * @return The result.
12154: * @throws IOException Signals an I/O error.
12155: */
12156: private Result pWordCharacters(final int yyStart)
12157: throws IOException {
12158: int yyC;
12159: int yyIndex;
12160: int yyRepetition1;
12161: Token yyValue;
12162: ParseError yyError = ParseError.DUMMY;
12163:
12164: // Alternative 1.
12165:
12166: yyC = character(yyStart);
12167: if (-1 != yyC) {
12168: yyIndex = yyStart + 1;
12169: final char start = (char) yyC;
12170:
12171: if (Character.isJavaIdentifierStart(start)) {
12172:
12173: yyRepetition1 = yyIndex;
12174: while (true) {
12175:
12176: yyC = character(yyRepetition1);
12177: if (-1 != yyC) {
12178: yyIndex = yyRepetition1 + 1;
12179: final char part = (char) yyC;
12180:
12181: if (Character.isJavaIdentifierPart(part)) {
12182:
12183: yyRepetition1 = yyIndex;
12184: continue;
12185: }
12186: }
12187: break;
12188: }
12189:
12190: yyValue = new Token(difference(yyStart, yyRepetition1));
12191: yyValue.setLocation(location(yyStart));
12192:
12193: return new SemanticValue(yyValue, yyRepetition1,
12194: yyError);
12195: }
12196: }
12197:
12198: // Done.
12199: yyError = yyError.select("word characters expected", yyStart);
12200: return yyError;
12201: }
12202:
12203: // =========================================================================
12204:
12205: /**
12206: * Parse nonterminal xtc.lang.JavaFiveSymbol.Symbol.
12207: *
12208: * @param yyStart The index.
12209: * @return The result.
12210: * @throws IOException Signals an I/O error.
12211: */
12212: private Result pSymbol(final int yyStart) throws IOException {
12213: JavaFiveReaderColumn yyColumn = (JavaFiveReaderColumn) column(yyStart);
12214: if (null == yyColumn.chunk4)
12215: yyColumn.chunk4 = new Chunk4();
12216: if (null == yyColumn.chunk4.fSymbol)
12217: yyColumn.chunk4.fSymbol = pSymbol$1(yyStart);
12218: return yyColumn.chunk4.fSymbol;
12219: }
12220:
12221: /** Actually parse xtc.lang.JavaFiveSymbol.Symbol. */
12222: private Result pSymbol$1(final int yyStart) throws IOException {
12223: Result yyResult;
12224: Node yyValue;
12225: ParseError yyError = ParseError.DUMMY;
12226:
12227: // Alternative 1.
12228:
12229: yyResult = pSymbolCharacters(yyStart);
12230: yyError = yyResult.select(yyError);
12231: if (yyResult.hasValue()) {
12232: final Token v$pt$2 = yyResult.semanticValue();
12233:
12234: yyResult = pSpacing(yyResult.index);
12235: yyError = yyResult.select(yyError);
12236: if (yyResult.hasValue()) {
12237: final Token v$pt$1 = yyResult.semanticValue();
12238: yyValue = Formatting.after1(v$pt$2, v$pt$1);
12239:
12240: return yyResult.createValue(yyValue, yyError);
12241: }
12242: }
12243:
12244: // Done.
12245: return yyError;
12246: }
12247:
12248: // =========================================================================
12249:
12250: /**
12251: * Parse nonterminal xtc.lang.JavaFiveSymbol.SymbolCharacters.
12252: *
12253: * @param yyStart The index.
12254: * @return The result.
12255: * @throws IOException Signals an I/O error.
12256: */
12257: private Result pSymbolCharacters(final int yyStart)
12258: throws IOException {
12259: int yyC;
12260: int yyIndex;
12261: Token yyValue;
12262: ParseError yyError = ParseError.DUMMY;
12263:
12264: // Alternative 1.
12265:
12266: yyC = character(yyStart);
12267: if (-1 != yyC) {
12268: yyIndex = yyStart + 1;
12269:
12270: switch (yyC) {
12271: case '>': {
12272: final int yyChoice1 = yyIndex;
12273:
12274: // Nested alternative 1.
12275:
12276: yyC = character(yyChoice1);
12277: if (-1 != yyC) {
12278: yyIndex = yyChoice1 + 1;
12279:
12280: switch (yyC) {
12281: case '>': {
12282: final int yyChoice2 = yyIndex;
12283:
12284: // Nested alternative 1.
12285:
12286: yyC = character(yyChoice2);
12287: if (-1 != yyC) {
12288: yyIndex = yyChoice2 + 1;
12289:
12290: switch (yyC) {
12291: case '>': {
12292: final int yyChoice3 = yyIndex;
12293:
12294: // Nested alternative 1.
12295:
12296: yyC = character(yyChoice3);
12297: if (-1 != yyC) {
12298: yyIndex = yyChoice3 + 1;
12299: if ('=' == yyC) {
12300:
12301: yyValue = new Token(">>>=");
12302: yyValue
12303: .setLocation(location(yyStart));
12304:
12305: return new SemanticValue(
12306: yyValue, yyIndex,
12307: yyError);
12308: }
12309: }
12310:
12311: // Nested alternative 2.
12312:
12313: yyValue = new Token(">>>");
12314: yyValue.setLocation(location(yyStart));
12315:
12316: return new SemanticValue(yyValue,
12317: yyChoice3, yyError);
12318: }
12319:
12320: case '=': {
12321: yyValue = new Token(">>=");
12322: yyValue.setLocation(location(yyStart));
12323:
12324: return new SemanticValue(yyValue,
12325: yyIndex, yyError);
12326: }
12327:
12328: default:
12329: /* No match. */
12330: }
12331: }
12332:
12333: // Nested alternative 2.
12334:
12335: yyValue = new Token(">>");
12336: yyValue.setLocation(location(yyStart));
12337:
12338: return new SemanticValue(yyValue, yyChoice2,
12339: yyError);
12340: }
12341:
12342: case '=': {
12343: yyValue = new Token(">=");
12344: yyValue.setLocation(location(yyStart));
12345:
12346: return new SemanticValue(yyValue, yyIndex,
12347: yyError);
12348: }
12349:
12350: default:
12351: /* No match. */
12352: }
12353: }
12354:
12355: // Nested alternative 2.
12356:
12357: yyValue = new Token(">");
12358: yyValue.setLocation(location(yyStart));
12359:
12360: return new SemanticValue(yyValue, yyChoice1, yyError);
12361: }
12362:
12363: case '<': {
12364: final int yyChoice1 = yyIndex;
12365:
12366: // Nested alternative 1.
12367:
12368: yyC = character(yyChoice1);
12369: if (-1 != yyC) {
12370: yyIndex = yyChoice1 + 1;
12371:
12372: switch (yyC) {
12373: case '<': {
12374: final int yyChoice2 = yyIndex;
12375:
12376: // Nested alternative 1.
12377:
12378: yyC = character(yyChoice2);
12379: if (-1 != yyC) {
12380: yyIndex = yyChoice2 + 1;
12381: if ('=' == yyC) {
12382:
12383: yyValue = new Token("<<=");
12384: yyValue.setLocation(location(yyStart));
12385:
12386: return new SemanticValue(yyValue,
12387: yyIndex, yyError);
12388: }
12389: }
12390:
12391: // Nested alternative 2.
12392:
12393: yyValue = new Token("<<");
12394: yyValue.setLocation(location(yyStart));
12395:
12396: return new SemanticValue(yyValue, yyChoice2,
12397: yyError);
12398: }
12399:
12400: case '=': {
12401: yyValue = new Token("<=");
12402: yyValue.setLocation(location(yyStart));
12403:
12404: return new SemanticValue(yyValue, yyIndex,
12405: yyError);
12406: }
12407:
12408: default:
12409: /* No match. */
12410: }
12411: }
12412:
12413: // Nested alternative 2.
12414:
12415: yyValue = new Token("<");
12416: yyValue.setLocation(location(yyStart));
12417:
12418: return new SemanticValue(yyValue, yyChoice1, yyError);
12419: }
12420:
12421: case '.': {
12422: final int yyChoice1 = yyIndex;
12423:
12424: // Nested alternative 1.
12425:
12426: yyC = character(yyChoice1);
12427: if (-1 != yyC) {
12428: yyIndex = yyChoice1 + 1;
12429: if ('.' == yyC) {
12430:
12431: yyC = character(yyIndex);
12432: if (-1 != yyC) {
12433: yyIndex = yyIndex + 1;
12434: if ('.' == yyC) {
12435:
12436: yyValue = new Token("...");
12437: yyValue.setLocation(location(yyStart));
12438:
12439: return new SemanticValue(yyValue,
12440: yyIndex, yyError);
12441: }
12442: }
12443: }
12444: }
12445:
12446: // Nested alternative 2.
12447:
12448: yyValue = new Token(".");
12449: yyValue.setLocation(location(yyStart));
12450:
12451: return new SemanticValue(yyValue, yyChoice1, yyError);
12452: }
12453:
12454: case '+': {
12455: final int yyChoice1 = yyIndex;
12456:
12457: // Nested alternative 1.
12458:
12459: yyC = character(yyChoice1);
12460: if (-1 != yyC) {
12461: yyIndex = yyChoice1 + 1;
12462:
12463: switch (yyC) {
12464: case '=': {
12465: yyValue = new Token("+=");
12466: yyValue.setLocation(location(yyStart));
12467:
12468: return new SemanticValue(yyValue, yyIndex,
12469: yyError);
12470: }
12471:
12472: case '+': {
12473: yyValue = new Token("++");
12474: yyValue.setLocation(location(yyStart));
12475:
12476: return new SemanticValue(yyValue, yyIndex,
12477: yyError);
12478: }
12479:
12480: default:
12481: /* No match. */
12482: }
12483: }
12484:
12485: // Nested alternative 2.
12486:
12487: yyValue = new Token("+");
12488: yyValue.setLocation(location(yyStart));
12489:
12490: return new SemanticValue(yyValue, yyChoice1, yyError);
12491: }
12492:
12493: case '-': {
12494: final int yyChoice1 = yyIndex;
12495:
12496: // Nested alternative 1.
12497:
12498: yyC = character(yyChoice1);
12499: if (-1 != yyC) {
12500: yyIndex = yyChoice1 + 1;
12501:
12502: switch (yyC) {
12503: case '=': {
12504: yyValue = new Token("-=");
12505: yyValue.setLocation(location(yyStart));
12506:
12507: return new SemanticValue(yyValue, yyIndex,
12508: yyError);
12509: }
12510:
12511: case '-': {
12512: yyValue = new Token("--");
12513: yyValue.setLocation(location(yyStart));
12514:
12515: return new SemanticValue(yyValue, yyIndex,
12516: yyError);
12517: }
12518:
12519: default:
12520: /* No match. */
12521: }
12522: }
12523:
12524: // Nested alternative 2.
12525:
12526: yyValue = new Token("-");
12527: yyValue.setLocation(location(yyStart));
12528:
12529: return new SemanticValue(yyValue, yyChoice1, yyError);
12530: }
12531:
12532: case '*': {
12533: final int yyChoice1 = yyIndex;
12534:
12535: // Nested alternative 1.
12536:
12537: yyC = character(yyChoice1);
12538: if (-1 != yyC) {
12539: yyIndex = yyChoice1 + 1;
12540: if ('=' == yyC) {
12541:
12542: yyValue = new Token("*=");
12543: yyValue.setLocation(location(yyStart));
12544:
12545: return new SemanticValue(yyValue, yyIndex,
12546: yyError);
12547: }
12548: }
12549:
12550: // Nested alternative 2.
12551:
12552: yyValue = new Token("*");
12553: yyValue.setLocation(location(yyStart));
12554:
12555: return new SemanticValue(yyValue, yyChoice1, yyError);
12556: }
12557:
12558: case '/': {
12559: final int yyChoice1 = yyIndex;
12560:
12561: // Nested alternative 1.
12562:
12563: yyC = character(yyChoice1);
12564: if (-1 != yyC) {
12565: yyIndex = yyChoice1 + 1;
12566: if ('=' == yyC) {
12567:
12568: yyValue = new Token("/=");
12569: yyValue.setLocation(location(yyStart));
12570:
12571: return new SemanticValue(yyValue, yyIndex,
12572: yyError);
12573: }
12574: }
12575:
12576: // Nested alternative 2.
12577:
12578: yyValue = new Token("/");
12579: yyValue.setLocation(location(yyStart));
12580:
12581: return new SemanticValue(yyValue, yyChoice1, yyError);
12582: }
12583:
12584: case '%': {
12585: final int yyChoice1 = yyIndex;
12586:
12587: // Nested alternative 1.
12588:
12589: yyC = character(yyChoice1);
12590: if (-1 != yyC) {
12591: yyIndex = yyChoice1 + 1;
12592: if ('=' == yyC) {
12593:
12594: yyValue = new Token("%=");
12595: yyValue.setLocation(location(yyStart));
12596:
12597: return new SemanticValue(yyValue, yyIndex,
12598: yyError);
12599: }
12600: }
12601:
12602: // Nested alternative 2.
12603:
12604: yyValue = new Token("%");
12605: yyValue.setLocation(location(yyStart));
12606:
12607: return new SemanticValue(yyValue, yyChoice1, yyError);
12608: }
12609:
12610: case '&': {
12611: final int yyChoice1 = yyIndex;
12612:
12613: // Nested alternative 1.
12614:
12615: yyC = character(yyChoice1);
12616: if (-1 != yyC) {
12617: yyIndex = yyChoice1 + 1;
12618:
12619: switch (yyC) {
12620: case '=': {
12621: yyValue = new Token("&=");
12622: yyValue.setLocation(location(yyStart));
12623:
12624: return new SemanticValue(yyValue, yyIndex,
12625: yyError);
12626: }
12627:
12628: case '&': {
12629: yyValue = new Token("&&");
12630: yyValue.setLocation(location(yyStart));
12631:
12632: return new SemanticValue(yyValue, yyIndex,
12633: yyError);
12634: }
12635:
12636: default:
12637: /* No match. */
12638: }
12639: }
12640:
12641: // Nested alternative 2.
12642:
12643: yyValue = new Token("&");
12644: yyValue.setLocation(location(yyStart));
12645:
12646: return new SemanticValue(yyValue, yyChoice1, yyError);
12647: }
12648:
12649: case '^': {
12650: final int yyChoice1 = yyIndex;
12651:
12652: // Nested alternative 1.
12653:
12654: yyC = character(yyChoice1);
12655: if (-1 != yyC) {
12656: yyIndex = yyChoice1 + 1;
12657: if ('=' == yyC) {
12658:
12659: yyValue = new Token("^=");
12660: yyValue.setLocation(location(yyStart));
12661:
12662: return new SemanticValue(yyValue, yyIndex,
12663: yyError);
12664: }
12665: }
12666:
12667: // Nested alternative 2.
12668:
12669: yyValue = new Token("^");
12670: yyValue.setLocation(location(yyStart));
12671:
12672: return new SemanticValue(yyValue, yyChoice1, yyError);
12673: }
12674:
12675: case '|': {
12676: final int yyChoice1 = yyIndex;
12677:
12678: // Nested alternative 1.
12679:
12680: yyC = character(yyChoice1);
12681: if (-1 != yyC) {
12682: yyIndex = yyChoice1 + 1;
12683:
12684: switch (yyC) {
12685: case '=': {
12686: yyValue = new Token("|=");
12687: yyValue.setLocation(location(yyStart));
12688:
12689: return new SemanticValue(yyValue, yyIndex,
12690: yyError);
12691: }
12692:
12693: case '|': {
12694: yyValue = new Token("||");
12695: yyValue.setLocation(location(yyStart));
12696:
12697: return new SemanticValue(yyValue, yyIndex,
12698: yyError);
12699: }
12700:
12701: default:
12702: /* No match. */
12703: }
12704: }
12705:
12706: // Nested alternative 2.
12707:
12708: yyValue = new Token("|");
12709: yyValue.setLocation(location(yyStart));
12710:
12711: return new SemanticValue(yyValue, yyChoice1, yyError);
12712: }
12713:
12714: case '=': {
12715: final int yyChoice1 = yyIndex;
12716:
12717: // Nested alternative 1.
12718:
12719: yyC = character(yyChoice1);
12720: if (-1 != yyC) {
12721: yyIndex = yyChoice1 + 1;
12722: if ('=' == yyC) {
12723:
12724: yyValue = new Token("==");
12725: yyValue.setLocation(location(yyStart));
12726:
12727: return new SemanticValue(yyValue, yyIndex,
12728: yyError);
12729: }
12730: }
12731:
12732: // Nested alternative 2.
12733:
12734: yyValue = new Token("=");
12735: yyValue.setLocation(location(yyStart));
12736:
12737: return new SemanticValue(yyValue, yyChoice1, yyError);
12738: }
12739:
12740: case '!': {
12741: final int yyChoice1 = yyIndex;
12742:
12743: // Nested alternative 1.
12744:
12745: yyC = character(yyChoice1);
12746: if (-1 != yyC) {
12747: yyIndex = yyChoice1 + 1;
12748: if ('=' == yyC) {
12749:
12750: yyValue = new Token("!=");
12751: yyValue.setLocation(location(yyStart));
12752:
12753: return new SemanticValue(yyValue, yyIndex,
12754: yyError);
12755: }
12756: }
12757:
12758: // Nested alternative 2.
12759:
12760: yyValue = new Token("!");
12761: yyValue.setLocation(location(yyStart));
12762:
12763: return new SemanticValue(yyValue, yyChoice1, yyError);
12764: }
12765:
12766: case ';': {
12767: yyValue = new Token(";");
12768: yyValue.setLocation(location(yyStart));
12769:
12770: return new SemanticValue(yyValue, yyIndex, yyError);
12771: }
12772:
12773: case ':': {
12774: yyValue = new Token(":");
12775: yyValue.setLocation(location(yyStart));
12776:
12777: return new SemanticValue(yyValue, yyIndex, yyError);
12778: }
12779:
12780: case ',': {
12781: yyValue = new Token(",");
12782: yyValue.setLocation(location(yyStart));
12783:
12784: return new SemanticValue(yyValue, yyIndex, yyError);
12785: }
12786:
12787: case '{': {
12788: yyValue = new Token("{");
12789: yyValue.setLocation(location(yyStart));
12790:
12791: return new SemanticValue(yyValue, yyIndex, yyError);
12792: }
12793:
12794: case '}': {
12795: yyValue = new Token("}");
12796: yyValue.setLocation(location(yyStart));
12797:
12798: return new SemanticValue(yyValue, yyIndex, yyError);
12799: }
12800:
12801: case '(': {
12802: yyValue = new Token("(");
12803: yyValue.setLocation(location(yyStart));
12804:
12805: return new SemanticValue(yyValue, yyIndex, yyError);
12806: }
12807:
12808: case ')': {
12809: yyValue = new Token(")");
12810: yyValue.setLocation(location(yyStart));
12811:
12812: return new SemanticValue(yyValue, yyIndex, yyError);
12813: }
12814:
12815: case '[': {
12816: yyValue = new Token("[");
12817: yyValue.setLocation(location(yyStart));
12818:
12819: return new SemanticValue(yyValue, yyIndex, yyError);
12820: }
12821:
12822: case ']': {
12823: yyValue = new Token("]");
12824: yyValue.setLocation(location(yyStart));
12825:
12826: return new SemanticValue(yyValue, yyIndex, yyError);
12827: }
12828:
12829: case '~': {
12830: yyValue = new Token("~");
12831: yyValue.setLocation(location(yyStart));
12832:
12833: return new SemanticValue(yyValue, yyIndex, yyError);
12834: }
12835:
12836: case '@': {
12837: yyValue = new Token("@");
12838: yyValue.setLocation(location(yyStart));
12839:
12840: return new SemanticValue(yyValue, yyIndex, yyError);
12841: }
12842:
12843: case '?': {
12844: yyValue = new Token("?");
12845: yyValue.setLocation(location(yyStart));
12846:
12847: return new SemanticValue(yyValue, yyIndex, yyError);
12848: }
12849:
12850: default:
12851: /* No match. */
12852: }
12853: }
12854:
12855: // Done.
12856: yyError = yyError.select("symbol characters expected", yyStart);
12857: return yyError;
12858: }
12859:
12860: // =========================================================================
12861:
12862: /**
12863: * Parse nonterminal xtc.util.Spacing.Spacing.
12864: *
12865: * @param yyStart The index.
12866: * @return The result.
12867: * @throws IOException Signals an I/O error.
12868: */
12869: private Result pSpacing(final int yyStart) throws IOException {
12870: int yyC;
12871: int yyIndex;
12872: Result yyPredResult;
12873: boolean yyPredMatched;
12874: int yyBase;
12875: int yyRepetition1;
12876: int yyRepetition2;
12877: Token yyValue;
12878: ParseError yyError = ParseError.DUMMY;
12879:
12880: // Alternative 1.
12881:
12882: yyRepetition1 = yyStart;
12883: while (true) {
12884:
12885: final int yyChoice1 = yyRepetition1;
12886:
12887: // Nested alternative 1.
12888:
12889: yyC = character(yyChoice1);
12890: if (-1 != yyC) {
12891: yyIndex = yyChoice1 + 1;
12892:
12893: switch (yyC) {
12894: case ' ': {
12895: yyRepetition1 = yyIndex;
12896: continue;
12897: }
12898:
12899: case '\t': {
12900: yyRepetition1 = yyIndex;
12901: continue;
12902: }
12903:
12904: case '\f': {
12905: yyRepetition1 = yyIndex;
12906: continue;
12907: }
12908:
12909: case '\r': {
12910: final int yyChoice2 = yyIndex;
12911:
12912: // Nested alternative 1.
12913:
12914: yyC = character(yyChoice2);
12915: if ('\n' == yyC) {
12916: yyIndex = yyChoice2 + 1;
12917:
12918: yyRepetition1 = yyIndex;
12919: continue;
12920: }
12921:
12922: // Nested alternative 2.
12923:
12924: yyRepetition1 = yyChoice2;
12925: continue;
12926: }
12927:
12928: case '\n': {
12929: yyRepetition1 = yyIndex;
12930: continue;
12931: }
12932:
12933: case '/': {
12934: yyC = character(yyIndex);
12935: if (-1 != yyC) {
12936: yyIndex = yyIndex + 1;
12937:
12938: switch (yyC) {
12939: case '*': {
12940: yyRepetition2 = yyIndex;
12941: while (true) {
12942:
12943: final int yyChoice2 = yyRepetition2;
12944:
12945: // Nested alternative 1.
12946:
12947: yyC = character(yyChoice2);
12948: if (-1 != yyC) {
12949: yyIndex = yyChoice2 + 1;
12950:
12951: switch (yyC) {
12952: case '*': {
12953: yyPredMatched = false;
12954:
12955: yyC = character(yyIndex);
12956: if ('/' == yyC) {
12957:
12958: yyPredMatched = true;
12959: }
12960:
12961: if (!yyPredMatched) {
12962:
12963: yyRepetition2 = yyIndex;
12964: continue;
12965: } else {
12966: yyError = yyError.select(
12967: "spacing expected",
12968: yyStart);
12969: }
12970: }
12971: break;
12972:
12973: default: {
12974: yyRepetition2 = yyIndex;
12975: continue;
12976: }
12977: }
12978: }
12979: break;
12980: }
12981:
12982: yyBase = yyRepetition2;
12983: yyC = character(yyBase);
12984: if ('*' == yyC) {
12985: yyIndex = yyRepetition2 + 1;
12986:
12987: yyC = character(yyIndex);
12988: if ('/' == yyC) {
12989: yyIndex = yyIndex + 1;
12990:
12991: yyRepetition1 = yyIndex;
12992: continue;
12993: } else {
12994: yyError = yyError.select(
12995: "\"*/\" expected", yyBase);
12996: }
12997: } else {
12998: yyError = yyError.select(
12999: "\"*/\" expected", yyBase);
13000: }
13001: }
13002: break;
13003:
13004: case '/': {
13005: yyRepetition2 = yyIndex;
13006: while (true) {
13007:
13008: yyC = character(yyRepetition2);
13009: if (-1 != yyC) {
13010: yyIndex = yyRepetition2 + 1;
13011:
13012: switch (yyC) {
13013: case '\n':
13014: case '\r':
13015: /* No match. */
13016: break;
13017:
13018: default: {
13019: yyRepetition2 = yyIndex;
13020: continue;
13021: }
13022: }
13023: }
13024: break;
13025: }
13026:
13027: final int yyChoice2 = yyRepetition2;
13028:
13029: // Nested alternative 1.
13030:
13031: yyC = character(yyChoice2);
13032: if (-1 != yyC) {
13033: yyIndex = yyChoice2 + 1;
13034:
13035: switch (yyC) {
13036: case '\r': {
13037: final int yyChoice3 = yyIndex;
13038:
13039: // Nested alternative 1.
13040:
13041: yyC = character(yyChoice3);
13042: if ('\n' == yyC) {
13043: yyIndex = yyChoice3 + 1;
13044:
13045: yyRepetition1 = yyIndex;
13046: continue;
13047: }
13048:
13049: // Nested alternative 2.
13050:
13051: yyRepetition1 = yyChoice3;
13052: continue;
13053: }
13054:
13055: case '\n': {
13056: yyRepetition1 = yyIndex;
13057: continue;
13058: }
13059:
13060: default:
13061: /* No match. */
13062: }
13063: }
13064:
13065: // Nested alternative 2.
13066:
13067: yyPredResult = pEndOfFile(yyChoice2);
13068: yyError = yyPredResult.select(yyError);
13069: if (yyPredResult.hasValue()) {
13070:
13071: yyRepetition1 = yyChoice2;
13072: continue;
13073: }
13074: }
13075: break;
13076:
13077: default:
13078: /* No match. */
13079: }
13080: }
13081: }
13082: break;
13083:
13084: default:
13085: /* No match. */
13086: }
13087: }
13088: break;
13089: }
13090:
13091: yyValue = new Token(difference(yyStart, yyRepetition1));
13092: yyValue.setLocation(location(yyStart));
13093:
13094: return new SemanticValue(yyValue, yyRepetition1, yyError);
13095: }
13096:
13097: // =========================================================================
13098:
13099: /**
13100: * Parse nonterminal xtc.util.Spacing.EndOfFile.
13101: *
13102: * @param yyStart The index.
13103: * @return The result.
13104: * @throws IOException Signals an I/O error.
13105: */
13106: private Result pEndOfFile(final int yyStart) throws IOException {
13107: int yyC;
13108: boolean yyPredMatched;
13109: Void yyValue;
13110: ParseError yyError = ParseError.DUMMY;
13111:
13112: // Alternative 1.
13113:
13114: yyPredMatched = false;
13115:
13116: yyC = character(yyStart);
13117: if (-1 != yyC) {
13118:
13119: yyPredMatched = true;
13120: }
13121:
13122: if (!yyPredMatched) {
13123:
13124: yyValue = null;
13125:
13126: return new SemanticValue(yyValue, yyStart, yyError);
13127: } else {
13128: yyError = yyError.select("end of file expected", yyStart);
13129: }
13130:
13131: // Done.
13132: return yyError;
13133: }
13134:
13135: // =========================================================================
13136:
13137: static {
13138: add(JAVA_KEYWORDS, new String[] { "abstract", "continue",
13139: "for", "new", "switch", "assert", "default", "if",
13140: "package", "synchronized", "boolean", "do", "goto",
13141: "private", "this", "break", "double", "implements",
13142: "protected", "throw", "byte", "else", "import",
13143: "public", "throws", "case", "instanceof", "return",
13144: "transient", "catch", "extends", "int", "short", "try",
13145: "char", "final", "interface", "static", "void",
13146: "class", "finally", "long", "strictfp", "volatile",
13147: "const", "float", "native", "super", "while" });
13148: }
13149: static {
13150: add(JAVA_KEYWORDS, new String[] { "enum" });
13151: }
13152:
13153: // =========================================================================
13154:
13155: /**
13156: * Get the text for the specified annotated token.
13157: *
13158: * @param n The annotated token.
13159: * @return The corresponding text.
13160: */
13161: protected static final String toText(Node n) {
13162: return n.getTokenText();
13163: }
13164:
13165: // =========================================================================
13166:
13167: /**
13168: * Add the specified values to the specified set.
13169: *
13170: * @param set The set.
13171: * @param values The new values.
13172: */
13173: protected static final <T> void add(Set<T> set, T[] values) {
13174: for (T v : values)
13175: set.add(v);
13176: }
13177:
13178: /**
13179: * Check whether the specified set contains the specified value.
13180: *
13181: * @param set The set.
13182: * @param value The value.
13183: * @return <code>true</code> if the set contains the value.
13184: */
13185: protected static final <T> boolean contains(Set<T> set, T value) {
13186: return set.contains(value);
13187: }
13188:
13189: }
|