00001: // ===========================================================================
00002: // This file has been generated by
00003: // Rats! Parser Generator, version 1.13.2,
00004: // (C) 2004-2007 Robert Grimm,
00005: // on Sunday, November 4, 2007 at 12:18: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:
00023: import xtc.parser.ParserBase;
00024: import xtc.parser.Column;
00025: import xtc.parser.Result;
00026: import xtc.parser.SemanticValue;
00027: import xtc.parser.ParseError;
00028:
00029: /**
00030: * Packrat parser for grammar <code>xtc.lang.CFactory</code>.
00031: *
00032: * <p />This class has been generated by the <i>Rats!</i> parser
00033: * generator, version 1.13.2, (C) 2004-2007 Robert Grimm.
00034: */
00035: public final class CFactoryParser extends ParserBase {
00036:
00037: /** The GCC flag. */
00038: public static final boolean GCC = true;
00039:
00040: /** The C_KEYWORDS set. */
00041: public static final Set<String> C_KEYWORDS = new HashSet<String>();
00042:
00043: /** The RELOCATE flag. */
00044: public static final boolean RELOCATE = true;
00045:
00046: /** The JAVA_KEYWORDS set. */
00047: public static final Set<String> JAVA_KEYWORDS = new HashSet<String>();
00048:
00049: /** The C99 flag. */
00050: public static final boolean C99 = true;
00051:
00052: // =========================================================================
00053:
00054: /** Chunk 1 of memoized results. */
00055: static final class Chunk1 {
00056: Result fAliasTerm;
00057: Result fDeclarationSpecifiers;
00058: Result fSpecifierQualifierList;
00059: Result fAttributedDeclarator;
00060: Result fDeclarator;
00061: Result fPointer;
00062: Result fVariableLength;
00063: Result fParameterTypeList;
00064: Result fAbstractDeclarator;
00065: Result fTypeName;
00066: }
00067:
00068: /** Chunk 2 of memoized results. */
00069: static final class Chunk2 {
00070: Result fAttributeSpecifierList;
00071: Result fAttributeSpecifier;
00072: Result fStatement;
00073: Result fCompoundStatement;
00074: Result fCompoundStatement$$Star1;
00075: Result fCompoundStatement$$Star2;
00076: Result fCommaExpression;
00077: Result fAssignmentExpression;
00078: Result fConditionalExpression;
00079: Result fLogicalOrExpression;
00080: }
00081:
00082: /** Chunk 3 of memoized results. */
00083: static final class Chunk3 {
00084: Result fCastExpression;
00085: Result fUnaryExpression;
00086: Result fExpressionList;
00087: Result fExpressionList$$Star1;
00088: Result fAssemblyOperands;
00089: Result fAssemblyOperands$$Star1;
00090: Result fAssemblyOperand;
00091: Result fAsmKeyword;
00092: Result fNodeVariable;
00093: Result fStringVariable;
00094: }
00095:
00096: /** Chunk 4 of memoized results. */
00097: static final class Chunk4 {
00098: Result fNodeListVariable;
00099: Result fExponent;
00100: Result f$$Shared2;
00101: Result fBinaryExponent;
00102: Result fCharacterLiteral;
00103: Result fCharacterLiteral$$Plus1;
00104: Result fStringConstant;
00105: Result fStringConstant$$Plus1;
00106: Result fStringLiteral;
00107: Result fStringLiteral$$Star1;
00108: }
00109:
00110: /** Chunk 5 of memoized results. */
00111: static final class Chunk5 {
00112: Result fCIdentifier$Identifier;
00113: Result fKeyword;
00114: Result fCIdentifier$Word;
00115: Result fSymbol;
00116: Result fJavaIdentifier$Identifier;
00117: Result fJavaIdentifier$Word;
00118: }
00119:
00120: // =========================================================================
00121:
00122: /** Memoization table column. */
00123: static final class CFactoryParserColumn extends Column {
00124: Chunk1 chunk1;
00125: Chunk2 chunk2;
00126: Chunk3 chunk3;
00127: Chunk4 chunk4;
00128: Chunk5 chunk5;
00129: }
00130:
00131: // =========================================================================
00132:
00133: /** The global state object. */
00134: protected final CParserState yyState;
00135:
00136: // =========================================================================
00137:
00138: /**
00139: * Create a new packrat parser.
00140: *
00141: * @param reader The reader.
00142: * @param file The file name.
00143: */
00144: public CFactoryParser(final Reader reader, final String file) {
00145: super (reader, file);
00146: yyState = new CParserState();
00147: }
00148:
00149: /**
00150: * Create a new packrat parser.
00151: *
00152: * @param reader The file reader.
00153: * @param file The file name.
00154: * @param size The file size.
00155: */
00156: public CFactoryParser(final Reader reader, final String file,
00157: final int size) {
00158: super (reader, file, size);
00159: yyState = new CParserState();
00160: }
00161:
00162: // =========================================================================
00163:
00164: protected Column newColumn() {
00165: return new CFactoryParserColumn();
00166: }
00167:
00168: // =========================================================================
00169:
00170: /**
00171: * Parse nonterminal xtc.lang.CFactory.Factory.
00172: *
00173: * @param yyStart The index.
00174: * @return The result.
00175: * @throws IOException Signals an I/O error.
00176: */
00177: public Result pFactory(final int yyStart) throws IOException {
00178: Result yyResult;
00179: int yyBase;
00180: int yyOption1;
00181: Node yyValue;
00182: ParseError yyError = ParseError.DUMMY;
00183:
00184: // Alternative 1.
00185:
00186: yyResult = pCFactory$Prelude(yyStart);
00187: yyError = yyResult.select(yyError);
00188: if (yyResult.hasValue()) {
00189:
00190: yyOption1 = yyResult.index;
00191:
00192: yyResult = pAlias(yyOption1);
00193: yyError = yyResult.select(yyError);
00194: if (yyResult.hasValue()) {
00195:
00196: yyOption1 = yyResult.index;
00197: }
00198:
00199: yyBase = yyOption1;
00200: yyResult = pJavaIdentifier$Word(yyBase);
00201: yyError = yyResult.select(yyError);
00202: if (yyResult.hasValue("factory")) {
00203:
00204: yyResult = pQualifiedIdentifier(yyResult.index);
00205: yyError = yyResult.select(yyError);
00206: if (yyResult.hasValue()) {
00207: final Node v$g$1 = yyResult.semanticValue();
00208:
00209: yyBase = yyResult.index;
00210: yyResult = pSymbol(yyBase);
00211: yyError = yyResult.select(yyError);
00212: if (yyResult.hasValue("{")) {
00213:
00214: yyResult = pMethods(yyResult.index);
00215: yyError = yyResult.select(yyError);
00216: if (yyResult.hasValue()) {
00217: final Node v$g$2 = yyResult.semanticValue();
00218:
00219: yyBase = yyResult.index;
00220: yyResult = pSymbol(yyBase);
00221: yyError = yyResult.select(yyError);
00222: if (yyResult.hasValue("}")) {
00223:
00224: yyResult = pEndOfFile(yyResult.index);
00225: yyError = yyResult.select(yyError);
00226: if (yyResult.hasValue()) {
00227:
00228: yyValue = GNode.create("Factory",
00229: v$g$1, v$g$2);
00230: yyValue
00231: .setLocation(location(yyStart));
00232:
00233: return yyResult.createValue(
00234: yyValue, yyError);
00235: }
00236: } else {
00237: yyError = yyError.select(
00238: "\"}\" expected", yyBase);
00239: }
00240: }
00241: } else {
00242: yyError = yyError.select("\"{\" expected",
00243: yyBase);
00244: }
00245: }
00246: } else {
00247: yyError = yyError
00248: .select("\"factory\" expected", yyBase);
00249: }
00250: }
00251:
00252: // Done.
00253: return yyError;
00254: }
00255:
00256: // =========================================================================
00257:
00258: /**
00259: * Parse nonterminal xtc.lang.CFactory.Prelude.
00260: *
00261: * @param yyStart The index.
00262: * @return The result.
00263: * @throws IOException Signals an I/O error.
00264: */
00265: private Result pCFactory$Prelude(final int yyStart)
00266: throws IOException {
00267: int yyC;
00268: int yyIndex;
00269: Result yyResult;
00270: Result yyPredResult;
00271: boolean yyPredMatched;
00272: int yyBase;
00273: int yyRepetition1;
00274: int yyRepetition2;
00275: Void yyValue;
00276: ParseError yyError = ParseError.DUMMY;
00277:
00278: // Reset the global state object.
00279: yyState.reset(column(yyStart).file);
00280:
00281: // Alternative 1.
00282:
00283: yyRepetition1 = yyStart;
00284: while (true) {
00285:
00286: final int yyChoice1 = yyRepetition1;
00287:
00288: // Nested alternative 1.
00289:
00290: yyC = character(yyChoice1);
00291: if (-1 != yyC) {
00292: yyIndex = yyChoice1 + 1;
00293:
00294: switch (yyC) {
00295: case ' ': {
00296: yyRepetition1 = yyIndex;
00297: continue;
00298: }
00299:
00300: case '\t': {
00301: yyRepetition1 = yyIndex;
00302: continue;
00303: }
00304:
00305: case '\f': {
00306: yyRepetition1 = yyIndex;
00307: continue;
00308: }
00309:
00310: case '/': {
00311: yyC = character(yyIndex);
00312: if (-1 != yyC) {
00313: yyIndex = yyIndex + 1;
00314:
00315: switch (yyC) {
00316: case '*': {
00317: yyRepetition2 = yyIndex;
00318: while (true) {
00319:
00320: final int yyChoice2 = yyRepetition2;
00321:
00322: // Nested alternative 1.
00323:
00324: yyC = character(yyChoice2);
00325: if (-1 != yyC) {
00326: yyIndex = yyChoice2 + 1;
00327:
00328: switch (yyC) {
00329: case '*': {
00330: yyPredMatched = false;
00331:
00332: yyC = character(yyIndex);
00333: if ('/' == yyC) {
00334:
00335: yyPredMatched = true;
00336: }
00337:
00338: if (!yyPredMatched) {
00339:
00340: yyRepetition2 = yyIndex;
00341: continue;
00342: } else {
00343: yyError = yyError.select(
00344: "prelude expected",
00345: yyStart);
00346: }
00347: }
00348: break;
00349:
00350: default: {
00351: yyRepetition2 = yyIndex;
00352: continue;
00353: }
00354: }
00355: }
00356: break;
00357: }
00358:
00359: yyBase = yyRepetition2;
00360: yyC = character(yyBase);
00361: if ('*' == yyC) {
00362: yyIndex = yyRepetition2 + 1;
00363:
00364: yyC = character(yyIndex);
00365: if ('/' == yyC) {
00366: yyIndex = yyIndex + 1;
00367:
00368: yyRepetition1 = yyIndex;
00369: continue;
00370: } else {
00371: yyError = yyError.select(
00372: "\"*/\" expected", yyBase);
00373: }
00374: } else {
00375: yyError = yyError.select(
00376: "\"*/\" expected", yyBase);
00377: }
00378: }
00379: break;
00380:
00381: case '/': {
00382: yyRepetition2 = yyIndex;
00383: while (true) {
00384:
00385: yyC = character(yyRepetition2);
00386: if (-1 != yyC) {
00387: yyIndex = yyRepetition2 + 1;
00388:
00389: switch (yyC) {
00390: case '\n':
00391: case '\r':
00392: /* No match. */
00393: break;
00394:
00395: default: {
00396: yyRepetition2 = yyIndex;
00397: continue;
00398: }
00399: }
00400: }
00401: break;
00402: }
00403:
00404: yyPredResult = pLineTerminator(yyRepetition2);
00405: yyError = yyPredResult.select(yyError);
00406: if (yyPredResult.hasValue()) {
00407:
00408: yyRepetition1 = yyRepetition2;
00409: continue;
00410: }
00411: }
00412: break;
00413:
00414: default:
00415: /* No match. */
00416: }
00417: }
00418: }
00419: break;
00420:
00421: case '\r': {
00422: final int yyChoice2 = yyIndex;
00423:
00424: // Nested alternative 1.
00425:
00426: yyC = character(yyChoice2);
00427: if ('\n' == yyC) {
00428: yyIndex = yyChoice2 + 1;
00429:
00430: yyResult = pDirective(yyIndex);
00431: yyError = yyResult.select(yyError);
00432: if (yyResult.hasValue()) {
00433:
00434: yyRepetition1 = yyResult.index;
00435: continue;
00436: }
00437: }
00438:
00439: // Nested alternative 2.
00440:
00441: yyResult = pDirective(yyChoice2);
00442: yyError = yyResult.select(yyError);
00443: if (yyResult.hasValue()) {
00444:
00445: yyRepetition1 = yyResult.index;
00446: continue;
00447: }
00448: }
00449: break;
00450:
00451: case '\n': {
00452: yyResult = pDirective(yyIndex);
00453: yyError = yyResult.select(yyError);
00454: if (yyResult.hasValue()) {
00455:
00456: yyRepetition1 = yyResult.index;
00457: continue;
00458: }
00459: }
00460: break;
00461:
00462: default:
00463: /* No match. */
00464: }
00465: }
00466: break;
00467: }
00468:
00469: yyValue = null;
00470:
00471: return new SemanticValue(yyValue, yyRepetition1, yyError);
00472: }
00473:
00474: // =========================================================================
00475:
00476: /**
00477: * Parse nonterminal xtc.lang.CFactory.Alias.
00478: *
00479: * @param yyStart The index.
00480: * @return The result.
00481: * @throws IOException Signals an I/O error.
00482: */
00483: private Result pAlias(final int yyStart) throws IOException {
00484: Result yyResult;
00485: int yyBase;
00486: int yyRepetition1;
00487: Void yyValue;
00488: ParseError yyError = ParseError.DUMMY;
00489:
00490: // Alternative 1.
00491:
00492: yyResult = pJavaIdentifier$Word(yyStart);
00493: yyError = yyResult.select(yyError);
00494: if (yyResult.hasValue("alias")) {
00495:
00496: yyResult = pAliasTerm(yyResult.index);
00497: yyError = yyResult.select(yyError);
00498: if (yyResult.hasValue()) {
00499:
00500: yyRepetition1 = yyResult.index;
00501: while (true) {
00502:
00503: yyBase = yyRepetition1;
00504: yyResult = pSymbol(yyBase);
00505: yyError = yyResult.select(yyError);
00506: if (yyResult.hasValue(",")) {
00507:
00508: yyResult = pAliasTerm(yyResult.index);
00509: yyError = yyResult.select(yyError);
00510: if (yyResult.hasValue()) {
00511:
00512: yyRepetition1 = yyResult.index;
00513: continue;
00514: }
00515: } else {
00516: yyError = yyError.select("\",\" expected",
00517: yyBase);
00518: }
00519: break;
00520: }
00521:
00522: yyBase = yyRepetition1;
00523: yyResult = pSymbol(yyBase);
00524: yyError = yyResult.select(yyError);
00525: if (yyResult.hasValue(";")) {
00526:
00527: yyValue = null;
00528:
00529: return yyResult.createValue(yyValue, yyError);
00530: } else {
00531: yyError = yyError.select("\";\" expected", yyBase);
00532: }
00533: }
00534: }
00535:
00536: // Done.
00537: yyError = yyError.select("alias expected", yyStart);
00538: return yyError;
00539: }
00540:
00541: // =========================================================================
00542:
00543: /**
00544: * Parse nonterminal xtc.lang.CFactory.AliasTerm.
00545: *
00546: * @param yyStart The index.
00547: * @return The result.
00548: * @throws IOException Signals an I/O error.
00549: */
00550: private Result pAliasTerm(final int yyStart) throws IOException {
00551: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
00552: if (null == yyColumn.chunk1)
00553: yyColumn.chunk1 = new Chunk1();
00554: if (null == yyColumn.chunk1.fAliasTerm)
00555: yyColumn.chunk1.fAliasTerm = pAliasTerm$1(yyStart);
00556: return yyColumn.chunk1.fAliasTerm;
00557: }
00558:
00559: /** Actually parse xtc.lang.CFactory.AliasTerm. */
00560: private Result pAliasTerm$1(final int yyStart) throws IOException {
00561: Result yyResult;
00562: Void yyValue;
00563: ParseError yyError = ParseError.DUMMY;
00564:
00565: // Alternative 1.
00566:
00567: yyResult = pJavaIdentifier$Word(yyStart);
00568: yyError = yyResult.select(yyError);
00569: if (yyResult.hasValue()) {
00570: final String w = yyResult.semanticValue();
00571:
00572: yyState.bind(toText(w), true);
00573:
00574: yyValue = null;
00575:
00576: return yyResult.createValue(yyValue, yyError);
00577: }
00578:
00579: // Done.
00580: return yyError;
00581: }
00582:
00583: // =========================================================================
00584:
00585: /**
00586: * Parse nonterminal xtc.lang.CFactory.Methods.
00587: *
00588: * @param yyStart The index.
00589: * @return The result.
00590: * @throws IOException Signals an I/O error.
00591: */
00592: private Result pMethods(final int yyStart) throws IOException {
00593: Result yyResult;
00594: int yyRepetition1;
00595: boolean yyRepeated1;
00596: Pair<Node> yyRepValue1;
00597: Node yyValue;
00598: ParseError yyError = ParseError.DUMMY;
00599:
00600: // Alternative 1.
00601:
00602: yyRepetition1 = yyStart;
00603: yyRepeated1 = false;
00604: yyRepValue1 = Pair.empty();
00605: while (true) {
00606:
00607: yyResult = pMethod(yyRepetition1);
00608: yyError = yyResult.select(yyError);
00609: if (yyResult.hasValue()) {
00610: final Node v$el$1 = yyResult.semanticValue();
00611:
00612: yyRepetition1 = yyResult.index;
00613: yyRepeated1 = true;
00614: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
00615: continue;
00616: }
00617: break;
00618: }
00619:
00620: if (yyRepeated1) {
00621: final Pair<Node> v$g$1 = yyRepValue1.reverse();
00622:
00623: yyValue = GNode.createFromPair("Methods", v$g$1);
00624: yyValue.setLocation(location(yyStart));
00625:
00626: return new SemanticValue(yyValue, yyRepetition1, yyError);
00627: }
00628:
00629: // Done.
00630: return yyError;
00631: }
00632:
00633: // =========================================================================
00634:
00635: /**
00636: * Parse nonterminal xtc.lang.CFactory.Method.
00637: *
00638: * @param yyStart The index.
00639: * @return The result.
00640: * @throws IOException Signals an I/O error.
00641: */
00642: private Result pMethod(final int yyStart) throws IOException {
00643: Result yyResult;
00644: int yyBase;
00645: Node yyValue;
00646: ParseError yyError = ParseError.DUMMY;
00647:
00648: // Alternative 1.
00649:
00650: yyResult = pJavaIdentifier$Word(yyStart);
00651: yyError = yyResult.select(yyError);
00652: if (yyResult.hasValue()) {
00653: final String v$g$1 = yyResult.semanticValue();
00654:
00655: yyBase = yyResult.index;
00656: yyResult = pSymbol(yyBase);
00657: yyError = yyResult.select(yyError);
00658: if (yyResult.hasValue("{")) {
00659:
00660: yyResult = pPattern(yyResult.index);
00661: yyError = yyResult.select(yyError);
00662: if (yyResult.hasValue()) {
00663: final Node v$g$2 = yyResult.semanticValue();
00664:
00665: yyBase = yyResult.index;
00666: yyResult = pSymbol(yyBase);
00667: yyError = yyResult.select(yyError);
00668: if (yyResult.hasValue("}")) {
00669:
00670: yyValue = GNode.create("Method", v$g$1, v$g$2);
00671: yyValue.setLocation(location(yyStart));
00672:
00673: return yyResult.createValue(yyValue, yyError);
00674: } else {
00675: yyError = yyError.select("\"}\" expected",
00676: yyBase);
00677: }
00678: }
00679: } else {
00680: yyError = yyError.select("\"{\" expected", yyBase);
00681: }
00682: }
00683:
00684: // Done.
00685: return yyError;
00686: }
00687:
00688: // =========================================================================
00689:
00690: /**
00691: * Parse nonterminal xtc.lang.CPattern.FunctionDefinition.
00692: *
00693: * @param yyStart The index.
00694: * @return The result.
00695: * @throws IOException Signals an I/O error.
00696: */
00697: private Result pFunctionDefinition(final int yyStart)
00698: throws IOException {
00699: Result yyResult;
00700: int yyBase;
00701: int yyOption1;
00702: Object yyOpValue1;
00703: Node yyValue;
00704: ParseError yyError = ParseError.DUMMY;
00705:
00706: // Alternative <Definition>.
00707:
00708: yyOption1 = yyStart;
00709: yyOpValue1 = null;
00710:
00711: yyBase = yyOption1;
00712: yyResult = pKeyword(yyBase);
00713: yyError = yyResult.select(yyError);
00714: if (yyResult.hasValue("__extension__")) {
00715: final String v$el$1 = "__extension__";
00716:
00717: yyOption1 = yyResult.index;
00718: yyOpValue1 = v$el$1;
00719: } else {
00720: yyError = yyError.select("\"__extension__\" expected",
00721: yyBase);
00722: }
00723: { // Start scope for v$g$1.
00724: final String v$g$1 = cast(yyOpValue1);
00725:
00726: yyOpValue1 = null;
00727:
00728: yyResult = pDeclarationSpecifiers(yyOption1);
00729: yyError = yyResult.select(yyError);
00730: if (yyResult.hasValue()) {
00731: final Node v$el$2 = yyResult.semanticValue();
00732:
00733: yyOption1 = yyResult.index;
00734: yyOpValue1 = v$el$2;
00735: }
00736: { // Start scope for v$g$2.
00737: final Node v$g$2 = cast(yyOpValue1);
00738:
00739: yyResult = pDeclarator(yyOption1);
00740: yyError = yyResult.select(yyError);
00741: if (yyResult.hasValue()) {
00742: final Node v$g$3 = yyResult.semanticValue();
00743:
00744: yyResult = pFunctionDeclaratorContext(yyResult.index);
00745: yyError = yyResult.select(yyError);
00746: if (yyResult.hasValue()) {
00747:
00748: yyOption1 = yyResult.index;
00749: yyOpValue1 = null;
00750:
00751: yyResult = pDeclarationList(yyOption1);
00752: yyError = yyResult.select(yyError);
00753: if (yyResult.hasValue()) {
00754: final Node v$el$3 = yyResult
00755: .semanticValue();
00756:
00757: yyOption1 = yyResult.index;
00758: yyOpValue1 = v$el$3;
00759: }
00760: { // Start scope for v$g$4.
00761: final Node v$g$4 = cast(yyOpValue1);
00762:
00763: yyResult = pCompoundStatement(yyOption1);
00764: yyError = yyResult.select(yyError);
00765: if (yyResult.hasValue()) {
00766: final Node v$g$5 = yyResult
00767: .semanticValue();
00768:
00769: yyValue = GNode.create(
00770: "FunctionDefinition", v$g$1,
00771: v$g$2, v$g$3, v$g$4, v$g$5);
00772: yyValue.setLocation(location(yyStart));
00773:
00774: return yyResult.createValue(yyValue,
00775: yyError);
00776: }
00777: } // End scope for v$g$4.
00778: }
00779: }
00780: } // End scope for v$g$2.
00781: } // End scope for v$g$1.
00782:
00783: // Done.
00784: return yyError;
00785: }
00786:
00787: // =========================================================================
00788:
00789: /**
00790: * Parse nonterminal xtc.lang.CPattern.DeclarationList.
00791: *
00792: * @param yyStart The index.
00793: * @return The result.
00794: * @throws IOException Signals an I/O error.
00795: */
00796: private Result pDeclarationList(final int yyStart)
00797: throws IOException {
00798: Result yyResult;
00799: int yyRepetition1;
00800: boolean yyRepeated1;
00801: Pair<Node> yyRepValue1;
00802: Node yyValue;
00803: ParseError yyError = ParseError.DUMMY;
00804:
00805: // Alternative <List>.
00806:
00807: yyRepetition1 = yyStart;
00808: yyRepeated1 = false;
00809: yyRepValue1 = Pair.empty();
00810: while (true) {
00811:
00812: yyResult = pDeclarationListEntry(yyRepetition1);
00813: yyError = yyResult.select(yyError);
00814: if (yyResult.hasValue()) {
00815: final Node v$el$1 = yyResult.semanticValue();
00816:
00817: yyRepetition1 = yyResult.index;
00818: yyRepeated1 = true;
00819: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
00820: continue;
00821: }
00822: break;
00823: }
00824:
00825: if (yyRepeated1) {
00826: final Pair<Node> v$g$1 = yyRepValue1.reverse();
00827:
00828: yyValue = GNode.createFromPair("DeclarationList", v$g$1);
00829: yyValue.setLocation(location(yyStart));
00830:
00831: return new SemanticValue(yyValue, yyRepetition1, yyError);
00832: }
00833:
00834: // Done.
00835: return yyError;
00836: }
00837:
00838: // =========================================================================
00839:
00840: /**
00841: * Parse nonterminal xtc.lang.CPattern.DeclarationListEntry.
00842: *
00843: * @param yyStart The index.
00844: * @return The result.
00845: * @throws IOException Signals an I/O error.
00846: */
00847: private Result pDeclarationListEntry(final int yyStart)
00848: throws IOException {
00849: Result yyResult;
00850: Node yyValue;
00851: ParseError yyError = ParseError.DUMMY;
00852:
00853: // Start a state modification.
00854: yyState.start();
00855:
00856: // Alternative <Entry>.
00857:
00858: yyResult = pDeclaration(yyStart);
00859: yyError = yyResult.select(yyError);
00860: if (yyResult.hasValue()) {
00861: yyValue = yyResult.semanticValue();
00862:
00863: // Commit the state modification.
00864: yyState.commit();
00865:
00866: return yyResult.createValue(yyValue, yyError);
00867: }
00868:
00869: // Abort the state modification.
00870: yyState.abort();
00871:
00872: // Done.
00873: return yyError;
00874: }
00875:
00876: // =========================================================================
00877:
00878: /**
00879: * Parse nonterminal xtc.lang.CPattern.Annotations.
00880: *
00881: * @param yyStart The index.
00882: * @return The result.
00883: * @throws IOException Signals an I/O error.
00884: */
00885: private Result pAnnotations(final int yyStart) throws IOException {
00886: Node yyValue;
00887: ParseError yyError = ParseError.DUMMY;
00888:
00889: // Start a state modification.
00890: yyState.start();
00891:
00892: // Alternative 1.
00893:
00894: yyState.mark();
00895: yyValue = yyState.annotate(null);
00896:
00897: // Commit the state modification.
00898: yyState.commit();
00899:
00900: setLocation(yyValue, yyStart);
00901: return new SemanticValue(yyValue, yyStart, yyError);
00902: }
00903:
00904: // =========================================================================
00905:
00906: /**
00907: * Parse nonterminal xtc.lang.CPattern.Declaration.
00908: *
00909: * @param yyStart The index.
00910: * @return The result.
00911: * @throws IOException Signals an I/O error.
00912: */
00913: private Result pDeclaration(final int yyStart) throws IOException {
00914: Result yyResult;
00915: int yyBase;
00916: int yyOption1;
00917: Object yyOpValue1;
00918: Node yyValue;
00919: ParseError yyError = ParseError.DUMMY;
00920:
00921: // Alternative 1.
00922:
00923: yyOption1 = yyStart;
00924: yyOpValue1 = null;
00925:
00926: yyBase = yyOption1;
00927: yyResult = pKeyword(yyBase);
00928: yyError = yyResult.select(yyError);
00929: if (yyResult.hasValue("__extension__")) {
00930: final String v$el$1 = "__extension__";
00931:
00932: yyOption1 = yyResult.index;
00933: yyOpValue1 = v$el$1;
00934: } else {
00935: yyError = yyError.select("\"__extension__\" expected",
00936: yyBase);
00937: }
00938: { // Start scope for v$g$1.
00939: final String v$g$1 = cast(yyOpValue1);
00940:
00941: yyResult = pDeclarationSpecifiers(yyOption1);
00942: yyError = yyResult.select(yyError);
00943: if (yyResult.hasValue()) {
00944: final Node v$g$2 = yyResult.semanticValue();
00945:
00946: yyOption1 = yyResult.index;
00947: yyOpValue1 = null;
00948:
00949: yyResult = pInitializedDeclaratorList(yyOption1);
00950: yyError = yyResult.select(yyError);
00951: if (yyResult.hasValue()) {
00952: final Node v$el$2 = yyResult.semanticValue();
00953:
00954: yyOption1 = yyResult.index;
00955: yyOpValue1 = v$el$2;
00956: }
00957: { // Start scope for l.
00958: final Node l = cast(yyOpValue1);
00959:
00960: if (yyState.isValid(l)) {
00961:
00962: yyBase = yyOption1;
00963: yyResult = pSymbol(yyBase);
00964: yyError = yyResult.select(yyError);
00965: if (yyResult.hasValue(";")) {
00966:
00967: yyValue = GNode.create("Declaration",
00968: v$g$1, v$g$2, l);
00969: yyValue.setLocation(location(yyStart));
00970:
00971: return yyResult.createValue(yyValue,
00972: yyError);
00973: } else {
00974: yyError = yyError.select("\";\" expected",
00975: yyBase);
00976: }
00977: }
00978: } // End scope for l.
00979: }
00980: } // End scope for v$g$1.
00981:
00982: // Done.
00983: yyError = yyError.select("declaration expected", yyStart);
00984: return yyError;
00985: }
00986:
00987: // =========================================================================
00988:
00989: /**
00990: * Parse nonterminal xtc.lang.CPattern.DeclarationSpecifiers.
00991: *
00992: * @param yyStart The index.
00993: * @return The result.
00994: * @throws IOException Signals an I/O error.
00995: */
00996: private Result pDeclarationSpecifiers(final int yyStart)
00997: throws IOException {
00998:
00999: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
01000: if (null == yyColumn.chunk1)
01001: yyColumn.chunk1 = new Chunk1();
01002: if (null == yyColumn.chunk1.fDeclarationSpecifiers)
01003: yyColumn.chunk1.fDeclarationSpecifiers = pDeclarationSpecifiers$1(yyStart);
01004: return yyColumn.chunk1.fDeclarationSpecifiers;
01005: }
01006:
01007: /** Actually parse xtc.lang.CPattern.DeclarationSpecifiers. */
01008: private Result pDeclarationSpecifiers$1(final int yyStart)
01009: throws IOException {
01010:
01011: Result yyResult;
01012: Node yyValue;
01013: ParseError yyError = ParseError.DUMMY;
01014:
01015: // Alternative 1.
01016:
01017: yyResult = pDeclarationSpecifierPlus(yyStart);
01018: yyError = yyResult.select(yyError);
01019: if (yyResult.hasValue()) {
01020: final Pair<Node> v$g$1 = yyResult.semanticValue();
01021:
01022: yyValue = GNode.createFromPair("DeclarationSpecifiers",
01023: v$g$1);
01024: yyValue.setLocation(location(yyStart));
01025:
01026: return yyResult.createValue(yyValue, yyError);
01027: }
01028:
01029: // Done.
01030: return yyError;
01031: }
01032:
01033: // =========================================================================
01034:
01035: /**
01036: * Parse nonterminal xtc.lang.CPattern.DeclarationSpecifierPlus.
01037: *
01038: * @param yyStart The index.
01039: * @return The result.
01040: * @throws IOException Signals an I/O error.
01041: */
01042: private Result pDeclarationSpecifierPlus(final int yyStart)
01043: throws IOException {
01044:
01045: Result yyResult;
01046: int yyRepetition1;
01047: boolean yyRepeated1;
01048: Pair<Node> yyRepValue1;
01049: Pair<Node> yyValue;
01050: ParseError yyError = ParseError.DUMMY;
01051:
01052: // Alternative 1.
01053:
01054: yyRepetition1 = yyStart;
01055: yyRepeated1 = false;
01056: yyRepValue1 = Pair.empty();
01057: while (true) {
01058:
01059: yyResult = pDeclarationSpecifier(yyRepetition1);
01060: yyError = yyResult.select(yyError);
01061: if (yyResult.hasValue()) {
01062: final Node v$el$1 = yyResult.semanticValue();
01063:
01064: yyRepetition1 = yyResult.index;
01065: yyRepeated1 = true;
01066: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
01067: continue;
01068: }
01069: break;
01070: }
01071:
01072: if (yyRepeated1) {
01073: yyValue = yyRepValue1.reverse();
01074:
01075: return new SemanticValue(yyValue, yyRepetition1, yyError);
01076: }
01077:
01078: // Done.
01079: return yyError;
01080: }
01081:
01082: // =========================================================================
01083:
01084: /**
01085: * Parse nonterminal xtc.lang.CPattern.DeclarationSpecifier.
01086: *
01087: * @param yyStart The index.
01088: * @return The result.
01089: * @throws IOException Signals an I/O error.
01090: */
01091: private Result pDeclarationSpecifier(final int yyStart)
01092: throws IOException {
01093: Result yyResult;
01094: Node yyValue;
01095: ParseError yyError = ParseError.DUMMY;
01096:
01097: // Alternative <StorageClass>.
01098:
01099: yyResult = pStorageClassSpecifier(yyStart);
01100: yyError = yyResult.select(yyError);
01101: if (yyResult.hasValue()) {
01102: yyValue = yyResult.semanticValue();
01103:
01104: return yyResult.createValue(yyValue, yyError);
01105: }
01106:
01107: // Alternative <TypeSpecifier>.
01108:
01109: yyResult = pTypeSpecifier(yyStart);
01110: yyError = yyResult.select(yyError);
01111: if (yyResult.hasValue()) {
01112: yyValue = yyResult.semanticValue();
01113:
01114: yyResult = pTypeSpecContext(yyResult.index);
01115: yyError = yyResult.select(yyError);
01116: if (yyResult.hasValue()) {
01117:
01118: return yyResult.createValue(yyValue, yyError);
01119: }
01120: }
01121:
01122: // Alternative <TypeQualifier>.
01123:
01124: yyResult = pTypeQualifier(yyStart);
01125: yyError = yyResult.select(yyError);
01126: if (yyResult.hasValue()) {
01127: yyValue = yyResult.semanticValue();
01128:
01129: return yyResult.createValue(yyValue, yyError);
01130: }
01131:
01132: // Alternative 4.
01133:
01134: yyResult = pKeyword(yyStart);
01135: yyError = yyResult.select(yyError);
01136: if (yyResult.hasValue("inline")) {
01137: final String v$g$1 = "inline";
01138:
01139: yyValue = GNode.create("FunctionSpecifier", v$g$1);
01140: yyValue.setLocation(location(yyStart));
01141:
01142: return yyResult.createValue(yyValue, yyError);
01143: }
01144:
01145: // Alternative 5.
01146:
01147: yyResult = pKeyword(yyStart);
01148: yyError = yyResult.select(yyError);
01149: if (yyResult.hasValue("__inline")) {
01150: final String v$g$2 = "__inline";
01151:
01152: yyValue = GNode.create("FunctionSpecifier", v$g$2);
01153: yyValue.setLocation(location(yyStart));
01154:
01155: return yyResult.createValue(yyValue, yyError);
01156: }
01157:
01158: // Alternative 6.
01159:
01160: yyResult = pKeyword(yyStart);
01161: yyError = yyResult.select(yyError);
01162: if (yyResult.hasValue("__inline__")) {
01163: final String v$g$3 = "__inline__";
01164:
01165: yyValue = GNode.create("FunctionSpecifier", v$g$3);
01166: yyValue.setLocation(location(yyStart));
01167:
01168: return yyResult.createValue(yyValue, yyError);
01169: }
01170:
01171: // Alternative <Attribute>.
01172:
01173: yyResult = pAttributeSpecifier(yyStart);
01174: yyError = yyResult.select(yyError);
01175: if (yyResult.hasValue()) {
01176: yyValue = yyResult.semanticValue();
01177:
01178: return yyResult.createValue(yyValue, yyError);
01179: }
01180:
01181: // Done.
01182: yyError = yyError.select("declaration specifier expected",
01183: yyStart);
01184: return yyError;
01185: }
01186:
01187: // =========================================================================
01188:
01189: /**
01190: * Parse nonterminal xtc.lang.CPattern.InitializedDeclaratorList.
01191: *
01192: * @param yyStart The index.
01193: * @return The result.
01194: * @throws IOException Signals an I/O error.
01195: */
01196: private Result pInitializedDeclaratorList(final int yyStart)
01197: throws IOException {
01198:
01199: Result yyResult;
01200: int yyBase;
01201: int yyRepetition1;
01202: Pair<Node> yyRepValue1;
01203: Node yyValue;
01204: ParseError yyError = ParseError.DUMMY;
01205:
01206: // Alternative <List>.
01207:
01208: yyResult = pInitializedDeclarator(yyStart);
01209: yyError = yyResult.select(yyError);
01210: if (yyResult.hasValue()) {
01211: final Node v$g$1 = yyResult.semanticValue();
01212:
01213: yyRepetition1 = yyResult.index;
01214: yyRepValue1 = Pair.empty();
01215: while (true) {
01216:
01217: yyBase = yyRepetition1;
01218: yyResult = pSymbol(yyBase);
01219: yyError = yyResult.select(yyError);
01220: if (yyResult.hasValue(",")) {
01221:
01222: yyResult = pInitializedDeclarator(yyResult.index);
01223: yyError = yyResult.select(yyError);
01224: if (yyResult.hasValue()) {
01225: final Node v$el$1 = yyResult.semanticValue();
01226:
01227: yyRepetition1 = yyResult.index;
01228: yyRepValue1 = new Pair<Node>(v$el$1,
01229: yyRepValue1);
01230: continue;
01231: }
01232: } else {
01233: yyError = yyError.select("\",\" expected", yyBase);
01234: }
01235: break;
01236: }
01237: { // Start scope for v$g$2.
01238: final Pair<Node> v$g$2 = yyRepValue1.reverse();
01239:
01240: yyValue = GNode.createFromPair(
01241: "InitializedDeclaratorList", v$g$1, v$g$2);
01242: yyValue.setLocation(location(yyStart));
01243:
01244: return new SemanticValue(yyValue, yyRepetition1,
01245: yyError);
01246: } // End scope for v$g$2.
01247: }
01248:
01249: // Done.
01250: return yyError;
01251: }
01252:
01253: // =========================================================================
01254:
01255: /**
01256: * Parse nonterminal xtc.lang.CPattern.InitializedDeclarator.
01257: *
01258: * @param yyStart The index.
01259: * @return The result.
01260: * @throws IOException Signals an I/O error.
01261: */
01262: private Result pInitializedDeclarator(final int yyStart)
01263: throws IOException {
01264:
01265: Result yyResult;
01266: int yyBase;
01267: int yyOption1;
01268: Node yyOpValue1;
01269: Node yyValue;
01270: ParseError yyError = ParseError.DUMMY;
01271:
01272: // Alternative 1.
01273:
01274: yyOption1 = yyStart;
01275: yyOpValue1 = null;
01276:
01277: yyResult = pAttributeSpecifierList(yyOption1);
01278: yyError = yyResult.select(yyError);
01279: if (yyResult.hasValue()) {
01280: final Node v$el$1 = yyResult.semanticValue();
01281:
01282: yyOption1 = yyResult.index;
01283: yyOpValue1 = v$el$1;
01284: }
01285: { // Start scope for v$g$1.
01286: final Node v$g$1 = yyOpValue1;
01287:
01288: yyResult = pDeclarator(yyOption1);
01289: yyError = yyResult.select(yyError);
01290: if (yyResult.hasValue()) {
01291: final Node v$g$2 = yyResult.semanticValue();
01292:
01293: yyOption1 = yyResult.index;
01294: yyOpValue1 = null;
01295:
01296: yyResult = pSimpleAssemblyExpression(yyOption1);
01297: yyError = yyResult.select(yyError);
01298: if (yyResult.hasValue()) {
01299: final Node v$el$2 = yyResult.semanticValue();
01300:
01301: yyOption1 = yyResult.index;
01302: yyOpValue1 = v$el$2;
01303: }
01304: { // Start scope for v$g$3.
01305: final Node v$g$3 = yyOpValue1;
01306:
01307: yyOpValue1 = null;
01308:
01309: yyResult = pAttributeSpecifierList(yyOption1);
01310: yyError = yyResult.select(yyError);
01311: if (yyResult.hasValue()) {
01312: final Node v$el$3 = yyResult.semanticValue();
01313:
01314: yyOption1 = yyResult.index;
01315: yyOpValue1 = v$el$3;
01316: }
01317: { // Start scope for v$g$4.
01318: final Node v$g$4 = yyOpValue1;
01319:
01320: yyOpValue1 = null;
01321:
01322: yyBase = yyOption1;
01323: yyResult = pSymbol(yyBase);
01324: yyError = yyResult.select(yyError);
01325: if (yyResult.hasValue("=")) {
01326:
01327: yyResult = pInitializer(yyResult.index);
01328: yyError = yyResult.select(yyError);
01329: if (yyResult.hasValue()) {
01330: final Node v$el$4 = yyResult
01331: .semanticValue();
01332:
01333: yyOption1 = yyResult.index;
01334: yyOpValue1 = v$el$4;
01335: }
01336: } else {
01337: yyError = yyError.select("\"=\" expected",
01338: yyBase);
01339: }
01340: { // Start scope for v$g$5.
01341: final Node v$g$5 = yyOpValue1;
01342:
01343: yyValue = GNode.create(
01344: "InitializedDeclarator", v$g$1,
01345: v$g$2, v$g$3, v$g$4, v$g$5);
01346: yyValue.setLocation(location(yyStart));
01347:
01348: return new SemanticValue(yyValue,
01349: yyOption1, yyError);
01350: } // End scope for v$g$5.
01351: } // End scope for v$g$4.
01352: } // End scope for v$g$3.
01353: }
01354: } // End scope for v$g$1.
01355:
01356: // Done.
01357: return yyError;
01358: }
01359:
01360: // =========================================================================
01361:
01362: /**
01363: * Parse nonterminal xtc.lang.CPattern.StorageClassSpecifier.
01364: *
01365: * @param yyStart The index.
01366: * @return The result.
01367: * @throws IOException Signals an I/O error.
01368: */
01369: private Result pStorageClassSpecifier(final int yyStart)
01370: throws IOException {
01371:
01372: Result yyResult;
01373: Node yyValue;
01374: ParseError yyError = ParseError.DUMMY;
01375:
01376: // Alternative 1.
01377:
01378: yyResult = pKeyword(yyStart);
01379: yyError = yyResult.select(yyError);
01380: if (yyResult.hasValue("auto")) {
01381:
01382: yyValue = GNode.create("AutoSpecifier", false);
01383: yyValue.setLocation(location(yyStart));
01384:
01385: return yyResult.createValue(yyValue, yyError);
01386: }
01387:
01388: // Alternative 2.
01389:
01390: yyResult = pKeyword(yyStart);
01391: yyError = yyResult.select(yyError);
01392: if (yyResult.hasValue("extern")) {
01393:
01394: yyValue = GNode.create("ExternSpecifier", false);
01395: yyValue.setLocation(location(yyStart));
01396:
01397: return yyResult.createValue(yyValue, yyError);
01398: }
01399:
01400: // Alternative 3.
01401:
01402: yyResult = pKeyword(yyStart);
01403: yyError = yyResult.select(yyError);
01404: if (yyResult.hasValue("register")) {
01405:
01406: yyValue = GNode.create("RegisterSpecifier", false);
01407: yyValue.setLocation(location(yyStart));
01408:
01409: return yyResult.createValue(yyValue, yyError);
01410: }
01411:
01412: // Alternative 4.
01413:
01414: yyResult = pKeyword(yyStart);
01415: yyError = yyResult.select(yyError);
01416: if (yyResult.hasValue("static")) {
01417:
01418: yyValue = GNode.create("StaticSpecifier", false);
01419: yyValue.setLocation(location(yyStart));
01420:
01421: return yyResult.createValue(yyValue, yyError);
01422: }
01423:
01424: // Alternative 5.
01425:
01426: yyResult = pKeyword(yyStart);
01427: yyError = yyResult.select(yyError);
01428: if (yyResult.hasValue("typedef")) {
01429:
01430: yyResult = pTypedefContext(yyResult.index);
01431: yyError = yyResult.select(yyError);
01432: if (yyResult.hasValue()) {
01433:
01434: yyValue = GNode.create("TypedefSpecifier", false);
01435: yyValue.setLocation(location(yyStart));
01436:
01437: return yyResult.createValue(yyValue, yyError);
01438: }
01439: }
01440:
01441: // Done.
01442: yyError = yyError.select("storage class specifier expected",
01443: yyStart);
01444: return yyError;
01445: }
01446:
01447: // =========================================================================
01448:
01449: /**
01450: * Parse nonterminal xtc.lang.CPattern.TypeQualifier.
01451: *
01452: * @param yyStart The index.
01453: * @return The result.
01454: * @throws IOException Signals an I/O error.
01455: */
01456: private Result pTypeQualifier(final int yyStart) throws IOException {
01457: Result yyResult;
01458: Node yyValue;
01459: ParseError yyError = ParseError.DUMMY;
01460:
01461: // Alternative 1.
01462:
01463: yyResult = pKeyword(yyStart);
01464: yyError = yyResult.select(yyError);
01465: if (yyResult.hasValue("volatile")) {
01466: final String v$g$1 = "volatile";
01467:
01468: yyValue = GNode.create("VolatileQualifier", v$g$1);
01469: yyValue.setLocation(location(yyStart));
01470:
01471: return yyResult.createValue(yyValue, yyError);
01472: }
01473:
01474: // Alternative 2.
01475:
01476: yyResult = pKeyword(yyStart);
01477: yyError = yyResult.select(yyError);
01478: if (yyResult.hasValue("__volatile")) {
01479: final String v$g$2 = "__volatile";
01480:
01481: yyValue = GNode.create("VolatileQualifier", v$g$2);
01482: yyValue.setLocation(location(yyStart));
01483:
01484: return yyResult.createValue(yyValue, yyError);
01485: }
01486:
01487: // Alternative 3.
01488:
01489: yyResult = pKeyword(yyStart);
01490: yyError = yyResult.select(yyError);
01491: if (yyResult.hasValue("__volatile__")) {
01492: final String v$g$3 = "__volatile__";
01493:
01494: yyValue = GNode.create("VolatileQualifier", v$g$3);
01495: yyValue.setLocation(location(yyStart));
01496:
01497: return yyResult.createValue(yyValue, yyError);
01498: }
01499:
01500: // Alternative 4.
01501:
01502: yyResult = pKeyword(yyStart);
01503: yyError = yyResult.select(yyError);
01504: if (yyResult.hasValue("const")) {
01505: final String v$g$1 = "const";
01506:
01507: yyValue = GNode.create("ConstantQualifier", v$g$1);
01508: yyValue.setLocation(location(yyStart));
01509:
01510: return yyResult.createValue(yyValue, yyError);
01511: }
01512:
01513: // Alternative 5.
01514:
01515: yyResult = pKeyword(yyStart);
01516: yyError = yyResult.select(yyError);
01517: if (yyResult.hasValue("__const")) {
01518: final String v$g$2 = "__const";
01519:
01520: yyValue = GNode.create("ConstantQualifier", v$g$2);
01521: yyValue.setLocation(location(yyStart));
01522:
01523: return yyResult.createValue(yyValue, yyError);
01524: }
01525:
01526: // Alternative 6.
01527:
01528: yyResult = pKeyword(yyStart);
01529: yyError = yyResult.select(yyError);
01530: if (yyResult.hasValue("__const__")) {
01531: final String v$g$3 = "__const__";
01532:
01533: yyValue = GNode.create("ConstantQualifier", v$g$3);
01534: yyValue.setLocation(location(yyStart));
01535:
01536: return yyResult.createValue(yyValue, yyError);
01537: }
01538:
01539: // Alternative 7.
01540:
01541: yyResult = pKeyword(yyStart);
01542: yyError = yyResult.select(yyError);
01543: if (yyResult.hasValue("restrict")) {
01544: final String v$g$1 = "restrict";
01545:
01546: yyValue = GNode.create("RestrictQualifier", v$g$1);
01547: yyValue.setLocation(location(yyStart));
01548:
01549: return yyResult.createValue(yyValue, yyError);
01550: }
01551:
01552: // Alternative 8.
01553:
01554: yyResult = pKeyword(yyStart);
01555: yyError = yyResult.select(yyError);
01556: if (yyResult.hasValue("__restrict")) {
01557: final String v$g$2 = "__restrict";
01558:
01559: yyValue = GNode.create("RestrictQualifier", v$g$2);
01560: yyValue.setLocation(location(yyStart));
01561:
01562: return yyResult.createValue(yyValue, yyError);
01563: }
01564:
01565: // Alternative 9.
01566:
01567: yyResult = pKeyword(yyStart);
01568: yyError = yyResult.select(yyError);
01569: if (yyResult.hasValue("__restrict__")) {
01570: final String v$g$3 = "__restrict__";
01571:
01572: yyValue = GNode.create("RestrictQualifier", v$g$3);
01573: yyValue.setLocation(location(yyStart));
01574:
01575: return yyResult.createValue(yyValue, yyError);
01576: }
01577:
01578: // Done.
01579: yyError = yyError.select("type qualifier expected", yyStart);
01580: return yyError;
01581: }
01582:
01583: // =========================================================================
01584:
01585: /**
01586: * Parse nonterminal xtc.lang.CPattern.TypeSpecifier.
01587: *
01588: * @param yyStart The index.
01589: * @return The result.
01590: * @throws IOException Signals an I/O error.
01591: */
01592: private Result pTypeSpecifier(final int yyStart) throws IOException {
01593: Result yyResult;
01594: int yyBase;
01595: Node yyValue;
01596: ParseError yyError = ParseError.DUMMY;
01597:
01598: // Alternative <Enumeration>.
01599:
01600: yyResult = pEnumerationTypeSpecifier(yyStart);
01601: yyError = yyResult.select(yyError);
01602: if (yyResult.hasValue()) {
01603: yyValue = yyResult.semanticValue();
01604:
01605: return yyResult.createValue(yyValue, yyError);
01606: }
01607:
01608: // Alternative <Structure>.
01609:
01610: yyResult = pStructureTypeSpecifier(yyStart);
01611: yyError = yyResult.select(yyError);
01612: if (yyResult.hasValue()) {
01613: yyValue = yyResult.semanticValue();
01614:
01615: return yyResult.createValue(yyValue, yyError);
01616: }
01617:
01618: // Alternative <Union>.
01619:
01620: yyResult = pUnionTypeSpecifier(yyStart);
01621: yyError = yyResult.select(yyError);
01622: if (yyResult.hasValue()) {
01623: yyValue = yyResult.semanticValue();
01624:
01625: return yyResult.createValue(yyValue, yyError);
01626: }
01627:
01628: // Alternative <Floating>.
01629:
01630: yyResult = pFloatingPointTypeSpecifier(yyStart);
01631: yyError = yyResult.select(yyError);
01632: if (yyResult.hasValue()) {
01633: yyValue = yyResult.semanticValue();
01634:
01635: return yyResult.createValue(yyValue, yyError);
01636: }
01637:
01638: // Alternative <Integer>.
01639:
01640: yyResult = pIntegerTypeSpecifier(yyStart);
01641: yyError = yyResult.select(yyError);
01642: if (yyResult.hasValue()) {
01643: yyValue = yyResult.semanticValue();
01644:
01645: return yyResult.createValue(yyValue, yyError);
01646: }
01647:
01648: // Alternative 6.
01649:
01650: yyResult = pCIdentifier$Identifier(yyStart);
01651: yyError = yyResult.select(yyError);
01652: if (yyResult.hasValue()) {
01653: final String id = yyResult.semanticValue();
01654:
01655: if (yyState.isType(toText(id))) {
01656:
01657: yyValue = GNode.create("TypedefName", id);
01658: yyValue.setLocation(location(yyStart));
01659:
01660: return yyResult.createValue(yyValue, yyError);
01661: }
01662: }
01663:
01664: // Alternative 7.
01665:
01666: yyResult = pTypeofKeyword(yyStart);
01667: yyError = yyResult.select(yyError);
01668: if (yyResult.hasValue()) {
01669:
01670: yyBase = yyResult.index;
01671: yyResult = pSymbol(yyBase);
01672: yyError = yyResult.select(yyError);
01673: if (yyResult.hasValue("(")) {
01674:
01675: final int yyChoice1 = yyResult.index;
01676:
01677: // Nested alternative 1.
01678:
01679: yyResult = pTypeName(yyChoice1);
01680: yyError = yyResult.select(yyError);
01681: if (yyResult.hasValue()) {
01682: final Node v$g$1 = yyResult.semanticValue();
01683:
01684: yyBase = yyResult.index;
01685: yyResult = pSymbol(yyBase);
01686: yyError = yyResult.select(yyError);
01687: if (yyResult.hasValue(")")) {
01688:
01689: yyValue = GNode
01690: .create("TypeofSpecifier", v$g$1);
01691: yyValue.setLocation(location(yyStart));
01692:
01693: return yyResult.createValue(yyValue, yyError);
01694: } else {
01695: yyError = yyError.select("\")\" expected",
01696: yyBase);
01697: }
01698: }
01699:
01700: // Nested alternative 2.
01701:
01702: yyResult = pCommaExpression(yyChoice1);
01703: yyError = yyResult.select(yyError);
01704: if (yyResult.hasValue()) {
01705: final Node v$g$2 = yyResult.semanticValue();
01706:
01707: yyBase = yyResult.index;
01708: yyResult = pSymbol(yyBase);
01709: yyError = yyResult.select(yyError);
01710: if (yyResult.hasValue(")")) {
01711:
01712: yyValue = GNode
01713: .create("TypeofSpecifier", v$g$2);
01714: yyValue.setLocation(location(yyStart));
01715:
01716: return yyResult.createValue(yyValue, yyError);
01717: } else {
01718: yyError = yyError.select("\")\" expected",
01719: yyBase);
01720: }
01721: }
01722: } else {
01723: yyError = yyError.select("\"(\" expected", yyBase);
01724: }
01725: }
01726:
01727: // Alternative 8.
01728:
01729: yyResult = pKeyword(yyStart);
01730: yyError = yyResult.select(yyError);
01731: if (yyResult.hasValue("void")) {
01732:
01733: yyValue = GNode.create("VoidTypeSpecifier", false);
01734: yyValue.setLocation(location(yyStart));
01735:
01736: return yyResult.createValue(yyValue, yyError);
01737: }
01738:
01739: // Alternative 9.
01740:
01741: yyResult = pKeyword(yyStart);
01742: yyError = yyResult.select(yyError);
01743: if (yyResult.hasValue("__builtin_va_list")) {
01744:
01745: yyValue = GNode.create("VarArgListSpecifier", false);
01746: yyValue.setLocation(location(yyStart));
01747:
01748: return yyResult.createValue(yyValue, yyError);
01749: }
01750:
01751: // Done.
01752: yyError = yyError.select("type specifier expected", yyStart);
01753: return yyError;
01754: }
01755:
01756: // =========================================================================
01757:
01758: /**
01759: * Parse nonterminal xtc.lang.CPattern.EnumerationTypeSpecifier.
01760: *
01761: * @param yyStart The index.
01762: * @return The result.
01763: * @throws IOException Signals an I/O error.
01764: */
01765: private Result pEnumerationTypeSpecifier(final int yyStart)
01766: throws IOException {
01767:
01768: Result yyResult;
01769: int yyBase;
01770: int yyOption1;
01771: Object yyOpValue1;
01772: Node yyValue;
01773: ParseError yyError = ParseError.DUMMY;
01774:
01775: // Alternative 1.
01776:
01777: yyResult = pKeyword(yyStart);
01778: yyError = yyResult.select(yyError);
01779: if (yyResult.hasValue("enum")) {
01780:
01781: yyOption1 = yyResult.index;
01782: yyOpValue1 = null;
01783:
01784: yyResult = pAttributeSpecifierList(yyOption1);
01785: yyError = yyResult.select(yyError);
01786: if (yyResult.hasValue()) {
01787: final Node v$el$1 = yyResult.semanticValue();
01788:
01789: yyOption1 = yyResult.index;
01790: yyOpValue1 = v$el$1;
01791: }
01792: { // Start scope for v$g$1.
01793: final Node v$g$1 = cast(yyOpValue1);
01794:
01795: final int yyChoice1 = yyOption1;
01796:
01797: // Nested alternative 1.
01798:
01799: yyOption1 = yyChoice1;
01800: yyOpValue1 = null;
01801:
01802: yyResult = pCIdentifier$Identifier(yyOption1);
01803: yyError = yyResult.select(yyError);
01804: if (yyResult.hasValue()) {
01805: final String v$el$2 = yyResult.semanticValue();
01806:
01807: yyOption1 = yyResult.index;
01808: yyOpValue1 = v$el$2;
01809: }
01810: { // Start scope for v$g$2.
01811: final String v$g$2 = cast(yyOpValue1);
01812:
01813: yyBase = yyOption1;
01814: yyResult = pSymbol(yyBase);
01815: yyError = yyResult.select(yyError);
01816: if (yyResult.hasValue("{")) {
01817:
01818: yyResult = pEnumeratorList(yyResult.index);
01819: yyError = yyResult.select(yyError);
01820: if (yyResult.hasValue()) {
01821: final Node v$g$3 = yyResult.semanticValue();
01822:
01823: yyOption1 = yyResult.index;
01824:
01825: yyBase = yyOption1;
01826: yyResult = pSymbol(yyBase);
01827: yyError = yyResult.select(yyError);
01828: if (yyResult.hasValue(",")) {
01829:
01830: yyOption1 = yyResult.index;
01831: } else {
01832: yyError = yyError.select(
01833: "\",\" expected", yyBase);
01834: }
01835:
01836: yyBase = yyOption1;
01837: yyResult = pSymbol(yyBase);
01838: yyError = yyResult.select(yyError);
01839: if (yyResult.hasValue("}")) {
01840:
01841: yyOption1 = yyResult.index;
01842: yyOpValue1 = null;
01843:
01844: yyResult = pAttributeSpecifierList(yyOption1);
01845: yyError = yyResult.select(yyError);
01846: if (yyResult.hasValue()) {
01847: final Node v$el$3 = yyResult
01848: .semanticValue();
01849:
01850: yyOption1 = yyResult.index;
01851: yyOpValue1 = v$el$3;
01852: }
01853: { // Start scope for v$g$4.
01854: final Node v$g$4 = cast(yyOpValue1);
01855:
01856: yyValue = GNode
01857: .create(
01858: "EnumerationTypeDefinition",
01859: v$g$1, v$g$2,
01860: v$g$3, v$g$4);
01861: yyValue
01862: .setLocation(location(yyStart));
01863:
01864: return new SemanticValue(yyValue,
01865: yyOption1, yyError);
01866: } // End scope for v$g$4.
01867: } else {
01868: yyError = yyError.select(
01869: "\"}\" expected", yyBase);
01870: }
01871: }
01872: } else {
01873: yyError = yyError.select("\"{\" expected",
01874: yyBase);
01875: }
01876: } // End scope for v$g$2.
01877:
01878: // Nested alternative 2.
01879:
01880: yyResult = pCIdentifier$Identifier(yyChoice1);
01881: yyError = yyResult.select(yyError);
01882: if (yyResult.hasValue()) {
01883: final String v$g$2 = yyResult.semanticValue();
01884:
01885: yyValue = GNode.create("EnumerationTypeReference",
01886: v$g$1, v$g$2);
01887: yyValue.setLocation(location(yyStart));
01888:
01889: return yyResult.createValue(yyValue, yyError);
01890: }
01891: } // End scope for v$g$1.
01892: }
01893:
01894: // Done.
01895: yyError = yyError.select("enumeration type specifier expected",
01896: yyStart);
01897: return yyError;
01898: }
01899:
01900: // =========================================================================
01901:
01902: /**
01903: * Parse nonterminal xtc.lang.CPattern.EnumeratorList.
01904: *
01905: * @param yyStart The index.
01906: * @return The result.
01907: * @throws IOException Signals an I/O error.
01908: */
01909: private Result pEnumeratorList(final int yyStart)
01910: throws IOException {
01911: Result yyResult;
01912: int yyBase;
01913: int yyRepetition1;
01914: Pair<Node> yyRepValue1;
01915: Node yyValue;
01916: ParseError yyError = ParseError.DUMMY;
01917:
01918: // Alternative <List>.
01919:
01920: yyResult = pEnumerator(yyStart);
01921: yyError = yyResult.select(yyError);
01922: if (yyResult.hasValue()) {
01923: final Node v$g$1 = yyResult.semanticValue();
01924:
01925: yyRepetition1 = yyResult.index;
01926: yyRepValue1 = Pair.empty();
01927: while (true) {
01928:
01929: yyBase = yyRepetition1;
01930: yyResult = pSymbol(yyBase);
01931: yyError = yyResult.select(yyError);
01932: if (yyResult.hasValue(",")) {
01933:
01934: yyResult = pEnumerator(yyResult.index);
01935: yyError = yyResult.select(yyError);
01936: if (yyResult.hasValue()) {
01937: final Node v$el$1 = yyResult.semanticValue();
01938:
01939: yyRepetition1 = yyResult.index;
01940: yyRepValue1 = new Pair<Node>(v$el$1,
01941: yyRepValue1);
01942: continue;
01943: }
01944: } else {
01945: yyError = yyError.select("\",\" expected", yyBase);
01946: }
01947: break;
01948: }
01949: { // Start scope for v$g$2.
01950: final Pair<Node> v$g$2 = yyRepValue1.reverse();
01951:
01952: yyValue = GNode.createFromPair("EnumeratorList", v$g$1,
01953: v$g$2);
01954: yyValue.setLocation(location(yyStart));
01955:
01956: return new SemanticValue(yyValue, yyRepetition1,
01957: yyError);
01958: } // End scope for v$g$2.
01959: }
01960:
01961: // Done.
01962: return yyError;
01963: }
01964:
01965: // =========================================================================
01966:
01967: /**
01968: * Parse nonterminal xtc.lang.CPattern.Enumerator.
01969: *
01970: * @param yyStart The index.
01971: * @return The result.
01972: * @throws IOException Signals an I/O error.
01973: */
01974: private Result pEnumerator(final int yyStart) throws IOException {
01975: Result yyResult;
01976: int yyBase;
01977: int yyOption1;
01978: Node yyOpValue1;
01979: Node yyValue;
01980: ParseError yyError = ParseError.DUMMY;
01981:
01982: // Alternative <Enumerator>.
01983:
01984: yyResult = pCIdentifier$Identifier(yyStart);
01985: yyError = yyResult.select(yyError);
01986: if (yyResult.hasValue()) {
01987: final String id = yyResult.semanticValue();
01988:
01989: yyState.bind(toText(id), false);
01990:
01991: yyOption1 = yyResult.index;
01992: yyOpValue1 = null;
01993:
01994: yyBase = yyOption1;
01995: yyResult = pSymbol(yyBase);
01996: yyError = yyResult.select(yyError);
01997: if (yyResult.hasValue("=")) {
01998:
01999: yyResult = pConditionalExpression(yyResult.index);
02000: yyError = yyResult.select(yyError);
02001: if (yyResult.hasValue()) {
02002: final Node v$el$1 = yyResult.semanticValue();
02003:
02004: yyOption1 = yyResult.index;
02005: yyOpValue1 = v$el$1;
02006: }
02007: } else {
02008: yyError = yyError.select("\"=\" expected", yyBase);
02009: }
02010: { // Start scope for v$g$1.
02011: final Node v$g$1 = yyOpValue1;
02012:
02013: yyValue = GNode.create("Enumerator", id, v$g$1);
02014: yyValue.setLocation(location(yyStart));
02015:
02016: return new SemanticValue(yyValue, yyOption1, yyError);
02017: } // End scope for v$g$1.
02018: }
02019:
02020: // Done.
02021: return yyError;
02022: }
02023:
02024: // =========================================================================
02025:
02026: /**
02027: * Parse nonterminal xtc.lang.CPattern.StructureTypeSpecifier.
02028: *
02029: * @param yyStart The index.
02030: * @return The result.
02031: * @throws IOException Signals an I/O error.
02032: */
02033: private Result pStructureTypeSpecifier(final int yyStart)
02034: throws IOException {
02035:
02036: Result yyResult;
02037: int yyBase;
02038: int yyOption1;
02039: Object yyOpValue1;
02040: Node yyValue;
02041: ParseError yyError = ParseError.DUMMY;
02042:
02043: // Alternative 1.
02044:
02045: yyResult = pKeyword(yyStart);
02046: yyError = yyResult.select(yyError);
02047: if (yyResult.hasValue("struct")) {
02048:
02049: yyOption1 = yyResult.index;
02050: yyOpValue1 = null;
02051:
02052: yyResult = pAttributeSpecifierList(yyOption1);
02053: yyError = yyResult.select(yyError);
02054: if (yyResult.hasValue()) {
02055: final Node v$el$1 = yyResult.semanticValue();
02056:
02057: yyOption1 = yyResult.index;
02058: yyOpValue1 = v$el$1;
02059: }
02060: { // Start scope for v$g$1.
02061: final Node v$g$1 = cast(yyOpValue1);
02062:
02063: final int yyChoice1 = yyOption1;
02064:
02065: // Nested alternative 1.
02066:
02067: yyOption1 = yyChoice1;
02068: yyOpValue1 = null;
02069:
02070: yyResult = p$$Shared1(yyOption1);
02071: yyError = yyResult.select(yyError);
02072: if (yyResult.hasValue()) {
02073: final Object v$el$2 = yyResult.semanticValue();
02074:
02075: yyOption1 = yyResult.index;
02076: yyOpValue1 = v$el$2;
02077: }
02078: { // Start scope for v$g$2.
02079: final Object v$g$2 = yyOpValue1;
02080:
02081: yyBase = yyOption1;
02082: yyResult = pSymbol(yyBase);
02083: yyError = yyResult.select(yyError);
02084: if (yyResult.hasValue("{")) {
02085:
02086: yyResult = pPushScope(yyResult.index);
02087: yyError = yyResult.select(yyError);
02088: if (yyResult.hasValue()) {
02089:
02090: yyResult = pEnterStructure(yyResult.index);
02091: yyError = yyResult.select(yyError);
02092: if (yyResult.hasValue()) {
02093:
02094: yyResult = pStructureDeclarationList(yyResult.index);
02095: yyError = yyResult.select(yyError);
02096: if (yyResult.hasValue()) {
02097: final Node v$g$3 = yyResult
02098: .semanticValue();
02099:
02100: yyBase = yyResult.index;
02101: yyResult = pSymbol(yyBase);
02102: yyError = yyResult.select(yyError);
02103: if (yyResult.hasValue("}")) {
02104:
02105: yyResult = pExitStructure(yyResult.index);
02106: yyError = yyResult
02107: .select(yyError);
02108: if (yyResult.hasValue()) {
02109:
02110: yyResult = pPopScope(yyResult.index);
02111: yyError = yyResult
02112: .select(yyError);
02113: if (yyResult.hasValue()) {
02114:
02115: yyOption1 = yyResult.index;
02116: yyOpValue1 = null;
02117:
02118: yyResult = pAttributeSpecifierList(yyOption1);
02119: yyError = yyResult
02120: .select(yyError);
02121: if (yyResult.hasValue()) {
02122: final Node v$el$3 = yyResult
02123: .semanticValue();
02124:
02125: yyOption1 = yyResult.index;
02126: yyOpValue1 = v$el$3;
02127: }
02128: { // Start scope for v$g$4.
02129: final Node v$g$4 = cast(yyOpValue1);
02130:
02131: yyValue = GNode
02132: .create(
02133: "StructureTypeDefinition",
02134: v$g$1,
02135: v$g$2,
02136: v$g$3,
02137: v$g$4);
02138: yyValue
02139: .setLocation(location(yyStart));
02140:
02141: return new SemanticValue(
02142: yyValue,
02143: yyOption1,
02144: yyError);
02145: } // End scope for v$g$4.
02146: }
02147: }
02148: } else {
02149: yyError = yyError.select(
02150: "\"}\" expected",
02151: yyBase);
02152: }
02153: }
02154: }
02155: }
02156: } else {
02157: yyError = yyError.select("\"{\" expected",
02158: yyBase);
02159: }
02160: } // End scope for v$g$2.
02161:
02162: // Nested alternative 2.
02163:
02164: yyResult = p$$Shared1(yyChoice1);
02165: yyError = yyResult.select(yyError);
02166: if (yyResult.hasValue()) {
02167: final Object v$g$2 = yyResult.semanticValue();
02168:
02169: yyValue = GNode.create("StructureTypeReference",
02170: v$g$1, v$g$2);
02171: yyValue.setLocation(location(yyStart));
02172:
02173: return yyResult.createValue(yyValue, yyError);
02174: }
02175: } // End scope for v$g$1.
02176: }
02177:
02178: // Done.
02179: yyError = yyError.select("structure type specifier expected",
02180: yyStart);
02181: return yyError;
02182: }
02183:
02184: // =========================================================================
02185:
02186: /**
02187: * Parse synthetic nonterminal xtc.lang.CFactory.$$Shared1.
02188: * This nonterminal represents the duplicate productions
02189: * xtc.lang.CPattern.StructureTag and xtc.lang.CPattern.UnionTag.
02190: *
02191: * @param yyStart The index.
02192: * @return The result.
02193: * @throws IOException Signals an I/O error.
02194: */
02195: private Result p$$Shared1(final int yyStart) throws IOException {
02196: Result yyResult;
02197: Object yyValue;
02198: ParseError yyError = ParseError.DUMMY;
02199:
02200: // Alternative <Pattern>.
02201:
02202: yyResult = pStringVariable(yyStart);
02203: yyError = yyResult.select(yyError);
02204: if (yyResult.hasValue()) {
02205: yyValue = yyResult.semanticValue();
02206:
02207: return yyResult.createValue(yyValue, yyError);
02208: }
02209:
02210: // Alternative <Identifier>.
02211:
02212: yyResult = pCIdentifier$Identifier(yyStart);
02213: yyError = yyResult.select(yyError);
02214: if (yyResult.hasValue()) {
02215: yyValue = yyResult.semanticValue();
02216:
02217: return yyResult.createValue(yyValue, yyError);
02218: }
02219:
02220: // Done.
02221: return yyError;
02222: }
02223:
02224: // =========================================================================
02225:
02226: /**
02227: * Parse nonterminal xtc.lang.CPattern.UnionTypeSpecifier.
02228: *
02229: * @param yyStart The index.
02230: * @return The result.
02231: * @throws IOException Signals an I/O error.
02232: */
02233: private Result pUnionTypeSpecifier(final int yyStart)
02234: throws IOException {
02235: Result yyResult;
02236: int yyBase;
02237: int yyOption1;
02238: Object yyOpValue1;
02239: Node yyValue;
02240: ParseError yyError = ParseError.DUMMY;
02241:
02242: // Alternative 1.
02243:
02244: yyResult = pKeyword(yyStart);
02245: yyError = yyResult.select(yyError);
02246: if (yyResult.hasValue("union")) {
02247:
02248: yyOption1 = yyResult.index;
02249: yyOpValue1 = null;
02250:
02251: yyResult = pAttributeSpecifierList(yyOption1);
02252: yyError = yyResult.select(yyError);
02253: if (yyResult.hasValue()) {
02254: final Node v$el$1 = yyResult.semanticValue();
02255:
02256: yyOption1 = yyResult.index;
02257: yyOpValue1 = v$el$1;
02258: }
02259: { // Start scope for v$g$1.
02260: final Node v$g$1 = cast(yyOpValue1);
02261:
02262: final int yyChoice1 = yyOption1;
02263:
02264: // Nested alternative 1.
02265:
02266: yyOption1 = yyChoice1;
02267: yyOpValue1 = null;
02268:
02269: yyResult = p$$Shared1(yyOption1);
02270: yyError = yyResult.select(yyError);
02271: if (yyResult.hasValue()) {
02272: final Object v$el$2 = yyResult.semanticValue();
02273:
02274: yyOption1 = yyResult.index;
02275: yyOpValue1 = v$el$2;
02276: }
02277: { // Start scope for v$g$2.
02278: final Object v$g$2 = yyOpValue1;
02279:
02280: yyBase = yyOption1;
02281: yyResult = pSymbol(yyBase);
02282: yyError = yyResult.select(yyError);
02283: if (yyResult.hasValue("{")) {
02284:
02285: yyResult = pPushScope(yyResult.index);
02286: yyError = yyResult.select(yyError);
02287: if (yyResult.hasValue()) {
02288:
02289: yyResult = pEnterStructure(yyResult.index);
02290: yyError = yyResult.select(yyError);
02291: if (yyResult.hasValue()) {
02292:
02293: yyResult = pStructureDeclarationList(yyResult.index);
02294: yyError = yyResult.select(yyError);
02295: if (yyResult.hasValue()) {
02296: final Node v$g$3 = yyResult
02297: .semanticValue();
02298:
02299: yyBase = yyResult.index;
02300: yyResult = pSymbol(yyBase);
02301: yyError = yyResult.select(yyError);
02302: if (yyResult.hasValue("}")) {
02303:
02304: yyResult = pExitStructure(yyResult.index);
02305: yyError = yyResult
02306: .select(yyError);
02307: if (yyResult.hasValue()) {
02308:
02309: yyResult = pPopScope(yyResult.index);
02310: yyError = yyResult
02311: .select(yyError);
02312: if (yyResult.hasValue()) {
02313:
02314: yyOption1 = yyResult.index;
02315: yyOpValue1 = null;
02316:
02317: yyResult = pAttributeSpecifierList(yyOption1);
02318: yyError = yyResult
02319: .select(yyError);
02320: if (yyResult.hasValue()) {
02321: final Node v$el$3 = yyResult
02322: .semanticValue();
02323:
02324: yyOption1 = yyResult.index;
02325: yyOpValue1 = v$el$3;
02326: }
02327: { // Start scope for v$g$4.
02328: final Node v$g$4 = cast(yyOpValue1);
02329:
02330: yyValue = GNode
02331: .create(
02332: "UnionTypeDefinition",
02333: v$g$1,
02334: v$g$2,
02335: v$g$3,
02336: v$g$4);
02337: yyValue
02338: .setLocation(location(yyStart));
02339:
02340: return new SemanticValue(
02341: yyValue,
02342: yyOption1,
02343: yyError);
02344: } // End scope for v$g$4.
02345: }
02346: }
02347: } else {
02348: yyError = yyError.select(
02349: "\"}\" expected",
02350: yyBase);
02351: }
02352: }
02353: }
02354: }
02355: } else {
02356: yyError = yyError.select("\"{\" expected",
02357: yyBase);
02358: }
02359: } // End scope for v$g$2.
02360:
02361: // Nested alternative 2.
02362:
02363: yyResult = p$$Shared1(yyChoice1);
02364: yyError = yyResult.select(yyError);
02365: if (yyResult.hasValue()) {
02366: final Object v$g$2 = yyResult.semanticValue();
02367:
02368: yyValue = GNode.create("UnionTypeReference", v$g$1,
02369: v$g$2);
02370: yyValue.setLocation(location(yyStart));
02371:
02372: return yyResult.createValue(yyValue, yyError);
02373: }
02374: } // End scope for v$g$1.
02375: }
02376:
02377: // Done.
02378: yyError = yyError.select("union type specifier expected",
02379: yyStart);
02380: return yyError;
02381: }
02382:
02383: // =========================================================================
02384:
02385: /**
02386: * Parse nonterminal xtc.lang.CPattern.StructureDeclarationList.
02387: *
02388: * @param yyStart The index.
02389: * @return The result.
02390: * @throws IOException Signals an I/O error.
02391: */
02392: private Result pStructureDeclarationList(final int yyStart)
02393: throws IOException {
02394:
02395: Result yyResult;
02396: int yyRepetition1;
02397: boolean yyRepeated1;
02398: Pair<Node> yyRepValue1;
02399: Node yyValue;
02400: ParseError yyError = ParseError.DUMMY;
02401:
02402: // Alternative <Regular>.
02403:
02404: yyRepetition1 = yyStart;
02405: yyRepeated1 = false;
02406: yyRepValue1 = Pair.empty();
02407: while (true) {
02408:
02409: yyResult = pAnnotatedStructureDeclaration(yyRepetition1);
02410: yyError = yyResult.select(yyError);
02411: if (yyResult.hasValue()) {
02412: final Node v$el$1 = yyResult.semanticValue();
02413:
02414: yyRepetition1 = yyResult.index;
02415: yyRepeated1 = true;
02416: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
02417: continue;
02418: }
02419: break;
02420: }
02421:
02422: if (yyRepeated1) {
02423: final Pair<Node> v$g$1 = yyRepValue1.reverse();
02424:
02425: yyResult = pAnnotations(yyRepetition1);
02426: yyError = yyResult.select(yyError);
02427: if (yyResult.hasValue()) {
02428: final Node v$g$2 = yyResult.semanticValue();
02429:
02430: yyValue = GNode.create("StructureDeclarationList",
02431: v$g$1.size() + 1).addAll(v$g$1).add(v$g$2);
02432: yyValue.setLocation(location(yyStart));
02433:
02434: return yyResult.createValue(yyValue, yyError);
02435: }
02436: }
02437:
02438: // Alternative <Empty>.
02439:
02440: if (GCC) {
02441:
02442: yyResult = pAnnotations(yyStart);
02443: yyError = yyResult.select(yyError);
02444: if (yyResult.hasValue()) {
02445: final Node v$g$3 = yyResult.semanticValue();
02446:
02447: yyValue = GNode.create("StructureDeclarationList",
02448: v$g$3);
02449: yyValue.setLocation(location(yyStart));
02450:
02451: return yyResult.createValue(yyValue, yyError);
02452: }
02453: }
02454:
02455: // Done.
02456: yyError = yyError.select("structure declaration list expected",
02457: yyStart);
02458: return yyError;
02459: }
02460:
02461: // =========================================================================
02462:
02463: /**
02464: * Parse nonterminal xtc.lang.CPattern.AnnotatedStructureDeclaration.
02465: *
02466: * @param yyStart The index.
02467: * @return The result.
02468: * @throws IOException Signals an I/O error.
02469: */
02470: private Result pAnnotatedStructureDeclaration(final int yyStart)
02471: throws IOException {
02472:
02473: Result yyResult;
02474: Node yyValue;
02475: ParseError yyError = ParseError.DUMMY;
02476:
02477: // Start a state modification.
02478: yyState.start();
02479:
02480: // Alternative 1.
02481:
02482: yyState.mark();
02483:
02484: yyResult = pStructureDeclaration(yyStart);
02485: yyError = yyResult.select(yyError);
02486: if (yyResult.hasValue()) {
02487: final Node d = yyResult.semanticValue();
02488:
02489: yyValue = yyState.annotate(d);
02490:
02491: // Commit the state modification.
02492: yyState.commit();
02493:
02494: setLocation(yyValue, yyStart);
02495: return yyResult.createValue(yyValue, yyError);
02496: }
02497:
02498: // Abort the state modification.
02499: yyState.abort();
02500:
02501: // Done.
02502: return yyError;
02503: }
02504:
02505: // =========================================================================
02506:
02507: /**
02508: * Parse nonterminal xtc.lang.CPattern.StructureDeclaration.
02509: *
02510: * @param yyStart The index.
02511: * @return The result.
02512: * @throws IOException Signals an I/O error.
02513: */
02514: private Result pStructureDeclaration(final int yyStart)
02515: throws IOException {
02516: Result yyResult;
02517: int yyBase;
02518: int yyRepetition1;
02519: boolean yyRepeated1;
02520: int yyOption1;
02521: String yyOpValue1;
02522: Node yyValue;
02523: ParseError yyError = ParseError.DUMMY;
02524:
02525: // Alternative <Declaration>.
02526:
02527: yyOption1 = yyStart;
02528: yyOpValue1 = null;
02529:
02530: yyBase = yyOption1;
02531: yyResult = pKeyword(yyBase);
02532: yyError = yyResult.select(yyError);
02533: if (yyResult.hasValue("__extension__")) {
02534: final String v$el$1 = "__extension__";
02535:
02536: yyOption1 = yyResult.index;
02537: yyOpValue1 = v$el$1;
02538: } else {
02539: yyError = yyError.select("\"__extension__\" expected",
02540: yyBase);
02541: }
02542: { // Start scope for v$g$1.
02543: final String v$g$1 = yyOpValue1;
02544:
02545: yyResult = pSpecifierQualifierList(yyOption1);
02546: yyError = yyResult.select(yyError);
02547: if (yyResult.hasValue()) {
02548: final Node v$g$2 = yyResult.semanticValue();
02549:
02550: yyResult = pOptionalStructureDeclaratorList(yyResult.index);
02551: yyError = yyResult.select(yyError);
02552: if (yyResult.hasValue()) {
02553: final Node v$g$3 = yyResult.semanticValue();
02554:
02555: yyBase = yyResult.index;
02556: yyResult = pSymbol(yyBase);
02557: yyError = yyResult.select(yyError);
02558: if (yyResult.hasValue(";")) {
02559:
02560: yyOption1 = yyResult.index;
02561:
02562: if (GCC) {
02563:
02564: yyRepetition1 = yyOption1;
02565: yyRepeated1 = false;
02566: while (true) {
02567:
02568: yyBase = yyRepetition1;
02569: yyResult = pSymbol(yyBase);
02570: yyError = yyResult.select(yyError);
02571: if (yyResult.hasValue(";")) {
02572:
02573: yyRepetition1 = yyResult.index;
02574: yyRepeated1 = true;
02575: continue;
02576: } else {
02577: yyError = yyError.select(
02578: "\";\" expected", yyBase);
02579: }
02580: break;
02581: }
02582:
02583: if (yyRepeated1) {
02584:
02585: yyOption1 = yyRepetition1;
02586: }
02587: }
02588:
02589: yyValue = GNode.create("StructureDeclaration",
02590: v$g$1, v$g$2, v$g$3);
02591: yyValue.setLocation(location(yyStart));
02592:
02593: return new SemanticValue(yyValue, yyOption1,
02594: yyError);
02595: } else {
02596: yyError = yyError.select("\";\" expected",
02597: yyBase);
02598: }
02599: }
02600: }
02601: } // End scope for v$g$1.
02602:
02603: // Alternative <ListPattern>.
02604:
02605: yyResult = pNodeListVariable(yyStart);
02606: yyError = yyResult.select(yyError);
02607: if (yyResult.hasValue()) {
02608: yyValue = yyResult.semanticValue();
02609:
02610: return yyResult.createValue(yyValue, yyError);
02611: }
02612:
02613: // Alternative <Pattern>.
02614:
02615: yyResult = pNodeVariable(yyStart);
02616: yyError = yyResult.select(yyError);
02617: if (yyResult.hasValue()) {
02618: yyValue = yyResult.semanticValue();
02619:
02620: return yyResult.createValue(yyValue, yyError);
02621: }
02622:
02623: // Done.
02624: yyError = yyError.select("structure declaration expected",
02625: yyStart);
02626: return yyError;
02627: }
02628:
02629: // =========================================================================
02630:
02631: /**
02632: * Parse nonterminal xtc.lang.CPattern.SpecifierQualifierList.
02633: *
02634: * @param yyStart The index.
02635: * @return The result.
02636: * @throws IOException Signals an I/O error.
02637: */
02638: private Result pSpecifierQualifierList(final int yyStart)
02639: throws IOException {
02640:
02641: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
02642: if (null == yyColumn.chunk1)
02643: yyColumn.chunk1 = new Chunk1();
02644: if (null == yyColumn.chunk1.fSpecifierQualifierList)
02645: yyColumn.chunk1.fSpecifierQualifierList = pSpecifierQualifierList$1(yyStart);
02646: return yyColumn.chunk1.fSpecifierQualifierList;
02647: }
02648:
02649: /** Actually parse xtc.lang.CPattern.SpecifierQualifierList. */
02650: private Result pSpecifierQualifierList$1(final int yyStart)
02651: throws IOException {
02652:
02653: Result yyResult;
02654: Node yyValue;
02655: ParseError yyError = ParseError.DUMMY;
02656:
02657: // Alternative 1.
02658:
02659: yyResult = pSpecifierQualifierPlus(yyStart);
02660: yyError = yyResult.select(yyError);
02661: if (yyResult.hasValue()) {
02662: final Pair<Node> v$g$1 = yyResult.semanticValue();
02663:
02664: yyValue = GNode.createFromPair("SpecifierQualifierList",
02665: v$g$1);
02666: yyValue.setLocation(location(yyStart));
02667:
02668: return yyResult.createValue(yyValue, yyError);
02669: }
02670:
02671: // Done.
02672: return yyError;
02673: }
02674:
02675: // =========================================================================
02676:
02677: /**
02678: * Parse nonterminal xtc.lang.CPattern.SpecifierQualifierPlus.
02679: *
02680: * @param yyStart The index.
02681: * @return The result.
02682: * @throws IOException Signals an I/O error.
02683: */
02684: private Result pSpecifierQualifierPlus(final int yyStart)
02685: throws IOException {
02686:
02687: Result yyResult;
02688: int yyRepetition1;
02689: boolean yyRepeated1;
02690: Pair<Node> yyRepValue1;
02691: Pair<Node> yyValue;
02692: ParseError yyError = ParseError.DUMMY;
02693:
02694: // Alternative 1.
02695:
02696: yyRepetition1 = yyStart;
02697: yyRepeated1 = false;
02698: yyRepValue1 = Pair.empty();
02699: while (true) {
02700:
02701: yyResult = pSpecifierQualifier(yyRepetition1);
02702: yyError = yyResult.select(yyError);
02703: if (yyResult.hasValue()) {
02704: final Node v$el$1 = yyResult.semanticValue();
02705:
02706: yyRepetition1 = yyResult.index;
02707: yyRepeated1 = true;
02708: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
02709: continue;
02710: }
02711: break;
02712: }
02713:
02714: if (yyRepeated1) {
02715: yyValue = yyRepValue1.reverse();
02716:
02717: return new SemanticValue(yyValue, yyRepetition1, yyError);
02718: }
02719:
02720: // Done.
02721: return yyError;
02722: }
02723:
02724: // =========================================================================
02725:
02726: /**
02727: * Parse nonterminal xtc.lang.CPattern.SpecifierQualifier.
02728: *
02729: * @param yyStart The index.
02730: * @return The result.
02731: * @throws IOException Signals an I/O error.
02732: */
02733: private Result pSpecifierQualifier(final int yyStart)
02734: throws IOException {
02735: Result yyResult;
02736: Node yyValue;
02737: ParseError yyError = ParseError.DUMMY;
02738:
02739: // Alternative <TypeSpecifier>.
02740:
02741: yyResult = pTypeSpecifier(yyStart);
02742: yyError = yyResult.select(yyError);
02743: if (yyResult.hasValue()) {
02744: yyValue = yyResult.semanticValue();
02745:
02746: yyResult = pTypeSpecContext(yyResult.index);
02747: yyError = yyResult.select(yyError);
02748: if (yyResult.hasValue()) {
02749:
02750: return yyResult.createValue(yyValue, yyError);
02751: }
02752: }
02753:
02754: // Alternative <TypeQualifier>.
02755:
02756: yyResult = pTypeQualifier(yyStart);
02757: yyError = yyResult.select(yyError);
02758: if (yyResult.hasValue()) {
02759: yyValue = yyResult.semanticValue();
02760:
02761: return yyResult.createValue(yyValue, yyError);
02762: }
02763:
02764: // Alternative <Attribute>.
02765:
02766: yyResult = pAttributeSpecifier(yyStart);
02767: yyError = yyResult.select(yyError);
02768: if (yyResult.hasValue()) {
02769: yyValue = yyResult.semanticValue();
02770:
02771: return yyResult.createValue(yyValue, yyError);
02772: }
02773:
02774: // Done.
02775: return yyError;
02776: }
02777:
02778: // =========================================================================
02779:
02780: /**
02781: * Parse nonterminal xtc.lang.CPattern.OptionalStructureDeclaratorList.
02782: *
02783: * @param yyStart The index.
02784: * @return The result.
02785: * @throws IOException Signals an I/O error.
02786: */
02787: private Result pOptionalStructureDeclaratorList(final int yyStart)
02788: throws IOException {
02789:
02790: Result yyResult;
02791: Node yyValue;
02792: ParseError yyError = ParseError.DUMMY;
02793:
02794: // Alternative <List>.
02795:
02796: yyResult = pStructureDeclaratorList(yyStart);
02797: yyError = yyResult.select(yyError);
02798: if (yyResult.hasValue()) {
02799: yyValue = yyResult.semanticValue();
02800:
02801: return yyResult.createValue(yyValue, yyError);
02802: }
02803:
02804: // Alternative <Null>.
02805:
02806: if (GCC) {
02807: { // Start scope for yyValue.
02808: yyValue = null;
02809:
02810: return new SemanticValue(yyValue, yyStart, yyError);
02811: } // End scope for yyValue.
02812: }
02813:
02814: // Done.
02815: yyError = yyError.select(
02816: "optional structure declarator list expected", yyStart);
02817: return yyError;
02818: }
02819:
02820: // =========================================================================
02821:
02822: /**
02823: * Parse nonterminal xtc.lang.CPattern.StructureDeclaratorList.
02824: *
02825: * @param yyStart The index.
02826: * @return The result.
02827: * @throws IOException Signals an I/O error.
02828: */
02829: private Result pStructureDeclaratorList(final int yyStart)
02830: throws IOException {
02831:
02832: Result yyResult;
02833: int yyBase;
02834: int yyRepetition1;
02835: Pair<Node> yyRepValue1;
02836: Node yyValue;
02837: ParseError yyError = ParseError.DUMMY;
02838:
02839: // Alternative <List>.
02840:
02841: yyResult = pStructureDeclarator(yyStart);
02842: yyError = yyResult.select(yyError);
02843: if (yyResult.hasValue()) {
02844: final Node v$g$1 = yyResult.semanticValue();
02845:
02846: yyRepetition1 = yyResult.index;
02847: yyRepValue1 = Pair.empty();
02848: while (true) {
02849:
02850: yyBase = yyRepetition1;
02851: yyResult = pSymbol(yyBase);
02852: yyError = yyResult.select(yyError);
02853: if (yyResult.hasValue(",")) {
02854:
02855: yyResult = pStructureDeclarator(yyResult.index);
02856: yyError = yyResult.select(yyError);
02857: if (yyResult.hasValue()) {
02858: final Node v$el$1 = yyResult.semanticValue();
02859:
02860: yyRepetition1 = yyResult.index;
02861: yyRepValue1 = new Pair<Node>(v$el$1,
02862: yyRepValue1);
02863: continue;
02864: }
02865: } else {
02866: yyError = yyError.select("\",\" expected", yyBase);
02867: }
02868: break;
02869: }
02870: { // Start scope for v$g$2.
02871: final Pair<Node> v$g$2 = yyRepValue1.reverse();
02872:
02873: yyValue = GNode.createFromPair(
02874: "StructureDeclaratorList", v$g$1, v$g$2);
02875: yyValue.setLocation(location(yyStart));
02876:
02877: return new SemanticValue(yyValue, yyRepetition1,
02878: yyError);
02879: } // End scope for v$g$2.
02880: }
02881:
02882: // Done.
02883: return yyError;
02884: }
02885:
02886: // =========================================================================
02887:
02888: /**
02889: * Parse nonterminal xtc.lang.CPattern.StructureDeclarator.
02890: *
02891: * @param yyStart The index.
02892: * @return The result.
02893: * @throws IOException Signals an I/O error.
02894: */
02895: private Result pStructureDeclarator(final int yyStart)
02896: throws IOException {
02897: Result yyResult;
02898: int yyBase;
02899: int yyOption1;
02900: Node yyOpValue1;
02901: Node yyValue;
02902: ParseError yyError = ParseError.DUMMY;
02903:
02904: // Alternative 1.
02905:
02906: yyOption1 = yyStart;
02907: yyOpValue1 = null;
02908:
02909: yyResult = pAttributeSpecifierList(yyOption1);
02910: yyError = yyResult.select(yyError);
02911: if (yyResult.hasValue()) {
02912: final Node v$el$1 = yyResult.semanticValue();
02913:
02914: yyOption1 = yyResult.index;
02915: yyOpValue1 = v$el$1;
02916: }
02917: { // Start scope for v$g$1.
02918: final Node v$g$1 = yyOpValue1;
02919:
02920: yyOpValue1 = null;
02921:
02922: yyResult = pDeclarator(yyOption1);
02923: yyError = yyResult.select(yyError);
02924: if (yyResult.hasValue()) {
02925: final Node v$el$2 = yyResult.semanticValue();
02926:
02927: yyOption1 = yyResult.index;
02928: yyOpValue1 = v$el$2;
02929: }
02930: { // Start scope for v$g$2.
02931: final Node v$g$2 = yyOpValue1;
02932:
02933: yyBase = yyOption1;
02934: yyResult = pSymbol(yyBase);
02935: yyError = yyResult.select(yyError);
02936: if (yyResult.hasValue(":")) {
02937:
02938: yyResult = pConditionalExpression(yyResult.index);
02939: yyError = yyResult.select(yyError);
02940: if (yyResult.hasValue()) {
02941: final Node v$g$3 = yyResult.semanticValue();
02942:
02943: yyOption1 = yyResult.index;
02944: yyOpValue1 = null;
02945:
02946: yyResult = pAttributeSpecifierList(yyOption1);
02947: yyError = yyResult.select(yyError);
02948: if (yyResult.hasValue()) {
02949: final Node v$el$3 = yyResult
02950: .semanticValue();
02951:
02952: yyOption1 = yyResult.index;
02953: yyOpValue1 = v$el$3;
02954: }
02955: { // Start scope for v$g$4.
02956: final Node v$g$4 = yyOpValue1;
02957:
02958: yyValue = GNode.create("BitField", v$g$1,
02959: v$g$2, v$g$3, v$g$4);
02960: yyValue.setLocation(location(yyStart));
02961:
02962: return new SemanticValue(yyValue,
02963: yyOption1, yyError);
02964: } // End scope for v$g$4.
02965: }
02966: } else {
02967: yyError = yyError.select("\":\" expected", yyBase);
02968: }
02969: } // End scope for v$g$2.
02970: } // End scope for v$g$1.
02971:
02972: // Alternative <Simple>.
02973:
02974: yyResult = pAttributedDeclarator(yyStart);
02975: yyError = yyResult.select(yyError);
02976: if (yyResult.hasValue()) {
02977: yyValue = yyResult.semanticValue();
02978:
02979: return yyResult.createValue(yyValue, yyError);
02980: }
02981:
02982: // Done.
02983: return yyError;
02984: }
02985:
02986: // =========================================================================
02987:
02988: /**
02989: * Parse nonterminal xtc.lang.CPattern.AttributedDeclarator.
02990: *
02991: * @param yyStart The index.
02992: * @return The result.
02993: * @throws IOException Signals an I/O error.
02994: */
02995: private Result pAttributedDeclarator(final int yyStart)
02996: throws IOException {
02997: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
02998: if (null == yyColumn.chunk1)
02999: yyColumn.chunk1 = new Chunk1();
03000: if (null == yyColumn.chunk1.fAttributedDeclarator)
03001: yyColumn.chunk1.fAttributedDeclarator = pAttributedDeclarator$1(yyStart);
03002: return yyColumn.chunk1.fAttributedDeclarator;
03003: }
03004:
03005: /** Actually parse xtc.lang.CPattern.AttributedDeclarator. */
03006: private Result pAttributedDeclarator$1(final int yyStart)
03007: throws IOException {
03008:
03009: Result yyResult;
03010: int yyOption1;
03011: Node yyOpValue1;
03012: Node yyValue;
03013: ParseError yyError = ParseError.DUMMY;
03014:
03015: // Alternative 1.
03016:
03017: yyOption1 = yyStart;
03018: yyOpValue1 = null;
03019:
03020: yyResult = pAttributeSpecifierList(yyOption1);
03021: yyError = yyResult.select(yyError);
03022: if (yyResult.hasValue()) {
03023: final Node v$el$1 = yyResult.semanticValue();
03024:
03025: yyOption1 = yyResult.index;
03026: yyOpValue1 = v$el$1;
03027: }
03028: { // Start scope for v$g$1.
03029: final Node v$g$1 = yyOpValue1;
03030:
03031: yyResult = pDeclarator(yyOption1);
03032: yyError = yyResult.select(yyError);
03033: if (yyResult.hasValue()) {
03034: final Node v$g$2 = yyResult.semanticValue();
03035:
03036: yyOption1 = yyResult.index;
03037: yyOpValue1 = null;
03038:
03039: yyResult = pAttributeSpecifierList(yyOption1);
03040: yyError = yyResult.select(yyError);
03041: if (yyResult.hasValue()) {
03042: final Node v$el$2 = yyResult.semanticValue();
03043:
03044: yyOption1 = yyResult.index;
03045: yyOpValue1 = v$el$2;
03046: }
03047: { // Start scope for v$g$3.
03048: final Node v$g$3 = yyOpValue1;
03049:
03050: yyValue = GNode.create("AttributedDeclarator",
03051: v$g$1, v$g$2, v$g$3);
03052: yyValue.setLocation(location(yyStart));
03053:
03054: return new SemanticValue(yyValue, yyOption1,
03055: yyError);
03056: } // End scope for v$g$3.
03057: }
03058: } // End scope for v$g$1.
03059:
03060: // Done.
03061: return yyError;
03062: }
03063:
03064: // =========================================================================
03065:
03066: /**
03067: * Parse nonterminal xtc.lang.CPattern.Declarator.
03068: *
03069: * @param yyStart The index.
03070: * @return The result.
03071: * @throws IOException Signals an I/O error.
03072: */
03073: private Result pDeclarator(final int yyStart) throws IOException {
03074: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
03075: if (null == yyColumn.chunk1)
03076: yyColumn.chunk1 = new Chunk1();
03077: if (null == yyColumn.chunk1.fDeclarator)
03078: yyColumn.chunk1.fDeclarator = pDeclarator$1(yyStart);
03079: return yyColumn.chunk1.fDeclarator;
03080: }
03081:
03082: /** Actually parse xtc.lang.CPattern.Declarator. */
03083: private Result pDeclarator$1(final int yyStart) throws IOException {
03084: Result yyResult;
03085: Node yyValue;
03086: ParseError yyError = ParseError.DUMMY;
03087:
03088: // Alternative <Pointer>.
03089:
03090: yyResult = pPointerDeclarator(yyStart);
03091: yyError = yyResult.select(yyError);
03092: if (yyResult.hasValue()) {
03093: yyValue = yyResult.semanticValue();
03094:
03095: return yyResult.createValue(yyValue, yyError);
03096: }
03097:
03098: // Alternative <Direct>.
03099:
03100: yyResult = pDirectDeclarator(yyStart);
03101: yyError = yyResult.select(yyError);
03102: if (yyResult.hasValue()) {
03103: yyValue = yyResult.semanticValue();
03104:
03105: return yyResult.createValue(yyValue, yyError);
03106: }
03107:
03108: // Done.
03109: return yyError;
03110: }
03111:
03112: // =========================================================================
03113:
03114: /**
03115: * Parse nonterminal xtc.lang.CPattern.PointerDeclarator.
03116: *
03117: * @param yyStart The index.
03118: * @return The result.
03119: * @throws IOException Signals an I/O error.
03120: */
03121: private Result pPointerDeclarator(final int yyStart)
03122: throws IOException {
03123: Result yyResult;
03124: Node yyValue;
03125: ParseError yyError = ParseError.DUMMY;
03126:
03127: // Alternative 1.
03128:
03129: yyResult = pPointer(yyStart);
03130: yyError = yyResult.select(yyError);
03131: if (yyResult.hasValue()) {
03132: final Node v$g$1 = yyResult.semanticValue();
03133:
03134: yyResult = pDirectDeclarator(yyResult.index);
03135: yyError = yyResult.select(yyError);
03136: if (yyResult.hasValue()) {
03137: final Node v$g$2 = yyResult.semanticValue();
03138:
03139: yyValue = GNode.create("PointerDeclarator", v$g$1,
03140: v$g$2);
03141: yyValue.setLocation(location(yyStart));
03142:
03143: return yyResult.createValue(yyValue, yyError);
03144: }
03145: }
03146:
03147: // Done.
03148: return yyError;
03149: }
03150:
03151: // =========================================================================
03152:
03153: /**
03154: * Parse nonterminal xtc.lang.CPattern.Pointer.
03155: *
03156: * @param yyStart The index.
03157: * @return The result.
03158: * @throws IOException Signals an I/O error.
03159: */
03160: private Result pPointer(final int yyStart) throws IOException {
03161: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
03162: if (null == yyColumn.chunk1)
03163: yyColumn.chunk1 = new Chunk1();
03164: if (null == yyColumn.chunk1.fPointer)
03165: yyColumn.chunk1.fPointer = pPointer$1(yyStart);
03166: return yyColumn.chunk1.fPointer;
03167: }
03168:
03169: /** Actually parse xtc.lang.CPattern.Pointer. */
03170: private Result pPointer$1(final int yyStart) throws IOException {
03171: Result yyResult;
03172: int yyOption1;
03173: Node yyOpValue1;
03174: Node yyValue;
03175: ParseError yyError = ParseError.DUMMY;
03176:
03177: // Alternative 1.
03178:
03179: yyResult = pSymbol(yyStart);
03180: yyError = yyResult.select(yyError);
03181: if (yyResult.hasValue("*")) {
03182:
03183: yyResult = pTypeQualifierList(yyResult.index);
03184: yyError = yyResult.select(yyError);
03185: if (yyResult.hasValue()) {
03186: final Node v$g$1 = yyResult.semanticValue();
03187:
03188: yyOption1 = yyResult.index;
03189: yyOpValue1 = null;
03190:
03191: yyResult = pPointer(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$g$2.
03200: final Node v$g$2 = yyOpValue1;
03201:
03202: yyValue = GNode.create("Pointer", v$g$1, v$g$2);
03203: yyValue.setLocation(location(yyStart));
03204:
03205: return new SemanticValue(yyValue, yyOption1,
03206: yyError);
03207: } // End scope for v$g$2.
03208: }
03209: }
03210:
03211: // Done.
03212: yyError = yyError.select("pointer expected", yyStart);
03213: return yyError;
03214: }
03215:
03216: // =========================================================================
03217:
03218: /**
03219: * Parse nonterminal xtc.lang.CPattern.TypeQualifierList.
03220: *
03221: * @param yyStart The index.
03222: * @return The result.
03223: * @throws IOException Signals an I/O error.
03224: */
03225: private Result pTypeQualifierList(final int yyStart)
03226: throws IOException {
03227: Result yyResult;
03228: int yyRepetition1;
03229: Pair<Node> yyRepValue1;
03230: Node yyValue;
03231: ParseError yyError = ParseError.DUMMY;
03232:
03233: // Alternative 1.
03234:
03235: yyRepetition1 = yyStart;
03236: yyRepValue1 = Pair.empty();
03237: while (true) {
03238:
03239: yyResult = pTypeQualifierList$$Choice1(yyRepetition1);
03240: yyError = yyResult.select(yyError);
03241: if (yyResult.hasValue()) {
03242: final Node v$el$1 = yyResult.semanticValue();
03243:
03244: yyRepetition1 = yyResult.index;
03245: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
03246: continue;
03247: }
03248: break;
03249: }
03250: { // Start scope for v$g$1.
03251: final Pair<Node> v$g$1 = yyRepValue1.reverse();
03252:
03253: yyValue = GNode.createFromPair("TypeQualifierList", v$g$1);
03254: yyValue.setLocation(location(yyStart));
03255:
03256: return new SemanticValue(yyValue, yyRepetition1, yyError);
03257: } // End scope for v$g$1.
03258: }
03259:
03260: // =========================================================================
03261:
03262: /**
03263: * Parse synthetic nonterminal xtc.lang.CFactory.TypeQualifierList$$Choice1.
03264: *
03265: * @param yyStart The index.
03266: * @return The result.
03267: * @throws IOException Signals an I/O error.
03268: */
03269: private Result pTypeQualifierList$$Choice1(final int yyStart)
03270: throws IOException {
03271:
03272: Result yyResult;
03273: Node yyValue;
03274: ParseError yyError = ParseError.DUMMY;
03275:
03276: // Alternative 1.
03277:
03278: yyResult = pTypeQualifier(yyStart);
03279: yyError = yyResult.select(yyError);
03280: if (yyResult.hasValue()) {
03281: yyValue = yyResult.semanticValue();
03282:
03283: return yyResult.createValue(yyValue, yyError);
03284: }
03285:
03286: // Alternative 2.
03287:
03288: yyResult = pAttributeSpecifier(yyStart);
03289: yyError = yyResult.select(yyError);
03290: if (yyResult.hasValue()) {
03291: yyValue = yyResult.semanticValue();
03292:
03293: return yyResult.createValue(yyValue, yyError);
03294: }
03295:
03296: // Done.
03297: return yyError;
03298: }
03299:
03300: // =========================================================================
03301:
03302: /**
03303: * Parse nonterminal xtc.lang.CPattern.DirectDeclarator.
03304: *
03305: * @param yyStart The index.
03306: * @return The result.
03307: * @throws IOException Signals an I/O error.
03308: */
03309: private Result pDirectDeclarator(final int yyStart)
03310: throws IOException {
03311: Result yyResult;
03312: int yyBase;
03313: int yyRepetition1;
03314: Pair<Action<Node>> yyRepValue1;
03315: Node yyValue;
03316: ParseError yyError = ParseError.DUMMY;
03317:
03318: // Alternative <FullBase>.
03319:
03320: yyResult = pSymbol(yyStart);
03321: yyError = yyResult.select(yyError);
03322: if (yyResult.hasValue("(")) {
03323:
03324: yyResult = pAttributedDeclarator(yyResult.index);
03325: yyError = yyResult.select(yyError);
03326: if (yyResult.hasValue()) {
03327: final Node v$g$7 = yyResult.semanticValue();
03328:
03329: yyBase = yyResult.index;
03330: yyResult = pSymbol(yyBase);
03331: yyError = yyResult.select(yyError);
03332: if (yyResult.hasValue(")")) {
03333:
03334: yyRepetition1 = yyResult.index;
03335: yyRepValue1 = Pair.empty();
03336: while (true) {
03337:
03338: yyResult = pDirectDeclarator$$Tail1(yyRepetition1);
03339: yyError = yyResult.select(yyError);
03340: if (yyResult.hasValue()) {
03341: final Action<Node> v$8 = yyResult
03342: .semanticValue();
03343:
03344: yyRepetition1 = yyResult.index;
03345: yyRepValue1 = new Pair<Action<Node>>(v$8,
03346: yyRepValue1);
03347: continue;
03348: }
03349: break;
03350: }
03351: { // Start scope for v$9.
03352: final Pair<Action<Node>> v$9 = yyRepValue1
03353: .reverse();
03354:
03355: yyValue = apply(v$9, v$g$7, yyStart);
03356:
03357: return new SemanticValue(yyValue,
03358: yyRepetition1, yyError);
03359: } // End scope for v$9.
03360: } else {
03361: yyError = yyError.select("\")\" expected", yyBase);
03362: }
03363: }
03364: }
03365:
03366: // Alternative <SimpleBase>.
03367:
03368: yyResult = pSimpleDeclarator(yyStart);
03369: yyError = yyResult.select(yyError);
03370: if (yyResult.hasValue()) {
03371: final Node v$g$10 = yyResult.semanticValue();
03372:
03373: yyRepetition1 = yyResult.index;
03374: yyRepValue1 = Pair.empty();
03375: while (true) {
03376:
03377: yyResult = pDirectDeclarator$$Tail1(yyRepetition1);
03378: yyError = yyResult.select(yyError);
03379: if (yyResult.hasValue()) {
03380: final Action<Node> v$11 = yyResult.semanticValue();
03381:
03382: yyRepetition1 = yyResult.index;
03383: yyRepValue1 = new Pair<Action<Node>>(v$11,
03384: yyRepValue1);
03385: continue;
03386: }
03387: break;
03388: }
03389: { // Start scope for v$12.
03390: final Pair<Action<Node>> v$12 = yyRepValue1.reverse();
03391:
03392: yyValue = apply(v$12, v$g$10, yyStart);
03393:
03394: return new SemanticValue(yyValue, yyRepetition1,
03395: yyError);
03396: } // End scope for v$12.
03397: }
03398:
03399: // Done.
03400: yyError = yyError.select("direct declarator expected", yyStart);
03401: return yyError;
03402: }
03403:
03404: // =========================================================================
03405:
03406: /**
03407: * Parse synthetic nonterminal xtc.lang.CFactory.DirectDeclarator$$Tail1.
03408: *
03409: * @param yyStart The index.
03410: * @return The result.
03411: * @throws IOException Signals an I/O error.
03412: */
03413: private Result pDirectDeclarator$$Tail1(final int yyStart)
03414: throws IOException {
03415:
03416: Result yyResult;
03417: int yyBase;
03418: int yyOption1;
03419: Node yyOpValue1;
03420: Action<Node> yyValue;
03421: ParseError yyError = ParseError.DUMMY;
03422:
03423: // Alternative 1.
03424:
03425: yyResult = pSymbol(yyStart);
03426: yyError = yyResult.select(yyError);
03427: if (yyResult.hasValue("(")) {
03428:
03429: yyResult = pPushScope(yyResult.index);
03430: yyError = yyResult.select(yyError);
03431: if (yyResult.hasValue()) {
03432:
03433: final int yyChoice1 = yyResult.index;
03434:
03435: // Nested alternative 1.
03436:
03437: yyResult = pParameterTypeList(yyChoice1);
03438: yyError = yyResult.select(yyError);
03439: if (yyResult.hasValue()) {
03440: final Node v$g$2 = yyResult.semanticValue();
03441:
03442: yyBase = yyResult.index;
03443: yyResult = pSymbol(yyBase);
03444: yyError = yyResult.select(yyError);
03445: if (yyResult.hasValue(")")) {
03446:
03447: yyResult = pParameterContext(yyResult.index);
03448: yyError = yyResult.select(yyError);
03449: if (yyResult.hasValue()) {
03450:
03451: yyValue = new Action<Node>() {
03452: public Node run(Node v$1) {
03453: return GNode.create(
03454: "FunctionDeclarator", v$1,
03455: v$g$2);
03456: }
03457: };
03458:
03459: return yyResult.createValue(yyValue,
03460: yyError);
03461: }
03462: } else {
03463: yyError = yyError.select("\")\" expected",
03464: yyBase);
03465: }
03466: }
03467:
03468: // Nested alternative 2.
03469:
03470: yyOption1 = yyChoice1;
03471: yyOpValue1 = null;
03472:
03473: yyResult = pIdentifierList(yyOption1);
03474: yyError = yyResult.select(yyError);
03475: if (yyResult.hasValue()) {
03476: final Node v$el$1 = yyResult.semanticValue();
03477:
03478: yyOption1 = yyResult.index;
03479: yyOpValue1 = v$el$1;
03480: }
03481: { // Start scope for v$g$3.
03482: final Node v$g$3 = yyOpValue1;
03483:
03484: yyBase = yyOption1;
03485: yyResult = pSymbol(yyBase);
03486: yyError = yyResult.select(yyError);
03487: if (yyResult.hasValue(")")) {
03488:
03489: yyResult = pParameterContext(yyResult.index);
03490: yyError = yyResult.select(yyError);
03491: if (yyResult.hasValue()) {
03492:
03493: yyValue = new Action<Node>() {
03494: public Node run(Node v$1) {
03495: return GNode.create(
03496: "FunctionDeclarator", v$1,
03497: v$g$3);
03498: }
03499: };
03500:
03501: return yyResult.createValue(yyValue,
03502: yyError);
03503: }
03504: } else {
03505: yyError = yyError.select("\")\" expected",
03506: yyBase);
03507: }
03508: } // End scope for v$g$3.
03509: }
03510: }
03511:
03512: // Alternative 2.
03513:
03514: yyResult = pSymbol(yyStart);
03515: yyError = yyResult.select(yyError);
03516: if (yyResult.hasValue("[")) {
03517:
03518: yyResult = pArrayQualifierList(yyResult.index);
03519: yyError = yyResult.select(yyError);
03520: if (yyResult.hasValue()) {
03521: final Node v$g$4 = yyResult.semanticValue();
03522:
03523: final int yyChoice1 = yyResult.index;
03524:
03525: // Nested alternative 1.
03526:
03527: yyOption1 = yyChoice1;
03528: yyOpValue1 = null;
03529:
03530: yyResult = pAssignmentExpression(yyOption1);
03531: yyError = yyResult.select(yyError);
03532: if (yyResult.hasValue()) {
03533: final Node v$el$2 = yyResult.semanticValue();
03534:
03535: yyOption1 = yyResult.index;
03536: yyOpValue1 = v$el$2;
03537: }
03538: { // Start scope for v$g$5.
03539: final Node v$g$5 = yyOpValue1;
03540:
03541: yyBase = yyOption1;
03542: yyResult = pSymbol(yyBase);
03543: yyError = yyResult.select(yyError);
03544: if (yyResult.hasValue("]")) {
03545:
03546: yyValue = new Action<Node>() {
03547: public Node run(Node v$1) {
03548: return GNode.create("ArrayDeclarator",
03549: v$1, v$g$4, v$g$5);
03550: }
03551: };
03552:
03553: return yyResult.createValue(yyValue, yyError);
03554: } else {
03555: yyError = yyError.select("\"]\" expected",
03556: yyBase);
03557: }
03558: } // End scope for v$g$5.
03559:
03560: // Nested alternative 2.
03561:
03562: yyResult = pVariableLength(yyChoice1);
03563: yyError = yyResult.select(yyError);
03564: if (yyResult.hasValue()) {
03565: final Node v$g$6 = yyResult.semanticValue();
03566:
03567: yyBase = yyResult.index;
03568: yyResult = pSymbol(yyBase);
03569: yyError = yyResult.select(yyError);
03570: if (yyResult.hasValue("]")) {
03571:
03572: yyValue = new Action<Node>() {
03573: public Node run(Node v$1) {
03574: return GNode.create("ArrayDeclarator",
03575: v$1, v$g$4, v$g$6);
03576: }
03577: };
03578:
03579: return yyResult.createValue(yyValue, yyError);
03580: } else {
03581: yyError = yyError.select("\"]\" expected",
03582: yyBase);
03583: }
03584: }
03585: }
03586: }
03587:
03588: // Done.
03589: yyError = yyError.select("direct declarator expected", yyStart);
03590: return yyError;
03591: }
03592:
03593: // =========================================================================
03594:
03595: /**
03596: * Parse nonterminal xtc.lang.CPattern.VariableLength.
03597: *
03598: * @param yyStart The index.
03599: * @return The result.
03600: * @throws IOException Signals an I/O error.
03601: */
03602: private Result pVariableLength(final int yyStart)
03603: throws IOException {
03604: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
03605: if (null == yyColumn.chunk1)
03606: yyColumn.chunk1 = new Chunk1();
03607: if (null == yyColumn.chunk1.fVariableLength)
03608: yyColumn.chunk1.fVariableLength = pVariableLength$1(yyStart);
03609: return yyColumn.chunk1.fVariableLength;
03610: }
03611:
03612: /** Actually parse xtc.lang.CPattern.VariableLength. */
03613: private Result pVariableLength$1(final int yyStart)
03614: throws IOException {
03615: Result yyResult;
03616: Node yyValue;
03617: ParseError yyError = ParseError.DUMMY;
03618:
03619: // Alternative 1.
03620:
03621: yyResult = pSymbol(yyStart);
03622: yyError = yyResult.select(yyError);
03623: if (yyResult.hasValue("*")) {
03624:
03625: yyValue = GNode.create("VariableLength", false);
03626: yyValue.setLocation(location(yyStart));
03627:
03628: return yyResult.createValue(yyValue, yyError);
03629: }
03630:
03631: // Done.
03632: yyError = yyError.select("variable length expected", yyStart);
03633: return yyError;
03634: }
03635:
03636: // =========================================================================
03637:
03638: /**
03639: * Parse nonterminal xtc.lang.CPattern.SimpleDeclarator.
03640: *
03641: * @param yyStart The index.
03642: * @return The result.
03643: * @throws IOException Signals an I/O error.
03644: */
03645: private Result pSimpleDeclarator(final int yyStart)
03646: throws IOException {
03647: Result yyResult;
03648: Node yyValue;
03649: ParseError yyError = ParseError.DUMMY;
03650:
03651: // Alternative <PatternVariable>.
03652:
03653: yyResult = pStringVariable(yyStart);
03654: yyError = yyResult.select(yyError);
03655: if (yyResult.hasValue()) {
03656: final Node v$g$1 = yyResult.semanticValue();
03657:
03658: yyValue = GNode.create("SimpleDeclarator", v$g$1);
03659: yyValue.setLocation(location(yyStart));
03660:
03661: return yyResult.createValue(yyValue, yyError);
03662: }
03663:
03664: // Alternative <Declarator>.
03665:
03666: yyResult = pCIdentifier$Identifier(yyStart);
03667: yyError = yyResult.select(yyError);
03668: if (yyResult.hasValue()) {
03669: final String id = yyResult.semanticValue();
03670:
03671: yyState.bind(toText(id));
03672:
03673: yyValue = GNode.create("SimpleDeclarator", id);
03674: yyValue.setLocation(location(yyStart));
03675:
03676: return yyResult.createValue(yyValue, yyError);
03677: }
03678:
03679: // Done.
03680: return yyError;
03681: }
03682:
03683: // =========================================================================
03684:
03685: /**
03686: * Parse nonterminal xtc.lang.CPattern.ParameterTypeList.
03687: *
03688: * @param yyStart The index.
03689: * @return The result.
03690: * @throws IOException Signals an I/O error.
03691: */
03692: private Result pParameterTypeList(final int yyStart)
03693: throws IOException {
03694: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
03695: if (null == yyColumn.chunk1)
03696: yyColumn.chunk1 = new Chunk1();
03697: if (null == yyColumn.chunk1.fParameterTypeList)
03698: yyColumn.chunk1.fParameterTypeList = pParameterTypeList$1(yyStart);
03699: return yyColumn.chunk1.fParameterTypeList;
03700: }
03701:
03702: /** Actually parse xtc.lang.CPattern.ParameterTypeList. */
03703: private Result pParameterTypeList$1(final int yyStart)
03704: throws IOException {
03705: Result yyResult;
03706: int yyBase;
03707: int yyOption1;
03708: String yyOpValue1;
03709: Node yyValue;
03710: ParseError yyError = ParseError.DUMMY;
03711:
03712: // Alternative 1.
03713:
03714: yyResult = pParameterList(yyStart);
03715: yyError = yyResult.select(yyError);
03716: if (yyResult.hasValue()) {
03717: final Node v$g$1 = yyResult.semanticValue();
03718:
03719: yyOption1 = yyResult.index;
03720: yyOpValue1 = null;
03721:
03722: yyBase = yyOption1;
03723: yyResult = pSymbol(yyBase);
03724: yyError = yyResult.select(yyError);
03725: if (yyResult.hasValue(",")) {
03726:
03727: yyBase = yyResult.index;
03728: yyResult = pSymbol(yyBase);
03729: yyError = yyResult.select(yyError);
03730: if (yyResult.hasValue("...")) {
03731: final String v$el$1 = "...";
03732:
03733: yyOption1 = yyResult.index;
03734: yyOpValue1 = v$el$1;
03735: } else {
03736: yyError = yyError
03737: .select("\"...\" expected", yyBase);
03738: }
03739: } else {
03740: yyError = yyError.select("\",\" expected", yyBase);
03741: }
03742: { // Start scope for v$g$2.
03743: final String v$g$2 = yyOpValue1;
03744:
03745: yyValue = GNode.create("ParameterTypeList", v$g$1,
03746: v$g$2);
03747: yyValue.setLocation(location(yyStart));
03748:
03749: return new SemanticValue(yyValue, yyOption1, yyError);
03750: } // End scope for v$g$2.
03751: }
03752:
03753: // Done.
03754: return yyError;
03755: }
03756:
03757: // =========================================================================
03758:
03759: /**
03760: * Parse nonterminal xtc.lang.CPattern.ParameterList.
03761: *
03762: * @param yyStart The index.
03763: * @return The result.
03764: * @throws IOException Signals an I/O error.
03765: */
03766: private Result pParameterList(final int yyStart) throws IOException {
03767: Result yyResult;
03768: int yyBase;
03769: int yyRepetition1;
03770: Pair<Node> yyRepValue1;
03771: Node yyValue;
03772: ParseError yyError = ParseError.DUMMY;
03773:
03774: // Alternative 1.
03775:
03776: yyResult = pParameterDeclaration(yyStart);
03777: yyError = yyResult.select(yyError);
03778: if (yyResult.hasValue()) {
03779: final Node v$g$1 = yyResult.semanticValue();
03780:
03781: yyRepetition1 = yyResult.index;
03782: yyRepValue1 = Pair.empty();
03783: while (true) {
03784:
03785: yyBase = yyRepetition1;
03786: yyResult = pSymbol(yyBase);
03787: yyError = yyResult.select(yyError);
03788: if (yyResult.hasValue(",")) {
03789:
03790: yyResult = pParameterDeclaration(yyResult.index);
03791: yyError = yyResult.select(yyError);
03792: if (yyResult.hasValue()) {
03793: final Node v$el$1 = yyResult.semanticValue();
03794:
03795: yyRepetition1 = yyResult.index;
03796: yyRepValue1 = new Pair<Node>(v$el$1,
03797: yyRepValue1);
03798: continue;
03799: }
03800: } else {
03801: yyError = yyError.select("\",\" expected", yyBase);
03802: }
03803: break;
03804: }
03805: { // Start scope for v$g$2.
03806: final Pair<Node> v$g$2 = yyRepValue1.reverse();
03807:
03808: yyValue = GNode.createFromPair("ParameterList", v$g$1,
03809: v$g$2);
03810: yyValue.setLocation(location(yyStart));
03811:
03812: return new SemanticValue(yyValue, yyRepetition1,
03813: yyError);
03814: } // End scope for v$g$2.
03815: }
03816:
03817: // Done.
03818: return yyError;
03819: }
03820:
03821: // =========================================================================
03822:
03823: /**
03824: * Parse nonterminal xtc.lang.CPattern.ParameterDeclaration.
03825: *
03826: * @param yyStart The index.
03827: * @return The result.
03828: * @throws IOException Signals an I/O error.
03829: */
03830: private Result pParameterDeclaration(final int yyStart)
03831: throws IOException {
03832: Result yyResult;
03833: int yyOption1;
03834: Node yyOpValue1;
03835: Node yyValue;
03836: ParseError yyError = ParseError.DUMMY;
03837:
03838: // Start a state modification.
03839: yyState.start();
03840:
03841: // Alternative 1.
03842:
03843: yyResult = pDeclarationSpecifiers(yyStart);
03844: yyError = yyResult.select(yyError);
03845: if (yyResult.hasValue()) {
03846: final Node v$g$1 = yyResult.semanticValue();
03847:
03848: final int yyChoice1 = yyResult.index;
03849:
03850: // Nested alternative 1.
03851:
03852: yyResult = pDeclarator(yyChoice1);
03853: yyError = yyResult.select(yyError);
03854: if (yyResult.hasValue()) {
03855: final Node v$g$2 = yyResult.semanticValue();
03856:
03857: yyOption1 = yyResult.index;
03858: yyOpValue1 = null;
03859:
03860: yyResult = pAttributeSpecifierList(yyOption1);
03861: yyError = yyResult.select(yyError);
03862: if (yyResult.hasValue()) {
03863: final Node v$el$1 = yyResult.semanticValue();
03864:
03865: yyOption1 = yyResult.index;
03866: yyOpValue1 = v$el$1;
03867: }
03868: { // Start scope for v$g$3.
03869: final Node v$g$3 = yyOpValue1;
03870:
03871: yyValue = GNode.create("ParameterDeclaration",
03872: v$g$1, v$g$2, v$g$3);
03873: yyValue.setLocation(location(yyStart));
03874:
03875: // Commit the state modification.
03876: yyState.commit();
03877:
03878: return new SemanticValue(yyValue, yyOption1,
03879: yyError);
03880: } // End scope for v$g$3.
03881: }
03882:
03883: // Nested alternative 2.
03884:
03885: yyOption1 = yyChoice1;
03886: yyOpValue1 = null;
03887:
03888: yyResult = pAbstractDeclarator(yyOption1);
03889: yyError = yyResult.select(yyError);
03890: if (yyResult.hasValue()) {
03891: final Node v$el$2 = yyResult.semanticValue();
03892:
03893: yyOption1 = yyResult.index;
03894: yyOpValue1 = v$el$2;
03895: }
03896: { // Start scope for v$g$4.
03897: final Node v$g$4 = yyOpValue1;
03898:
03899: yyOpValue1 = null;
03900:
03901: yyResult = pAttributeSpecifierList(yyOption1);
03902: yyError = yyResult.select(yyError);
03903: if (yyResult.hasValue()) {
03904: final Node v$el$3 = yyResult.semanticValue();
03905:
03906: yyOption1 = yyResult.index;
03907: yyOpValue1 = v$el$3;
03908: }
03909: { // Start scope for v$g$5.
03910: final Node v$g$5 = yyOpValue1;
03911:
03912: yyValue = GNode.create("ParameterDeclaration",
03913: v$g$1, v$g$4, v$g$5);
03914: yyValue.setLocation(location(yyStart));
03915:
03916: // Commit the state modification.
03917: yyState.commit();
03918:
03919: return new SemanticValue(yyValue, yyOption1,
03920: yyError);
03921: } // End scope for v$g$5.
03922: } // End scope for v$g$4.
03923: }
03924:
03925: // Abort the state modification.
03926: yyState.abort();
03927:
03928: // Done.
03929: return yyError;
03930: }
03931:
03932: // =========================================================================
03933:
03934: /**
03935: * Parse nonterminal xtc.lang.CPattern.AttributedAbstractDeclarator.
03936: *
03937: * @param yyStart The index.
03938: * @return The result.
03939: * @throws IOException Signals an I/O error.
03940: */
03941: private Result pAttributedAbstractDeclarator(final int yyStart)
03942: throws IOException {
03943:
03944: Result yyResult;
03945: int yyOption1;
03946: Node yyOpValue1;
03947: Node yyValue;
03948: ParseError yyError = ParseError.DUMMY;
03949:
03950: // Alternative 1.
03951:
03952: yyOption1 = yyStart;
03953: yyOpValue1 = null;
03954:
03955: yyResult = pAttributeSpecifierList(yyOption1);
03956: yyError = yyResult.select(yyError);
03957: if (yyResult.hasValue()) {
03958: final Node v$el$1 = yyResult.semanticValue();
03959:
03960: yyOption1 = yyResult.index;
03961: yyOpValue1 = v$el$1;
03962: }
03963: { // Start scope for v$g$1.
03964: final Node v$g$1 = yyOpValue1;
03965:
03966: yyResult = pAbstractDeclarator(yyOption1);
03967: yyError = yyResult.select(yyError);
03968: if (yyResult.hasValue()) {
03969: final Node v$g$2 = yyResult.semanticValue();
03970:
03971: yyValue = GNode.create("AttributedAbstractDeclarator",
03972: v$g$1, v$g$2);
03973: yyValue.setLocation(location(yyStart));
03974:
03975: return yyResult.createValue(yyValue, yyError);
03976: }
03977: } // End scope for v$g$1.
03978:
03979: // Done.
03980: return yyError;
03981: }
03982:
03983: // =========================================================================
03984:
03985: /**
03986: * Parse nonterminal xtc.lang.CPattern.AbstractDeclarator.
03987: *
03988: * @param yyStart The index.
03989: * @return The result.
03990: * @throws IOException Signals an I/O error.
03991: */
03992: private Result pAbstractDeclarator(final int yyStart)
03993: throws IOException {
03994: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
03995: if (null == yyColumn.chunk1)
03996: yyColumn.chunk1 = new Chunk1();
03997: if (null == yyColumn.chunk1.fAbstractDeclarator)
03998: yyColumn.chunk1.fAbstractDeclarator = pAbstractDeclarator$1(yyStart);
03999: return yyColumn.chunk1.fAbstractDeclarator;
04000: }
04001:
04002: /** Actually parse xtc.lang.CPattern.AbstractDeclarator. */
04003: private Result pAbstractDeclarator$1(final int yyStart)
04004: throws IOException {
04005: Result yyResult;
04006: int yyOption1;
04007: Node yyOpValue1;
04008: Node yyValue;
04009: ParseError yyError = ParseError.DUMMY;
04010:
04011: // Alternative 1.
04012:
04013: yyOption1 = yyStart;
04014: yyOpValue1 = null;
04015:
04016: yyResult = pPointer(yyOption1);
04017: yyError = yyResult.select(yyError);
04018: if (yyResult.hasValue()) {
04019: final Node v$el$1 = yyResult.semanticValue();
04020:
04021: yyOption1 = yyResult.index;
04022: yyOpValue1 = v$el$1;
04023: }
04024: { // Start scope for p.
04025: final Node p = yyOpValue1;
04026:
04027: yyResult = pDirectAbstractDeclarator(yyOption1);
04028: yyError = yyResult.select(yyError);
04029: if (yyResult.hasValue()) {
04030: final Node d = yyResult.semanticValue();
04031:
04032: if ((null != p) || (null != d)) {
04033:
04034: yyValue = GNode.create("AbstractDeclarator", p, d);
04035: yyValue.setLocation(location(yyStart));
04036:
04037: return yyResult.createValue(yyValue, yyError);
04038: }
04039: }
04040: } // End scope for p.
04041:
04042: // Done.
04043: yyError = yyError.select("abstract declarator expected",
04044: yyStart);
04045: return yyError;
04046: }
04047:
04048: // =========================================================================
04049:
04050: /**
04051: * Parse nonterminal xtc.lang.CPattern.DirectAbstractDeclarator.
04052: *
04053: * @param yyStart The index.
04054: * @return The result.
04055: * @throws IOException Signals an I/O error.
04056: */
04057: private Result pDirectAbstractDeclarator(final int yyStart)
04058: throws IOException {
04059:
04060: Result yyResult;
04061: int yyBase;
04062: int yyRepetition1;
04063: Pair<Action<Node>> yyRepValue1;
04064: Node yyValue;
04065: ParseError yyError = ParseError.DUMMY;
04066:
04067: // Alternative <Parenthesized>.
04068:
04069: yyResult = pSymbol(yyStart);
04070: yyError = yyResult.select(yyError);
04071: if (yyResult.hasValue("(")) {
04072:
04073: yyResult = pAttributedAbstractDeclarator(yyResult.index);
04074: yyError = yyResult.select(yyError);
04075: if (yyResult.hasValue()) {
04076: final Node v$g$7 = yyResult.semanticValue();
04077:
04078: yyBase = yyResult.index;
04079: yyResult = pSymbol(yyBase);
04080: yyError = yyResult.select(yyError);
04081: if (yyResult.hasValue(")")) {
04082:
04083: yyRepetition1 = yyResult.index;
04084: yyRepValue1 = Pair.empty();
04085: while (true) {
04086:
04087: yyResult = pDirectAbstractDeclarator$$Tail1(yyRepetition1);
04088: yyError = yyResult.select(yyError);
04089: if (yyResult.hasValue()) {
04090: final Action<Node> v$8 = yyResult
04091: .semanticValue();
04092:
04093: yyRepetition1 = yyResult.index;
04094: yyRepValue1 = new Pair<Action<Node>>(v$8,
04095: yyRepValue1);
04096: continue;
04097: }
04098: break;
04099: }
04100: { // Start scope for v$9.
04101: final Pair<Action<Node>> v$9 = yyRepValue1
04102: .reverse();
04103:
04104: yyValue = apply(v$9, v$g$7, yyStart);
04105:
04106: return new SemanticValue(yyValue,
04107: yyRepetition1, yyError);
04108: } // End scope for v$9.
04109: } else {
04110: yyError = yyError.select("\")\" expected", yyBase);
04111: }
04112: }
04113: }
04114:
04115: // Alternative <Empty>.
04116:
04117: yyRepetition1 = yyStart;
04118: yyRepValue1 = Pair.empty();
04119: while (true) {
04120:
04121: yyResult = pDirectAbstractDeclarator$$Tail1(yyRepetition1);
04122: yyError = yyResult.select(yyError);
04123: if (yyResult.hasValue()) {
04124: final Action<Node> v$11 = yyResult.semanticValue();
04125:
04126: yyRepetition1 = yyResult.index;
04127: yyRepValue1 = new Pair<Action<Node>>(v$11, yyRepValue1);
04128: continue;
04129: }
04130: break;
04131: }
04132: { // Start scope for v$12.
04133: final Pair<Action<Node>> v$12 = yyRepValue1.reverse();
04134:
04135: yyValue = apply(v$12, null, yyStart);
04136:
04137: return new SemanticValue(yyValue, yyRepetition1, yyError);
04138: } // End scope for v$12.
04139: }
04140:
04141: // =========================================================================
04142:
04143: /**
04144: * Parse synthetic nonterminal
04145: * xtc.lang.CFactory.DirectAbstractDeclarator$$Tail1.
04146: *
04147: * @param yyStart The index.
04148: * @return The result.
04149: * @throws IOException Signals an I/O error.
04150: */
04151: private Result pDirectAbstractDeclarator$$Tail1(final int yyStart)
04152: throws IOException {
04153:
04154: Result yyResult;
04155: int yyBase;
04156: int yyOption1;
04157: Node yyOpValue1;
04158: Action<Node> yyValue;
04159: ParseError yyError = ParseError.DUMMY;
04160:
04161: // Alternative 1.
04162:
04163: yyResult = pSymbol(yyStart);
04164: yyError = yyResult.select(yyError);
04165: if (yyResult.hasValue("[")) {
04166: final String v$g$2 = "[";
04167:
04168: final int yyChoice1 = yyResult.index;
04169:
04170: // Nested alternative 1.
04171:
04172: yyOption1 = yyChoice1;
04173: yyOpValue1 = null;
04174:
04175: yyResult = pAssignmentExpression(yyOption1);
04176: yyError = yyResult.select(yyError);
04177: if (yyResult.hasValue()) {
04178: final Node v$el$1 = yyResult.semanticValue();
04179:
04180: yyOption1 = yyResult.index;
04181: yyOpValue1 = v$el$1;
04182: }
04183: { // Start scope for v$g$3.
04184: final Node v$g$3 = yyOpValue1;
04185:
04186: yyBase = yyOption1;
04187: yyResult = pSymbol(yyBase);
04188: yyError = yyResult.select(yyError);
04189: if (yyResult.hasValue("]")) {
04190:
04191: yyValue = new Action<Node>() {
04192: public Node run(Node v$1) {
04193: return GNode.create(
04194: "DirectAbstractDeclarator", v$1,
04195: v$g$2, v$g$3);
04196: }
04197: };
04198:
04199: return yyResult.createValue(yyValue, yyError);
04200: } else {
04201: yyError = yyError.select("\"]\" expected", yyBase);
04202: }
04203: } // End scope for v$g$3.
04204:
04205: // Nested alternative 2.
04206:
04207: yyResult = pVariableLength(yyChoice1);
04208: yyError = yyResult.select(yyError);
04209: if (yyResult.hasValue()) {
04210: final Node v$g$4 = yyResult.semanticValue();
04211:
04212: yyBase = yyResult.index;
04213: yyResult = pSymbol(yyBase);
04214: yyError = yyResult.select(yyError);
04215: if (yyResult.hasValue("]")) {
04216:
04217: yyValue = new Action<Node>() {
04218: public Node run(Node v$1) {
04219: return GNode.create(
04220: "DirectAbstractDeclarator", v$1,
04221: v$g$2, v$g$4);
04222: }
04223: };
04224:
04225: return yyResult.createValue(yyValue, yyError);
04226: } else {
04227: yyError = yyError.select("\"]\" expected", yyBase);
04228: }
04229: }
04230: }
04231:
04232: // Alternative 2.
04233:
04234: yyResult = pSymbol(yyStart);
04235: yyError = yyResult.select(yyError);
04236: if (yyResult.hasValue("(")) {
04237: final String v$g$5 = "(";
04238:
04239: yyOption1 = yyResult.index;
04240: yyOpValue1 = null;
04241:
04242: yyResult = pParameterTypeList(yyOption1);
04243: yyError = yyResult.select(yyError);
04244: if (yyResult.hasValue()) {
04245: final Node v$el$2 = yyResult.semanticValue();
04246:
04247: yyOption1 = yyResult.index;
04248: yyOpValue1 = v$el$2;
04249: }
04250: { // Start scope for v$g$6.
04251: final Node v$g$6 = yyOpValue1;
04252:
04253: yyBase = yyOption1;
04254: yyResult = pSymbol(yyBase);
04255: yyError = yyResult.select(yyError);
04256: if (yyResult.hasValue(")")) {
04257:
04258: yyValue = new Action<Node>() {
04259: public Node run(Node v$1) {
04260: return GNode.create(
04261: "DirectAbstractDeclarator", v$1,
04262: v$g$5, v$g$6);
04263: }
04264: };
04265:
04266: return yyResult.createValue(yyValue, yyError);
04267: } else {
04268: yyError = yyError.select("\")\" expected", yyBase);
04269: }
04270: } // End scope for v$g$6.
04271: }
04272:
04273: // Done.
04274: yyError = yyError.select("direct abstract declarator expected",
04275: yyStart);
04276: return yyError;
04277: }
04278:
04279: // =========================================================================
04280:
04281: /**
04282: * Parse nonterminal xtc.lang.CPattern.IdentifierList.
04283: *
04284: * @param yyStart The index.
04285: * @return The result.
04286: * @throws IOException Signals an I/O error.
04287: */
04288: private Result pIdentifierList(final int yyStart)
04289: throws IOException {
04290: Result yyResult;
04291: int yyBase;
04292: int yyRepetition1;
04293: Pair<String> yyRepValue1;
04294: Node yyValue;
04295: ParseError yyError = ParseError.DUMMY;
04296:
04297: // Alternative 1.
04298:
04299: yyResult = pCIdentifier$Identifier(yyStart);
04300: yyError = yyResult.select(yyError);
04301: if (yyResult.hasValue()) {
04302: final String id1 = yyResult.semanticValue();
04303:
04304: yyState.bind(toText(id1));
04305:
04306: yyRepetition1 = yyResult.index;
04307: yyRepValue1 = Pair.empty();
04308: while (true) {
04309:
04310: yyBase = yyRepetition1;
04311: yyResult = pSymbol(yyBase);
04312: yyError = yyResult.select(yyError);
04313: if (yyResult.hasValue(",")) {
04314:
04315: yyResult = pCIdentifier$Identifier(yyResult.index);
04316: yyError = yyResult.select(yyError);
04317: if (yyResult.hasValue()) {
04318: final String id2 = yyResult.semanticValue();
04319:
04320: yyState.bind(toText(id2));
04321:
04322: yyRepetition1 = yyResult.index;
04323: yyRepValue1 = new Pair<String>(id2, yyRepValue1);
04324: continue;
04325: }
04326: } else {
04327: yyError = yyError.select("\",\" expected", yyBase);
04328: }
04329: break;
04330: }
04331: { // Start scope for v$g$1.
04332: final Pair<String> v$g$1 = yyRepValue1.reverse();
04333:
04334: yyValue = GNode.createFromPair("IdentifierList", id1,
04335: v$g$1);
04336: yyValue.setLocation(location(yyStart));
04337:
04338: return new SemanticValue(yyValue, yyRepetition1,
04339: yyError);
04340: } // End scope for v$g$1.
04341: }
04342:
04343: // Done.
04344: return yyError;
04345: }
04346:
04347: // =========================================================================
04348:
04349: /**
04350: * Parse nonterminal xtc.lang.CPattern.ArrayQualifierList.
04351: *
04352: * @param yyStart The index.
04353: * @return The result.
04354: * @throws IOException Signals an I/O error.
04355: */
04356: private Result pArrayQualifierList(final int yyStart)
04357: throws IOException {
04358: Result yyResult;
04359: int yyRepetition1;
04360: Pair<Node> yyRepValue1;
04361: Node yyValue;
04362: ParseError yyError = ParseError.DUMMY;
04363:
04364: // Alternative 1.
04365:
04366: yyRepetition1 = yyStart;
04367: yyRepValue1 = Pair.empty();
04368: while (true) {
04369:
04370: yyResult = pArrayQualifierList$$Choice1(yyRepetition1);
04371: yyError = yyResult.select(yyError);
04372: if (yyResult.hasValue()) {
04373: final Node v$el$1 = yyResult.semanticValue();
04374:
04375: yyRepetition1 = yyResult.index;
04376: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
04377: continue;
04378: }
04379: break;
04380: }
04381: { // Start scope for v$g$1.
04382: final Pair<Node> v$g$1 = yyRepValue1.reverse();
04383:
04384: yyValue = GNode.createFromPair("ArrayQualifierList", v$g$1);
04385: yyValue.setLocation(location(yyStart));
04386:
04387: return new SemanticValue(yyValue, yyRepetition1, yyError);
04388: } // End scope for v$g$1.
04389: }
04390:
04391: // =========================================================================
04392:
04393: /**
04394: * Parse synthetic nonterminal
04395: * xtc.lang.CFactory.ArrayQualifierList$$Choice1.
04396: *
04397: * @param yyStart The index.
04398: * @return The result.
04399: * @throws IOException Signals an I/O error.
04400: */
04401: private Result pArrayQualifierList$$Choice1(final int yyStart)
04402: throws IOException {
04403:
04404: Result yyResult;
04405: Node yyValue;
04406: ParseError yyError = ParseError.DUMMY;
04407:
04408: // Alternative 1.
04409:
04410: yyResult = pKeyword(yyStart);
04411: yyError = yyResult.select(yyError);
04412: if (yyResult.hasValue("static")) {
04413:
04414: yyValue = GNode.create("StaticSpecifier", false);
04415: yyValue.setLocation(location(yyStart));
04416:
04417: return yyResult.createValue(yyValue, yyError);
04418: }
04419:
04420: // Alternative 2.
04421:
04422: yyResult = pKeyword(yyStart);
04423: yyError = yyResult.select(yyError);
04424: if (yyResult.hasValue("volatile")) {
04425: final String v$g$1 = "volatile";
04426:
04427: yyValue = GNode.create("VolatileQualifier", v$g$1);
04428: yyValue.setLocation(location(yyStart));
04429:
04430: return yyResult.createValue(yyValue, yyError);
04431: }
04432:
04433: // Alternative 3.
04434:
04435: yyResult = pKeyword(yyStart);
04436: yyError = yyResult.select(yyError);
04437: if (yyResult.hasValue("__volatile")) {
04438: final String v$g$2 = "__volatile";
04439:
04440: yyValue = GNode.create("VolatileQualifier", v$g$2);
04441: yyValue.setLocation(location(yyStart));
04442:
04443: return yyResult.createValue(yyValue, yyError);
04444: }
04445:
04446: // Alternative 4.
04447:
04448: yyResult = pKeyword(yyStart);
04449: yyError = yyResult.select(yyError);
04450: if (yyResult.hasValue("__volatile__")) {
04451: final String v$g$3 = "__volatile__";
04452:
04453: yyValue = GNode.create("VolatileQualifier", v$g$3);
04454: yyValue.setLocation(location(yyStart));
04455:
04456: return yyResult.createValue(yyValue, yyError);
04457: }
04458:
04459: // Alternative 5.
04460:
04461: yyResult = pKeyword(yyStart);
04462: yyError = yyResult.select(yyError);
04463: if (yyResult.hasValue("restrict")) {
04464: final String v$g$1 = "restrict";
04465:
04466: yyValue = GNode.create("RestrictQualifier", v$g$1);
04467: yyValue.setLocation(location(yyStart));
04468:
04469: return yyResult.createValue(yyValue, yyError);
04470: }
04471:
04472: // Alternative 6.
04473:
04474: yyResult = pKeyword(yyStart);
04475: yyError = yyResult.select(yyError);
04476: if (yyResult.hasValue("__restrict")) {
04477: final String v$g$2 = "__restrict";
04478:
04479: yyValue = GNode.create("RestrictQualifier", v$g$2);
04480: yyValue.setLocation(location(yyStart));
04481:
04482: return yyResult.createValue(yyValue, yyError);
04483: }
04484:
04485: // Alternative 7.
04486:
04487: yyResult = pKeyword(yyStart);
04488: yyError = yyResult.select(yyError);
04489: if (yyResult.hasValue("__restrict__")) {
04490: final String v$g$3 = "__restrict__";
04491:
04492: yyValue = GNode.create("RestrictQualifier", v$g$3);
04493: yyValue.setLocation(location(yyStart));
04494:
04495: return yyResult.createValue(yyValue, yyError);
04496: }
04497:
04498: // Alternative 8.
04499:
04500: yyResult = pKeyword(yyStart);
04501: yyError = yyResult.select(yyError);
04502: if (yyResult.hasValue("const")) {
04503: final String v$g$1 = "const";
04504:
04505: yyValue = GNode.create("ConstantQualifier", v$g$1);
04506: yyValue.setLocation(location(yyStart));
04507:
04508: return yyResult.createValue(yyValue, yyError);
04509: }
04510:
04511: // Alternative 9.
04512:
04513: yyResult = pKeyword(yyStart);
04514: yyError = yyResult.select(yyError);
04515: if (yyResult.hasValue("__const")) {
04516: final String v$g$2 = "__const";
04517:
04518: yyValue = GNode.create("ConstantQualifier", v$g$2);
04519: yyValue.setLocation(location(yyStart));
04520:
04521: return yyResult.createValue(yyValue, yyError);
04522: }
04523:
04524: // Alternative 10.
04525:
04526: yyResult = pKeyword(yyStart);
04527: yyError = yyResult.select(yyError);
04528: if (yyResult.hasValue("__const__")) {
04529: final String v$g$3 = "__const__";
04530:
04531: yyValue = GNode.create("ConstantQualifier", v$g$3);
04532: yyValue.setLocation(location(yyStart));
04533:
04534: return yyResult.createValue(yyValue, yyError);
04535: }
04536:
04537: // Alternative 11.
04538:
04539: yyResult = pAttributeSpecifier(yyStart);
04540: yyError = yyResult.select(yyError);
04541: if (yyResult.hasValue()) {
04542: yyValue = yyResult.semanticValue();
04543:
04544: return yyResult.createValue(yyValue, yyError);
04545: }
04546:
04547: // Done.
04548: yyError = yyError.select("array qualifier list expected",
04549: yyStart);
04550: return yyError;
04551: }
04552:
04553: // =========================================================================
04554:
04555: /**
04556: * Parse nonterminal xtc.lang.CPattern.FloatingPointTypeSpecifier.
04557: *
04558: * @param yyStart The index.
04559: * @return The result.
04560: * @throws IOException Signals an I/O error.
04561: */
04562: private Result pFloatingPointTypeSpecifier(final int yyStart)
04563: throws IOException {
04564:
04565: Result yyResult;
04566: Node yyValue;
04567: ParseError yyError = ParseError.DUMMY;
04568:
04569: // Alternative 1.
04570:
04571: yyResult = pKeyword(yyStart);
04572: yyError = yyResult.select(yyError);
04573: if (yyResult.hasValue("_Complex")) {
04574: final String v$g$1 = "_Complex";
04575:
04576: yyValue = GNode.create("Complex", v$g$1);
04577: yyValue.setLocation(location(yyStart));
04578:
04579: return yyResult.createValue(yyValue, yyError);
04580: }
04581:
04582: // Alternative 2.
04583:
04584: yyResult = pKeyword(yyStart);
04585: yyError = yyResult.select(yyError);
04586: if (yyResult.hasValue("__complex__")) {
04587: final String v$g$2 = "__complex__";
04588:
04589: yyValue = GNode.create("Complex", v$g$2);
04590: yyValue.setLocation(location(yyStart));
04591:
04592: return yyResult.createValue(yyValue, yyError);
04593: }
04594:
04595: // Alternative 3.
04596:
04597: yyResult = pKeyword(yyStart);
04598: yyError = yyResult.select(yyError);
04599: if (yyResult.hasValue("double")) {
04600:
04601: yyValue = GNode.create("Double", false);
04602: yyValue.setLocation(location(yyStart));
04603:
04604: return yyResult.createValue(yyValue, yyError);
04605: }
04606:
04607: // Alternative 4.
04608:
04609: yyResult = pKeyword(yyStart);
04610: yyError = yyResult.select(yyError);
04611: if (yyResult.hasValue("float")) {
04612:
04613: yyValue = GNode.create("Float", false);
04614: yyValue.setLocation(location(yyStart));
04615:
04616: return yyResult.createValue(yyValue, yyError);
04617: }
04618:
04619: // Done.
04620: yyError = yyError.select(
04621: "floating point type specifier expected", yyStart);
04622: return yyError;
04623: }
04624:
04625: // =========================================================================
04626:
04627: /**
04628: * Parse nonterminal xtc.lang.CPattern.IntegerTypeSpecifier.
04629: *
04630: * @param yyStart The index.
04631: * @return The result.
04632: * @throws IOException Signals an I/O error.
04633: */
04634: private Result pIntegerTypeSpecifier(final int yyStart)
04635: throws IOException {
04636: Result yyResult;
04637: Node yyValue;
04638: ParseError yyError = ParseError.DUMMY;
04639:
04640: // Alternative 1.
04641:
04642: yyResult = pKeyword(yyStart);
04643: yyError = yyResult.select(yyError);
04644: if (yyResult.hasValue("long")) {
04645:
04646: yyValue = GNode.create("Long", false);
04647: yyValue.setLocation(location(yyStart));
04648:
04649: return yyResult.createValue(yyValue, yyError);
04650: }
04651:
04652: // Alternative 2.
04653:
04654: yyResult = pKeyword(yyStart);
04655: yyError = yyResult.select(yyError);
04656: if (yyResult.hasValue("int")) {
04657:
04658: yyValue = GNode.create("Int", false);
04659: yyValue.setLocation(location(yyStart));
04660:
04661: return yyResult.createValue(yyValue, yyError);
04662: }
04663:
04664: // Alternative 3.
04665:
04666: yyResult = pKeyword(yyStart);
04667: yyError = yyResult.select(yyError);
04668: if (yyResult.hasValue("short")) {
04669:
04670: yyValue = GNode.create("Short", false);
04671: yyValue.setLocation(location(yyStart));
04672:
04673: return yyResult.createValue(yyValue, yyError);
04674: }
04675:
04676: // Alternative 4.
04677:
04678: yyResult = pKeyword(yyStart);
04679: yyError = yyResult.select(yyError);
04680: if (yyResult.hasValue("char")) {
04681:
04682: yyValue = GNode.create("Char", false);
04683: yyValue.setLocation(location(yyStart));
04684:
04685: return yyResult.createValue(yyValue, yyError);
04686: }
04687:
04688: // Alternative 5.
04689:
04690: yyResult = pKeyword(yyStart);
04691: yyError = yyResult.select(yyError);
04692: if (yyResult.hasValue("_Bool")) {
04693:
04694: yyValue = GNode.create("Bool", false);
04695: yyValue.setLocation(location(yyStart));
04696:
04697: return yyResult.createValue(yyValue, yyError);
04698: }
04699:
04700: // Alternative 6.
04701:
04702: yyResult = pKeyword(yyStart);
04703: yyError = yyResult.select(yyError);
04704: if (yyResult.hasValue("unsigned")) {
04705:
04706: yyValue = GNode.create("Unsigned", false);
04707: yyValue.setLocation(location(yyStart));
04708:
04709: return yyResult.createValue(yyValue, yyError);
04710: }
04711:
04712: // Alternative 7.
04713:
04714: yyResult = pKeyword(yyStart);
04715: yyError = yyResult.select(yyError);
04716: if (yyResult.hasValue("signed")) {
04717: final String v$g$1 = "signed";
04718:
04719: yyValue = GNode.create("Signed", v$g$1);
04720: yyValue.setLocation(location(yyStart));
04721:
04722: return yyResult.createValue(yyValue, yyError);
04723: }
04724:
04725: // Alternative 8.
04726:
04727: yyResult = pKeyword(yyStart);
04728: yyError = yyResult.select(yyError);
04729: if (yyResult.hasValue("__signed")) {
04730: final String v$g$2 = "__signed";
04731:
04732: yyValue = GNode.create("Signed", v$g$2);
04733: yyValue.setLocation(location(yyStart));
04734:
04735: return yyResult.createValue(yyValue, yyError);
04736: }
04737:
04738: // Alternative 9.
04739:
04740: yyResult = pKeyword(yyStart);
04741: yyError = yyResult.select(yyError);
04742: if (yyResult.hasValue("__signed__")) {
04743: final String v$g$3 = "__signed__";
04744:
04745: yyValue = GNode.create("Signed", v$g$3);
04746: yyValue.setLocation(location(yyStart));
04747:
04748: return yyResult.createValue(yyValue, yyError);
04749: }
04750:
04751: // Done.
04752: yyError = yyError.select("integer type specifier expected",
04753: yyStart);
04754: return yyError;
04755: }
04756:
04757: // =========================================================================
04758:
04759: /**
04760: * Parse nonterminal xtc.lang.CPattern.TypeofKeyword.
04761: *
04762: * @param yyStart The index.
04763: * @return The result.
04764: * @throws IOException Signals an I/O error.
04765: */
04766: private Result pTypeofKeyword(final int yyStart) throws IOException {
04767: Result yyResult;
04768: Void yyValue;
04769: ParseError yyError = ParseError.DUMMY;
04770:
04771: // Alternative 1.
04772:
04773: yyResult = pKeyword(yyStart);
04774: yyError = yyResult.select(yyError);
04775: if (yyResult.hasValue("typeof")) {
04776:
04777: yyValue = null;
04778:
04779: return yyResult.createValue(yyValue, yyError);
04780: }
04781:
04782: // Alternative 2.
04783:
04784: yyResult = pKeyword(yyStart);
04785: yyError = yyResult.select(yyError);
04786: if (yyResult.hasValue("__typeof")) {
04787:
04788: yyValue = null;
04789:
04790: return yyResult.createValue(yyValue, yyError);
04791: }
04792:
04793: // Alternative 3.
04794:
04795: yyResult = pKeyword(yyStart);
04796: yyError = yyResult.select(yyError);
04797: if (yyResult.hasValue("__typeof__")) {
04798:
04799: yyValue = null;
04800:
04801: return yyResult.createValue(yyValue, yyError);
04802: }
04803:
04804: // Done.
04805: yyError = yyError.select("typeof keyword expected", yyStart);
04806: return yyError;
04807: }
04808:
04809: // =========================================================================
04810:
04811: /**
04812: * Parse nonterminal xtc.lang.CPattern.Initializer.
04813: *
04814: * @param yyStart The index.
04815: * @return The result.
04816: * @throws IOException Signals an I/O error.
04817: */
04818: private Result pInitializer(final int yyStart) throws IOException {
04819: Result yyResult;
04820: int yyBase;
04821: int yyOption1;
04822: Node yyValue;
04823: ParseError yyError = ParseError.DUMMY;
04824:
04825: // Alternative <Complex>.
04826:
04827: yyResult = pSymbol(yyStart);
04828: yyError = yyResult.select(yyError);
04829: if (yyResult.hasValue("{")) {
04830:
04831: yyResult = pInitializerList(yyResult.index);
04832: yyError = yyResult.select(yyError);
04833: if (yyResult.hasValue()) {
04834: yyValue = yyResult.semanticValue();
04835:
04836: yyOption1 = yyResult.index;
04837:
04838: yyBase = yyOption1;
04839: yyResult = pSymbol(yyBase);
04840: yyError = yyResult.select(yyError);
04841: if (yyResult.hasValue(",")) {
04842:
04843: yyOption1 = yyResult.index;
04844: } else {
04845: yyError = yyError.select("\",\" expected", yyBase);
04846: }
04847:
04848: yyBase = yyOption1;
04849: yyResult = pSymbol(yyBase);
04850: yyError = yyResult.select(yyError);
04851: if (yyResult.hasValue("}")) {
04852:
04853: return yyResult.createValue(yyValue, yyError);
04854: } else {
04855: yyError = yyError.select("\"}\" expected", yyBase);
04856: }
04857: }
04858: }
04859:
04860: // Alternative <Simple>.
04861:
04862: yyResult = pAssignmentExpression(yyStart);
04863: yyError = yyResult.select(yyError);
04864: if (yyResult.hasValue()) {
04865: yyValue = yyResult.semanticValue();
04866:
04867: return yyResult.createValue(yyValue, yyError);
04868: }
04869:
04870: // Done.
04871: yyError = yyError.select("initializer expected", yyStart);
04872: return yyError;
04873: }
04874:
04875: // =========================================================================
04876:
04877: /**
04878: * Parse nonterminal xtc.lang.CPattern.InitializerList.
04879: *
04880: * @param yyStart The index.
04881: * @return The result.
04882: * @throws IOException Signals an I/O error.
04883: */
04884: private Result pInitializerList(final int yyStart)
04885: throws IOException {
04886: Result yyResult;
04887: int yyBase;
04888: int yyRepetition1;
04889: Pair<Node> yyRepValue1;
04890: Node yyValue;
04891: ParseError yyError = ParseError.DUMMY;
04892:
04893: // Alternative 1.
04894:
04895: yyResult = pInitializerListEntry(yyStart);
04896: yyError = yyResult.select(yyError);
04897: if (yyResult.hasValue()) {
04898: final Node v$g$1 = yyResult.semanticValue();
04899:
04900: yyRepetition1 = yyResult.index;
04901: yyRepValue1 = Pair.empty();
04902: while (true) {
04903:
04904: yyBase = yyRepetition1;
04905: yyResult = pSymbol(yyBase);
04906: yyError = yyResult.select(yyError);
04907: if (yyResult.hasValue(",")) {
04908:
04909: yyResult = pInitializerListEntry(yyResult.index);
04910: yyError = yyResult.select(yyError);
04911: if (yyResult.hasValue()) {
04912: final Node v$el$1 = yyResult.semanticValue();
04913:
04914: yyRepetition1 = yyResult.index;
04915: yyRepValue1 = new Pair<Node>(v$el$1,
04916: yyRepValue1);
04917: continue;
04918: }
04919: } else {
04920: yyError = yyError.select("\",\" expected", yyBase);
04921: }
04922: break;
04923: }
04924: { // Start scope for v$g$2.
04925: final Pair<Node> v$g$2 = yyRepValue1.reverse();
04926:
04927: yyValue = GNode.createFromPair("InitializerList",
04928: v$g$1, v$g$2);
04929: yyValue.setLocation(location(yyStart));
04930:
04931: return new SemanticValue(yyValue, yyRepetition1,
04932: yyError);
04933: } // End scope for v$g$2.
04934: }
04935:
04936: // Alternative 2.
04937:
04938: if (GCC) {
04939:
04940: yyValue = GNode.create("InitializerList", false);
04941: yyValue.setLocation(location(yyStart));
04942:
04943: return new SemanticValue(yyValue, yyStart, yyError);
04944: }
04945:
04946: // Done.
04947: yyError = yyError.select("initializer list expected", yyStart);
04948: return yyError;
04949: }
04950:
04951: // =========================================================================
04952:
04953: /**
04954: * Parse nonterminal xtc.lang.CPattern.InitializerListEntry.
04955: *
04956: * @param yyStart The index.
04957: * @return The result.
04958: * @throws IOException Signals an I/O error.
04959: */
04960: private Result pInitializerListEntry(final int yyStart)
04961: throws IOException {
04962: Result yyResult;
04963: int yyOption1;
04964: Node yyOpValue1;
04965: Node yyValue;
04966: ParseError yyError = ParseError.DUMMY;
04967:
04968: // Alternative 1.
04969:
04970: yyOption1 = yyStart;
04971: yyOpValue1 = null;
04972:
04973: yyResult = pDesignation(yyOption1);
04974: yyError = yyResult.select(yyError);
04975: if (yyResult.hasValue()) {
04976: final Node v$el$1 = yyResult.semanticValue();
04977:
04978: yyOption1 = yyResult.index;
04979: yyOpValue1 = v$el$1;
04980: }
04981: { // Start scope for v$g$1.
04982: final Node v$g$1 = yyOpValue1;
04983:
04984: yyResult = pInitializer(yyOption1);
04985: yyError = yyResult.select(yyError);
04986: if (yyResult.hasValue()) {
04987: final Node v$g$2 = yyResult.semanticValue();
04988:
04989: yyValue = GNode.create("InitializerListEntry", v$g$1,
04990: v$g$2);
04991: yyValue.setLocation(location(yyStart));
04992:
04993: return yyResult.createValue(yyValue, yyError);
04994: }
04995: } // End scope for v$g$1.
04996:
04997: // Done.
04998: return yyError;
04999: }
05000:
05001: // =========================================================================
05002:
05003: /**
05004: * Parse nonterminal xtc.lang.CPattern.Designation.
05005: *
05006: * @param yyStart The index.
05007: * @return The result.
05008: * @throws IOException Signals an I/O error.
05009: */
05010: private Result pDesignation(final int yyStart) throws IOException {
05011: Result yyResult;
05012: int yyBase;
05013: int yyRepetition1;
05014: boolean yyRepeated1;
05015: Pair<Node> yyRepValue1;
05016: Node yyValue;
05017: ParseError yyError = ParseError.DUMMY;
05018:
05019: // Alternative <Standard>.
05020:
05021: yyRepetition1 = yyStart;
05022: yyRepeated1 = false;
05023: yyRepValue1 = Pair.empty();
05024: while (true) {
05025:
05026: yyResult = pDesignator(yyRepetition1);
05027: yyError = yyResult.select(yyError);
05028: if (yyResult.hasValue()) {
05029: final Node v$el$1 = yyResult.semanticValue();
05030:
05031: yyRepetition1 = yyResult.index;
05032: yyRepeated1 = true;
05033: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
05034: continue;
05035: }
05036: break;
05037: }
05038:
05039: if (yyRepeated1) {
05040: final Pair<Node> v$g$1 = yyRepValue1.reverse();
05041:
05042: yyBase = yyRepetition1;
05043: yyResult = pSymbol(yyBase);
05044: yyError = yyResult.select(yyError);
05045: if (yyResult.hasValue("=")) {
05046:
05047: yyValue = GNode.createFromPair("Designation", v$g$1);
05048: yyValue.setLocation(location(yyStart));
05049:
05050: return yyResult.createValue(yyValue, yyError);
05051: } else {
05052: yyError = yyError.select("\"=\" expected", yyBase);
05053: }
05054: }
05055:
05056: // Alternative 2.
05057:
05058: if (GCC) {
05059:
05060: final int yyChoice1 = yyStart;
05061:
05062: // Nested alternative 1.
05063:
05064: yyResult = pObsoleteArrayDesignation(yyChoice1);
05065: yyError = yyResult.select(yyError);
05066: if (yyResult.hasValue()) {
05067: yyValue = yyResult.semanticValue();
05068:
05069: return yyResult.createValue(yyValue, yyError);
05070: }
05071:
05072: // Nested alternative 2.
05073:
05074: yyResult = pObsoleteFieldDesignation(yyChoice1);
05075: yyError = yyResult.select(yyError);
05076: if (yyResult.hasValue()) {
05077: yyValue = yyResult.semanticValue();
05078:
05079: return yyResult.createValue(yyValue, yyError);
05080: }
05081: }
05082:
05083: // Done.
05084: yyError = yyError.select("designation expected", yyStart);
05085: return yyError;
05086: }
05087:
05088: // =========================================================================
05089:
05090: /**
05091: * Parse nonterminal xtc.lang.CPattern.Designator.
05092: *
05093: * @param yyStart The index.
05094: * @return The result.
05095: * @throws IOException Signals an I/O error.
05096: */
05097: private Result pDesignator(final int yyStart) throws IOException {
05098: Result yyResult;
05099: int yyBase;
05100: Node yyValue;
05101: ParseError yyError = ParseError.DUMMY;
05102:
05103: // Alternative <Array>.
05104:
05105: yyResult = pSymbol(yyStart);
05106: yyError = yyResult.select(yyError);
05107: if (yyResult.hasValue("[")) {
05108: final String v$g$1 = "[";
05109:
05110: yyResult = pConditionalExpression(yyResult.index);
05111: yyError = yyResult.select(yyError);
05112: if (yyResult.hasValue()) {
05113: final Node v$g$2 = yyResult.semanticValue();
05114:
05115: yyBase = yyResult.index;
05116: yyResult = pSymbol(yyBase);
05117: yyError = yyResult.select(yyError);
05118: if (yyResult.hasValue("]")) {
05119:
05120: yyValue = GNode.create("Designator", v$g$1, v$g$2);
05121: yyValue.setLocation(location(yyStart));
05122:
05123: return yyResult.createValue(yyValue, yyError);
05124: } else {
05125: yyError = yyError.select("\"]\" expected", yyBase);
05126: }
05127: }
05128: }
05129:
05130: // Alternative <ArrayRange>.
05131:
05132: if (GCC) {
05133:
05134: yyResult = pSymbol(yyStart);
05135: yyError = yyResult.select(yyError);
05136: if (yyResult.hasValue("[")) {
05137: final String v$g$3 = "[";
05138:
05139: yyResult = pConditionalExpression(yyResult.index);
05140: yyError = yyResult.select(yyError);
05141: if (yyResult.hasValue()) {
05142: final Node v$g$4 = yyResult.semanticValue();
05143:
05144: yyBase = yyResult.index;
05145: yyResult = pSymbol(yyBase);
05146: yyError = yyResult.select(yyError);
05147: if (yyResult.hasValue("...")) {
05148:
05149: yyResult = pConditionalExpression(yyResult.index);
05150: yyError = yyResult.select(yyError);
05151: if (yyResult.hasValue()) {
05152: final Node v$g$5 = yyResult.semanticValue();
05153:
05154: yyBase = yyResult.index;
05155: yyResult = pSymbol(yyBase);
05156: yyError = yyResult.select(yyError);
05157: if (yyResult.hasValue("]")) {
05158:
05159: yyValue = GNode.create("Designator",
05160: v$g$3, v$g$4, v$g$5);
05161: yyValue.setLocation(location(yyStart));
05162:
05163: return yyResult.createValue(yyValue,
05164: yyError);
05165: } else {
05166: yyError = yyError.select(
05167: "\"]\" expected", yyBase);
05168: }
05169: }
05170: } else {
05171: yyError = yyError.select("\"...\" expected",
05172: yyBase);
05173: }
05174: }
05175: }
05176: }
05177:
05178: // Alternative <Structure>.
05179:
05180: yyResult = pSymbol(yyStart);
05181: yyError = yyResult.select(yyError);
05182: if (yyResult.hasValue(".")) {
05183: final String v$g$6 = ".";
05184:
05185: yyResult = pPrimaryIdentifier(yyResult.index);
05186: yyError = yyResult.select(yyError);
05187: if (yyResult.hasValue()) {
05188: final Node v$g$7 = yyResult.semanticValue();
05189:
05190: yyValue = GNode.create("Designator", v$g$6, v$g$7);
05191: yyValue.setLocation(location(yyStart));
05192:
05193: return yyResult.createValue(yyValue, yyError);
05194: }
05195: }
05196:
05197: // Done.
05198: yyError = yyError.select("designator expected", yyStart);
05199: return yyError;
05200: }
05201:
05202: // =========================================================================
05203:
05204: /**
05205: * Parse nonterminal xtc.lang.CPattern.ObsoleteArrayDesignation.
05206: *
05207: * @param yyStart The index.
05208: * @return The result.
05209: * @throws IOException Signals an I/O error.
05210: */
05211: private Result pObsoleteArrayDesignation(final int yyStart)
05212: throws IOException {
05213:
05214: Result yyResult;
05215: int yyBase;
05216: Node yyValue;
05217: ParseError yyError = ParseError.DUMMY;
05218:
05219: // Alternative 1.
05220:
05221: yyResult = pSymbol(yyStart);
05222: yyError = yyResult.select(yyError);
05223: if (yyResult.hasValue("[")) {
05224: final String v$g$1 = "[";
05225:
05226: yyResult = pConditionalExpression(yyResult.index);
05227: yyError = yyResult.select(yyError);
05228: if (yyResult.hasValue()) {
05229: final Node v$g$2 = yyResult.semanticValue();
05230:
05231: final int yyChoice1 = yyResult.index;
05232:
05233: // Nested alternative 1.
05234:
05235: yyBase = yyChoice1;
05236: yyResult = pSymbol(yyBase);
05237: yyError = yyResult.select(yyError);
05238: if (yyResult.hasValue("]")) {
05239:
05240: yyValue = GNode.create("ObsoleteArrayDesignation",
05241: v$g$1, v$g$2);
05242: yyValue.setLocation(location(yyStart));
05243:
05244: return yyResult.createValue(yyValue, yyError);
05245: } else {
05246: yyError = yyError.select("\"]\" expected", yyBase);
05247: }
05248:
05249: // Nested alternative 2.
05250:
05251: yyBase = yyChoice1;
05252: yyResult = pSymbol(yyBase);
05253: yyError = yyResult.select(yyError);
05254: if (yyResult.hasValue("...")) {
05255:
05256: yyResult = pConditionalExpression(yyResult.index);
05257: yyError = yyResult.select(yyError);
05258: if (yyResult.hasValue()) {
05259: final Node v$g$3 = yyResult.semanticValue();
05260:
05261: yyBase = yyResult.index;
05262: yyResult = pSymbol(yyBase);
05263: yyError = yyResult.select(yyError);
05264: if (yyResult.hasValue("]")) {
05265:
05266: yyValue = GNode.create(
05267: "ObsoleteArrayDesignation", v$g$1,
05268: v$g$2, v$g$3);
05269: yyValue.setLocation(location(yyStart));
05270:
05271: return yyResult.createValue(yyValue,
05272: yyError);
05273: } else {
05274: yyError = yyError.select("\"]\" expected",
05275: yyBase);
05276: }
05277: }
05278: } else {
05279: yyError = yyError
05280: .select("\"...\" expected", yyBase);
05281: }
05282: }
05283: }
05284:
05285: // Done.
05286: yyError = yyError.select("obsolete array designation expected",
05287: yyStart);
05288: return yyError;
05289: }
05290:
05291: // =========================================================================
05292:
05293: /**
05294: * Parse nonterminal xtc.lang.CPattern.ObsoleteFieldDesignation.
05295: *
05296: * @param yyStart The index.
05297: * @return The result.
05298: * @throws IOException Signals an I/O error.
05299: */
05300: private Result pObsoleteFieldDesignation(final int yyStart)
05301: throws IOException {
05302:
05303: Result yyResult;
05304: int yyBase;
05305: Node yyValue;
05306: ParseError yyError = ParseError.DUMMY;
05307:
05308: // Alternative 1.
05309:
05310: yyResult = pCIdentifier$Identifier(yyStart);
05311: yyError = yyResult.select(yyError);
05312: if (yyResult.hasValue()) {
05313: final String v$g$1 = yyResult.semanticValue();
05314:
05315: yyBase = yyResult.index;
05316: yyResult = pSymbol(yyBase);
05317: yyError = yyResult.select(yyError);
05318: if (yyResult.hasValue(":")) {
05319:
05320: yyValue = GNode.create("ObsoleteFieldDesignation",
05321: v$g$1);
05322: yyValue.setLocation(location(yyStart));
05323:
05324: return yyResult.createValue(yyValue, yyError);
05325: } else {
05326: yyError = yyError.select("\":\" expected", yyBase);
05327: }
05328: }
05329:
05330: // Done.
05331: return yyError;
05332: }
05333:
05334: // =========================================================================
05335:
05336: /**
05337: * Parse nonterminal xtc.lang.CPattern.TypeName.
05338: *
05339: * @param yyStart The index.
05340: * @return The result.
05341: * @throws IOException Signals an I/O error.
05342: */
05343: private Result pTypeName(final int yyStart) throws IOException {
05344: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
05345: if (null == yyColumn.chunk1)
05346: yyColumn.chunk1 = new Chunk1();
05347: if (null == yyColumn.chunk1.fTypeName)
05348: yyColumn.chunk1.fTypeName = pTypeName$1(yyStart);
05349: return yyColumn.chunk1.fTypeName;
05350: }
05351:
05352: /** Actually parse xtc.lang.CPattern.TypeName. */
05353: private Result pTypeName$1(final int yyStart) throws IOException {
05354: Result yyResult;
05355: int yyOption1;
05356: Node yyOpValue1;
05357: Node yyValue;
05358: ParseError yyError = ParseError.DUMMY;
05359:
05360: // Start a state modification.
05361: yyState.start();
05362:
05363: // Alternative 1.
05364:
05365: yyResult = pSpecifierQualifierList(yyStart);
05366: yyError = yyResult.select(yyError);
05367: if (yyResult.hasValue()) {
05368: final Node v$g$1 = yyResult.semanticValue();
05369:
05370: yyOption1 = yyResult.index;
05371: yyOpValue1 = null;
05372:
05373: yyResult = pAbstractDeclarator(yyOption1);
05374: yyError = yyResult.select(yyError);
05375: if (yyResult.hasValue()) {
05376: final Node v$el$1 = yyResult.semanticValue();
05377:
05378: yyOption1 = yyResult.index;
05379: yyOpValue1 = v$el$1;
05380: }
05381: { // Start scope for v$g$2.
05382: final Node v$g$2 = yyOpValue1;
05383:
05384: yyValue = GNode.create("TypeName", v$g$1, v$g$2);
05385: yyValue.setLocation(location(yyStart));
05386:
05387: // Commit the state modification.
05388: yyState.commit();
05389:
05390: return new SemanticValue(yyValue, yyOption1, yyError);
05391: } // End scope for v$g$2.
05392: }
05393:
05394: // Abort the state modification.
05395: yyState.abort();
05396:
05397: // Done.
05398: return yyError;
05399: }
05400:
05401: // =========================================================================
05402:
05403: /**
05404: * Parse nonterminal xtc.lang.CPattern.AttributeSpecifierList.
05405: *
05406: * @param yyStart The index.
05407: * @return The result.
05408: * @throws IOException Signals an I/O error.
05409: */
05410: private Result pAttributeSpecifierList(final int yyStart)
05411: throws IOException {
05412:
05413: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
05414: if (null == yyColumn.chunk2)
05415: yyColumn.chunk2 = new Chunk2();
05416: if (null == yyColumn.chunk2.fAttributeSpecifierList)
05417: yyColumn.chunk2.fAttributeSpecifierList = pAttributeSpecifierList$1(yyStart);
05418: return yyColumn.chunk2.fAttributeSpecifierList;
05419: }
05420:
05421: /** Actually parse xtc.lang.CPattern.AttributeSpecifierList. */
05422: private Result pAttributeSpecifierList$1(final int yyStart)
05423: throws IOException {
05424:
05425: Result yyResult;
05426: Node yyValue;
05427: ParseError yyError = ParseError.DUMMY;
05428:
05429: // Alternative 1.
05430:
05431: yyResult = pAttributeSpecifierPlus(yyStart);
05432: yyError = yyResult.select(yyError);
05433: if (yyResult.hasValue()) {
05434: final Pair<Node> v$g$1 = yyResult.semanticValue();
05435:
05436: yyValue = GNode.createFromPair("AttributeSpecifierList",
05437: v$g$1);
05438: yyValue.setLocation(location(yyStart));
05439:
05440: return yyResult.createValue(yyValue, yyError);
05441: }
05442:
05443: // Done.
05444: return yyError;
05445: }
05446:
05447: // =========================================================================
05448:
05449: /**
05450: * Parse nonterminal xtc.lang.CPattern.AttributeSpecifierPlus.
05451: *
05452: * @param yyStart The index.
05453: * @return The result.
05454: * @throws IOException Signals an I/O error.
05455: */
05456: private Result pAttributeSpecifierPlus(final int yyStart)
05457: throws IOException {
05458:
05459: Result yyResult;
05460: int yyRepetition1;
05461: boolean yyRepeated1;
05462: Pair<Node> yyRepValue1;
05463: Pair<Node> yyValue;
05464: ParseError yyError = ParseError.DUMMY;
05465:
05466: // Alternative 1.
05467:
05468: yyRepetition1 = yyStart;
05469: yyRepeated1 = false;
05470: yyRepValue1 = Pair.empty();
05471: while (true) {
05472:
05473: yyResult = pAttributeSpecifier(yyRepetition1);
05474: yyError = yyResult.select(yyError);
05475: if (yyResult.hasValue()) {
05476: final Node v$el$1 = yyResult.semanticValue();
05477:
05478: yyRepetition1 = yyResult.index;
05479: yyRepeated1 = true;
05480: yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1);
05481: continue;
05482: }
05483: break;
05484: }
05485:
05486: if (yyRepeated1) {
05487: yyValue = yyRepValue1.reverse();
05488:
05489: return new SemanticValue(yyValue, yyRepetition1, yyError);
05490: }
05491:
05492: // Done.
05493: return yyError;
05494: }
05495:
05496: // =========================================================================
05497:
05498: /**
05499: * Parse nonterminal xtc.lang.CPattern.AttributeSpecifier.
05500: *
05501: * @param yyStart The index.
05502: * @return The result.
05503: * @throws IOException Signals an I/O error.
05504: */
05505: private Result pAttributeSpecifier(final int yyStart)
05506: throws IOException {
05507: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
05508: if (null == yyColumn.chunk2)
05509: yyColumn.chunk2 = new Chunk2();
05510: if (null == yyColumn.chunk2.fAttributeSpecifier)
05511: yyColumn.chunk2.fAttributeSpecifier = pAttributeSpecifier$1(yyStart);
05512: return yyColumn.chunk2.fAttributeSpecifier;
05513: }
05514:
05515: /** Actually parse xtc.lang.CPattern.AttributeSpecifier. */
05516: private Result pAttributeSpecifier$1(final int yyStart)
05517: throws IOException {
05518: Result yyResult;
05519: int yyBase;
05520: int yyOption1;
05521: Node yyOpValue1;
05522: Node yyValue;
05523: ParseError yyError = ParseError.DUMMY;
05524:
05525: // Alternative 1.
05526:
05527: yyResult = pAttributeKeyword(yyStart);
05528: yyError = yyResult.select(yyError);
05529: if (yyResult.hasValue()) {
05530:
05531: yyBase = yyResult.index;
05532: yyResult = pSymbol(yyBase);
05533: yyError = yyResult.select(yyError);
05534: if (yyResult.hasValue("(")) {
05535:
05536: yyBase = yyResult.index;
05537: yyResult = pSymbol(yyBase);
05538: yyError = yyResult.select(yyError);
05539: if (yyResult.hasValue("(")) {
05540:
05541: yyOption1 = yyResult.index;
05542: yyOpValue1 = null;
05543:
05544: yyResult = pAttributeList(yyOption1);
05545: yyError = yyResult.select(yyError);
05546: if (yyResult.hasValue()) {
05547: final Node v$el$1 = yyResult.semanticValue();
05548:
05549: yyOption1 = yyResult.index;
05550: yyOpValue1 = v$el$1;
05551: }
05552: { // Start scope for v$g$1.
05553: final Node v$g$1 = yyOpValue1;
05554:
05555: yyBase = yyOption1;
05556: yyResult = pSymbol(yyBase);
05557: yyError = yyResult.select(yyError);
05558: if (yyResult.hasValue(")")) {
05559:
05560: yyBase = yyResult.index;
05561: yyResult = pSymbol(yyBase);
05562: yyError = yyResult.select(yyError);
05563: if (yyResult.hasValue(")")) {
05564:
05565: yyValue = GNode.create(
05566: "AttributeSpecifier", v$g$1);
05567: yyValue.setLocation(location(yyStart));
05568:
05569: return yyResult.createValue(yyValue,
05570: yyError);
05571: } else {
05572: yyError = yyError.select(
05573: "\")\" expected", yyBase);
05574: }
05575: } else {
05576: yyError = yyError.select("\")\" expected",
05577: yyBase);
05578: }
05579: } // End scope for v$g$1.
05580: } else {
05581: yyError = yyError.select("\"(\" expected", yyBase);
05582: }
05583: } else {
05584: yyError = yyError.select("\"(\" expected", yyBase);
05585: }
05586: }
05587:
05588: // Done.
05589: return yyError;
05590: }
05591:
05592: // =========================================================================
05593:
05594: /**
05595: * Parse nonterminal xtc.lang.CPattern.AttributeKeyword.
05596: *
05597: * @param yyStart The index.
05598: * @return The result.
05599: * @throws IOException Signals an I/O error.
05600: */
05601: private Result pAttributeKeyword(final int yyStart)
05602: throws IOException {
05603: Result yyResult;
05604: Void yyValue;
05605: ParseError yyError = ParseError.DUMMY;
05606:
05607: // Alternative 1.
05608:
05609: yyResult = pKeyword(yyStart);
05610: yyError = yyResult.select(yyError);
05611: if (yyResult.hasValue("__attribute")) {
05612:
05613: yyValue = null;
05614:
05615: return yyResult.createValue(yyValue, yyError);
05616: }
05617:
05618: // Alternative 2.
05619:
05620: yyResult = pKeyword(yyStart);
05621: yyError = yyResult.select(yyError);
05622: if (yyResult.hasValue("__attribute__")) {
05623:
05624: yyValue = null;
05625:
05626: return yyResult.createValue(yyValue, yyError);
05627: }
05628:
05629: // Done.
05630: yyError = yyError.select("attribute keyword expected", yyStart);
05631: return yyError;
05632: }
05633:
05634: // =========================================================================
05635:
05636: /**
05637: * Parse nonterminal xtc.lang.CPattern.AttributeList.
05638: *
05639: * @param yyStart The index.
05640: * @return The result.
05641: * @throws IOException Signals an I/O error.
05642: */
05643: private Result pAttributeList(final int yyStart) throws IOException {
05644: Result yyResult;
05645: int yyBase;
05646: int yyRepetition1;
05647: Pair<Node> yyRepValue1;
05648: Node yyValue;
05649: ParseError yyError = ParseError.DUMMY;
05650:
05651: // Alternative 1.
05652:
05653: yyResult = pAttributeListEntry(yyStart);
05654: yyError = yyResult.select(yyError);
05655: if (yyResult.hasValue()) {
05656: final Node v$g$1 = yyResult.semanticValue();
05657:
05658: yyRepetition1 = yyResult.index;
05659: yyRepValue1 = Pair.empty();
05660: while (true) {
05661:
05662: yyBase = yyRepetition1;
05663: yyResult = pSymbol(yyBase);
05664: yyError = yyResult.select(yyError);
05665: if (yyResult.hasValue(",")) {
05666:
05667: yyResult = pAttributeListEntry(yyResult.index);
05668: yyError = yyResult.select(yyError);
05669: if (yyResult.hasValue()) {
05670: final Node v$el$1 = yyResult.semanticValue();
05671:
05672: yyRepetition1 = yyResult.index;
05673: yyRepValue1 = new Pair<Node>(v$el$1,
05674: yyRepValue1);
05675: continue;
05676: }
05677: } else {
05678: yyError = yyError.select("\",\" expected", yyBase);
05679: }
05680: break;
05681: }
05682: { // Start scope for v$g$2.
05683: final Pair<Node> v$g$2 = yyRepValue1.reverse();
05684:
05685: yyValue = GNode.createFromPair("AttributeList", v$g$1,
05686: v$g$2);
05687: yyValue.setLocation(location(yyStart));
05688:
05689: return new SemanticValue(yyValue, yyRepetition1,
05690: yyError);
05691: } // End scope for v$g$2.
05692: }
05693:
05694: // Done.
05695: return yyError;
05696: }
05697:
05698: // =========================================================================
05699:
05700: /**
05701: * Parse nonterminal xtc.lang.CPattern.AttributeListEntry.
05702: *
05703: * @param yyStart The index.
05704: * @return The result.
05705: * @throws IOException Signals an I/O error.
05706: */
05707: private Result pAttributeListEntry(final int yyStart)
05708: throws IOException {
05709: Result yyResult;
05710: int yyBase;
05711: int yyOption1;
05712: Node yyOpValue1;
05713: int yyOption2;
05714: Node yyOpValue2;
05715: Node yyValue;
05716: ParseError yyError = ParseError.DUMMY;
05717:
05718: // Alternative 1.
05719:
05720: yyResult = pCIdentifier$Word(yyStart);
05721: yyError = yyResult.select(yyError);
05722: if (yyResult.hasValue()) {
05723: final String v$g$1 = yyResult.semanticValue();
05724:
05725: yyOption1 = yyResult.index;
05726: yyOpValue1 = null;
05727:
05728: yyBase = yyOption1;
05729: yyResult = pSymbol(yyBase);
05730: yyError = yyResult.select(yyError);
05731: if (yyResult.hasValue("(")) {
05732:
05733: yyOption2 = yyResult.index;
05734: yyOpValue2 = null;
05735:
05736: yyResult = pExpressionList(yyOption2);
05737: yyError = yyResult.select(yyError);
05738: if (yyResult.hasValue()) {
05739: final Node v$el$2 = yyResult.semanticValue();
05740:
05741: yyOption2 = yyResult.index;
05742: yyOpValue2 = v$el$2;
05743: }
05744: { // Start scope for v$el$1.
05745: final Node v$el$1 = yyOpValue2;
05746:
05747: yyBase = yyOption2;
05748: yyResult = pSymbol(yyBase);
05749: yyError = yyResult.select(yyError);
05750: if (yyResult.hasValue(")")) {
05751:
05752: yyOption1 = yyResult.index;
05753: yyOpValue1 = v$el$1;
05754: } else {
05755: yyError = yyError.select("\")\" expected",
05756: yyBase);
05757: }
05758: } // End scope for v$el$1.
05759: } else {
05760: yyError = yyError.select("\"(\" expected", yyBase);
05761: }
05762: { // Start scope for v$g$2.
05763: final Node v$g$2 = yyOpValue1;
05764:
05765: yyValue = GNode.create("AttributeListEntry", v$g$1,
05766: v$g$2);
05767: yyValue.setLocation(location(yyStart));
05768:
05769: return new SemanticValue(yyValue, yyOption1, yyError);
05770: } // End scope for v$g$2.
05771: }
05772:
05773: // Done.
05774: return yyError;
05775: }
05776:
05777: // =========================================================================
05778:
05779: /**
05780: * Parse nonterminal xtc.lang.CPattern.Statement.
05781: *
05782: * @param yyStart The index.
05783: * @return The result.
05784: * @throws IOException Signals an I/O error.
05785: */
05786: private Result pStatement(final int yyStart) throws IOException {
05787: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
05788: if (null == yyColumn.chunk2)
05789: yyColumn.chunk2 = new Chunk2();
05790: if (null == yyColumn.chunk2.fStatement)
05791: yyColumn.chunk2.fStatement = pStatement$1(yyStart);
05792: return yyColumn.chunk2.fStatement;
05793: }
05794:
05795: /** Actually parse xtc.lang.CPattern.Statement. */
05796: private Result pStatement$1(final int yyStart) throws IOException {
05797: Result yyResult;
05798: int yyBase;
05799: int yyOption1;
05800: Node yyOpValue1;
05801: Node yyValue;
05802: ParseError yyError = ParseError.DUMMY;
05803:
05804: // Alternative 1.
05805:
05806: yyResult = pCommaExpression(yyStart);
05807: yyError = yyResult.select(yyError);
05808: if (yyResult.hasValue()) {
05809: final Node v$g$1 = yyResult.semanticValue();
05810:
05811: yyBase = yyResult.index;
05812: yyResult = pSymbol(yyBase);
05813: yyError = yyResult.select(yyError);
05814: if (yyResult.hasValue(";")) {
05815:
05816: yyValue = GNode.create("ExpressionStatement", v$g$1);
05817: yyValue.setLocation(location(yyStart));
05818:
05819: return yyResult.createValue(yyValue, yyError);
05820: } else {
05821: yyError = yyError.select("\";\" expected", yyBase);
05822: }
05823: }
05824:
05825: // Alternative <Compound>.
05826:
05827: yyResult = pCompoundStatement(yyStart);
05828: yyError = yyResult.select(yyError);
05829: if (yyResult.hasValue()) {
05830: yyValue = yyResult.semanticValue();
05831:
05832: return yyResult.createValue(yyValue, yyError);
05833: }
05834:
05835: // Alternative 3.
05836:
05837: yyResult = pKeyword(yyStart);
05838: yyError = yyResult.select(yyError);
05839: if (yyResult.hasValue("if")) {
05840:
05841: yyBase = yyResult.index;
05842: yyResult = pSymbol(yyBase);
05843: yyError = yyResult.select(yyError);
05844: if (yyResult.hasValue("(")) {
05845:
05846: yyResult = pCommaExpression(yyResult.index);
05847: yyError = yyResult.select(yyError);
05848: if (yyResult.hasValue()) {
05849: final Node v$g$1 = yyResult.semanticValue();
05850:
05851: yyBase = yyResult.index;
05852: yyResult = pSymbol(yyBase);
05853: yyError = yyResult.select(yyError);
05854: if (yyResult.hasValue(")")) {
05855:
05856: yyResult = pStatement(yyResult.index);
05857: yyError = yyResult.select(yyError);
05858: if (yyResult.hasValue()) {
05859: final Node v$g$2 = yyResult.semanticValue();
05860:
05861: final int yyChoice1 = yyResult.index;
05862:
05863: // Nested alternative 1.
05864:
05865: yyBase = yyChoice1;
05866: yyResult = pKeyword(yyBase);
05867: yyError = yyResult.select(yyError);
05868: if (yyResult.hasValue("else")) {
05869:
05870: yyResult = pStatement(yyResult.index);
05871: yyError = yyResult.select(yyError);
05872: if (yyResult.hasValue()) {
05873: final Node v$g$3 = yyResult
05874: .semanticValue();
05875:
05876: yyValue = GNode.create(
05877: "IfElseStatement", v$g$1,
05878: v$g$2, v$g$3);
05879: yyValue
05880: .setLocation(location(yyStart));
05881:
05882: return yyResult.createValue(
05883: yyValue, yyError);
05884: }
05885: } else {
05886: yyError = yyError.select(
05887: "\"else\" expected", yyBase);
05888: }
05889:
05890: // Nested alternative 2.
05891:
05892: yyValue = GNode.create("IfStatement",
05893: v$g$1, v$g$2);
05894: yyValue.setLocation(location(yyStart));
05895:
05896: return new SemanticValue(yyValue,
05897: yyChoice1, yyError);
05898: }
05899: } else {
05900: yyError = yyError.select("\")\" expected",
05901: yyBase);
05902: }
05903: }
05904: } else {
05905: yyError = yyError.select("\"(\" expected", yyBase);
05906: }
05907: }
05908:
05909: // Alternative 4.
05910:
05911: yyResult = pKeyword(yyStart);
05912: yyError = yyResult.select(yyError);
05913: if (yyResult.hasValue("while")) {
05914:
05915: yyBase = yyResult.index;
05916: yyResult = pSymbol(yyBase);
05917: yyError = yyResult.select(yyError);
05918: if (yyResult.hasValue("(")) {
05919:
05920: yyResult = pCommaExpression(yyResult.index);
05921: yyError = yyResult.select(yyError);
05922: if (yyResult.hasValue()) {
05923: final Node v$g$1 = yyResult.semanticValue();
05924:
05925: yyBase = yyResult.index;
05926: yyResult = pSymbol(yyBase);
05927: yyError = yyResult.select(yyError);
05928: if (yyResult.hasValue(")")) {
05929:
05930: yyResult = pStatement(yyResult.index);
05931: yyError = yyResult.select(yyError);
05932: if (yyResult.hasValue()) {
05933: final Node v$g$2 = yyResult.semanticValue();
05934:
05935: yyValue = GNode.create("WhileStatement",
05936: v$g$1, v$g$2);
05937: yyValue.setLocation(location(yyStart));
05938:
05939: return yyResult.createValue(yyValue,
05940: yyError);
05941: }
05942: } else {
05943: yyError = yyError.select("\")\" expected",
05944: yyBase);
05945: }
05946: }
05947: } else {
05948: yyError = yyError.select("\"(\" expected", yyBase);
05949: }
05950: }
05951:
05952: // Alternative 5.
05953:
05954: yyResult = pKeyword(yyStart);
05955: yyError = yyResult.select(yyError);
05956: if (yyResult.hasValue("do")) {
05957:
05958: yyResult = pStatement(yyResult.index);
05959: yyError = yyResult.select(yyError);
05960: if (yyResult.hasValue()) {
05961: final Node v$g$1 = yyResult.semanticValue();
05962:
05963: yyBase = yyResult.index;
05964: yyResult = pKeyword(yyBase);
05965: yyError = yyResult.select(yyError);
05966: if (yyResult.hasValue("while")) {
05967:
05968: yyBase = yyResult.index;
05969: yyResult = pSymbol(yyBase);
05970: yyError = yyResult.select(yyError);
05971: if (yyResult.hasValue("(")) {
05972:
05973: yyResult = pCommaExpression(yyResult.index);
05974: yyError = yyResult.select(yyError);
05975: if (yyResult.hasValue()) {
05976: final Node v$g$2 = yyResult.semanticValue();
05977:
05978: yyBase = yyResult.index;
05979: yyResult = pSymbol(yyBase);
05980: yyError = yyResult.select(yyError);
05981: if (yyResult.hasValue(")")) {
05982:
05983: yyBase = yyResult.index;
05984: yyResult = pSymbol(yyBase);
05985: yyError = yyResult.select(yyError);
05986: if (yyResult.hasValue(";")) {
05987:
05988: yyValue = GNode
05989: .create("DoStatement",
05990: v$g$1, v$g$2);
05991: yyValue
05992: .setLocation(location(yyStart));
05993:
05994: return yyResult.createValue(
05995: yyValue, yyError);
05996: } else {
05997: yyError = yyError.select(
05998: "\";\" expected", yyBase);
05999: }
06000: } else {
06001: yyError = yyError.select(
06002: "\")\" expected", yyBase);
06003: }
06004: }
06005: } else {
06006: yyError = yyError.select("\"(\" expected",
06007: yyBase);
06008: }
06009: } else {
06010: yyError = yyError.select("\"while\" expected",
06011: yyBase);
06012: }
06013: }
06014: }
06015:
06016: // Alternative 6.
06017:
06018: yyResult = pKeyword(yyStart);
06019: yyError = yyResult.select(yyError);
06020: if (yyResult.hasValue("for")) {
06021:
06022: yyResult = pPushScope(yyResult.index);
06023: yyError = yyResult.select(yyError);
06024: if (yyResult.hasValue()) {
06025:
06026: yyBase = yyResult.index;
06027: yyResult = pSymbol(yyBase);
06028: yyError = yyResult.select(yyError);
06029: if (yyResult.hasValue("(")) {
06030:
06031: yyResult = pInitialClause(yyResult.index);
06032: yyError = yyResult.select(yyError);
06033: if (yyResult.hasValue()) {
06034: final Node v$g$1 = yyResult.semanticValue();
06035:
06036: yyOption1 = yyResult.index;
06037: yyOpValue1 = null;
06038:
06039: yyResult = pCommaExpression(yyOption1);
06040: yyError = yyResult.select(yyError);
06041: if (yyResult.hasValue()) {
06042: final Node v$el$1 = yyResult
06043: .semanticValue();
06044:
06045: yyOption1 = yyResult.index;
06046: yyOpValue1 = v$el$1;
06047: }
06048: { // Start scope for v$g$2.
06049: final Node v$g$2 = yyOpValue1;
06050:
06051: yyBase = yyOption1;
06052: yyResult = pSymbol(yyBase);
06053: yyError = yyResult.select(yyError);
06054: if (yyResult.hasValue(";")) {
06055:
06056: yyOption1 = yyResult.index;
06057: yyOpValue1 = null;
06058:
06059: yyResult = pCommaExpression(yyOption1);
06060: yyError = yyResult.select(yyError);
06061: if (yyResult.hasValue()) {
06062: final Node v$el$2 = yyResult
06063: .semanticValue();
06064:
06065: yyOption1 = yyResult.index;
06066: yyOpValue1 = v$el$2;
06067: }
06068: { // Start scope for v$g$3.
06069: final Node v$g$3 = yyOpValue1;
06070:
06071: yyBase = yyOption1;
06072: yyResult = pSymbol(yyBase);
06073: yyError = yyResult.select(yyError);
06074: if (yyResult.hasValue(")")) {
06075:
06076: yyResult = pStatement(yyResult.index);
06077: yyError = yyResult
06078: .select(yyError);
06079: if (yyResult.hasValue()) {
06080: final Node v$g$4 = yyResult
06081: .semanticValue();
06082:
06083: yyResult = pPopScope(yyResult.index);
06084: yyError = yyResult
06085: .select(yyError);
06086: if (yyResult.hasValue()) {
06087:
06088: yyValue = GNode.create(
06089: "ForStatement",
06090: v$g$1, v$g$2,
06091: v$g$3, v$g$4);
06092: yyValue
06093: .setLocation(location(yyStart));
06094:
06095: return yyResult
06096: .createValue(
06097: yyValue,
06098: yyError);
06099: }
06100: }
06101: } else {
06102: yyError = yyError.select(
06103: "\")\" expected",
06104: yyBase);
06105: }
06106: } // End scope for v$g$3.
06107: } else {
06108: yyError = yyError.select(
06109: "\";\" expected", yyBase);
06110: }
06111: } // End scope for v$g$2.
06112: }
06113: } else {
06114: yyError = yyError.select("\"(\" expected", yyBase);
06115: }
06116: }
06117: }
06118:
06119: // Alternative 7.
06120:
06121: yyResult = pKeyword(yyStart);
06122: yyError = yyResult.select(yyError);
06123: if (yyResult.hasValue("switch")) {
06124:
06125: yyBase = yyResult.index;
06126: yyResult = pSymbol(yyBase);
06127: yyError = yyResult.select(yyError);
06128: if (yyResult.hasValue("(")) {
06129:
06130: yyResult = pCommaExpression(yyResult.index);
06131: yyError = yyResult.select(yyError);
06132: if (yyResult.hasValue()) {
06133: final Node v$g$1 = yyResult.semanticValue();
06134:
06135: yyBase = yyResult.index;
06136: yyResult = pSymbol(yyBase);
06137: yyError = yyResult.select(yyError);
06138: if (yyResult.hasValue(")")) {
06139:
06140: yyResult = pStatement(yyResult.index);
06141: yyError = yyResult.select(yyError);
06142: if (yyResult.hasValue()) {
06143: final Node v$g$2 = yyResult.semanticValue();
06144:
06145: yyValue = GNode.create("SwitchStatement",
06146: v$g$1, v$g$2);
06147: yyValue.setLocation(location(yyStart));
06148:
06149: return yyResult.createValue(yyValue,
06150: yyError);
06151: }
06152: } else {
06153: yyError = yyError.select("\")\" expected",
06154: yyBase);
06155: }
06156: }
06157: } else {
06158: yyError = yyError.select("\"(\" expected", yyBase);
06159: }
06160: }
06161:
06162: // Alternative <Complete>.
06163:
06164: yyResult = pLabel(yyStart);
06165: yyError = yyResult.select(yyError);
06166: if (yyResult.hasValue()) {
06167: final Node v$g$1 = yyResult.semanticValue();
06168:
06169: yyResult = pStatement(yyResult.index);
06170: yyError = yyResult.select(yyError);
06171: if (yyResult.hasValue()) {
06172: final Node v$g$2 = yyResult.semanticValue();
06173:
06174: yyValue = GNode
06175: .create("LabeledStatement", v$g$1, v$g$2);
06176: yyValue.setLocation(location(yyStart));
06177:
06178: return yyResult.createValue(yyValue, yyError);
06179: }
06180: }
06181:
06182: // Alternative <Incomplete>.
06183:
06184: if (GCC) {
06185:
06186: yyResult = pLabel(yyStart);
06187: yyError = yyResult.select(yyError);
06188: if (yyResult.hasValue()) {
06189: final Node v$g$3 = yyResult.semanticValue();
06190:
06191: yyValue = GNode.create("LabeledStatement", v$g$3, null);
06192: yyValue.setLocation(location(yyStart));
06193:
06194: return yyResult.createValue(yyValue, yyError);
06195: }
06196: }
06197:
06198: // Alternative 10.
06199:
06200: yyResult = pKeyword(yyStart);
06201: yyError = yyResult.select(yyError);
06202: if (yyResult.hasValue("break")) {
06203:
06204: yyBase = yyResult.index;
06205: yyResult = pSymbol(yyBase);
06206: yyError = yyResult.select(yyError);
06207: if (yyResult.hasValue(";")) {
06208:
06209: yyValue = GNode.create("BreakStatement", false);
06210: yyValue.setLocation(location(yyStart));
06211:
06212: return yyResult.createValue(yyValue, yyError);
06213: } else {
06214: yyError = yyError.select("\";\" expected", yyBase);
06215: }
06216: }
06217:
06218: // Alternative 11.
06219:
06220: yyResult = pKeyword(yyStart);
06221: yyError = yyResult.select(yyError);
06222: if (yyResult.hasValue("continue")) {
06223:
06224: yyBase = yyResult.index;
06225: yyResult = pSymbol(yyBase);
06226: yyError = yyResult.select(yyError);
06227: if (yyResult.hasValue(";")) {
06228:
06229: yyValue = GNode.create("ContinueStatement", false);
06230: yyValue.setLocation(location(yyStart));
06231:
06232: return yyResult.createValue(yyValue, yyError);
06233: } else {
06234: yyError = yyError.select("\";\" expected", yyBase);
06235: }
06236: }
06237:
06238: // Alternative 12.
06239:
06240: yyResult = pKeyword(yyStart);
06241: yyError = yyResult.select(yyError);
06242: if (yyResult.hasValue("return")) {
06243:
06244: yyOption1 = yyResult.index;
06245: yyOpValue1 = null;
06246:
06247: yyResult = pCommaExpression(yyOption1);
06248: yyError = yyResult.select(yyError);
06249: if (yyResult.hasValue()) {
06250: final Node v$el$1 = yyResult.semanticValue();
06251:
06252: yyOption1 = yyResult.index;
06253: yyOpValue1 = v$el$1;
06254: }
06255: { // Start scope for v$g$1.
06256: final Node v$g$1 = yyOpValue1;
06257:
06258: yyBase = yyOption1;
06259: yyResult = pSymbol(yyBase);
06260: yyError = yyResult.select(yyError);
06261: if (yyResult.hasValue(";")) {
06262:
06263: yyValue = GNode.create("ReturnStatement", v$g$1);
06264: yyValue.setLocation(location(yyStart));
06265:
06266: return yyResult.createValue(yyValue, yyError);
06267: } else {
06268: yyError = yyError.select("\";\" expected", yyBase);
06269: }
06270: } // End scope for v$g$1.
06271: }
06272:
06273: // Alternative 13.
06274:
06275: yyResult = pKeyword(yyStart);
06276: yyError = yyResult.select(yyError);
06277: if (yyResult.hasValue("goto")) {
06278:
06279: final int yyChoice1 = yyResult.index;
06280:
06281: // Nested alternative 1.
06282:
06283: yyResult = pGotoLabel(yyChoice1);
06284: yyError = yyResult.select(yyError);
06285: if (yyResult.hasValue()) {
06286: final Node v$g$2 = yyResult.semanticValue();
06287:
06288: yyBase = yyResult.index;
06289: yyResult = pSymbol(yyBase);
06290: yyError = yyResult.select(yyError);
06291: if (yyResult.hasValue(";")) {
06292:
06293: yyValue = GNode
06294: .create("GotoStatement", null, v$g$2);
06295: yyValue.setLocation(location(yyStart));
06296:
06297: return yyResult.createValue(yyValue, yyError);
06298: } else {
06299: yyError = yyError.select("\";\" expected", yyBase);
06300: }
06301: }
06302:
06303: // Nested alternative 2.
06304:
06305: yyResult = pPrimaryIdentifier(yyChoice1);
06306: yyError = yyResult.select(yyError);
06307: if (yyResult.hasValue()) {
06308: final Node v$g$3 = yyResult.semanticValue();
06309:
06310: yyBase = yyResult.index;
06311: yyResult = pSymbol(yyBase);
06312: yyError = yyResult.select(yyError);
06313: if (yyResult.hasValue(";")) {
06314:
06315: yyValue = GNode
06316: .create("GotoStatement", null, v$g$3);
06317: yyValue.setLocation(location(yyStart));
06318:
06319: return yyResult.createValue(yyValue, yyError);
06320: } else {
06321: yyError = yyError.select("\";\" expected", yyBase);
06322: }
06323: }
06324: }
06325:
06326: // Alternative <Computed>.
06327:
06328: if (GCC) {
06329:
06330: yyResult = pKeyword(yyStart);
06331: yyError = yyResult.select(yyError);
06332: if (yyResult.hasValue("goto")) {
06333:
06334: yyBase = yyResult.index;
06335: yyResult = pSymbol(yyBase);
06336: yyError = yyResult.select(yyError);
06337: if (yyResult.hasValue("*")) {
06338: final String v$g$4 = "*";
06339:
06340: yyResult = pCommaExpression(yyResult.index);
06341: yyError = yyResult.select(yyError);
06342: if (yyResult.hasValue()) {
06343: final Node v$g$5 = yyResult.semanticValue();
06344:
06345: yyBase = yyResult.index;
06346: yyResult = pSymbol(yyBase);
06347: yyError = yyResult.select(yyError);
06348: if (yyResult.hasValue(";")) {
06349:
06350: yyValue = GNode.create("GotoStatement",
06351: v$g$4, v$g$5);
06352: yyValue.setLocation(location(yyStart));
06353:
06354: return yyResult.createValue(yyValue,
06355: yyError);
06356: } else {
06357: yyError = yyError.select("\";\" expected",
06358: yyBase);
06359: }
06360: }
06361: } else {
06362: yyError = yyError.select("\"*\" expected", yyBase);
06363: }
06364: }
06365: }
06366:
06367: // Alternative 15.
06368:
06369: yyResult = pAsmKeyword(yyStart);
06370: yyError = yyResult.select(yyError);
06371: if (yyResult.hasValue()) {
06372:
06373: yyOption1 = yyResult.index;
06374: yyOpValue1 = null;
06375:
06376: yyResult = pTypeQualifier(yyOption1);
06377: yyError = yyResult.select(yyError);
06378: if (yyResult.hasValue()) {
06379: final Node v$el$1 = yyResult.semanticValue();
06380:
06381: yyOption1 = yyResult.index;
06382: yyOpValue1 = v$el$1;
06383: }
06384: { // Start scope for v$g$1.
06385: final Node v$g$1 = yyOpValue1;
06386:
06387: yyBase = yyOption1;
06388: yyResult = pSymbol(yyBase);
06389: yyError = yyResult.select(yyError);
06390: if (yyResult.hasValue("(")) {
06391:
06392: yyResult = pAssemblyArgument(yyResult.index);
06393: yyError = yyResult.select(yyError);
06394: if (yyResult.hasValue()) {
06395: final Node v$g$2 = yyResult.semanticValue();
06396:
06397: yyBase = yyResult.index;
06398: yyResult = pSymbol(yyBase);
06399: yyError = yyResult.select(yyError);
06400: if (yyResult.hasValue(")")) {
06401:
06402: yyBase = yyResult.index;
06403: yyResult = pSymbol(yyBase);
06404: yyError = yyResult.select(yyError);
06405: if (yyResult.hasValue(";")) {
06406: final String v$g$3 = ";";
06407:
06408: yyValue = GNode.create(
06409: "AssemblyStatement", v$g$1,
06410: v$g$2, v$g$3);
06411: yyValue.setLocation(location(yyStart));
06412:
06413: return yyResult.createValue(yyValue,
06414: yyError);
06415: } else {
06416: yyError = yyError.select(
06417: "\";\" expected", yyBase);
06418: }
06419: } else {
06420: yyError = yyError.select("\")\" expected",
06421: yyBase);
06422: }
06423: }
06424: } else {
06425: yyError = yyError.select("\"(\" expected", yyBase);
06426: }
06427: } // End scope for v$g$1.
06428: }
06429:
06430: // Alternative 16.
06431:
06432: yyResult = pSymbol(yyStart);
06433: yyError = yyResult.select(yyError);
06434: if (yyResult.hasValue(";")) {
06435:
06436: yyValue = GNode.create("EmptyStatement", false);
06437: yyValue.setLocation(location(yyStart));
06438:
06439: return yyResult.createValue(yyValue, yyError);
06440: }
06441:
06442: // Done.
06443: yyError = yyError.select("statement expected", yyStart);
06444: return yyError;
06445: }
06446:
06447: // =========================================================================
06448:
06449: /**
06450: * Parse nonterminal xtc.lang.CPattern.Label.
06451: *
06452: * @param yyStart The index.
06453: * @return The result.
06454: * @throws IOException Signals an I/O error.
06455: */
06456: private Result pLabel(final int yyStart) throws IOException {
06457: Result yyResult;
06458: int yyBase;
06459: int yyOption1;
06460: Node yyOpValue1;
06461: Node yyValue;
06462: ParseError yyError = ParseError.DUMMY;
06463:
06464: // Alternative <Patterned>.
06465:
06466: yyResult = pStringVariable(yyStart);
06467: yyError = yyResult.select(yyError);
06468: if (yyResult.hasValue()) {
06469: final Node v$g$1 = yyResult.semanticValue();
06470:
06471: yyBase = yyResult.index;
06472: yyResult = pSymbol(yyBase);
06473: yyError = yyResult.select(yyError);
06474: if (yyResult.hasValue(":")) {
06475:
06476: yyOption1 = yyResult.index;
06477: yyOpValue1 = null;
06478:
06479: yyResult = pAttributeSpecifierList(yyOption1);
06480: yyError = yyResult.select(yyError);
06481: if (yyResult.hasValue()) {
06482: final Node v$el$1 = yyResult.semanticValue();
06483:
06484: yyOption1 = yyResult.index;
06485: yyOpValue1 = v$el$1;
06486: }
06487: { // Start scope for v$g$2.
06488: final Node v$g$2 = yyOpValue1;
06489:
06490: yyValue = GNode.create("NamedLabel", v$g$1, v$g$2);
06491: yyValue.setLocation(location(yyStart));
06492:
06493: return new SemanticValue(yyValue, yyOption1,
06494: yyError);
06495: } // End scope for v$g$2.
06496: } else {
06497: yyError = yyError.select("\":\" expected", yyBase);
06498: }
06499: }
06500:
06501: // Alternative <Label>.
06502:
06503: yyResult = pCIdentifier$Identifier(yyStart);
06504: yyError = yyResult.select(yyError);
06505: if (yyResult.hasValue()) {
06506: final String v$g$3 = yyResult.semanticValue();
06507:
06508: yyBase = yyResult.index;
06509: yyResult = pSymbol(yyBase);
06510: yyError = yyResult.select(yyError);
06511: if (yyResult.hasValue(":")) {
06512:
06513: yyOption1 = yyResult.index;
06514: yyOpValue1 = null;
06515:
06516: yyResult = pAttributeSpecifierList(yyOption1);
06517: yyError = yyResult.select(yyError);
06518: if (yyResult.hasValue()) {
06519: final Node v$el$2 = yyResult.semanticValue();
06520:
06521: yyOption1 = yyResult.index;
06522: yyOpValue1 = v$el$2;
06523: }
06524: { // Start scope for v$g$4.
06525: final Node v$g$4 = yyOpValue1;
06526:
06527: yyValue = GNode.create("NamedLabel", v$g$3, v$g$4);
06528: yyValue.setLocation(location(yyStart));
06529:
06530: return new SemanticValue(yyValue, yyOption1,
06531: yyError);
06532: } // End scope for v$g$4.
06533: } else {
06534: yyError = yyError.select("\":\" expected", yyBase);
06535: }
06536: }
06537:
06538: // Alternative <Range>.
06539:
06540: if (GCC) {
06541:
06542: yyResult = pKeyword(yyStart);
06543: yyError = yyResult.select(yyError);
06544: if (yyResult.hasValue("case")) {
06545:
06546: yyResult = pConditionalExpression(yyResult.index);
06547: yyError = yyResult.select(yyError);
06548: if (yyResult.hasValue()) {
06549: final Node v$g$1 = yyResult.semanticValue();
06550:
06551: yyBase = yyResult.index;
06552: yyResult = pSymbol(yyBase);
06553: yyError = yyResult.select(yyError);
06554: if (yyResult.hasValue("...")) {
06555:
06556: yyResult = pConditionalExpression(yyResult.index);
06557: yyError = yyResult.select(yyError);
06558: if (yyResult.hasValue()) {
06559: final Node v$g$2 = yyResult.semanticValue();
06560:
06561: yyBase = yyResult.index;
06562: yyResult = pSymbol(yyBase);
06563: yyError = yyResult.select(yyError);
06564: if (yyResult.hasValue(":")) {
06565:
06566: yyValue = GNode.create("CaseLabel",
06567: v$g$1, v$g$2);
06568: yyValue.setLocation(location(yyStart));
06569:
06570: return yyResult.createValue(yyValue,
06571: yyError);
06572: } else {
06573: yyError = yyError.select(
06574: "\":\" expected", yyBase);
06575: }
06576: }
06577: } else {
06578: yyError = yyError.select("\"...\" expected",
06579: yyBase);
06580: }
06581: }
06582: }
06583: }
06584:
06585: // Alternative <Simple>.
06586:
06587: yyResult = pKeyword(yyStart);
06588: yyError = yyResult.select(yyError);
06589: if (yyResult.hasValue("case")) {
06590:
06591: yyResult = pConditionalExpression(yyResult.index);
06592: yyError = yyResult.select(yyError);
06593: if (yyResult.hasValue()) {
06594: final Node v$g$3 = yyResult.semanticValue();
06595:
06596: yyBase = yyResult.index;
06597: yyResult = pSymbol(yyBase);
06598: yyError = yyResult.select(yyError);
06599: if (yyResult.hasValue(":")) {
06600:
06601: yyValue = GNode.create("CaseLabel", v$g$3);
06602: yyValue.setLocation(location(yyStart));
06603:
06604: return yyResult.createValue(yyValue, yyError);
06605: } else {
06606: yyError = yyError.select("\":\" expected", yyBase);
06607: }
06608: }
06609: }
06610:
06611: // Alternative 5.
06612:
06613: yyResult = pKeyword(yyStart);
06614: yyError = yyResult.select(yyError);
06615: if (yyResult.hasValue("default")) {
06616:
06617: yyBase = yyResult.index;
06618: yyResult = pSymbol(yyBase);
06619: yyError = yyResult.select(yyError);
06620: if (yyResult.hasValue(":")) {
06621:
06622: yyValue = GNode.create("DefaultLabel", false);
06623: yyValue.setLocation(location(yyStart));
06624:
06625: return yyResult.createValue(yyValue, yyError);
06626: } else {
06627: yyError = yyError.select("\":\" expected", yyBase);
06628: }
06629: }
06630:
06631: // Done.
06632: yyError = yyError.select("label expected", yyStart);
06633: return yyError;
06634: }
06635:
06636: // =========================================================================
06637:
06638: /**
06639: * Parse nonterminal xtc.lang.CPattern.CompoundStatement.
06640: *
06641: * @param yyStart The index.
06642: * @return The result.
06643: * @throws IOException Signals an I/O error.
06644: */
06645: private Result pCompoundStatement(final int yyStart)
06646: throws IOException {
06647: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
06648: if (null == yyColumn.chunk2)
06649: yyColumn.chunk2 = new Chunk2();
06650: if (null == yyColumn.chunk2.fCompoundStatement)
06651: yyColumn.chunk2.fCompoundStatement = pCompoundStatement$1(yyStart);
06652: return yyColumn.chunk2.fCompoundStatement;
06653: }
06654:
06655: /** Actually parse xtc.lang.CPattern.CompoundStatement. */
06656: private Result pCompoundStatement$1(final int yyStart)
06657: throws IOException {
06658: Result yyResult;
06659: int yyBase;
06660: Node yyValue;
06661: ParseError yyError = ParseError.DUMMY;
06662:
06663: // Alternative <Compound>.
06664:
06665: yyResult = pSymbol(yyStart);
06666: yyError = yyResult.select(yyError);
06667: if (yyResult.hasValue("{")) {
06668:
06669: yyResult = pPushScope(yyResult.index);
06670: yyError = yyResult.select(yyError);
06671: if (yyResult.hasValue()) {
06672:
06673: yyResult = pCompoundStatement$$Star1(yyResult.index);
06674: yyError = yyResult.select(yyError);
06675: if (yyResult.hasValue()) {
06676: final Pair<Node> v$g$1 = yyResult.semanticValue();
06677:
06678: yyResult = pCompoundStatement$$Star2(yyResult.index);
06679: yyError = yyResult.select(yyError);
06680: if (yyResult.hasValue()) {
06681: final Pair<Node> v$g$2 = yyResult
06682: .semanticValue();
06683:
06684: yyResult = pAnnotations(yyResult.index);
06685: yyError = yyResult.select(yyError);
06686: if (yyResult.hasValue()) {
06687: final Node v$g$3 = yyResult.semanticValue();
06688:
06689: yyBase = yyResult.index;
06690: yyResult = pSymbol(yyBase);
06691: yyError = yyResult.select(yyError);
06692: if (yyResult.hasValue("}")) {
06693:
06694: yyResult = pPopScope(yyResult.index);
06695: yyError = yyResult.select(yyError);
06696: if (yyResult.hasValue()) {
06697:
06698: yyValue = GNode.create(
06699: "CompoundStatement",
06700: v$g$1.size() + v$g$2.size()
06701: + 1).addAll(v$g$1)
06702: .addAll(v$g$2).add(v$g$3);
06703: yyValue
06704: .setLocation(location(yyStart));
06705:
06706: return yyResult.createValue(
06707: yyValue, yyError);
06708: }
06709: } else {
06710: yyError = yyError.select(
06711: "\"}\" expected", yyBase);
06712: }
06713: }
06714: }
06715: }
06716: }
06717: }
06718:
06719: // Done.
06720: yyError = yyError
06721: .select("compound statement expected", yyStart);
06722: return yyError;
06723: }
06724:
06725: // =========================================================================
06726:
06727: /**
06728: * Parse synthetic nonterminal xtc.lang.CFactory.CompoundStatement$$Star1.
06729: *
06730: * @param yyStart The index.
06731: * @return The result.
06732: * @throws IOException Signals an I/O error.
06733: */
06734: private Result pCompoundStatement$$Star1(final int yyStart)
06735: throws IOException {
06736:
06737: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
06738: if (null == yyColumn.chunk2)
06739: yyColumn.chunk2 = new Chunk2();
06740: if (null == yyColumn.chunk2.fCompoundStatement$$Star1)
06741: yyColumn.chunk2.fCompoundStatement$$Star1 = pCompoundStatement$$Star1$1(yyStart);
06742: return yyColumn.chunk2.fCompoundStatement$$Star1;
06743: }
06744:
06745: /** Actually parse xtc.lang.CFactory.CompoundStatement$$Star1. */
06746: private Result pCompoundStatement$$Star1$1(final int yyStart)
06747: throws IOException {
06748:
06749: Result yyResult;
06750: Pair<Node> yyValue;
06751: ParseError yyError = ParseError.DUMMY;
06752:
06753: // Alternative 1.
06754:
06755: yyResult = pLocalLabelDeclaration(yyStart);
06756: yyError = yyResult.select(yyError);
06757: if (yyResult.hasValue()) {
06758: final Node v$el$1 = yyResult.semanticValue();
06759:
06760: yyResult = pCompoundStatement$$Star1(yyResult.index);
06761: yyError = yyResult.select(yyError);
06762: if (yyResult.hasValue()) {
06763: final Pair<Node> v$2 = yyResult.semanticValue();
06764:
06765: yyValue = new Pair<Node>(v$el$1, v$2);
06766:
06767: return yyResult.createValue(yyValue, yyError);
06768: }
06769: }
06770:
06771: // Alternative 2.
06772:
06773: yyValue = Pair.empty();
06774:
06775: return new SemanticValue(yyValue, yyStart, yyError);
06776: }
06777:
06778: // =========================================================================
06779:
06780: /**
06781: * Parse synthetic nonterminal xtc.lang.CFactory.CompoundStatement$$Star2.
06782: *
06783: * @param yyStart The index.
06784: * @return The result.
06785: * @throws IOException Signals an I/O error.
06786: */
06787: private Result pCompoundStatement$$Star2(final int yyStart)
06788: throws IOException {
06789:
06790: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
06791: if (null == yyColumn.chunk2)
06792: yyColumn.chunk2 = new Chunk2();
06793: if (null == yyColumn.chunk2.fCompoundStatement$$Star2)
06794: yyColumn.chunk2.fCompoundStatement$$Star2 = pCompoundStatement$$Star2$1(yyStart);
06795: return yyColumn.chunk2.fCompoundStatement$$Star2;
06796: }
06797:
06798: /** Actually parse xtc.lang.CFactory.CompoundStatement$$Star2. */
06799: private Result pCompoundStatement$$Star2$1(final int yyStart)
06800: throws IOException {
06801:
06802: Result yyResult;
06803: Pair<Node> yyValue;
06804: ParseError yyError = ParseError.DUMMY;
06805:
06806: // Alternative 1.
06807:
06808: yyResult = pDeclarationOrStatement(yyStart);
06809: yyError = yyResult.select(yyError);
06810: if (yyResult.hasValue()) {
06811: final Node v$el$3 = yyResult.semanticValue();
06812:
06813: yyResult = pCompoundStatement$$Star2(yyResult.index);
06814: yyError = yyResult.select(yyError);
06815: if (yyResult.hasValue()) {
06816: final Pair<Node> v$4 = yyResult.semanticValue();
06817:
06818: yyValue = new Pair<Node>(v$el$3, v$4);
06819:
06820: return yyResult.createValue(yyValue, yyError);
06821: }
06822: }
06823:
06824: // Alternative 2.
06825:
06826: yyValue = Pair.empty();
06827:
06828: return new SemanticValue(yyValue, yyStart, yyError);
06829: }
06830:
06831: // =========================================================================
06832:
06833: /**
06834: * Parse nonterminal xtc.lang.CPattern.LocalLabelDeclaration.
06835: *
06836: * @param yyStart The index.
06837: * @return The result.
06838: * @throws IOException Signals an I/O error.
06839: */
06840: private Result pLocalLabelDeclaration(final int yyStart)
06841: throws IOException {
06842:
06843: Result yyResult;
06844: int yyBase;
06845: int yyRepetition1;
06846: Pair<String> yyRepValue1;
06847: Node yyValue;
06848: ParseError yyError = ParseError.DUMMY;
06849:
06850: // Alternative 1.
06851:
06852: yyResult = pKeyword(yyStart);
06853: yyError = yyResult.select(yyError);
06854: if (yyResult.hasValue("__label__")) {
06855:
06856: yyResult = pCIdentifier$Identifier(yyResult.index);
06857: yyError = yyResult.select(yyError);
06858: if (yyResult.hasValue()) {
06859: final String v$g$1 = yyResult.semanticValue();
06860:
06861: yyRepetition1 = yyResult.index;
06862: yyRepValue1 = Pair.empty();
06863: while (true) {
06864:
06865: yyBase = yyRepetition1;
06866: yyResult = pSymbol(yyBase);
06867: yyError = yyResult.select(yyError);
06868: if (yyResult.hasValue(",")) {
06869:
06870: yyResult = pCIdentifier$Identifier(yyResult.index);
06871: yyError = yyResult.select(yyError);
06872: if (yyResult.hasValue()) {
06873: final String v$el$1 = yyResult
06874: .semanticValue();
06875:
06876: yyRepetition1 = yyResult.index;
06877: yyRepValue1 = new Pair<String>(v$el$1,
06878: yyRepValue1);
06879: continue;
06880: }
06881: } else {
06882: yyError = yyError.select("\",\" expected",
06883: yyBase);
06884: }
06885: break;
06886: }
06887: { // Start scope for v$g$2.
06888: final Pair<String> v$g$2 = yyRepValue1.reverse();
06889:
06890: yyBase = yyRepetition1;
06891: yyResult = pSymbol(yyBase);
06892: yyError = yyResult.select(yyError);
06893: if (yyResult.hasValue(";")) {
06894:
06895: yyValue = GNode.createFromPair(
06896: "LocalLabelDeclaration", v$g$1, v$g$2);
06897: yyValue.setLocation(location(yyStart));
06898:
06899: return yyResult.createValue(yyValue, yyError);
06900: } else {
06901: yyError = yyError.select("\";\" expected",
06902: yyBase);
06903: }
06904: } // End scope for v$g$2.
06905: }
06906: }
06907:
06908: // Done.
06909: yyError = yyError.select("local label declaration expected",
06910: yyStart);
06911: return yyError;
06912: }
06913:
06914: // =========================================================================
06915:
06916: /**
06917: * Parse nonterminal xtc.lang.CPattern.DeclarationOrStatement.
06918: *
06919: * @param yyStart The index.
06920: * @return The result.
06921: * @throws IOException Signals an I/O error.
06922: */
06923: private Result pDeclarationOrStatement(final int yyStart)
06924: throws IOException {
06925:
06926: Result yyResult;
06927: Node yyValue;
06928: ParseError yyError = ParseError.DUMMY;
06929:
06930: // Start a state modification.
06931: yyState.start();
06932:
06933: // Alternative <Declaration>.
06934:
06935: yyState.mark();
06936:
06937: yyResult = pDeclaration(yyStart);
06938: yyError = yyResult.select(yyError);
06939: if (yyResult.hasValue()) {
06940: final Node d = yyResult.semanticValue();
06941:
06942: yyValue = yyState.annotate(d);
06943:
06944: // Commit the state modification.
06945: yyState.commit();
06946:
06947: setLocation(yyValue, yyStart);
06948: return yyResult.createValue(yyValue, yyError);
06949: }
06950:
06951: // Alternative <Statement>.
06952:
06953: yyResult = pStatement(yyStart);
06954: yyError = yyResult.select(yyError);
06955: if (yyResult.hasValue()) {
06956: final Node s = yyResult.semanticValue();
06957:
06958: yyValue = yyState.annotate(s);
06959:
06960: // Commit the state modification.
06961: yyState.commit();
06962:
06963: setLocation(yyValue, yyStart);
06964: return yyResult.createValue(yyValue, yyError);
06965: }
06966:
06967: // Alternative <ListPattern>.
06968:
06969: yyResult = pNodeListVariable(yyStart);
06970: yyError = yyResult.select(yyError);
06971: if (yyResult.hasValue()) {
06972: final Node v = yyResult.semanticValue();
06973:
06974: yyValue = yyState.annotate(v);
06975:
06976: // Commit the state modification.
06977: yyState.commit();
06978:
06979: setLocation(yyValue, yyStart);
06980: return yyResult.createValue(yyValue, yyError);
06981: }
06982:
06983: // Alternative <Pattern>.
06984:
06985: yyResult = pNodeVariable(yyStart);
06986: yyError = yyResult.select(yyError);
06987: if (yyResult.hasValue()) {
06988: final Node v = yyResult.semanticValue();
06989:
06990: yyValue = yyState.annotate(v);
06991:
06992: // Commit the state modification.
06993: yyState.commit();
06994:
06995: setLocation(yyValue, yyStart);
06996: return yyResult.createValue(yyValue, yyError);
06997: }
06998:
06999: // Abort the state modification.
07000: yyState.abort();
07001:
07002: // Done.
07003: return yyError;
07004: }
07005:
07006: // =========================================================================
07007:
07008: /**
07009: * Parse nonterminal xtc.lang.CPattern.InitialClause.
07010: *
07011: * @param yyStart The index.
07012: * @return The result.
07013: * @throws IOException Signals an I/O error.
07014: */
07015: private Result pInitialClause(final int yyStart) throws IOException {
07016: Result yyResult;
07017: int yyBase;
07018: int yyOption1;
07019: Node yyOpValue1;
07020: Node yyValue;
07021: ParseError yyError = ParseError.DUMMY;
07022:
07023: // Start a state modification.
07024: yyState.start();
07025:
07026: // Alternative <Declaration>.
07027:
07028: yyResult = pDeclaration(yyStart);
07029: yyError = yyResult.select(yyError);
07030: if (yyResult.hasValue()) {
07031: yyValue = yyResult.semanticValue();
07032:
07033: // Commit the state modification.
07034: yyState.commit();
07035:
07036: return yyResult.createValue(yyValue, yyError);
07037: }
07038:
07039: // Alternative <Expression>.
07040:
07041: yyOption1 = yyStart;
07042: yyOpValue1 = null;
07043:
07044: yyResult = pCommaExpression(yyOption1);
07045: yyError = yyResult.select(yyError);
07046: if (yyResult.hasValue()) {
07047: final Node v$el$3 = yyResult.semanticValue();
07048:
07049: yyOption1 = yyResult.index;
07050: yyOpValue1 = v$el$3;
07051: }
07052: { // Start scope for yyValue.
07053: yyValue = yyOpValue1;
07054:
07055: yyBase = yyOption1;
07056: yyResult = pSymbol(yyBase);
07057: yyError = yyResult.select(yyError);
07058: if (yyResult.hasValue(";")) {
07059:
07060: // Commit the state modification.
07061: yyState.commit();
07062:
07063: return yyResult.createValue(yyValue, yyError);
07064: } else {
07065: yyError = yyError.select("\";\" expected", yyBase);
07066: }
07067: } // End scope for yyValue.
07068:
07069: // Abort the state modification.
07070: yyState.abort();
07071:
07072: // Done.
07073: return yyError;
07074: }
07075:
07076: // =========================================================================
07077:
07078: /**
07079: * Parse nonterminal xtc.lang.CPattern.CommaExpression.
07080: *
07081: * @param yyStart The index.
07082: * @return The result.
07083: * @throws IOException Signals an I/O error.
07084: */
07085: private Result pCommaExpression(final int yyStart)
07086: throws IOException {
07087: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
07088: if (null == yyColumn.chunk2)
07089: yyColumn.chunk2 = new Chunk2();
07090: if (null == yyColumn.chunk2.fCommaExpression)
07091: yyColumn.chunk2.fCommaExpression = pCommaExpression$1(yyStart);
07092: return yyColumn.chunk2.fCommaExpression;
07093: }
07094:
07095: /** Actually parse xtc.lang.CPattern.CommaExpression. */
07096: private Result pCommaExpression$1(final int yyStart)
07097: throws IOException {
07098: Result yyResult;
07099: int yyRepetition1;
07100: Pair<Action<Node>> yyRepValue1;
07101: Node yyValue;
07102: ParseError yyError = ParseError.DUMMY;
07103:
07104: // Alternative <Base>.
07105:
07106: yyResult = pAssignmentExpression(yyStart);
07107: yyError = yyResult.select(yyError);
07108: if (yyResult.hasValue()) {
07109: final Node v$3 = yyResult.semanticValue();
07110:
07111: yyRepetition1 = yyResult.index;
07112: yyRepValue1 = Pair.empty();
07113: while (true) {
07114:
07115: yyResult = pCommaExpression$$Tail1(yyRepetition1);
07116: yyError = yyResult.select(yyError);
07117: if (yyResult.hasValue()) {
07118: final Action<Node> v$4 = yyResult.semanticValue();
07119:
07120: yyRepetition1 = yyResult.index;
07121: yyRepValue1 = new Pair<Action<Node>>(v$4,
07122: yyRepValue1);
07123: continue;
07124: }
07125: break;
07126: }
07127: { // Start scope for v$5.
07128: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
07129:
07130: yyValue = apply(v$5, v$3, yyStart);
07131:
07132: return new SemanticValue(yyValue, yyRepetition1,
07133: yyError);
07134: } // End scope for v$5.
07135: }
07136:
07137: // Done.
07138: return yyError;
07139: }
07140:
07141: // =========================================================================
07142:
07143: /**
07144: * Parse synthetic nonterminal xtc.lang.CFactory.CommaExpression$$Tail1.
07145: *
07146: * @param yyStart The index.
07147: * @return The result.
07148: * @throws IOException Signals an I/O error.
07149: */
07150: private Result pCommaExpression$$Tail1(final int yyStart)
07151: throws IOException {
07152:
07153: Result yyResult;
07154: Action<Node> yyValue;
07155: ParseError yyError = ParseError.DUMMY;
07156:
07157: // Alternative <Comma>.
07158:
07159: yyResult = pSymbol(yyStart);
07160: yyError = yyResult.select(yyError);
07161: if (yyResult.hasValue(",")) {
07162:
07163: yyResult = pAssignmentExpression(yyResult.index);
07164: yyError = yyResult.select(yyError);
07165: if (yyResult.hasValue()) {
07166: final Node v$g$2 = yyResult.semanticValue();
07167:
07168: yyValue = new Action<Node>() {
07169: public Node run(Node v$1) {
07170: return GNode.create("CommaExpression", v$1,
07171: v$g$2);
07172: }
07173: };
07174:
07175: return yyResult.createValue(yyValue, yyError);
07176: }
07177: }
07178:
07179: // Done.
07180: yyError = yyError.select("comma expression expected", yyStart);
07181: return yyError;
07182: }
07183:
07184: // =========================================================================
07185:
07186: /**
07187: * Parse nonterminal xtc.lang.CPattern.AssignmentExpression.
07188: *
07189: * @param yyStart The index.
07190: * @return The result.
07191: * @throws IOException Signals an I/O error.
07192: */
07193: private Result pAssignmentExpression(final int yyStart)
07194: throws IOException {
07195: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
07196: if (null == yyColumn.chunk2)
07197: yyColumn.chunk2 = new Chunk2();
07198: if (null == yyColumn.chunk2.fAssignmentExpression)
07199: yyColumn.chunk2.fAssignmentExpression = pAssignmentExpression$1(yyStart);
07200: return yyColumn.chunk2.fAssignmentExpression;
07201: }
07202:
07203: /** Actually parse xtc.lang.CPattern.AssignmentExpression. */
07204: private Result pAssignmentExpression$1(final int yyStart)
07205: throws IOException {
07206:
07207: Result yyResult;
07208: Node yyValue;
07209: ParseError yyError = ParseError.DUMMY;
07210:
07211: // Alternative <Assignment>.
07212:
07213: yyResult = pUnaryExpression(yyStart);
07214: yyError = yyResult.select(yyError);
07215: if (yyResult.hasValue()) {
07216: final Node v$g$1 = yyResult.semanticValue();
07217:
07218: yyResult = pAssignmentOperator(yyResult.index);
07219: yyError = yyResult.select(yyError);
07220: if (yyResult.hasValue()) {
07221: final String v$g$2 = yyResult.semanticValue();
07222:
07223: yyResult = pAssignmentExpression(yyResult.index);
07224: yyError = yyResult.select(yyError);
07225: if (yyResult.hasValue()) {
07226: final Node v$g$3 = yyResult.semanticValue();
07227:
07228: yyValue = GNode.create("AssignmentExpression",
07229: v$g$1, v$g$2, v$g$3);
07230: yyValue.setLocation(location(yyStart));
07231:
07232: return yyResult.createValue(yyValue, yyError);
07233: }
07234: }
07235: }
07236:
07237: // Alternative <Base>.
07238:
07239: yyResult = pConditionalExpression(yyStart);
07240: yyError = yyResult.select(yyError);
07241: if (yyResult.hasValue()) {
07242: yyValue = yyResult.semanticValue();
07243:
07244: return yyResult.createValue(yyValue, yyError);
07245: }
07246:
07247: // Done.
07248: return yyError;
07249: }
07250:
07251: // =========================================================================
07252:
07253: /**
07254: * Parse nonterminal xtc.lang.CPattern.AssignmentOperator.
07255: *
07256: * @param yyStart The index.
07257: * @return The result.
07258: * @throws IOException Signals an I/O error.
07259: */
07260: private Result pAssignmentOperator(final int yyStart)
07261: throws IOException {
07262: Result yyResult;
07263: String yyValue;
07264: ParseError yyError = ParseError.DUMMY;
07265:
07266: // Alternative <Equal>.
07267:
07268: yyResult = pSymbol(yyStart);
07269: yyError = yyResult.select(yyError);
07270: if (yyResult.hasValue("=")) {
07271: yyValue = "=";
07272:
07273: return yyResult.createValue(yyValue, yyError);
07274: }
07275:
07276: // Alternative <PlusEqual>.
07277:
07278: yyResult = pSymbol(yyStart);
07279: yyError = yyResult.select(yyError);
07280: if (yyResult.hasValue("+=")) {
07281: yyValue = "+=";
07282:
07283: return yyResult.createValue(yyValue, yyError);
07284: }
07285:
07286: // Alternative <MinusEqual>.
07287:
07288: yyResult = pSymbol(yyStart);
07289: yyError = yyResult.select(yyError);
07290: if (yyResult.hasValue("-=")) {
07291: yyValue = "-=";
07292:
07293: return yyResult.createValue(yyValue, yyError);
07294: }
07295:
07296: // Alternative <TimesEqual>.
07297:
07298: yyResult = pSymbol(yyStart);
07299: yyError = yyResult.select(yyError);
07300: if (yyResult.hasValue("*=")) {
07301: yyValue = "*=";
07302:
07303: return yyResult.createValue(yyValue, yyError);
07304: }
07305:
07306: // Alternative <OverEqual>.
07307:
07308: yyResult = pSymbol(yyStart);
07309: yyError = yyResult.select(yyError);
07310: if (yyResult.hasValue("/=")) {
07311: yyValue = "/=";
07312:
07313: return yyResult.createValue(yyValue, yyError);
07314: }
07315:
07316: // Alternative <ModuloEqual>.
07317:
07318: yyResult = pSymbol(yyStart);
07319: yyError = yyResult.select(yyError);
07320: if (yyResult.hasValue("%=")) {
07321: yyValue = "%=";
07322:
07323: return yyResult.createValue(yyValue, yyError);
07324: }
07325:
07326: // Alternative <LeftEqual>.
07327:
07328: yyResult = pSymbol(yyStart);
07329: yyError = yyResult.select(yyError);
07330: if (yyResult.hasValue("<<=")) {
07331: yyValue = "<<=";
07332:
07333: return yyResult.createValue(yyValue, yyError);
07334: }
07335:
07336: // Alternative <RightEqual>.
07337:
07338: yyResult = pSymbol(yyStart);
07339: yyError = yyResult.select(yyError);
07340: if (yyResult.hasValue(">>=")) {
07341: yyValue = ">>=";
07342:
07343: return yyResult.createValue(yyValue, yyError);
07344: }
07345:
07346: // Alternative <AndEqual>.
07347:
07348: yyResult = pSymbol(yyStart);
07349: yyError = yyResult.select(yyError);
07350: if (yyResult.hasValue("&=")) {
07351: yyValue = "&=";
07352:
07353: return yyResult.createValue(yyValue, yyError);
07354: }
07355:
07356: // Alternative <XorEqual>.
07357:
07358: yyResult = pSymbol(yyStart);
07359: yyError = yyResult.select(yyError);
07360: if (yyResult.hasValue("^=")) {
07361: yyValue = "^=";
07362:
07363: return yyResult.createValue(yyValue, yyError);
07364: }
07365:
07366: // Alternative <OrEqual>.
07367:
07368: yyResult = pSymbol(yyStart);
07369: yyError = yyResult.select(yyError);
07370: if (yyResult.hasValue("|=")) {
07371: yyValue = "|=";
07372:
07373: return yyResult.createValue(yyValue, yyError);
07374: }
07375:
07376: // Done.
07377: yyError = yyError.select("assignment operator expected",
07378: yyStart);
07379: return yyError;
07380: }
07381:
07382: // =========================================================================
07383:
07384: /**
07385: * Parse nonterminal xtc.lang.CPattern.ConditionalExpression.
07386: *
07387: * @param yyStart The index.
07388: * @return The result.
07389: * @throws IOException Signals an I/O error.
07390: */
07391: private Result pConditionalExpression(final int yyStart)
07392: throws IOException {
07393:
07394: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
07395: if (null == yyColumn.chunk2)
07396: yyColumn.chunk2 = new Chunk2();
07397: if (null == yyColumn.chunk2.fConditionalExpression)
07398: yyColumn.chunk2.fConditionalExpression = pConditionalExpression$1(yyStart);
07399: return yyColumn.chunk2.fConditionalExpression;
07400: }
07401:
07402: /** Actually parse xtc.lang.CPattern.ConditionalExpression. */
07403: private Result pConditionalExpression$1(final int yyStart)
07404: throws IOException {
07405:
07406: Result yyResult;
07407: int yyBase;
07408: Node yyValue;
07409: ParseError yyError = ParseError.DUMMY;
07410:
07411: // Alternative <Conditional>.
07412:
07413: yyResult = pLogicalOrExpression(yyStart);
07414: yyError = yyResult.select(yyError);
07415: if (yyResult.hasValue()) {
07416: final Node v$g$1 = yyResult.semanticValue();
07417:
07418: yyBase = yyResult.index;
07419: yyResult = pSymbol(yyBase);
07420: yyError = yyResult.select(yyError);
07421: if (yyResult.hasValue("?")) {
07422:
07423: yyResult = pCommaExpression(yyResult.index);
07424: yyError = yyResult.select(yyError);
07425: if (yyResult.hasValue()) {
07426: final Node v$g$2 = yyResult.semanticValue();
07427:
07428: yyBase = yyResult.index;
07429: yyResult = pSymbol(yyBase);
07430: yyError = yyResult.select(yyError);
07431: if (yyResult.hasValue(":")) {
07432:
07433: yyResult = pConditionalExpression(yyResult.index);
07434: yyError = yyResult.select(yyError);
07435: if (yyResult.hasValue()) {
07436: final Node v$g$3 = yyResult.semanticValue();
07437:
07438: yyValue = GNode.create(
07439: "ConditionalExpression", v$g$1,
07440: v$g$2, v$g$3);
07441: yyValue.setLocation(location(yyStart));
07442:
07443: return yyResult.createValue(yyValue,
07444: yyError);
07445: }
07446: } else {
07447: yyError = yyError.select("\":\" expected",
07448: yyBase);
07449: }
07450: }
07451: } else {
07452: yyError = yyError.select("\"?\" expected", yyBase);
07453: }
07454: }
07455:
07456: // Alternative <IncompleteConditional>.
07457:
07458: if (GCC) {
07459:
07460: yyResult = pLogicalOrExpression(yyStart);
07461: yyError = yyResult.select(yyError);
07462: if (yyResult.hasValue()) {
07463: final Node v$g$4 = yyResult.semanticValue();
07464:
07465: yyBase = yyResult.index;
07466: yyResult = pSymbol(yyBase);
07467: yyError = yyResult.select(yyError);
07468: if (yyResult.hasValue("?")) {
07469:
07470: yyBase = yyResult.index;
07471: yyResult = pSymbol(yyBase);
07472: yyError = yyResult.select(yyError);
07473: if (yyResult.hasValue(":")) {
07474:
07475: yyResult = pConditionalExpression(yyResult.index);
07476: yyError = yyResult.select(yyError);
07477: if (yyResult.hasValue()) {
07478: final Node v$g$6 = yyResult.semanticValue();
07479:
07480: yyValue = GNode.create(
07481: "ConditionalExpression", v$g$4,
07482: null, v$g$6);
07483: yyValue.setLocation(location(yyStart));
07484:
07485: return yyResult.createValue(yyValue,
07486: yyError);
07487: }
07488: } else {
07489: yyError = yyError.select("\":\" expected",
07490: yyBase);
07491: }
07492: } else {
07493: yyError = yyError.select("\"?\" expected", yyBase);
07494: }
07495: }
07496: }
07497:
07498: // Alternative <Base>.
07499:
07500: yyResult = pLogicalOrExpression(yyStart);
07501: yyError = yyResult.select(yyError);
07502: if (yyResult.hasValue()) {
07503: yyValue = yyResult.semanticValue();
07504:
07505: return yyResult.createValue(yyValue, yyError);
07506: }
07507:
07508: // Done.
07509: yyError = yyError.select("conditional expression expected",
07510: yyStart);
07511: return yyError;
07512: }
07513:
07514: // =========================================================================
07515:
07516: /**
07517: * Parse nonterminal xtc.lang.CPattern.LogicalOrExpression.
07518: *
07519: * @param yyStart The index.
07520: * @return The result.
07521: * @throws IOException Signals an I/O error.
07522: */
07523: private Result pLogicalOrExpression(final int yyStart)
07524: throws IOException {
07525: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
07526: if (null == yyColumn.chunk2)
07527: yyColumn.chunk2 = new Chunk2();
07528: if (null == yyColumn.chunk2.fLogicalOrExpression)
07529: yyColumn.chunk2.fLogicalOrExpression = pLogicalOrExpression$1(yyStart);
07530: return yyColumn.chunk2.fLogicalOrExpression;
07531: }
07532:
07533: /** Actually parse xtc.lang.CPattern.LogicalOrExpression. */
07534: private Result pLogicalOrExpression$1(final int yyStart)
07535: throws IOException {
07536:
07537: Result yyResult;
07538: int yyRepetition1;
07539: Pair<Action<Node>> yyRepValue1;
07540: Node yyValue;
07541: ParseError yyError = ParseError.DUMMY;
07542:
07543: // Alternative <Base>.
07544:
07545: yyResult = pLogicalAndExpression(yyStart);
07546: yyError = yyResult.select(yyError);
07547: if (yyResult.hasValue()) {
07548: final Node v$3 = yyResult.semanticValue();
07549:
07550: yyRepetition1 = yyResult.index;
07551: yyRepValue1 = Pair.empty();
07552: while (true) {
07553:
07554: yyResult = pLogicalOrExpression$$Tail1(yyRepetition1);
07555: yyError = yyResult.select(yyError);
07556: if (yyResult.hasValue()) {
07557: final Action<Node> v$4 = yyResult.semanticValue();
07558:
07559: yyRepetition1 = yyResult.index;
07560: yyRepValue1 = new Pair<Action<Node>>(v$4,
07561: yyRepValue1);
07562: continue;
07563: }
07564: break;
07565: }
07566: { // Start scope for v$5.
07567: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
07568:
07569: yyValue = apply(v$5, v$3, yyStart);
07570:
07571: return new SemanticValue(yyValue, yyRepetition1,
07572: yyError);
07573: } // End scope for v$5.
07574: }
07575:
07576: // Done.
07577: return yyError;
07578: }
07579:
07580: // =========================================================================
07581:
07582: /**
07583: * Parse synthetic nonterminal xtc.lang.CFactory.LogicalOrExpression$$Tail1.
07584: *
07585: * @param yyStart The index.
07586: * @return The result.
07587: * @throws IOException Signals an I/O error.
07588: */
07589: private Result pLogicalOrExpression$$Tail1(final int yyStart)
07590: throws IOException {
07591:
07592: Result yyResult;
07593: Action<Node> yyValue;
07594: ParseError yyError = ParseError.DUMMY;
07595:
07596: // Alternative <Or>.
07597:
07598: yyResult = pSymbol(yyStart);
07599: yyError = yyResult.select(yyError);
07600: if (yyResult.hasValue("||")) {
07601:
07602: yyResult = pLogicalAndExpression(yyResult.index);
07603: yyError = yyResult.select(yyError);
07604: if (yyResult.hasValue()) {
07605: final Node v$g$2 = yyResult.semanticValue();
07606:
07607: yyValue = new Action<Node>() {
07608: public Node run(Node v$1) {
07609: return GNode.create("LogicalOrExpression", v$1,
07610: v$g$2);
07611: }
07612: };
07613:
07614: return yyResult.createValue(yyValue, yyError);
07615: }
07616: }
07617:
07618: // Done.
07619: yyError = yyError.select("logical or expression expected",
07620: yyStart);
07621: return yyError;
07622: }
07623:
07624: // =========================================================================
07625:
07626: /**
07627: * Parse nonterminal xtc.lang.CPattern.LogicalAndExpression.
07628: *
07629: * @param yyStart The index.
07630: * @return The result.
07631: * @throws IOException Signals an I/O error.
07632: */
07633: private Result pLogicalAndExpression(final int yyStart)
07634: throws IOException {
07635: Result yyResult;
07636: int yyRepetition1;
07637: Pair<Action<Node>> yyRepValue1;
07638: Node yyValue;
07639: ParseError yyError = ParseError.DUMMY;
07640:
07641: // Alternative <Base>.
07642:
07643: yyResult = pBitwiseOrExpression(yyStart);
07644: yyError = yyResult.select(yyError);
07645: if (yyResult.hasValue()) {
07646: final Node v$3 = yyResult.semanticValue();
07647:
07648: yyRepetition1 = yyResult.index;
07649: yyRepValue1 = Pair.empty();
07650: while (true) {
07651:
07652: yyResult = pLogicalAndExpression$$Tail1(yyRepetition1);
07653: yyError = yyResult.select(yyError);
07654: if (yyResult.hasValue()) {
07655: final Action<Node> v$4 = yyResult.semanticValue();
07656:
07657: yyRepetition1 = yyResult.index;
07658: yyRepValue1 = new Pair<Action<Node>>(v$4,
07659: yyRepValue1);
07660: continue;
07661: }
07662: break;
07663: }
07664: { // Start scope for v$5.
07665: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
07666:
07667: yyValue = apply(v$5, v$3, yyStart);
07668:
07669: return new SemanticValue(yyValue, yyRepetition1,
07670: yyError);
07671: } // End scope for v$5.
07672: }
07673:
07674: // Done.
07675: return yyError;
07676: }
07677:
07678: // =========================================================================
07679:
07680: /**
07681: * Parse synthetic nonterminal
07682: * xtc.lang.CFactory.LogicalAndExpression$$Tail1.
07683: *
07684: * @param yyStart The index.
07685: * @return The result.
07686: * @throws IOException Signals an I/O error.
07687: */
07688: private Result pLogicalAndExpression$$Tail1(final int yyStart)
07689: throws IOException {
07690:
07691: Result yyResult;
07692: Action<Node> yyValue;
07693: ParseError yyError = ParseError.DUMMY;
07694:
07695: // Alternative <And>.
07696:
07697: yyResult = pSymbol(yyStart);
07698: yyError = yyResult.select(yyError);
07699: if (yyResult.hasValue("&&")) {
07700:
07701: yyResult = pBitwiseOrExpression(yyResult.index);
07702: yyError = yyResult.select(yyError);
07703: if (yyResult.hasValue()) {
07704: final Node v$g$2 = yyResult.semanticValue();
07705:
07706: yyValue = new Action<Node>() {
07707: public Node run(Node v$1) {
07708: return GNode.create("LogicalAndExpression",
07709: v$1, v$g$2);
07710: }
07711: };
07712:
07713: return yyResult.createValue(yyValue, yyError);
07714: }
07715: }
07716:
07717: // Done.
07718: yyError = yyError.select("logical and expression expected",
07719: yyStart);
07720: return yyError;
07721: }
07722:
07723: // =========================================================================
07724:
07725: /**
07726: * Parse nonterminal xtc.lang.CPattern.BitwiseOrExpression.
07727: *
07728: * @param yyStart The index.
07729: * @return The result.
07730: * @throws IOException Signals an I/O error.
07731: */
07732: private Result pBitwiseOrExpression(final int yyStart)
07733: throws IOException {
07734: Result yyResult;
07735: int yyRepetition1;
07736: Pair<Action<Node>> yyRepValue1;
07737: Node yyValue;
07738: ParseError yyError = ParseError.DUMMY;
07739:
07740: // Alternative <Base>.
07741:
07742: yyResult = pBitwiseXorExpression(yyStart);
07743: yyError = yyResult.select(yyError);
07744: if (yyResult.hasValue()) {
07745: final Node v$3 = yyResult.semanticValue();
07746:
07747: yyRepetition1 = yyResult.index;
07748: yyRepValue1 = Pair.empty();
07749: while (true) {
07750:
07751: yyResult = pBitwiseOrExpression$$Tail1(yyRepetition1);
07752: yyError = yyResult.select(yyError);
07753: if (yyResult.hasValue()) {
07754: final Action<Node> v$4 = yyResult.semanticValue();
07755:
07756: yyRepetition1 = yyResult.index;
07757: yyRepValue1 = new Pair<Action<Node>>(v$4,
07758: yyRepValue1);
07759: continue;
07760: }
07761: break;
07762: }
07763: { // Start scope for v$5.
07764: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
07765:
07766: yyValue = apply(v$5, v$3, yyStart);
07767:
07768: return new SemanticValue(yyValue, yyRepetition1,
07769: yyError);
07770: } // End scope for v$5.
07771: }
07772:
07773: // Done.
07774: return yyError;
07775: }
07776:
07777: // =========================================================================
07778:
07779: /**
07780: * Parse synthetic nonterminal xtc.lang.CFactory.BitwiseOrExpression$$Tail1.
07781: *
07782: * @param yyStart The index.
07783: * @return The result.
07784: * @throws IOException Signals an I/O error.
07785: */
07786: private Result pBitwiseOrExpression$$Tail1(final int yyStart)
07787: throws IOException {
07788:
07789: Result yyResult;
07790: Action<Node> yyValue;
07791: ParseError yyError = ParseError.DUMMY;
07792:
07793: // Alternative <Or>.
07794:
07795: yyResult = pSymbol(yyStart);
07796: yyError = yyResult.select(yyError);
07797: if (yyResult.hasValue("|")) {
07798:
07799: yyResult = pBitwiseXorExpression(yyResult.index);
07800: yyError = yyResult.select(yyError);
07801: if (yyResult.hasValue()) {
07802: final Node v$g$2 = yyResult.semanticValue();
07803:
07804: yyValue = new Action<Node>() {
07805: public Node run(Node v$1) {
07806: return GNode.create("BitwiseOrExpression", v$1,
07807: v$g$2);
07808: }
07809: };
07810:
07811: return yyResult.createValue(yyValue, yyError);
07812: }
07813: }
07814:
07815: // Done.
07816: yyError = yyError.select("bitwise or expression expected",
07817: yyStart);
07818: return yyError;
07819: }
07820:
07821: // =========================================================================
07822:
07823: /**
07824: * Parse nonterminal xtc.lang.CPattern.BitwiseXorExpression.
07825: *
07826: * @param yyStart The index.
07827: * @return The result.
07828: * @throws IOException Signals an I/O error.
07829: */
07830: private Result pBitwiseXorExpression(final int yyStart)
07831: throws IOException {
07832: Result yyResult;
07833: int yyRepetition1;
07834: Pair<Action<Node>> yyRepValue1;
07835: Node yyValue;
07836: ParseError yyError = ParseError.DUMMY;
07837:
07838: // Alternative <Base>.
07839:
07840: yyResult = pBitwiseAndExpression(yyStart);
07841: yyError = yyResult.select(yyError);
07842: if (yyResult.hasValue()) {
07843: final Node v$3 = yyResult.semanticValue();
07844:
07845: yyRepetition1 = yyResult.index;
07846: yyRepValue1 = Pair.empty();
07847: while (true) {
07848:
07849: yyResult = pBitwiseXorExpression$$Tail1(yyRepetition1);
07850: yyError = yyResult.select(yyError);
07851: if (yyResult.hasValue()) {
07852: final Action<Node> v$4 = yyResult.semanticValue();
07853:
07854: yyRepetition1 = yyResult.index;
07855: yyRepValue1 = new Pair<Action<Node>>(v$4,
07856: yyRepValue1);
07857: continue;
07858: }
07859: break;
07860: }
07861: { // Start scope for v$5.
07862: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
07863:
07864: yyValue = apply(v$5, v$3, yyStart);
07865:
07866: return new SemanticValue(yyValue, yyRepetition1,
07867: yyError);
07868: } // End scope for v$5.
07869: }
07870:
07871: // Done.
07872: return yyError;
07873: }
07874:
07875: // =========================================================================
07876:
07877: /**
07878: * Parse synthetic nonterminal
07879: * xtc.lang.CFactory.BitwiseXorExpression$$Tail1.
07880: *
07881: * @param yyStart The index.
07882: * @return The result.
07883: * @throws IOException Signals an I/O error.
07884: */
07885: private Result pBitwiseXorExpression$$Tail1(final int yyStart)
07886: throws IOException {
07887:
07888: Result yyResult;
07889: Action<Node> yyValue;
07890: ParseError yyError = ParseError.DUMMY;
07891:
07892: // Alternative <Xor>.
07893:
07894: yyResult = pSymbol(yyStart);
07895: yyError = yyResult.select(yyError);
07896: if (yyResult.hasValue("^")) {
07897:
07898: yyResult = pBitwiseAndExpression(yyResult.index);
07899: yyError = yyResult.select(yyError);
07900: if (yyResult.hasValue()) {
07901: final Node v$g$2 = yyResult.semanticValue();
07902:
07903: yyValue = new Action<Node>() {
07904: public Node run(Node v$1) {
07905: return GNode.create("BitwiseXorExpression",
07906: v$1, v$g$2);
07907: }
07908: };
07909:
07910: return yyResult.createValue(yyValue, yyError);
07911: }
07912: }
07913:
07914: // Done.
07915: yyError = yyError.select("bitwise xor expression expected",
07916: yyStart);
07917: return yyError;
07918: }
07919:
07920: // =========================================================================
07921:
07922: /**
07923: * Parse nonterminal xtc.lang.CPattern.BitwiseAndExpression.
07924: *
07925: * @param yyStart The index.
07926: * @return The result.
07927: * @throws IOException Signals an I/O error.
07928: */
07929: private Result pBitwiseAndExpression(final int yyStart)
07930: throws IOException {
07931: Result yyResult;
07932: int yyRepetition1;
07933: Pair<Action<Node>> yyRepValue1;
07934: Node yyValue;
07935: ParseError yyError = ParseError.DUMMY;
07936:
07937: // Alternative <Base>.
07938:
07939: yyResult = pEqualityExpression(yyStart);
07940: yyError = yyResult.select(yyError);
07941: if (yyResult.hasValue()) {
07942: final Node v$3 = yyResult.semanticValue();
07943:
07944: yyRepetition1 = yyResult.index;
07945: yyRepValue1 = Pair.empty();
07946: while (true) {
07947:
07948: yyResult = pBitwiseAndExpression$$Tail1(yyRepetition1);
07949: yyError = yyResult.select(yyError);
07950: if (yyResult.hasValue()) {
07951: final Action<Node> v$4 = yyResult.semanticValue();
07952:
07953: yyRepetition1 = yyResult.index;
07954: yyRepValue1 = new Pair<Action<Node>>(v$4,
07955: yyRepValue1);
07956: continue;
07957: }
07958: break;
07959: }
07960: { // Start scope for v$5.
07961: final Pair<Action<Node>> v$5 = yyRepValue1.reverse();
07962:
07963: yyValue = apply(v$5, v$3, yyStart);
07964:
07965: return new SemanticValue(yyValue, yyRepetition1,
07966: yyError);
07967: } // End scope for v$5.
07968: }
07969:
07970: // Done.
07971: return yyError;
07972: }
07973:
07974: // =========================================================================
07975:
07976: /**
07977: * Parse synthetic nonterminal
07978: * xtc.lang.CFactory.BitwiseAndExpression$$Tail1.
07979: *
07980: * @param yyStart The index.
07981: * @return The result.
07982: * @throws IOException Signals an I/O error.
07983: */
07984: private Result pBitwiseAndExpression$$Tail1(final int yyStart)
07985: throws IOException {
07986:
07987: Result yyResult;
07988: Action<Node> yyValue;
07989: ParseError yyError = ParseError.DUMMY;
07990:
07991: // Alternative <And>.
07992:
07993: yyResult = pSymbol(yyStart);
07994: yyError = yyResult.select(yyError);
07995: if (yyResult.hasValue("&")) {
07996:
07997: yyResult = pEqualityExpression(yyResult.index);
07998: yyError = yyResult.select(yyError);
07999: if (yyResult.hasValue()) {
08000: final Node v$g$2 = yyResult.semanticValue();
08001:
08002: yyValue = new Action<Node>() {
08003: public Node run(Node v$1) {
08004: return GNode.create("BitwiseAndExpression",
08005: v$1, v$g$2);
08006: }
08007: };
08008:
08009: return yyResult.createValue(yyValue, yyError);
08010: }
08011: }
08012:
08013: // Done.
08014: yyError = yyError.select("bitwise and expression expected",
08015: yyStart);
08016: return yyError;
08017: }
08018:
08019: // =========================================================================
08020:
08021: /**
08022: * Parse nonterminal xtc.lang.CPattern.EqualityExpression.
08023: *
08024: * @param yyStart The index.
08025: * @return The result.
08026: * @throws IOException Signals an I/O error.
08027: */
08028: private Result pEqualityExpression(final int yyStart)
08029: throws IOException {
08030: Result yyResult;
08031: int yyRepetition1;
08032: Pair<Action<Node>> yyRepValue1;
08033: Node yyValue;
08034: ParseError yyError = ParseError.DUMMY;
08035:
08036: // Alternative <Base>.
08037:
08038: yyResult = pRelationalExpression(yyStart);
08039: yyError = yyResult.select(yyError);
08040: if (yyResult.hasValue()) {
08041: final Node v$4 = yyResult.semanticValue();
08042:
08043: yyRepetition1 = yyResult.index;
08044: yyRepValue1 = Pair.empty();
08045: while (true) {
08046:
08047: yyResult = pEqualityExpression$$Tail1(yyRepetition1);
08048: yyError = yyResult.select(yyError);
08049: if (yyResult.hasValue()) {
08050: final Action<Node> v$5 = yyResult.semanticValue();
08051:
08052: yyRepetition1 = yyResult.index;
08053: yyRepValue1 = new Pair<Action<Node>>(v$5,
08054: yyRepValue1);
08055: continue;
08056: }
08057: break;
08058: }
08059: { // Start scope for v$6.
08060: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
08061:
08062: yyValue = apply(v$6, v$4, yyStart);
08063:
08064: return new SemanticValue(yyValue, yyRepetition1,
08065: yyError);
08066: } // End scope for v$6.
08067: }
08068:
08069: // Done.
08070: return yyError;
08071: }
08072:
08073: // =========================================================================
08074:
08075: /**
08076: * Parse synthetic nonterminal xtc.lang.CFactory.EqualityExpression$$Tail1.
08077: *
08078: * @param yyStart The index.
08079: * @return The result.
08080: * @throws IOException Signals an I/O error.
08081: */
08082: private Result pEqualityExpression$$Tail1(final int yyStart)
08083: throws IOException {
08084:
08085: Result yyResult;
08086: Action<Node> yyValue;
08087: ParseError yyError = ParseError.DUMMY;
08088:
08089: // Alternative <Recursion>.
08090:
08091: yyResult = pEqualityOperator(yyStart);
08092: yyError = yyResult.select(yyError);
08093: if (yyResult.hasValue()) {
08094: final String v$g$2 = yyResult.semanticValue();
08095:
08096: yyResult = pRelationalExpression(yyResult.index);
08097: yyError = yyResult.select(yyError);
08098: if (yyResult.hasValue()) {
08099: final Node v$g$3 = yyResult.semanticValue();
08100:
08101: yyValue = new Action<Node>() {
08102: public Node run(Node v$1) {
08103: return GNode.create("EqualityExpression", v$1,
08104: v$g$2, v$g$3);
08105: }
08106: };
08107:
08108: return yyResult.createValue(yyValue, yyError);
08109: }
08110: }
08111:
08112: // Done.
08113: return yyError;
08114: }
08115:
08116: // =========================================================================
08117:
08118: /**
08119: * Parse nonterminal xtc.lang.CPattern.EqualityOperator.
08120: *
08121: * @param yyStart The index.
08122: * @return The result.
08123: * @throws IOException Signals an I/O error.
08124: */
08125: private Result pEqualityOperator(final int yyStart)
08126: throws IOException {
08127: Result yyResult;
08128: String yyValue;
08129: ParseError yyError = ParseError.DUMMY;
08130:
08131: // Alternative <Equal>.
08132:
08133: yyResult = pSymbol(yyStart);
08134: yyError = yyResult.select(yyError);
08135: if (yyResult.hasValue("==")) {
08136: yyValue = "==";
08137:
08138: return yyResult.createValue(yyValue, yyError);
08139: }
08140:
08141: // Alternative <NotEqual>.
08142:
08143: yyResult = pSymbol(yyStart);
08144: yyError = yyResult.select(yyError);
08145: if (yyResult.hasValue("!=")) {
08146: yyValue = "!=";
08147:
08148: return yyResult.createValue(yyValue, yyError);
08149: }
08150:
08151: // Done.
08152: yyError = yyError.select("equality operator expected", yyStart);
08153: return yyError;
08154: }
08155:
08156: // =========================================================================
08157:
08158: /**
08159: * Parse nonterminal xtc.lang.CPattern.RelationalExpression.
08160: *
08161: * @param yyStart The index.
08162: * @return The result.
08163: * @throws IOException Signals an I/O error.
08164: */
08165: private Result pRelationalExpression(final int yyStart)
08166: throws IOException {
08167: Result yyResult;
08168: int yyRepetition1;
08169: Pair<Action<Node>> yyRepValue1;
08170: Node yyValue;
08171: ParseError yyError = ParseError.DUMMY;
08172:
08173: // Alternative <Base>.
08174:
08175: yyResult = pShiftExpression(yyStart);
08176: yyError = yyResult.select(yyError);
08177: if (yyResult.hasValue()) {
08178: final Node v$4 = yyResult.semanticValue();
08179:
08180: yyRepetition1 = yyResult.index;
08181: yyRepValue1 = Pair.empty();
08182: while (true) {
08183:
08184: yyResult = pRelationalExpression$$Tail1(yyRepetition1);
08185: yyError = yyResult.select(yyError);
08186: if (yyResult.hasValue()) {
08187: final Action<Node> v$5 = yyResult.semanticValue();
08188:
08189: yyRepetition1 = yyResult.index;
08190: yyRepValue1 = new Pair<Action<Node>>(v$5,
08191: yyRepValue1);
08192: continue;
08193: }
08194: break;
08195: }
08196: { // Start scope for v$6.
08197: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
08198:
08199: yyValue = apply(v$6, v$4, yyStart);
08200:
08201: return new SemanticValue(yyValue, yyRepetition1,
08202: yyError);
08203: } // End scope for v$6.
08204: }
08205:
08206: // Done.
08207: return yyError;
08208: }
08209:
08210: // =========================================================================
08211:
08212: /**
08213: * Parse synthetic nonterminal
08214: * xtc.lang.CFactory.RelationalExpression$$Tail1.
08215: *
08216: * @param yyStart The index.
08217: * @return The result.
08218: * @throws IOException Signals an I/O error.
08219: */
08220: private Result pRelationalExpression$$Tail1(final int yyStart)
08221: throws IOException {
08222:
08223: Result yyResult;
08224: Action<Node> yyValue;
08225: ParseError yyError = ParseError.DUMMY;
08226:
08227: // Alternative <Recursion>.
08228:
08229: yyResult = pRelationalOperator(yyStart);
08230: yyError = yyResult.select(yyError);
08231: if (yyResult.hasValue()) {
08232: final String v$g$2 = yyResult.semanticValue();
08233:
08234: yyResult = pShiftExpression(yyResult.index);
08235: yyError = yyResult.select(yyError);
08236: if (yyResult.hasValue()) {
08237: final Node v$g$3 = yyResult.semanticValue();
08238:
08239: yyValue = new Action<Node>() {
08240: public Node run(Node v$1) {
08241: return GNode.create("RelationalExpression",
08242: v$1, v$g$2, v$g$3);
08243: }
08244: };
08245:
08246: return yyResult.createValue(yyValue, yyError);
08247: }
08248: }
08249:
08250: // Done.
08251: return yyError;
08252: }
08253:
08254: // =========================================================================
08255:
08256: /**
08257: * Parse nonterminal xtc.lang.CPattern.RelationalOperator.
08258: *
08259: * @param yyStart The index.
08260: * @return The result.
08261: * @throws IOException Signals an I/O error.
08262: */
08263: private Result pRelationalOperator(final int yyStart)
08264: throws IOException {
08265: Result yyResult;
08266: String yyValue;
08267: ParseError yyError = ParseError.DUMMY;
08268:
08269: // Alternative <LessEqual>.
08270:
08271: yyResult = pSymbol(yyStart);
08272: yyError = yyResult.select(yyError);
08273: if (yyResult.hasValue("<=")) {
08274: yyValue = "<=";
08275:
08276: return yyResult.createValue(yyValue, yyError);
08277: }
08278:
08279: // Alternative <Less>.
08280:
08281: yyResult = pSymbol(yyStart);
08282: yyError = yyResult.select(yyError);
08283: if (yyResult.hasValue("<")) {
08284: yyValue = "<";
08285:
08286: return yyResult.createValue(yyValue, yyError);
08287: }
08288:
08289: // Alternative <GreaterEqual>.
08290:
08291: yyResult = pSymbol(yyStart);
08292: yyError = yyResult.select(yyError);
08293: if (yyResult.hasValue(">=")) {
08294: yyValue = ">=";
08295:
08296: return yyResult.createValue(yyValue, yyError);
08297: }
08298:
08299: // Alternative <Greater>.
08300:
08301: yyResult = pSymbol(yyStart);
08302: yyError = yyResult.select(yyError);
08303: if (yyResult.hasValue(">")) {
08304: yyValue = ">";
08305:
08306: return yyResult.createValue(yyValue, yyError);
08307: }
08308:
08309: // Done.
08310: yyError = yyError.select("relational operator expected",
08311: yyStart);
08312: return yyError;
08313: }
08314:
08315: // =========================================================================
08316:
08317: /**
08318: * Parse nonterminal xtc.lang.CPattern.ShiftExpression.
08319: *
08320: * @param yyStart The index.
08321: * @return The result.
08322: * @throws IOException Signals an I/O error.
08323: */
08324: private Result pShiftExpression(final int yyStart)
08325: throws IOException {
08326: Result yyResult;
08327: int yyRepetition1;
08328: Pair<Action<Node>> yyRepValue1;
08329: Node yyValue;
08330: ParseError yyError = ParseError.DUMMY;
08331:
08332: // Alternative <Base>.
08333:
08334: yyResult = pAdditiveExpression(yyStart);
08335: yyError = yyResult.select(yyError);
08336: if (yyResult.hasValue()) {
08337: final Node v$4 = yyResult.semanticValue();
08338:
08339: yyRepetition1 = yyResult.index;
08340: yyRepValue1 = Pair.empty();
08341: while (true) {
08342:
08343: yyResult = pShiftExpression$$Tail1(yyRepetition1);
08344: yyError = yyResult.select(yyError);
08345: if (yyResult.hasValue()) {
08346: final Action<Node> v$5 = yyResult.semanticValue();
08347:
08348: yyRepetition1 = yyResult.index;
08349: yyRepValue1 = new Pair<Action<Node>>(v$5,
08350: yyRepValue1);
08351: continue;
08352: }
08353: break;
08354: }
08355: { // Start scope for v$6.
08356: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
08357:
08358: yyValue = apply(v$6, v$4, yyStart);
08359:
08360: return new SemanticValue(yyValue, yyRepetition1,
08361: yyError);
08362: } // End scope for v$6.
08363: }
08364:
08365: // Done.
08366: return yyError;
08367: }
08368:
08369: // =========================================================================
08370:
08371: /**
08372: * Parse synthetic nonterminal xtc.lang.CFactory.ShiftExpression$$Tail1.
08373: *
08374: * @param yyStart The index.
08375: * @return The result.
08376: * @throws IOException Signals an I/O error.
08377: */
08378: private Result pShiftExpression$$Tail1(final int yyStart)
08379: throws IOException {
08380:
08381: Result yyResult;
08382: Action<Node> yyValue;
08383: ParseError yyError = ParseError.DUMMY;
08384:
08385: // Alternative <Recursion>.
08386:
08387: yyResult = pShiftOperator(yyStart);
08388: yyError = yyResult.select(yyError);
08389: if (yyResult.hasValue()) {
08390: final String v$g$2 = yyResult.semanticValue();
08391:
08392: yyResult = pAdditiveExpression(yyResult.index);
08393: yyError = yyResult.select(yyError);
08394: if (yyResult.hasValue()) {
08395: final Node v$g$3 = yyResult.semanticValue();
08396:
08397: yyValue = new Action<Node>() {
08398: public Node run(Node v$1) {
08399: return GNode.create("ShiftExpression", v$1,
08400: v$g$2, v$g$3);
08401: }
08402: };
08403:
08404: return yyResult.createValue(yyValue, yyError);
08405: }
08406: }
08407:
08408: // Done.
08409: return yyError;
08410: }
08411:
08412: // =========================================================================
08413:
08414: /**
08415: * Parse nonterminal xtc.lang.CPattern.ShiftOperator.
08416: *
08417: * @param yyStart The index.
08418: * @return The result.
08419: * @throws IOException Signals an I/O error.
08420: */
08421: private Result pShiftOperator(final int yyStart) throws IOException {
08422: Result yyResult;
08423: String yyValue;
08424: ParseError yyError = ParseError.DUMMY;
08425:
08426: // Alternative <Left>.
08427:
08428: yyResult = pSymbol(yyStart);
08429: yyError = yyResult.select(yyError);
08430: if (yyResult.hasValue("<<")) {
08431: yyValue = "<<";
08432:
08433: return yyResult.createValue(yyValue, yyError);
08434: }
08435:
08436: // Alternative <Right>.
08437:
08438: yyResult = pSymbol(yyStart);
08439: yyError = yyResult.select(yyError);
08440: if (yyResult.hasValue(">>")) {
08441: yyValue = ">>";
08442:
08443: return yyResult.createValue(yyValue, yyError);
08444: }
08445:
08446: // Done.
08447: yyError = yyError.select("shift operator expected", yyStart);
08448: return yyError;
08449: }
08450:
08451: // =========================================================================
08452:
08453: /**
08454: * Parse nonterminal xtc.lang.CPattern.AdditiveExpression.
08455: *
08456: * @param yyStart The index.
08457: * @return The result.
08458: * @throws IOException Signals an I/O error.
08459: */
08460: private Result pAdditiveExpression(final int yyStart)
08461: throws IOException {
08462: Result yyResult;
08463: int yyRepetition1;
08464: Pair<Action<Node>> yyRepValue1;
08465: Node yyValue;
08466: ParseError yyError = ParseError.DUMMY;
08467:
08468: // Alternative <Base>.
08469:
08470: yyResult = pMultiplicativeExpression(yyStart);
08471: yyError = yyResult.select(yyError);
08472: if (yyResult.hasValue()) {
08473: final Node v$4 = yyResult.semanticValue();
08474:
08475: yyRepetition1 = yyResult.index;
08476: yyRepValue1 = Pair.empty();
08477: while (true) {
08478:
08479: yyResult = pAdditiveExpression$$Tail1(yyRepetition1);
08480: yyError = yyResult.select(yyError);
08481: if (yyResult.hasValue()) {
08482: final Action<Node> v$5 = yyResult.semanticValue();
08483:
08484: yyRepetition1 = yyResult.index;
08485: yyRepValue1 = new Pair<Action<Node>>(v$5,
08486: yyRepValue1);
08487: continue;
08488: }
08489: break;
08490: }
08491: { // Start scope for v$6.
08492: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
08493:
08494: yyValue = apply(v$6, v$4, yyStart);
08495:
08496: return new SemanticValue(yyValue, yyRepetition1,
08497: yyError);
08498: } // End scope for v$6.
08499: }
08500:
08501: // Done.
08502: return yyError;
08503: }
08504:
08505: // =========================================================================
08506:
08507: /**
08508: * Parse synthetic nonterminal xtc.lang.CFactory.AdditiveExpression$$Tail1.
08509: *
08510: * @param yyStart The index.
08511: * @return The result.
08512: * @throws IOException Signals an I/O error.
08513: */
08514: private Result pAdditiveExpression$$Tail1(final int yyStart)
08515: throws IOException {
08516:
08517: Result yyResult;
08518: Action<Node> yyValue;
08519: ParseError yyError = ParseError.DUMMY;
08520:
08521: // Alternative <Recursion>.
08522:
08523: yyResult = pAdditiveOperator(yyStart);
08524: yyError = yyResult.select(yyError);
08525: if (yyResult.hasValue()) {
08526: final String v$g$2 = yyResult.semanticValue();
08527:
08528: yyResult = pMultiplicativeExpression(yyResult.index);
08529: yyError = yyResult.select(yyError);
08530: if (yyResult.hasValue()) {
08531: final Node v$g$3 = yyResult.semanticValue();
08532:
08533: yyValue = new Action<Node>() {
08534: public Node run(Node v$1) {
08535: return GNode.create("AdditiveExpression", v$1,
08536: v$g$2, v$g$3);
08537: }
08538: };
08539:
08540: return yyResult.createValue(yyValue, yyError);
08541: }
08542: }
08543:
08544: // Done.
08545: return yyError;
08546: }
08547:
08548: // =========================================================================
08549:
08550: /**
08551: * Parse nonterminal xtc.lang.CPattern.AdditiveOperator.
08552: *
08553: * @param yyStart The index.
08554: * @return The result.
08555: * @throws IOException Signals an I/O error.
08556: */
08557: private Result pAdditiveOperator(final int yyStart)
08558: throws IOException {
08559: Result yyResult;
08560: String yyValue;
08561: ParseError yyError = ParseError.DUMMY;
08562:
08563: // Alternative <Plus>.
08564:
08565: yyResult = pSymbol(yyStart);
08566: yyError = yyResult.select(yyError);
08567: if (yyResult.hasValue("+")) {
08568: yyValue = "+";
08569:
08570: return yyResult.createValue(yyValue, yyError);
08571: }
08572:
08573: // Alternative <Minus>.
08574:
08575: yyResult = pSymbol(yyStart);
08576: yyError = yyResult.select(yyError);
08577: if (yyResult.hasValue("-")) {
08578: yyValue = "-";
08579:
08580: return yyResult.createValue(yyValue, yyError);
08581: }
08582:
08583: // Done.
08584: yyError = yyError.select("additive operator expected", yyStart);
08585: return yyError;
08586: }
08587:
08588: // =========================================================================
08589:
08590: /**
08591: * Parse nonterminal xtc.lang.CPattern.MultiplicativeExpression.
08592: *
08593: * @param yyStart The index.
08594: * @return The result.
08595: * @throws IOException Signals an I/O error.
08596: */
08597: private Result pMultiplicativeExpression(final int yyStart)
08598: throws IOException {
08599:
08600: Result yyResult;
08601: int yyRepetition1;
08602: Pair<Action<Node>> yyRepValue1;
08603: Node yyValue;
08604: ParseError yyError = ParseError.DUMMY;
08605:
08606: // Alternative <Base>.
08607:
08608: yyResult = pCastExpression(yyStart);
08609: yyError = yyResult.select(yyError);
08610: if (yyResult.hasValue()) {
08611: final Node v$4 = yyResult.semanticValue();
08612:
08613: yyRepetition1 = yyResult.index;
08614: yyRepValue1 = Pair.empty();
08615: while (true) {
08616:
08617: yyResult = pMultiplicativeExpression$$Tail1(yyRepetition1);
08618: yyError = yyResult.select(yyError);
08619: if (yyResult.hasValue()) {
08620: final Action<Node> v$5 = yyResult.semanticValue();
08621:
08622: yyRepetition1 = yyResult.index;
08623: yyRepValue1 = new Pair<Action<Node>>(v$5,
08624: yyRepValue1);
08625: continue;
08626: }
08627: break;
08628: }
08629: { // Start scope for v$6.
08630: final Pair<Action<Node>> v$6 = yyRepValue1.reverse();
08631:
08632: yyValue = apply(v$6, v$4, yyStart);
08633:
08634: return new SemanticValue(yyValue, yyRepetition1,
08635: yyError);
08636: } // End scope for v$6.
08637: }
08638:
08639: // Done.
08640: return yyError;
08641: }
08642:
08643: // =========================================================================
08644:
08645: /**
08646: * Parse synthetic nonterminal
08647: * xtc.lang.CFactory.MultiplicativeExpression$$Tail1.
08648: *
08649: * @param yyStart The index.
08650: * @return The result.
08651: * @throws IOException Signals an I/O error.
08652: */
08653: private Result pMultiplicativeExpression$$Tail1(final int yyStart)
08654: throws IOException {
08655:
08656: Result yyResult;
08657: Action<Node> yyValue;
08658: ParseError yyError = ParseError.DUMMY;
08659:
08660: // Alternative <Recursion>.
08661:
08662: yyResult = pMultiplicativeOperator(yyStart);
08663: yyError = yyResult.select(yyError);
08664: if (yyResult.hasValue()) {
08665: final String v$g$2 = yyResult.semanticValue();
08666:
08667: yyResult = pCastExpression(yyResult.index);
08668: yyError = yyResult.select(yyError);
08669: if (yyResult.hasValue()) {
08670: final Node v$g$3 = yyResult.semanticValue();
08671:
08672: yyValue = new Action<Node>() {
08673: public Node run(Node v$1) {
08674: return GNode.create("MultiplicativeExpression",
08675: v$1, v$g$2, v$g$3);
08676: }
08677: };
08678:
08679: return yyResult.createValue(yyValue, yyError);
08680: }
08681: }
08682:
08683: // Done.
08684: return yyError;
08685: }
08686:
08687: // =========================================================================
08688:
08689: /**
08690: * Parse nonterminal xtc.lang.CPattern.MultiplicativeOperator.
08691: *
08692: * @param yyStart The index.
08693: * @return The result.
08694: * @throws IOException Signals an I/O error.
08695: */
08696: private Result pMultiplicativeOperator(final int yyStart)
08697: throws IOException {
08698:
08699: Result yyResult;
08700: String yyValue;
08701: ParseError yyError = ParseError.DUMMY;
08702:
08703: // Alternative <Times>.
08704:
08705: yyResult = pSymbol(yyStart);
08706: yyError = yyResult.select(yyError);
08707: if (yyResult.hasValue("*")) {
08708: yyValue = "*";
08709:
08710: return yyResult.createValue(yyValue, yyError);
08711: }
08712:
08713: // Alternative <Over>.
08714:
08715: yyResult = pSymbol(yyStart);
08716: yyError = yyResult.select(yyError);
08717: if (yyResult.hasValue("/")) {
08718: yyValue = "/";
08719:
08720: return yyResult.createValue(yyValue, yyError);
08721: }
08722:
08723: // Alternative <Modulo>.
08724:
08725: yyResult = pSymbol(yyStart);
08726: yyError = yyResult.select(yyError);
08727: if (yyResult.hasValue("%")) {
08728: yyValue = "%";
08729:
08730: return yyResult.createValue(yyValue, yyError);
08731: }
08732:
08733: // Done.
08734: yyError = yyError.select("multiplicative operator expected",
08735: yyStart);
08736: return yyError;
08737: }
08738:
08739: // =========================================================================
08740:
08741: /**
08742: * Parse nonterminal xtc.lang.CPattern.CastExpression.
08743: *
08744: * @param yyStart The index.
08745: * @return The result.
08746: * @throws IOException Signals an I/O error.
08747: */
08748: private Result pCastExpression(final int yyStart)
08749: throws IOException {
08750: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
08751: if (null == yyColumn.chunk3)
08752: yyColumn.chunk3 = new Chunk3();
08753: if (null == yyColumn.chunk3.fCastExpression)
08754: yyColumn.chunk3.fCastExpression = pCastExpression$1(yyStart);
08755: return yyColumn.chunk3.fCastExpression;
08756: }
08757:
08758: /** Actually parse xtc.lang.CPattern.CastExpression. */
08759: private Result pCastExpression$1(final int yyStart)
08760: throws IOException {
08761: Result yyResult;
08762: int yyBase;
08763: Node yyValue;
08764: ParseError yyError = ParseError.DUMMY;
08765:
08766: // Alternative <Cast>.
08767:
08768: yyResult = pSymbol(yyStart);
08769: yyError = yyResult.select(yyError);
08770: if (yyResult.hasValue("(")) {
08771:
08772: yyResult = pTypeName(yyResult.index);
08773: yyError = yyResult.select(yyError);
08774: if (yyResult.hasValue()) {
08775: final Node v$g$1 = yyResult.semanticValue();
08776:
08777: yyBase = yyResult.index;
08778: yyResult = pSymbol(yyBase);
08779: yyError = yyResult.select(yyError);
08780: if (yyResult.hasValue(")")) {
08781:
08782: yyResult = pCastExpression(yyResult.index);
08783: yyError = yyResult.select(yyError);
08784: if (yyResult.hasValue()) {
08785: final Node v$g$2 = yyResult.semanticValue();
08786:
08787: yyValue = GNode.create("CastExpression", v$g$1,
08788: v$g$2);
08789: yyValue.setLocation(location(yyStart));
08790:
08791: return yyResult.createValue(yyValue, yyError);
08792: }
08793: } else {
08794: yyError = yyError.select("\")\" expected", yyBase);
08795: }
08796: }
08797: }
08798:
08799: // Alternative <Base>.
08800:
08801: yyResult = pUnaryExpression(yyStart);
08802: yyError = yyResult.select(yyError);
08803: if (yyResult.hasValue()) {
08804: yyValue = yyResult.semanticValue();
08805:
08806: return yyResult.createValue(yyValue, yyError);
08807: }
08808:
08809: // Done.
08810: yyError = yyError.select("cast expression expected", yyStart);
08811: return yyError;
08812: }
08813:
08814: // =========================================================================
08815:
08816: /**
08817: * Parse nonterminal xtc.lang.CPattern.UnaryExpression.
08818: *
08819: * @param yyStart The index.
08820: * @return The result.
08821: * @throws IOException Signals an I/O error.
08822: */
08823: private Result pUnaryExpression(final int yyStart)
08824: throws IOException {
08825: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
08826: if (null == yyColumn.chunk3)
08827: yyColumn.chunk3 = new Chunk3();
08828: if (null == yyColumn.chunk3.fUnaryExpression)
08829: yyColumn.chunk3.fUnaryExpression = pUnaryExpression$1(yyStart);
08830: return yyColumn.chunk3.fUnaryExpression;
08831: }
08832:
08833: /** Actually parse xtc.lang.CPattern.UnaryExpression. */
08834: private Result pUnaryExpression$1(final int yyStart)
08835: throws IOException {
08836: Result yyResult;
08837: Result yyPredResult;
08838: boolean yyPredMatched;
08839: int yyBase;
08840: Node yyValue;
08841: ParseError yyError = ParseError.DUMMY;
08842:
08843: // Alternative 1.
08844:
08845: yyResult = pKeyword(yyStart);
08846: yyError = yyResult.select(yyError);
08847: if (yyResult.hasValue("sizeof")) {
08848:
08849: final int yyChoice1 = yyResult.index;
08850:
08851: // Nested alternative 1.
08852:
08853: yyBase = yyChoice1;
08854: yyResult = pSymbol(yyBase);
08855: yyError = yyResult.select(yyError);
08856: if (yyResult.hasValue("(")) {
08857:
08858: yyResult = pTypeName(yyResult.index);
08859: yyError = yyResult.select(yyError);
08860: if (yyResult.hasValue()) {
08861: final Node v$g$1 = yyResult.semanticValue();
08862:
08863: yyBase = yyResult.index;
08864: yyResult = pSymbol(yyBase);
08865: yyError = yyResult.select(yyError);
08866: if (yyResult.hasValue(")")) {
08867:
08868: yyPredMatched = false;
08869:
08870: yyPredResult = pSymbol(yyResult.index);
08871: if (yyPredResult.hasValue("{")) {
08872:
08873: yyPredMatched = true;
08874: }
08875:
08876: if (!yyPredMatched) {
08877:
08878: yyValue = GNode.create("SizeofExpression",
08879: v$g$1);
08880: yyValue.setLocation(location(yyStart));
08881:
08882: return yyResult.createValue(yyValue,
08883: yyError);
08884: } else {
08885: yyError = yyError.select(
08886: "unary expression expected",
08887: yyStart);
08888: }
08889: } else {
08890: yyError = yyError.select("\")\" expected",
08891: yyBase);
08892: }
08893: }
08894: } else {
08895: yyError = yyError.select("\"(\" expected", yyBase);
08896: }
08897:
08898: // Nested alternative 2.
08899:
08900: yyResult = pUnaryExpression(yyChoice1);
08901: yyError = yyResult.select(yyError);
08902: if (yyResult.hasValue()) {
08903: final Node v$g$2 = yyResult.semanticValue();
08904:
08905: yyValue = GNode.create("SizeofExpression", v$g$2);
08906: yyValue.setLocation(location(yyStart));
08907:
08908: return yyResult.createValue(yyValue, yyError);
08909: }
08910: }
08911:
08912: // Alternative 2.
08913:
08914: yyResult = pAlignofKeyword(yyStart);
08915: yyError = yyResult.select(yyError);
08916: if (yyResult.hasValue()) {
08917:
08918: final int yyChoice1 = yyResult.index;
08919:
08920: // Nested alternative 1.
08921:
08922: yyBase = yyChoice1;
08923: yyResult = pSymbol(yyBase);
08924: yyError = yyResult.select(yyError);
08925: if (yyResult.hasValue("(")) {
08926:
08927: yyResult = pTypeName(yyResult.index);
08928: yyError = yyResult.select(yyError);
08929: if (yyResult.hasValue()) {
08930: final Node v$g$1 = yyResult.semanticValue();
08931:
08932: yyBase = yyResult.index;
08933: yyResult = pSymbol(yyBase);
08934: yyError = yyResult.select(yyError);
08935: if (yyResult.hasValue(")")) {
08936:
08937: yyPredMatched = false;
08938:
08939: yyPredResult = pSymbol(yyResult.index);
08940: if (yyPredResult.hasValue("{")) {
08941:
08942: yyPredMatched = true;
08943: }
08944:
08945: if (!yyPredMatched) {
08946:
08947: yyValue = GNode.create("AlignofExpression",
08948: v$g$1);
08949: yyValue.setLocation(location(yyStart));
08950:
08951: return yyResult.createValue(yyValue,
08952: yyError);
08953: } else {
08954: yyError = yyError.select(
08955: "unary expression expected",
08956: yyStart);
08957: }
08958: } else {
08959: yyError = yyError.select("\")\" expected",
08960: yyBase);
08961: }
08962: }
08963: } else {
08964: yyError = yyError.select("\"(\" expected", yyBase);
08965: }
08966:
08967: // Nested alternative 2.
08968:
08969: yyResult = pUnaryExpression(yyChoice1);
08970: yyError = yyResult.select(yyError);
08971: if (yyResult.hasValue()) {
08972: final Node v$g$2 = yyResult.semanticValue();
08973:
08974: yyValue = GNode.create("AlignofExpression", v$g$2);
08975: yyValue.setLocation(location(yyStart));
08976:
08977: return yyResult.createValue(yyValue, yyError);
08978: }
08979: }
08980:
08981: // Alternative 3.
08982:
08983: yyResult = pKeyword(yyStart);
08984: yyError = yyResult.select(yyError);
08985: if (yyResult.hasValue("__builtin_offsetof")) {
08986:
08987: yyBase = yyResult.index;
08988: yyResult = pSymbol(yyBase);
08989: yyError = yyResult.select(yyError);
08990: if (yyResult.hasValue("(")) {
08991:
08992: yyResult = pTypeName(yyResult.index);
08993: yyError = yyResult.select(yyError);
08994: if (yyResult.hasValue()) {
08995: final Node v$g$1 = yyResult.semanticValue();
08996:
08997: yyBase = yyResult.index;
08998: yyResult = pSymbol(yyBase);
08999: yyError = yyResult.select(yyError);
09000: if (yyResult.hasValue(",")) {
09001:
09002: yyResult = pPostfixExpression(yyResult.index);
09003: yyError = yyResult.select(yyError);
09004: if (yyResult.hasValue()) {
09005: final Node v$g$2 = yyResult.semanticValue();
09006:
09007: yyBase = yyResult.index;
09008: yyResult = pSymbol(yyBase);
09009: yyError = yyResult.select(yyError);
09010: if (yyResult.hasValue(")")) {
09011:
09012: yyValue = GNode.create(
09013: "OffsetofExpression", v$g$1,
09014: v$g$2);
09015: yyValue.setLocation(location(yyStart));
09016:
09017: return yyResult.createValue(yyValue,
09018: yyError);
09019: } else {
09020: yyError = yyError.select(
09021: "\")\" expected", yyBase);
09022: }
09023: }
09024: } else {
09025: yyError = yyError.select("\",\" expected",
09026: yyBase);
09027: }
09028: }
09029: } else {
09030: yyError = yyError.select("\"(\" expected", yyBase);
09031: }
09032: }
09033:
09034: // Alternative 4.
09035:
09036: yyResult = pKeyword(yyStart);
09037: yyError = yyResult.select(yyError);
09038: if (yyResult.hasValue("__builtin_types_compatible_p")) {
09039:
09040: yyBase = yyResult.index;
09041: yyResult = pSymbol(yyBase);
09042: yyError = yyResult.select(yyError);
09043: if (yyResult.hasValue("(")) {
09044:
09045: yyResult = pTypeName(yyResult.index);
09046: yyError = yyResult.select(yyError);
09047: if (yyResult.hasValue()) {
09048: final Node v$g$1 = yyResult.semanticValue();
09049:
09050: yyBase = yyResult.index;
09051: yyResult = pSymbol(yyBase);
09052: yyError = yyResult.select(yyError);
09053: if (yyResult.hasValue(",")) {
09054:
09055: yyResult = pTypeName(yyResult.index);
09056: yyError = yyResult.select(yyError);
09057: if (yyResult.hasValue()) {
09058: final Node v$g$2 = yyResult.semanticValue();
09059:
09060: yyBase = yyResult.index;
09061: yyResult = pSymbol(yyBase);
09062: yyError = yyResult.select(yyError);
09063: if (yyResult.hasValue(")")) {
09064:
09065: yyValue = GNode.create(
09066: "TypeCompatibilityExpression",
09067: v$g$1, v$g$2);
09068: yyValue.setLocation(location(yyStart));
09069:
09070: return yyResult.createValue(yyValue,
09071: yyError);
09072: } else {
09073: yyError = yyError.select(
09074: "\")\" expected", yyBase);
09075: }
09076: }
09077: } else {
09078: yyError = yyError.select("\",\" expected",
09079: yyBase);
09080: }
09081: }
09082: } else {
09083: yyError = yyError.select("\"(\" expected", yyBase);
09084: }
09085: }
09086:
09087: // Alternative 5.
09088:
09089: yyResult = pSymbol(yyStart);
09090: yyError = yyResult.select(yyError);
09091: if (yyResult.hasValue("-")) {
09092:
09093: yyResult = pCastExpression(yyResult.index);
09094: yyError = yyResult.select(yyError);
09095: if (yyResult.hasValue()) {
09096: final Node v$g$1 = yyResult.semanticValue();
09097:
09098: yyValue = GNode.create("UnaryMinusExpression", v$g$1);
09099: yyValue.setLocation(location(yyStart));
09100:
09101: return yyResult.createValue(yyValue, yyError);
09102: }
09103: }
09104:
09105: // Alternative 6.
09106:
09107: yyResult = pSymbol(yyStart);
09108: yyError = yyResult.select(yyError);
09109: if (yyResult.hasValue("+")) {
09110:
09111: yyResult = pCastExpression(yyResult.index);
09112: yyError = yyResult.select(yyError);
09113: if (yyResult.hasValue()) {
09114: final Node v$g$1 = yyResult.semanticValue();
09115:
09116: yyValue = GNode.create("UnaryPlusExpression", v$g$1);
09117: yyValue.setLocation(location(yyStart));
09118:
09119: return yyResult.createValue(yyValue, yyError);
09120: }
09121: }
09122:
09123: // Alternative 7.
09124:
09125: yyResult = pSymbol(yyStart);
09126: yyError = yyResult.select(yyError);
09127: if (yyResult.hasValue("!")) {
09128:
09129: yyResult = pCastExpression(yyResult.index);
09130: yyError = yyResult.select(yyError);
09131: if (yyResult.hasValue()) {
09132: final Node v$g$1 = yyResult.semanticValue();
09133:
09134: yyValue = GNode.create("LogicalNegationExpression",
09135: v$g$1);
09136: yyValue.setLocation(location(yyStart));
09137:
09138: return yyResult.createValue(yyValue, yyError);
09139: }
09140: }
09141:
09142: // Alternative 8.
09143:
09144: yyResult = pSymbol(yyStart);
09145: yyError = yyResult.select(yyError);
09146: if (yyResult.hasValue("~")) {
09147:
09148: yyResult = pCastExpression(yyResult.index);
09149: yyError = yyResult.select(yyError);
09150: if (yyResult.hasValue()) {
09151: final Node v$g$1 = yyResult.semanticValue();
09152:
09153: yyValue = GNode.create("BitwiseNegationExpression",
09154: v$g$1);
09155: yyValue.setLocation(location(yyStart));
09156:
09157: return yyResult.createValue(yyValue, yyError);
09158: }
09159: }
09160:
09161: // Alternative 9.
09162:
09163: yyResult = pSymbol(yyStart);
09164: yyError = yyResult.select(yyError);
09165: if (yyResult.hasValue("&")) {
09166:
09167: yyResult = pCastExpression(yyResult.index);
09168: yyError = yyResult.select(yyError);
09169: if (yyResult.hasValue()) {
09170: final Node v$g$1 = yyResult.semanticValue();
09171:
09172: yyValue = GNode.create("AddressExpression", v$g$1);
09173: yyValue.setLocation(location(yyStart));
09174:
09175: return yyResult.createValue(yyValue, yyError);
09176: }
09177: }
09178:
09179: // Alternative 10.
09180:
09181: if (GCC) {
09182:
09183: yyResult = pSymbol(yyStart);
09184: yyError = yyResult.select(yyError);
09185: if (yyResult.hasValue("&&")) {
09186:
09187: yyResult = pCIdentifier$Identifier(yyResult.index);
09188: yyError = yyResult.select(yyError);
09189: if (yyResult.hasValue()) {
09190: final String v$g$1 = yyResult.semanticValue();
09191:
09192: yyValue = GNode.create("LabelAddressExpression",
09193: v$g$1);
09194: yyValue.setLocation(location(yyStart));
09195:
09196: return yyResult.createValue(yyValue, yyError);
09197: }
09198: }
09199: }
09200:
09201: // Alternative 11.
09202:
09203: yyResult = pSymbol(yyStart);
09204: yyError = yyResult.select(yyError);
09205: if (yyResult.hasValue("*")) {
09206:
09207: yyResult = pCastExpression(yyResult.index);
09208: yyError = yyResult.select(yyError);
09209: if (yyResult.hasValue()) {
09210: final Node v$g$1 = yyResult.semanticValue();
09211:
09212: yyValue = GNode.create("IndirectionExpression", v$g$1);
09213: yyValue.setLocation(location(yyStart));
09214:
09215: return yyResult.createValue(yyValue, yyError);
09216: }
09217: }
09218:
09219: // Alternative 12.
09220:
09221: yyResult = pSymbol(yyStart);
09222: yyError = yyResult.select(yyError);
09223: if (yyResult.hasValue("++")) {
09224:
09225: yyResult = pUnaryExpression(yyResult.index);
09226: yyError = yyResult.select(yyError);
09227: if (yyResult.hasValue()) {
09228: final Node v$g$1 = yyResult.semanticValue();
09229:
09230: yyValue = GNode.create("PreincrementExpression", v$g$1);
09231: yyValue.setLocation(location(yyStart));
09232:
09233: return yyResult.createValue(yyValue, yyError);
09234: }
09235: }
09236:
09237: // Alternative 13.
09238:
09239: yyResult = pSymbol(yyStart);
09240: yyError = yyResult.select(yyError);
09241: if (yyResult.hasValue("--")) {
09242:
09243: yyResult = pUnaryExpression(yyResult.index);
09244: yyError = yyResult.select(yyError);
09245: if (yyResult.hasValue()) {
09246: final Node v$g$1 = yyResult.semanticValue();
09247:
09248: yyValue = GNode.create("PredecrementExpression", v$g$1);
09249: yyValue.setLocation(location(yyStart));
09250:
09251: return yyResult.createValue(yyValue, yyError);
09252: }
09253: }
09254:
09255: // Alternative 14.
09256:
09257: if (GCC) {
09258:
09259: yyResult = pKeyword(yyStart);
09260: yyError = yyResult.select(yyError);
09261: if (yyResult.hasValue("__extension__")) {
09262:
09263: yyResult = pCastExpression(yyResult.index);
09264: yyError = yyResult.select(yyError);
09265: if (yyResult.hasValue()) {
09266: final Node v$g$1 = yyResult.semanticValue();
09267:
09268: yyValue = GNode
09269: .create("ExtensionExpression", v$g$1);
09270: yyValue.setLocation(location(yyStart));
09271:
09272: return yyResult.createValue(yyValue, yyError);
09273: }
09274: }
09275: }
09276:
09277: // Alternative <Base>.
09278:
09279: yyResult = pPostfixExpression(yyStart);
09280: yyError = yyResult.select(yyError);
09281: if (yyResult.hasValue()) {
09282: yyValue = yyResult.semanticValue();
09283:
09284: return yyResult.createValue(yyValue, yyError);
09285: }
09286:
09287: // Done.
09288: yyError = yyError.select("unary expression expected", yyStart);
09289: return yyError;
09290: }
09291:
09292: // =========================================================================
09293:
09294: /**
09295: * Parse nonterminal xtc.lang.CPattern.AlignofKeyword.
09296: *
09297: * @param yyStart The index.
09298: * @return The result.
09299: * @throws IOException Signals an I/O error.
09300: */
09301: private Result pAlignofKeyword(final int yyStart)
09302: throws IOException {
09303: Result yyResult;
09304: Void yyValue;
09305: ParseError yyError = ParseError.DUMMY;
09306:
09307: // Alternative 1.
09308:
09309: yyResult = pKeyword(yyStart);
09310: yyError = yyResult.select(yyError);
09311: if (yyResult.hasValue("__alignof__")) {
09312:
09313: yyValue = null;
09314:
09315: return yyResult.createValue(yyValue, yyError);
09316: }
09317:
09318: // Alternative 2.
09319:
09320: yyResult = pKeyword(yyStart);
09321: yyError = yyResult.select(yyError);
09322: if (yyResult.hasValue("__alignof")) {
09323:
09324: yyValue = null;
09325:
09326: return yyResult.createValue(yyValue, yyError);
09327: }
09328:
09329: // Done.
09330: yyError = yyError.select("alignof keyword expected", yyStart);
09331: return yyError;
09332: }
09333:
09334: // =========================================================================
09335:
09336: /**
09337: * Parse nonterminal xtc.lang.CPattern.PostfixExpression.
09338: *
09339: * @param yyStart The index.
09340: * @return The result.
09341: * @throws IOException Signals an I/O error.
09342: */
09343: private Result pPostfixExpression(final int yyStart)
09344: throws IOException {
09345: Result yyResult;
09346: int yyRepetition1;
09347: Pair<Action<Node>> yyRepValue1;
09348: Node yyValue;
09349: ParseError yyError = ParseError.DUMMY;
09350:
09351: // Alternative <Compound>.
09352:
09353: yyResult = pCompoundLiteral(yyStart);
09354: yyError = yyResult.select(yyError);
09355: if (yyResult.hasValue()) {
09356: final Node v$g$9 = yyResult.semanticValue();
09357:
09358: yyRepetition1 = yyResult.index;
09359: yyRepValue1 = Pair.empty();
09360: while (true) {
09361:
09362: yyResult = pPostfixExpression$$Tail1(yyRepetition1);
09363: yyError = yyResult.select(yyError);
09364: if (yyResult.hasValue()) {
09365: final Action<Node> v$10 = yyResult.semanticValue();
09366:
09367: yyRepetition1 = yyResult.index;
09368: yyRepValue1 = new Pair<Action<Node>>(v$10,
09369: yyRepValue1);
09370: continue;
09371: }
09372: break;
09373: }
09374: { // Start scope for v$11.
09375: final Pair<Action<Node>> v$11 = yyRepValue1.reverse();
09376:
09377: yyValue = apply(v$11, v$g$9, yyStart);
09378:
09379: return new SemanticValue(yyValue, yyRepetition1,
09380: yyError);
09381: } // End scope for v$11.
09382: }
09383:
09384: // Alternative <Primary>.
09385:
09386: yyResult = pPrimaryExpression(yyStart);
09387: yyError = yyResult.select(yyError);
09388: if (yyResult.hasValue()) {
09389: final Node v$g$12 = yyResult.semanticValue();
09390:
09391: yyRepetition1 = yyResult.index;
09392: yyRepValue1 = Pair.empty();
09393: while (true) {
09394:
09395: yyResult = pPostfixExpression$$Tail1(yyRepetition1);
09396: yyError = yyResult.select(yyError);
09397: if (yyResult.hasValue()) {
09398: final Action<Node> v$13 = yyResult.semanticValue();
09399:
09400: yyRepetition1 = yyResult.index;
09401: yyRepValue1 = new Pair<Action<Node>>(v$13,
09402: yyRepValue1);
09403: continue;
09404: }
09405: break;
09406: }
09407: { // Start scope for v$14.
09408: final Pair<Action<Node>> v$14 = yyRepValue1.reverse();
09409:
09410: yyValue = apply(v$14, v$g$12, yyStart);
09411:
09412: return new SemanticValue(yyValue, yyRepetition1,
09413: yyError);
09414: } // End scope for v$14.
09415: }
09416:
09417: // Done.
09418: return yyError;
09419: }
09420:
09421: // =========================================================================
09422:
09423: /**
09424: * Parse synthetic nonterminal xtc.lang.CFactory.PostfixExpression$$Tail1.
09425: *
09426: * @param yyStart The index.
09427: * @return The result.
09428: * @throws IOException Signals an I/O error.
09429: */
09430: private Result pPostfixExpression$$Tail1(final int yyStart)
09431: throws IOException {
09432:
09433: Result yyResult;
09434: int yyBase;
09435: int yyOption1;
09436: Node yyOpValue1;
09437: Action<Node> yyValue;
09438: ParseError yyError = ParseError.DUMMY;
09439:
09440: // Alternative 1.
09441:
09442: yyResult = pSymbol(yyStart);
09443: yyError = yyResult.select(yyError);
09444: if (yyResult.hasValue("[")) {
09445:
09446: yyResult = pCommaExpression(yyResult.index);
09447: yyError = yyResult.select(yyError);
09448: if (yyResult.hasValue()) {
09449: final Node v$g$2 = yyResult.semanticValue();
09450:
09451: yyBase = yyResult.index;
09452: yyResult = pSymbol(yyBase);
09453: yyError = yyResult.select(yyError);
09454: if (yyResult.hasValue("]")) {
09455:
09456: yyValue = new Action<Node>() {
09457: public Node run(Node v$1) {
09458: return GNode.create("SubscriptExpression",
09459: v$1, v$g$2);
09460: }
09461: };
09462:
09463: return yyResult.createValue(yyValue, yyError);
09464: } else {
09465: yyError = yyError.select("\"]\" expected", yyBase);
09466: }
09467: }
09468: }
09469:
09470: // Alternative 2.
09471:
09472: yyResult = pSymbol(yyStart);
09473: yyError = yyResult.select(yyError);
09474: if (yyResult.hasValue(".")) {
09475:
09476: yyResult = pCIdentifier$Identifier(yyResult.index);
09477: yyError = yyResult.select(yyError);
09478: if (yyResult.hasValue()) {
09479: final String v$g$3 = yyResult.semanticValue();
09480:
09481: yyValue = new Action<Node>() {
09482: public Node run(Node v$1) {
09483: return GNode.create("DirectComponentSelection",
09484: v$1, v$g$3);
09485: }
09486: };
09487:
09488: return yyResult.createValue(yyValue, yyError);
09489: }
09490: }
09491:
09492: // Alternative 3.
09493:
09494: yyResult = pSymbol(yyStart);
09495: yyError = yyResult.select(yyError);
09496: if (yyResult.hasValue("->")) {
09497:
09498: yyResult = pCIdentifier$Identifier(yyResult.index);
09499: yyError = yyResult.select(yyError);
09500: if (yyResult.hasValue()) {
09501: final String v$g$4 = yyResult.semanticValue();
09502:
09503: yyValue = new Action<Node>() {
09504: public Node run(Node v$1) {
09505: return GNode.create(
09506: "IndirectComponentSelection", v$1,
09507: v$g$4);
09508: }
09509: };
09510:
09511: return yyResult.createValue(yyValue, yyError);
09512: }
09513: }
09514:
09515: // Alternative 4.
09516:
09517: yyResult = pSymbol(yyStart);
09518: yyError = yyResult.select(yyError);
09519: if (yyResult.hasValue("(")) {
09520:
09521: yyResult = pArgumentPattern(yyResult.index);
09522: yyError = yyResult.select(yyError);
09523: if (yyResult.hasValue()) {
09524: final Node v$g$5 = yyResult.semanticValue();
09525:
09526: yyBase = yyResult.index;
09527: yyResult = pSymbol(yyBase);
09528: yyError = yyResult.select(yyError);
09529: if (yyResult.hasValue(")")) {
09530:
09531: yyValue = new Action<Node>() {
09532: public Node run(Node v$1) {
09533: return GNode.create("FunctionCall", v$1,
09534: v$g$5);
09535: }
09536: };
09537:
09538: return yyResult.createValue(yyValue, yyError);
09539: } else {
09540: yyError = yyError.select("\")\" expected", yyBase);
09541: }
09542: }
09543: }
09544:
09545: // Alternative 5.
09546:
09547: yyResult = pSymbol(yyStart);
09548: yyError = yyResult.select(yyError);
09549: if (yyResult.hasValue(".")) {
09550:
09551: yyResult = pStringVariable(yyResult.index);
09552: yyError = yyResult.select(yyError);
09553: if (yyResult.hasValue()) {
09554: final Node v$g$6 = yyResult.semanticValue();
09555:
09556: yyValue = new Action<Node>() {
09557: public Node run(Node v$1) {
09558: return GNode.create("DirectComponentSelection",
09559: v$1, v$g$6);
09560: }
09561: };
09562:
09563: return yyResult.createValue(yyValue, yyError);
09564: }
09565: }
09566:
09567: // Alternative 6.
09568:
09569: yyResult = pSymbol(yyStart);
09570: yyError = yyResult.select(yyError);
09571: if (yyResult.hasValue("->")) {
09572:
09573: yyResult = pStringVariable(yyResult.index);
09574: yyError = yyResult.select(yyError);
09575: if (yyResult.hasValue()) {
09576: final Node v$g$7 = yyResult.semanticValue();
09577:
09578: yyValue = new Action<Node>() {
09579: public Node run(Node v$1) {
09580: return GNode.create(
09581: "IndirectComponentSelection", v$1,
09582: v$g$7);
09583: }
09584: };
09585:
09586: return yyResult.createValue(yyValue, yyError);
09587: }
09588: }
09589:
09590: // Alternative 7.
09591:
09592: yyResult = pSymbol(yyStart);
09593: yyError = yyResult.select(yyError);
09594: if (yyResult.hasValue("(")) {
09595:
09596: yyOption1 = yyResult.index;
09597: yyOpValue1 = null;
09598:
09599: yyResult = pExpressionList(yyOption1);
09600: yyError = yyResult.select(yyError);
09601: if (yyResult.hasValue()) {
09602: final Node v$el$1 = yyResult.semanticValue();
09603:
09604: yyOption1 = yyResult.index;
09605: yyOpValue1 = v$el$1;
09606: }
09607: { // Start scope for v$g$8.
09608: final Node v$g$8 = yyOpValue1;
09609:
09610: yyBase = yyOption1;
09611: yyResult = pSymbol(yyBase);
09612: yyError = yyResult.select(yyError);
09613: if (yyResult.hasValue(")")) {
09614:
09615: yyValue = new Action<Node>() {
09616: public Node run(Node v$1) {
09617: return GNode.create("FunctionCall", v$1,
09618: v$g$8);
09619: }
09620: };
09621:
09622: return yyResult.createValue(yyValue, yyError);
09623: } else {
09624: yyError = yyError.select("\")\" expected", yyBase);
09625: }
09626: } // End scope for v$g$8.
09627: }
09628:
09629: // Alternative 8.
09630:
09631: yyResult = pSymbol(yyStart);
09632: yyError = yyResult.select(yyError);
09633: if (yyResult.hasValue("++")) {
09634:
09635: yyValue = new Action<Node>() {
09636: public Node run(Node v$1) {
09637: return GNode.create("PostincrementExpression", v$1);
09638: }
09639: };
09640:
09641: return yyResult.createValue(yyValue, yyError);
09642: }
09643:
09644: // Alternative 9.
09645:
09646: yyResult = pSymbol(yyStart);
09647: yyError = yyResult.select(yyError);
09648: if (yyResult.hasValue("--")) {
09649:
09650: yyValue = new Action<Node>() {
09651: public Node run(Node v$1) {
09652: return GNode.create("PostdecrementExpression", v$1);
09653: }
09654: };
09655:
09656: return yyResult.createValue(yyValue, yyError);
09657: }
09658:
09659: // Done.
09660: yyError = yyError
09661: .select("postfix expression expected", yyStart);
09662: return yyError;
09663: }
09664:
09665: // =========================================================================
09666:
09667: /**
09668: * Parse nonterminal xtc.lang.CPattern.ExpressionList.
09669: *
09670: * @param yyStart The index.
09671: * @return The result.
09672: * @throws IOException Signals an I/O error.
09673: */
09674: private Result pExpressionList(final int yyStart)
09675: throws IOException {
09676: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
09677: if (null == yyColumn.chunk3)
09678: yyColumn.chunk3 = new Chunk3();
09679: if (null == yyColumn.chunk3.fExpressionList)
09680: yyColumn.chunk3.fExpressionList = pExpressionList$1(yyStart);
09681: return yyColumn.chunk3.fExpressionList;
09682: }
09683:
09684: /** Actually parse xtc.lang.CPattern.ExpressionList. */
09685: private Result pExpressionList$1(final int yyStart)
09686: throws IOException {
09687: Result yyResult;
09688: Node yyValue;
09689: ParseError yyError = ParseError.DUMMY;
09690:
09691: // Alternative <Expressions>.
09692:
09693: yyResult = pAssignmentExpression(yyStart);
09694: yyError = yyResult.select(yyError);
09695: if (yyResult.hasValue()) {
09696: final Node v$g$1 = yyResult.semanticValue();
09697:
09698: yyResult = pExpressionList$$Star1(yyResult.index);
09699: yyError = yyResult.select(yyError);
09700: if (yyResult.hasValue()) {
09701: final Pair<Node> v$g$2 = yyResult.semanticValue();
09702:
09703: yyValue = GNode.createFromPair("ExpressionList", v$g$1,
09704: v$g$2);
09705: yyValue.setLocation(location(yyStart));
09706:
09707: return yyResult.createValue(yyValue, yyError);
09708: }
09709: }
09710:
09711: // Done.
09712: return yyError;
09713: }
09714:
09715: // =========================================================================
09716:
09717: /**
09718: * Parse synthetic nonterminal xtc.lang.CFactory.ExpressionList$$Star1.
09719: *
09720: * @param yyStart The index.
09721: * @return The result.
09722: * @throws IOException Signals an I/O error.
09723: */
09724: private Result pExpressionList$$Star1(final int yyStart)
09725: throws IOException {
09726:
09727: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
09728: if (null == yyColumn.chunk3)
09729: yyColumn.chunk3 = new Chunk3();
09730: if (null == yyColumn.chunk3.fExpressionList$$Star1)
09731: yyColumn.chunk3.fExpressionList$$Star1 = pExpressionList$$Star1$1(yyStart);
09732: return yyColumn.chunk3.fExpressionList$$Star1;
09733: }
09734:
09735: /** Actually parse xtc.lang.CFactory.ExpressionList$$Star1. */
09736: private Result pExpressionList$$Star1$1(final int yyStart)
09737: throws IOException {
09738:
09739: Result yyResult;
09740: Pair<Node> yyValue;
09741: ParseError yyError = ParseError.DUMMY;
09742:
09743: // Alternative 1.
09744:
09745: yyResult = pSymbol(yyStart);
09746: yyError = yyResult.select(yyError);
09747: if (yyResult.hasValue(",")) {
09748:
09749: yyResult = pAssignmentExpression(yyResult.index);
09750: yyError = yyResult.select(yyError);
09751: if (yyResult.hasValue()) {
09752: final Node v$el$1 = yyResult.semanticValue();
09753:
09754: yyResult = pExpressionList$$Star1(yyResult.index);
09755: yyError = yyResult.select(yyError);
09756: if (yyResult.hasValue()) {
09757: final Pair<Node> v$2 = yyResult.semanticValue();
09758:
09759: yyValue = new Pair<Node>(v$el$1, v$2);
09760:
09761: return yyResult.createValue(yyValue, yyError);
09762: }
09763: }
09764: }
09765:
09766: // Alternative 2.
09767:
09768: yyValue = Pair.empty();
09769:
09770: return new SemanticValue(yyValue, yyStart, yyError);
09771: }
09772:
09773: // =========================================================================
09774:
09775: /**
09776: * Parse nonterminal xtc.lang.CPattern.CompoundLiteral.
09777: *
09778: * @param yyStart The index.
09779: * @return The result.
09780: * @throws IOException Signals an I/O error.
09781: */
09782: private Result pCompoundLiteral(final int yyStart)
09783: throws IOException {
09784: Result yyResult;
09785: int yyBase;
09786: int yyOption1;
09787: Node yyValue;
09788: ParseError yyError = ParseError.DUMMY;
09789:
09790: // Alternative 1.
09791:
09792: yyResult = pSymbol(yyStart);
09793: yyError = yyResult.select(yyError);
09794: if (yyResult.hasValue("(")) {
09795:
09796: yyResult = pTypeName(yyResult.index);
09797: yyError = yyResult.select(yyError);
09798: if (yyResult.hasValue()) {
09799: final Node v$g$1 = yyResult.semanticValue();
09800:
09801: yyBase = yyResult.index;
09802: yyResult = pSymbol(yyBase);
09803: yyError = yyResult.select(yyError);
09804: if (yyResult.hasValue(")")) {
09805:
09806: yyBase = yyResult.index;
09807: yyResult = pSymbol(yyBase);
09808: yyError = yyResult.select(yyError);
09809: if (yyResult.hasValue("{")) {
09810:
09811: yyResult = pInitializerList(yyResult.index);
09812: yyError = yyResult.select(yyError);
09813: if (yyResult.hasValue()) {
09814: final Node v$g$2 = yyResult.semanticValue();
09815:
09816: yyOption1 = yyResult.index;
09817:
09818: yyBase = yyOption1;
09819: yyResult = pSymbol(yyBase);
09820: yyError = yyResult.select(yyError);
09821: if (yyResult.hasValue(",")) {
09822:
09823: yyOption1 = yyResult.index;
09824: } else {
09825: yyError = yyError.select(
09826: "\",\" expected", yyBase);
09827: }
09828:
09829: yyBase = yyOption1;
09830: yyResult = pSymbol(yyBase);
09831: yyError = yyResult.select(yyError);
09832: if (yyResult.hasValue("}")) {
09833:
09834: yyValue = GNode
09835: .create("CompoundLiteral",
09836: v$g$1, v$g$2);
09837: yyValue.setLocation(location(yyStart));
09838:
09839: return yyResult.createValue(yyValue,
09840: yyError);
09841: } else {
09842: yyError = yyError.select(
09843: "\"}\" expected", yyBase);
09844: }
09845: }
09846: } else {
09847: yyError = yyError.select("\"{\" expected",
09848: yyBase);
09849: }
09850: } else {
09851: yyError = yyError.select("\")\" expected", yyBase);
09852: }
09853: }
09854: }
09855:
09856: // Done.
09857: yyError = yyError.select("compound literal expected", yyStart);
09858: return yyError;
09859: }
09860:
09861: // =========================================================================
09862:
09863: /**
09864: * Parse nonterminal xtc.lang.CPattern.PrimaryExpression.
09865: *
09866: * @param yyStart The index.
09867: * @return The result.
09868: * @throws IOException Signals an I/O error.
09869: */
09870: private Result pPrimaryExpression(final int yyStart)
09871: throws IOException {
09872: Result yyResult;
09873: int yyBase;
09874: Node yyValue;
09875: ParseError yyError = ParseError.DUMMY;
09876:
09877: // Alternative <PatternVariable>.
09878:
09879: yyResult = pNodeVariable(yyStart);
09880: yyError = yyResult.select(yyError);
09881: if (yyResult.hasValue()) {
09882: yyValue = yyResult.semanticValue();
09883:
09884: return yyResult.createValue(yyValue, yyError);
09885: }
09886:
09887: // Alternative <Constant>.
09888:
09889: yyResult = pConstant(yyStart);
09890: yyError = yyResult.select(yyError);
09891: if (yyResult.hasValue()) {
09892: yyValue = yyResult.semanticValue();
09893:
09894: return yyResult.createValue(yyValue, yyError);
09895: }
09896:
09897: // Alternative 3.
09898:
09899: yyResult = pCIdentifier$Identifier(yyStart);
09900: yyError = yyResult.select(yyError);
09901: if (yyResult.hasValue()) {
09902: final String v$g$1 = yyResult.semanticValue();
09903:
09904: yyValue = GNode.create("PrimaryIdentifier", v$g$1);
09905: yyValue.setLocation(location(yyStart));
09906:
09907: return yyResult.createValue(yyValue, yyError);
09908: }
09909:
09910: // Alternative 4.
09911:
09912: if (GCC) {
09913:
09914: yyResult = pSymbol(yyStart);
09915: yyError = yyResult.select(yyError);
09916: if (yyResult.hasValue("(")) {
09917:
09918: yyResult = pCompoundStatement(yyResult.index);
09919: yyError = yyResult.select(yyError);
09920: if (yyResult.hasValue()) {
09921: final Node v$g$1 = yyResult.semanticValue();
09922:
09923: yyBase = yyResult.index;
09924: yyResult = pSymbol(yyBase);
09925: yyError = yyResult.select(yyError);
09926: if (yyResult.hasValue(")")) {
09927:
09928: yyValue = GNode.create("StatementAsExpression",
09929: v$g$1);
09930: yyValue.setLocation(location(yyStart));
09931:
09932: return yyResult.createValue(yyValue, yyError);
09933: } else {
09934: yyError = yyError.select("\")\" expected",
09935: yyBase);
09936: }
09937: }
09938: }
09939: }
09940:
09941: // Alternative 5.
09942:
09943: yyResult = pKeyword(yyStart);
09944: yyError = yyResult.select(yyError);
09945: if (yyResult.hasValue("__builtin_va_arg")) {
09946:
09947: yyBase = yyResult.index;
09948: yyResult = pSymbol(yyBase);
09949: yyError = yyResult.select(yyError);
09950: if (yyResult.hasValue("(")) {
09951:
09952: yyResult = pAssignmentExpression(yyResult.index);
09953: yyError = yyResult.select(yyError);
09954: if (yyResult.hasValue()) {
09955: final Node v$g$1 = yyResult.semanticValue();
09956:
09957: yyBase = yyResult.index;
09958: yyResult = pSymbol(yyBase);
09959: yyError = yyResult.select(yyError);
09960: if (yyResult.hasValue(",")) {
09961:
09962: yyResult = pTypeName(yyResult.index);
09963: yyError = yyResult.select(yyError);
09964: if (yyResult.hasValue()) {
09965: final Node v$g$2 = yyResult.semanticValue();
09966:
09967: yyBase = yyResult.index;
09968: yyResult = pSymbol(yyBase);
09969: yyError = yyResult.select(yyError);
09970: if (yyResult.hasValue(")")) {
09971:
09972: yyValue = GNode.create(
09973: "VariableArgumentAccess",
09974: v$g$1, v$g$2);
09975: yyValue.setLocation(location(yyStart));
09976:
09977: return yyResult.createValue(yyValue,
09978: yyError);
09979: } else {
09980: yyError = yyError.select(
09981: "\")\" expected", yyBase);
09982: }
09983: }
09984: } else {
09985: yyError = yyError.select("\",\" expected",
09986: yyBase);
09987: }
09988: }
09989: } else {
09990: yyError = yyError.select("\"(\" expected", yyBase);
09991: }
09992: }
09993:
09994: // Alternative <ParenthesizedExpression>.
09995:
09996: yyResult = pSymbol(yyStart);
09997: yyError = yyResult.select(yyError);
09998: if (yyResult.hasValue("(")) {
09999:
10000: yyResult = pCommaExpression(yyResult.index);
10001: yyError = yyResult.select(yyError);
10002: if (yyResult.hasValue()) {
10003: yyValue = yyResult.semanticValue();
10004:
10005: yyBase = yyResult.index;
10006: yyResult = pSymbol(yyBase);
10007: yyError = yyResult.select(yyError);
10008: if (yyResult.hasValue(")")) {
10009:
10010: return yyResult.createValue(yyValue, yyError);
10011: } else {
10012: yyError = yyError.select("\")\" expected", yyBase);
10013: }
10014: }
10015: }
10016:
10017: // Done.
10018: yyError = yyError
10019: .select("primary expression expected", yyStart);
10020: return yyError;
10021: }
10022:
10023: // =========================================================================
10024:
10025: /**
10026: * Parse nonterminal xtc.lang.CPattern.PrimaryIdentifier.
10027: *
10028: * @param yyStart The index.
10029: * @return The result.
10030: * @throws IOException Signals an I/O error.
10031: */
10032: private Result pPrimaryIdentifier(final int yyStart)
10033: throws IOException {
10034: Result yyResult;
10035: Node yyValue;
10036: ParseError yyError = ParseError.DUMMY;
10037:
10038: // Alternative 1.
10039:
10040: yyResult = pCIdentifier$Identifier(yyStart);
10041: yyError = yyResult.select(yyError);
10042: if (yyResult.hasValue()) {
10043: final String v$g$1 = yyResult.semanticValue();
10044:
10045: yyValue = GNode.create("PrimaryIdentifier", v$g$1);
10046: yyValue.setLocation(location(yyStart));
10047:
10048: return yyResult.createValue(yyValue, yyError);
10049: }
10050:
10051: // Done.
10052: return yyError;
10053: }
10054:
10055: // =========================================================================
10056:
10057: /**
10058: * Parse nonterminal xtc.lang.CPattern.SimpleAssemblyExpression.
10059: *
10060: * @param yyStart The index.
10061: * @return The result.
10062: * @throws IOException Signals an I/O error.
10063: */
10064: private Result pSimpleAssemblyExpression(final int yyStart)
10065: throws IOException {
10066:
10067: Result yyResult;
10068: int yyBase;
10069: Node yyValue;
10070: ParseError yyError = ParseError.DUMMY;
10071:
10072: // Alternative 1.
10073:
10074: yyResult = pAsmKeyword(yyStart);
10075: yyError = yyResult.select(yyError);
10076: if (yyResult.hasValue()) {
10077:
10078: yyBase = yyResult.index;
10079: yyResult = pSymbol(yyBase);
10080: yyError = yyResult.select(yyError);
10081: if (yyResult.hasValue("(")) {
10082:
10083: yyResult = pStringConstant(yyResult.index);
10084: yyError = yyResult.select(yyError);
10085: if (yyResult.hasValue()) {
10086: final Node v$g$1 = yyResult.semanticValue();
10087:
10088: yyBase = yyResult.index;
10089: yyResult = pSymbol(yyBase);
10090: yyError = yyResult.select(yyError);
10091: if (yyResult.hasValue(")")) {
10092:
10093: yyValue = GNode.create(
10094: "SimpleAssemblyExpression", v$g$1);
10095: yyValue.setLocation(location(yyStart));
10096:
10097: return yyResult.createValue(yyValue, yyError);
10098: } else {
10099: yyError = yyError.select("\")\" expected",
10100: yyBase);
10101: }
10102: }
10103: } else {
10104: yyError = yyError.select("\"(\" expected", yyBase);
10105: }
10106: }
10107:
10108: // Done.
10109: return yyError;
10110: }
10111:
10112: // =========================================================================
10113:
10114: /**
10115: * Parse nonterminal xtc.lang.CPattern.AssemblyArgument.
10116: *
10117: * @param yyStart The index.
10118: * @return The result.
10119: * @throws IOException Signals an I/O error.
10120: */
10121: private Result pAssemblyArgument(final int yyStart)
10122: throws IOException {
10123: Result yyResult;
10124: int yyBase;
10125: int yyOption1;
10126: Node yyOpValue1;
10127: Node yyValue;
10128: ParseError yyError = ParseError.DUMMY;
10129:
10130: // Alternative 1.
10131:
10132: yyResult = pStringConstant(yyStart);
10133: yyError = yyResult.select(yyError);
10134: if (yyResult.hasValue()) {
10135: final Node v$g$1 = yyResult.semanticValue();
10136:
10137: final int yyChoice1 = yyResult.index;
10138:
10139: // Nested alternative 1.
10140:
10141: yyBase = yyChoice1;
10142: yyResult = pSymbol(yyBase);
10143: yyError = yyResult.select(yyError);
10144: if (yyResult.hasValue(":")) {
10145:
10146: yyOption1 = yyResult.index;
10147: yyOpValue1 = null;
10148:
10149: yyResult = pAssemblyOperands(yyOption1);
10150: yyError = yyResult.select(yyError);
10151: if (yyResult.hasValue()) {
10152: final Node v$el$1 = yyResult.semanticValue();
10153:
10154: yyOption1 = yyResult.index;
10155: yyOpValue1 = v$el$1;
10156: }
10157: { // Start scope for v$g$2.
10158: final Node v$g$2 = yyOpValue1;
10159:
10160: final int yyChoice2 = yyOption1;
10161:
10162: // Nested alternative 1.
10163:
10164: yyBase = yyChoice2;
10165: yyResult = pSymbol(yyBase);
10166: yyError = yyResult.select(yyError);
10167: if (yyResult.hasValue(":")) {
10168:
10169: yyOption1 = yyResult.index;
10170: yyOpValue1 = null;
10171:
10172: yyResult = pAssemblyOperands(yyOption1);
10173: yyError = yyResult.select(yyError);
10174: if (yyResult.hasValue()) {
10175: final Node v$el$2 = yyResult
10176: .semanticValue();
10177:
10178: yyOption1 = yyResult.index;
10179: yyOpValue1 = v$el$2;
10180: }
10181: { // Start scope for v$g$3.
10182: final Node v$g$3 = yyOpValue1;
10183:
10184: final int yyChoice3 = yyOption1;
10185:
10186: // Nested alternative 1.
10187:
10188: yyBase = yyChoice3;
10189: yyResult = pSymbol(yyBase);
10190: yyError = yyResult.select(yyError);
10191: if (yyResult.hasValue(":")) {
10192:
10193: yyResult = pAssemblyClobbers(yyResult.index);
10194: yyError = yyResult.select(yyError);
10195: if (yyResult.hasValue()) {
10196: final Node v$g$4 = yyResult
10197: .semanticValue();
10198:
10199: yyValue = GNode.create(
10200: "AssemblyArgument", v$g$1,
10201: v$g$2, v$g$3, v$g$4);
10202: yyValue
10203: .setLocation(location(yyStart));
10204:
10205: return yyResult.createValue(
10206: yyValue, yyError);
10207: }
10208: } else {
10209: yyError = yyError.select(
10210: "\":\" expected", yyBase);
10211: }
10212:
10213: // Nested alternative 2.
10214:
10215: yyValue = GNode.create("AssemblyArgument",
10216: v$g$1, v$g$2, v$g$3);
10217: yyValue.setLocation(location(yyStart));
10218:
10219: return new SemanticValue(yyValue,
10220: yyChoice3, yyError);
10221: } // End scope for v$g$3.
10222: } else {
10223: yyError = yyError.select("\":\" expected",
10224: yyBase);
10225: }
10226:
10227: // Nested alternative 2.
10228:
10229: yyValue = GNode.create("AssemblyArgument", v$g$1,
10230: v$g$2);
10231: yyValue.setLocation(location(yyStart));
10232:
10233: return new SemanticValue(yyValue, yyChoice2,
10234: yyError);
10235: } // End scope for v$g$2.
10236: } else {
10237: yyError = yyError.select("\":\" expected", yyBase);
10238: }
10239:
10240: // Nested alternative 2.
10241:
10242: yyValue = GNode.create("AssemblyArgument", v$g$1);
10243: yyValue.setLocation(location(yyStart));
10244:
10245: return new SemanticValue(yyValue, yyChoice1, yyError);
10246: }
10247:
10248: // Done.
10249: return yyError;
10250: }
10251:
10252: // =========================================================================
10253:
10254: /**
10255: * Parse nonterminal xtc.lang.CPattern.AssemblyOperands.
10256: *
10257: * @param yyStart The index.
10258: * @return The result.
10259: * @throws IOException Signals an I/O error.
10260: */
10261: private Result pAssemblyOperands(final int yyStart)
10262: throws IOException {
10263: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
10264: if (null == yyColumn.chunk3)
10265: yyColumn.chunk3 = new Chunk3();
10266: if (null == yyColumn.chunk3.fAssemblyOperands)
10267: yyColumn.chunk3.fAssemblyOperands = pAssemblyOperands$1(yyStart);
10268: return yyColumn.chunk3.fAssemblyOperands;
10269: }
10270:
10271: /** Actually parse xtc.lang.CPattern.AssemblyOperands. */
10272: private Result pAssemblyOperands$1(final int yyStart)
10273: throws IOException {
10274: Result yyResult;
10275: Node yyValue;
10276: ParseError yyError = ParseError.DUMMY;
10277:
10278: // Alternative 1.
10279:
10280: yyResult = pAssemblyOperand(yyStart);
10281: yyError = yyResult.select(yyError);
10282: if (yyResult.hasValue()) {
10283: final Node v$g$1 = yyResult.semanticValue();
10284:
10285: yyResult = pAssemblyOperands$$Star1(yyResult.index);
10286: yyError = yyResult.select(yyError);
10287: if (yyResult.hasValue()) {
10288: final Pair<Node> v$g$2 = yyResult.semanticValue();
10289:
10290: yyValue = GNode.createFromPair("AssemblyOperands",
10291: v$g$1, v$g$2);
10292: yyValue.setLocation(location(yyStart));
10293:
10294: return yyResult.createValue(yyValue, yyError);
10295: }
10296: }
10297:
10298: // Done.
10299: return yyError;
10300: }
10301:
10302: // =========================================================================
10303:
10304: /**
10305: * Parse synthetic nonterminal xtc.lang.CFactory.AssemblyOperands$$Star1.
10306: *
10307: * @param yyStart The index.
10308: * @return The result.
10309: * @throws IOException Signals an I/O error.
10310: */
10311: private Result pAssemblyOperands$$Star1(final int yyStart)
10312: throws IOException {
10313:
10314: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
10315: if (null == yyColumn.chunk3)
10316: yyColumn.chunk3 = new Chunk3();
10317: if (null == yyColumn.chunk3.fAssemblyOperands$$Star1)
10318: yyColumn.chunk3.fAssemblyOperands$$Star1 = pAssemblyOperands$$Star1$1(yyStart);
10319: return yyColumn.chunk3.fAssemblyOperands$$Star1;
10320: }
10321:
10322: /** Actually parse xtc.lang.CFactory.AssemblyOperands$$Star1. */
10323: private Result pAssemblyOperands$$Star1$1(final int yyStart)
10324: throws IOException {
10325:
10326: Result yyResult;
10327: Pair<Node> yyValue;
10328: ParseError yyError = ParseError.DUMMY;
10329:
10330: // Alternative 1.
10331:
10332: yyResult = pSymbol(yyStart);
10333: yyError = yyResult.select(yyError);
10334: if (yyResult.hasValue(",")) {
10335:
10336: yyResult = pAssemblyOperand(yyResult.index);
10337: yyError = yyResult.select(yyError);
10338: if (yyResult.hasValue()) {
10339: final Node v$el$1 = yyResult.semanticValue();
10340:
10341: yyResult = pAssemblyOperands$$Star1(yyResult.index);
10342: yyError = yyResult.select(yyError);
10343: if (yyResult.hasValue()) {
10344: final Pair<Node> v$2 = yyResult.semanticValue();
10345:
10346: yyValue = new Pair<Node>(v$el$1, v$2);
10347:
10348: return yyResult.createValue(yyValue, yyError);
10349: }
10350: }
10351: }
10352:
10353: // Alternative 2.
10354:
10355: yyValue = Pair.empty();
10356:
10357: return new SemanticValue(yyValue, yyStart, yyError);
10358: }
10359:
10360: // =========================================================================
10361:
10362: /**
10363: * Parse nonterminal xtc.lang.CPattern.AssemblyOperand.
10364: *
10365: * @param yyStart The index.
10366: * @return The result.
10367: * @throws IOException Signals an I/O error.
10368: */
10369: private Result pAssemblyOperand(final int yyStart)
10370: throws IOException {
10371: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
10372: if (null == yyColumn.chunk3)
10373: yyColumn.chunk3 = new Chunk3();
10374: if (null == yyColumn.chunk3.fAssemblyOperand)
10375: yyColumn.chunk3.fAssemblyOperand = pAssemblyOperand$1(yyStart);
10376: return yyColumn.chunk3.fAssemblyOperand;
10377: }
10378:
10379: /** Actually parse xtc.lang.CPattern.AssemblyOperand. */
10380: private Result pAssemblyOperand$1(final int yyStart)
10381: throws IOException {
10382: Result yyResult;
10383: int yyBase;
10384: int yyOption1;
10385: String yyOpValue1;
10386: Node yyValue;
10387: ParseError yyError = ParseError.DUMMY;
10388:
10389: // Alternative 1.
10390:
10391: yyOption1 = yyStart;
10392: yyOpValue1 = null;
10393:
10394: yyBase = yyOption1;
10395: yyResult = pSymbol(yyBase);
10396: yyError = yyResult.select(yyError);
10397: if (yyResult.hasValue("[")) {
10398:
10399: yyResult = pCIdentifier$Word(yyResult.index);
10400: yyError = yyResult.select(yyError);
10401: if (yyResult.hasValue()) {
10402: final String v$el$1 = yyResult.semanticValue();
10403:
10404: yyBase = yyResult.index;
10405: yyResult = pSymbol(yyBase);
10406: yyError = yyResult.select(yyError);
10407: if (yyResult.hasValue("]")) {
10408:
10409: yyOption1 = yyResult.index;
10410: yyOpValue1 = v$el$1;
10411: } else {
10412: yyError = yyError.select("\"]\" expected", yyBase);
10413: }
10414: }
10415: } else {
10416: yyError = yyError.select("\"[\" expected", yyBase);
10417: }
10418: { // Start scope for v$g$1.
10419: final String v$g$1 = yyOpValue1;
10420:
10421: yyResult = pStringConstant(yyOption1);
10422: yyError = yyResult.select(yyError);
10423: if (yyResult.hasValue()) {
10424: final Node v$g$2 = yyResult.semanticValue();
10425:
10426: yyBase = yyResult.index;
10427: yyResult = pSymbol(yyBase);
10428: yyError = yyResult.select(yyError);
10429: if (yyResult.hasValue("(")) {
10430:
10431: yyResult = pCommaExpression(yyResult.index);
10432: yyError = yyResult.select(yyError);
10433: if (yyResult.hasValue()) {
10434: final Node v$g$3 = yyResult.semanticValue();
10435:
10436: yyBase = yyResult.index;
10437: yyResult = pSymbol(yyBase);
10438: yyError = yyResult.select(yyError);
10439: if (yyResult.hasValue(")")) {
10440:
10441: yyValue = GNode.create("AssemblyOperand",
10442: v$g$1, v$g$2, v$g$3);
10443: yyValue.setLocation(location(yyStart));
10444:
10445: return yyResult.createValue(yyValue,
10446: yyError);
10447: } else {
10448: yyError = yyError.select("\")\" expected",
10449: yyBase);
10450: }
10451: }
10452: } else {
10453: yyError = yyError.select("\"(\" expected", yyBase);
10454: }
10455: }
10456: } // End scope for v$g$1.
10457:
10458: // Done.
10459: return yyError;
10460: }
10461:
10462: // =========================================================================
10463:
10464: /**
10465: * Parse nonterminal xtc.lang.CPattern.AssemblyClobbers.
10466: *
10467: * @param yyStart The index.
10468: * @return The result.
10469: * @throws IOException Signals an I/O error.
10470: */
10471: private Result pAssemblyClobbers(final int yyStart)
10472: throws IOException {
10473: Result yyResult;
10474: int yyBase;
10475: int yyRepetition1;
10476: Pair<Node> yyRepValue1;
10477: Node yyValue;
10478: ParseError yyError = ParseError.DUMMY;
10479:
10480: // Alternative 1.
10481:
10482: yyResult = pStringConstant(yyStart);
10483: yyError = yyResult.select(yyError);
10484: if (yyResult.hasValue()) {
10485: final Node v$g$1 = yyResult.semanticValue();
10486:
10487: yyRepetition1 = yyResult.index;
10488: yyRepValue1 = Pair.empty();
10489: while (true) {
10490:
10491: yyBase = yyRepetition1;
10492: yyResult = pSymbol(yyBase);
10493: yyError = yyResult.select(yyError);
10494: if (yyResult.hasValue(",")) {
10495:
10496: yyResult = pStringConstant(yyResult.index);
10497: yyError = yyResult.select(yyError);
10498: if (yyResult.hasValue()) {
10499: final Node v$el$1 = yyResult.semanticValue();
10500:
10501: yyRepetition1 = yyResult.index;
10502: yyRepValue1 = new Pair<Node>(v$el$1,
10503: yyRepValue1);
10504: continue;
10505: }
10506: } else {
10507: yyError = yyError.select("\",\" expected", yyBase);
10508: }
10509: break;
10510: }
10511: { // Start scope for v$g$2.
10512: final Pair<Node> v$g$2 = yyRepValue1.reverse();
10513:
10514: yyValue = GNode.createFromPair("AssemblyClobbers",
10515: v$g$1, v$g$2);
10516: yyValue.setLocation(location(yyStart));
10517:
10518: return new SemanticValue(yyValue, yyRepetition1,
10519: yyError);
10520: } // End scope for v$g$2.
10521: }
10522:
10523: // Done.
10524: return yyError;
10525: }
10526:
10527: // =========================================================================
10528:
10529: /**
10530: * Parse nonterminal xtc.lang.CPattern.AsmKeyword.
10531: *
10532: * @param yyStart The index.
10533: * @return The result.
10534: * @throws IOException Signals an I/O error.
10535: */
10536: private Result pAsmKeyword(final int yyStart) throws IOException {
10537: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
10538: if (null == yyColumn.chunk3)
10539: yyColumn.chunk3 = new Chunk3();
10540: if (null == yyColumn.chunk3.fAsmKeyword)
10541: yyColumn.chunk3.fAsmKeyword = pAsmKeyword$1(yyStart);
10542: return yyColumn.chunk3.fAsmKeyword;
10543: }
10544:
10545: /** Actually parse xtc.lang.CPattern.AsmKeyword. */
10546: private Result pAsmKeyword$1(final int yyStart) throws IOException {
10547: Result yyResult;
10548: Void yyValue;
10549: ParseError yyError = ParseError.DUMMY;
10550:
10551: // Alternative 1.
10552:
10553: yyResult = pKeyword(yyStart);
10554: yyError = yyResult.select(yyError);
10555: if (yyResult.hasValue("asm")) {
10556:
10557: yyValue = null;
10558:
10559: return yyResult.createValue(yyValue, yyError);
10560: }
10561:
10562: // Alternative 2.
10563:
10564: yyResult = pKeyword(yyStart);
10565: yyError = yyResult.select(yyError);
10566: if (yyResult.hasValue("__asm")) {
10567:
10568: yyValue = null;
10569:
10570: return yyResult.createValue(yyValue, yyError);
10571: }
10572:
10573: // Alternative 3.
10574:
10575: yyResult = pKeyword(yyStart);
10576: yyError = yyResult.select(yyError);
10577: if (yyResult.hasValue("__asm__")) {
10578:
10579: yyValue = null;
10580:
10581: return yyResult.createValue(yyValue, yyError);
10582: }
10583:
10584: // Done.
10585: yyError = yyError.select("asm keyword expected", yyStart);
10586: return yyError;
10587: }
10588:
10589: // =========================================================================
10590:
10591: /**
10592: * Parse nonterminal xtc.lang.CPattern.Pattern.
10593: *
10594: * @param yyStart The index.
10595: * @return The result.
10596: * @throws IOException Signals an I/O error.
10597: */
10598: private Result pPattern(final int yyStart) throws IOException {
10599: Result yyResult;
10600: Node yyValue;
10601: ParseError yyError = ParseError.DUMMY;
10602:
10603: // Start a state modification.
10604: yyState.start();
10605:
10606: // Alternative <Declaration>.
10607:
10608: yyResult = pDeclaration(yyStart);
10609: yyError = yyResult.select(yyError);
10610: if (yyResult.hasValue()) {
10611: yyValue = yyResult.semanticValue();
10612:
10613: // Commit the state modification.
10614: yyState.commit();
10615:
10616: return yyResult.createValue(yyValue, yyError);
10617: }
10618:
10619: // Alternative <Function>.
10620:
10621: yyResult = pFunctionDefinition(yyStart);
10622: yyError = yyResult.select(yyError);
10623: if (yyResult.hasValue()) {
10624: yyValue = yyResult.semanticValue();
10625:
10626: // Commit the state modification.
10627: yyState.commit();
10628:
10629: return yyResult.createValue(yyValue, yyError);
10630: }
10631:
10632: // Alternative <Statement>.
10633:
10634: yyResult = pStatement(yyStart);
10635: yyError = yyResult.select(yyError);
10636: if (yyResult.hasValue()) {
10637: yyValue = yyResult.semanticValue();
10638:
10639: // Commit the state modification.
10640: yyState.commit();
10641:
10642: return yyResult.createValue(yyValue, yyError);
10643: }
10644:
10645: // Alternative <Expression>.
10646:
10647: yyResult = pCommaExpression(yyStart);
10648: yyError = yyResult.select(yyError);
10649: if (yyResult.hasValue()) {
10650: yyValue = yyResult.semanticValue();
10651:
10652: if (!yyValue.hasName("NodeVariable")) {
10653:
10654: // Commit the state modification.
10655: yyState.commit();
10656:
10657: return yyResult.createValue(yyValue, yyError);
10658: }
10659: }
10660:
10661: // Abort the state modification.
10662: yyState.abort();
10663:
10664: // Done.
10665: yyError = yyError.select("pattern expected", yyStart);
10666: return yyError;
10667: }
10668:
10669: // =========================================================================
10670:
10671: /**
10672: * Parse nonterminal xtc.lang.CPattern.GotoLabel.
10673: *
10674: * @param yyStart The index.
10675: * @return The result.
10676: * @throws IOException Signals an I/O error.
10677: */
10678: private Result pGotoLabel(final int yyStart) throws IOException {
10679: Result yyResult;
10680: Node yyValue;
10681: ParseError yyError = ParseError.DUMMY;
10682:
10683: // Alternative 1.
10684:
10685: yyResult = pStringVariable(yyStart);
10686: yyError = yyResult.select(yyError);
10687: if (yyResult.hasValue()) {
10688: final Node v$g$1 = yyResult.semanticValue();
10689:
10690: yyValue = GNode.create("PrimaryIdentifier", v$g$1);
10691: yyValue.setLocation(location(yyStart));
10692:
10693: return yyResult.createValue(yyValue, yyError);
10694: }
10695:
10696: // Done.
10697: return yyError;
10698: }
10699:
10700: // =========================================================================
10701:
10702: /**
10703: * Parse nonterminal xtc.lang.CPattern.ArgumentPattern.
10704: *
10705: * @param yyStart The index.
10706: * @return The result.
10707: * @throws IOException Signals an I/O error.
10708: */
10709: private Result pArgumentPattern(final int yyStart)
10710: throws IOException {
10711: Result yyResult;
10712: Node yyValue;
10713: ParseError yyError = ParseError.DUMMY;
10714:
10715: // Alternative 1.
10716:
10717: yyResult = pNodeListVariable(yyStart);
10718: yyError = yyResult.select(yyError);
10719: if (yyResult.hasValue()) {
10720: final Node v$g$1 = yyResult.semanticValue();
10721:
10722: yyValue = GNode.create("ExpressionList", v$g$1);
10723: yyValue.setLocation(location(yyStart));
10724:
10725: return yyResult.createValue(yyValue, yyError);
10726: }
10727:
10728: // Done.
10729: return yyError;
10730: }
10731:
10732: // =========================================================================
10733:
10734: /**
10735: * Parse nonterminal xtc.lang.CPattern.NodeVariable.
10736: *
10737: * @param yyStart The index.
10738: * @return The result.
10739: * @throws IOException Signals an I/O error.
10740: */
10741: private Result pNodeVariable(final int yyStart) throws IOException {
10742: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
10743: if (null == yyColumn.chunk3)
10744: yyColumn.chunk3 = new Chunk3();
10745: if (null == yyColumn.chunk3.fNodeVariable)
10746: yyColumn.chunk3.fNodeVariable = pNodeVariable$1(yyStart);
10747: return yyColumn.chunk3.fNodeVariable;
10748: }
10749:
10750: /** Actually parse xtc.lang.CPattern.NodeVariable. */
10751: private Result pNodeVariable$1(final int yyStart)
10752: throws IOException {
10753: int yyC;
10754: int yyIndex;
10755: Result yyResult;
10756: Node yyValue;
10757: ParseError yyError = ParseError.DUMMY;
10758:
10759: // Alternative 1.
10760:
10761: yyC = character(yyStart);
10762: if ('#' == yyC) {
10763: yyIndex = yyStart + 1;
10764:
10765: yyResult = pCIdentifier$Word(yyIndex);
10766: yyError = yyResult.select(yyError);
10767: if (yyResult.hasValue()) {
10768: final String v$g$1 = yyResult.semanticValue();
10769:
10770: yyValue = GNode.create("NodeVariable", v$g$1);
10771: yyValue.setLocation(location(yyStart));
10772:
10773: return yyResult.createValue(yyValue, yyError);
10774: }
10775: }
10776:
10777: // Done.
10778: yyError = yyError.select("node variable expected", yyStart);
10779: return yyError;
10780: }
10781:
10782: // =========================================================================
10783:
10784: /**
10785: * Parse nonterminal xtc.lang.CPattern.StringVariable.
10786: *
10787: * @param yyStart The index.
10788: * @return The result.
10789: * @throws IOException Signals an I/O error.
10790: */
10791: private Result pStringVariable(final int yyStart)
10792: throws IOException {
10793: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
10794: if (null == yyColumn.chunk3)
10795: yyColumn.chunk3 = new Chunk3();
10796: if (null == yyColumn.chunk3.fStringVariable)
10797: yyColumn.chunk3.fStringVariable = pStringVariable$1(yyStart);
10798: return yyColumn.chunk3.fStringVariable;
10799: }
10800:
10801: /** Actually parse xtc.lang.CPattern.StringVariable. */
10802: private Result pStringVariable$1(final int yyStart)
10803: throws IOException {
10804: int yyC;
10805: int yyIndex;
10806: Result yyResult;
10807: Node yyValue;
10808: ParseError yyError = ParseError.DUMMY;
10809:
10810: // Alternative 1.
10811:
10812: yyC = character(yyStart);
10813: if ('#' == yyC) {
10814: yyIndex = yyStart + 1;
10815:
10816: yyResult = pCIdentifier$Word(yyIndex);
10817: yyError = yyResult.select(yyError);
10818: if (yyResult.hasValue()) {
10819: final String v$g$1 = yyResult.semanticValue();
10820:
10821: yyValue = GNode.create("StringVariable", v$g$1);
10822: yyValue.setLocation(location(yyStart));
10823:
10824: return yyResult.createValue(yyValue, yyError);
10825: }
10826: }
10827:
10828: // Done.
10829: yyError = yyError.select("string variable expected", yyStart);
10830: return yyError;
10831: }
10832:
10833: // =========================================================================
10834:
10835: /**
10836: * Parse nonterminal xtc.lang.CPattern.NodeListVariable.
10837: *
10838: * @param yyStart The index.
10839: * @return The result.
10840: * @throws IOException Signals an I/O error.
10841: */
10842: private Result pNodeListVariable(final int yyStart)
10843: throws IOException {
10844: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
10845: if (null == yyColumn.chunk4)
10846: yyColumn.chunk4 = new Chunk4();
10847: if (null == yyColumn.chunk4.fNodeListVariable)
10848: yyColumn.chunk4.fNodeListVariable = pNodeListVariable$1(yyStart);
10849: return yyColumn.chunk4.fNodeListVariable;
10850: }
10851:
10852: /** Actually parse xtc.lang.CPattern.NodeListVariable. */
10853: private Result pNodeListVariable$1(final int yyStart)
10854: throws IOException {
10855: int yyC;
10856: int yyIndex;
10857: Result yyResult;
10858: Node yyValue;
10859: ParseError yyError = ParseError.DUMMY;
10860:
10861: // Alternative 1.
10862:
10863: yyC = character(yyStart);
10864: if ('#' == yyC) {
10865: yyIndex = yyStart + 1;
10866:
10867: yyC = character(yyIndex);
10868: if ('[' == yyC) {
10869: yyIndex = yyIndex + 1;
10870:
10871: yyResult = pCIdentifier$WordCharacters(yyIndex);
10872: yyError = yyResult.select(yyError);
10873: if (yyResult.hasValue()) {
10874: final String v$g$1 = yyResult.semanticValue();
10875:
10876: yyC = character(yyResult.index);
10877: if (']' == yyC) {
10878: yyIndex = yyResult.index + 1;
10879:
10880: yyResult = pSpacing(yyIndex);
10881: yyError = yyResult.select(yyError);
10882: if (yyResult.hasValue()) {
10883:
10884: yyValue = GNode.create("NodeListVariable",
10885: v$g$1);
10886: yyValue.setLocation(location(yyStart));
10887:
10888: return yyResult.createValue(yyValue,
10889: yyError);
10890: }
10891: }
10892: }
10893: }
10894: }
10895:
10896: // Done.
10897: yyError = yyError
10898: .select("node list variable expected", yyStart);
10899: return yyError;
10900: }
10901:
10902: // =========================================================================
10903:
10904: /**
10905: * Parse nonterminal xtc.lang.CConstant.Constant.
10906: *
10907: * @param yyStart The index.
10908: * @return The result.
10909: * @throws IOException Signals an I/O error.
10910: */
10911: private Result pConstant(final int yyStart) throws IOException {
10912: Result yyResult;
10913: Node yyValue;
10914: ParseError yyError = ParseError.DUMMY;
10915:
10916: // Alternative 1.
10917:
10918: yyResult = pFloatingConstant(yyStart);
10919: yyError = yyResult.select(yyError);
10920: if (yyResult.hasValue()) {
10921: yyValue = yyResult.semanticValue();
10922:
10923: yyResult = pSpacing(yyResult.index);
10924: yyError = yyResult.select(yyError);
10925: if (yyResult.hasValue()) {
10926:
10927: return yyResult.createValue(yyValue, yyError);
10928: }
10929: }
10930:
10931: // Alternative 2.
10932:
10933: yyResult = pIntegerConstant(yyStart);
10934: yyError = yyResult.select(yyError);
10935: if (yyResult.hasValue()) {
10936: yyValue = yyResult.semanticValue();
10937:
10938: yyResult = pSpacing(yyResult.index);
10939: yyError = yyResult.select(yyError);
10940: if (yyResult.hasValue()) {
10941:
10942: return yyResult.createValue(yyValue, yyError);
10943: }
10944: }
10945:
10946: // Alternative 3.
10947:
10948: yyResult = pCharacterConstant(yyStart);
10949: yyError = yyResult.select(yyError);
10950: if (yyResult.hasValue()) {
10951: yyValue = yyResult.semanticValue();
10952:
10953: return yyResult.createValue(yyValue, yyError);
10954: }
10955:
10956: // Alternative 4.
10957:
10958: yyResult = pStringConstant(yyStart);
10959: yyError = yyResult.select(yyError);
10960: if (yyResult.hasValue()) {
10961: yyValue = yyResult.semanticValue();
10962:
10963: return yyResult.createValue(yyValue, yyError);
10964: }
10965:
10966: // Done.
10967: return yyError;
10968: }
10969:
10970: // =========================================================================
10971:
10972: /**
10973: * Parse nonterminal xtc.lang.CConstant.IntegerConstant.
10974: *
10975: * @param yyStart The index.
10976: * @return The result.
10977: * @throws IOException Signals an I/O error.
10978: */
10979: private Result pIntegerConstant(final int yyStart)
10980: throws IOException {
10981: Result yyResult;
10982: Node yyValue;
10983: ParseError yyError = ParseError.DUMMY;
10984:
10985: // Alternative <Hex>.
10986:
10987: yyResult = pHexConstant(yyStart);
10988: yyError = yyResult.select(yyError);
10989: if (yyResult.hasValue()) {
10990: final String v$g$1 = yyResult.semanticValue();
10991:
10992: yyValue = GNode.create("IntegerConstant", v$g$1);
10993: yyValue.setLocation(location(yyStart));
10994:
10995: return yyResult.createValue(yyValue, yyError);
10996: }
10997:
10998: // Alternative <Octal>.
10999:
11000: yyResult = pOctalConstant(yyStart);
11001: yyError = yyResult.select(yyError);
11002: if (yyResult.hasValue()) {
11003: final String v$g$2 = yyResult.semanticValue();
11004:
11005: yyValue = GNode.create("IntegerConstant", v$g$2);
11006: yyValue.setLocation(location(yyStart));
11007:
11008: return yyResult.createValue(yyValue, yyError);
11009: }
11010:
11011: // Alternative <Decimal>.
11012:
11013: yyResult = pDecimalConstant(yyStart);
11014: yyError = yyResult.select(yyError);
11015: if (yyResult.hasValue()) {
11016: final String v$g$3 = yyResult.semanticValue();
11017:
11018: yyValue = GNode.create("IntegerConstant", v$g$3);
11019: yyValue.setLocation(location(yyStart));
11020:
11021: return yyResult.createValue(yyValue, yyError);
11022: }
11023:
11024: // Done.
11025: return yyError;
11026: }
11027:
11028: // =========================================================================
11029:
11030: /**
11031: * Parse nonterminal xtc.lang.CConstant.DecimalConstant.
11032: *
11033: * @param yyStart The index.
11034: * @return The result.
11035: * @throws IOException Signals an I/O error.
11036: */
11037: private Result pDecimalConstant(final int yyStart)
11038: throws IOException {
11039: int yyC;
11040: int yyIndex;
11041: Result yyResult;
11042: int yyRepetition1;
11043: int yyOption1;
11044: String yyValue;
11045: ParseError yyError = ParseError.DUMMY;
11046:
11047: // Alternative 1.
11048:
11049: yyC = character(yyStart);
11050: if (-1 != yyC) {
11051: yyIndex = yyStart + 1;
11052:
11053: switch (yyC) {
11054: case '1':
11055: case '2':
11056: case '3':
11057: case '4':
11058: case '5':
11059: case '6':
11060: case '7':
11061: case '8':
11062: case '9': {
11063: yyRepetition1 = yyIndex;
11064: while (true) {
11065:
11066: yyC = character(yyRepetition1);
11067: if (-1 != yyC) {
11068: yyIndex = yyRepetition1 + 1;
11069:
11070: switch (yyC) {
11071: case '0':
11072: case '1':
11073: case '2':
11074: case '3':
11075: case '4':
11076: case '5':
11077: case '6':
11078: case '7':
11079: case '8':
11080: case '9': {
11081: yyRepetition1 = yyIndex;
11082: continue;
11083: }
11084:
11085: default:
11086: /* No match. */
11087: }
11088: }
11089: break;
11090: }
11091:
11092: yyOption1 = yyRepetition1;
11093:
11094: yyResult = pIntegerSuffix(yyOption1);
11095: yyError = yyResult.select(yyError);
11096: if (yyResult.hasValue()) {
11097:
11098: yyOption1 = yyResult.index;
11099: }
11100:
11101: yyValue = difference(yyStart, yyOption1);
11102:
11103: return new SemanticValue(yyValue, yyOption1, yyError);
11104: }
11105:
11106: default:
11107: /* No match. */
11108: }
11109: }
11110:
11111: // Done.
11112: yyError = yyError.select("decimal constant expected", yyStart);
11113: return yyError;
11114: }
11115:
11116: // =========================================================================
11117:
11118: /**
11119: * Parse nonterminal xtc.lang.CConstant.HexConstant.
11120: *
11121: * @param yyStart The index.
11122: * @return The result.
11123: * @throws IOException Signals an I/O error.
11124: */
11125: private Result pHexConstant(final int yyStart) throws IOException {
11126: int yyC;
11127: int yyIndex;
11128: Result yyResult;
11129: int yyRepetition1;
11130: boolean yyRepeated1;
11131: int yyOption1;
11132: String yyValue;
11133: ParseError yyError = ParseError.DUMMY;
11134:
11135: // Alternative 1.
11136:
11137: yyResult = pHexPrefix(yyStart);
11138: yyError = yyResult.select(yyError);
11139: if (yyResult.hasValue()) {
11140:
11141: yyRepetition1 = yyResult.index;
11142: yyRepeated1 = false;
11143: while (true) {
11144:
11145: yyC = character(yyRepetition1);
11146: if (-1 != yyC) {
11147: yyIndex = yyRepetition1 + 1;
11148:
11149: switch (yyC) {
11150: case '0':
11151: case '1':
11152: case '2':
11153: case '3':
11154: case '4':
11155: case '5':
11156: case '6':
11157: case '7':
11158: case '8':
11159: case '9':
11160: case 'A':
11161: case 'B':
11162: case 'C':
11163: case 'D':
11164: case 'E':
11165: case 'F':
11166: case 'a':
11167: case 'b':
11168: case 'c':
11169: case 'd':
11170: case 'e':
11171: case 'f': {
11172: yyRepetition1 = yyIndex;
11173: yyRepeated1 = true;
11174: continue;
11175: }
11176:
11177: default:
11178: /* No match. */
11179: }
11180: }
11181: break;
11182: }
11183:
11184: if (yyRepeated1) {
11185:
11186: yyOption1 = yyRepetition1;
11187:
11188: yyResult = pIntegerSuffix(yyOption1);
11189: yyError = yyResult.select(yyError);
11190: if (yyResult.hasValue()) {
11191:
11192: yyOption1 = yyResult.index;
11193: }
11194:
11195: yyValue = difference(yyStart, yyOption1);
11196:
11197: return new SemanticValue(yyValue, yyOption1, yyError);
11198: }
11199: }
11200:
11201: // Done.
11202: yyError = yyError.select("hex constant expected", yyStart);
11203: return yyError;
11204: }
11205:
11206: // =========================================================================
11207:
11208: /**
11209: * Parse nonterminal xtc.lang.CConstant.HexPrefix.
11210: *
11211: * @param yyStart The index.
11212: * @return The result.
11213: * @throws IOException Signals an I/O error.
11214: */
11215: private Result pHexPrefix(final int yyStart) throws IOException {
11216: int yyC;
11217: int yyIndex;
11218: Void yyValue;
11219: ParseError yyError = ParseError.DUMMY;
11220:
11221: // Alternative 1.
11222:
11223: yyC = character(yyStart);
11224: if ('0' == yyC) {
11225: yyIndex = yyStart + 1;
11226:
11227: yyC = character(yyIndex);
11228: if (-1 != yyC) {
11229: yyIndex = yyIndex + 1;
11230:
11231: switch (yyC) {
11232: case 'X':
11233: case 'x': {
11234: yyValue = null;
11235:
11236: return new SemanticValue(yyValue, yyIndex, yyError);
11237: }
11238:
11239: default:
11240: /* No match. */
11241: }
11242: }
11243: }
11244:
11245: // Done.
11246: yyError = yyError.select("hex prefix expected", yyStart);
11247: return yyError;
11248: }
11249:
11250: // =========================================================================
11251:
11252: /**
11253: * Parse nonterminal xtc.lang.CConstant.OctalConstant.
11254: *
11255: * @param yyStart The index.
11256: * @return The result.
11257: * @throws IOException Signals an I/O error.
11258: */
11259: private Result pOctalConstant(final int yyStart) throws IOException {
11260: int yyC;
11261: int yyIndex;
11262: Result yyResult;
11263: int yyRepetition1;
11264: int yyOption1;
11265: String yyValue;
11266: ParseError yyError = ParseError.DUMMY;
11267:
11268: // Alternative 1.
11269:
11270: yyC = character(yyStart);
11271: if ('0' == yyC) {
11272: yyIndex = yyStart + 1;
11273:
11274: yyRepetition1 = yyIndex;
11275: while (true) {
11276:
11277: yyC = character(yyRepetition1);
11278: if (-1 != yyC) {
11279: yyIndex = yyRepetition1 + 1;
11280:
11281: switch (yyC) {
11282: case '0':
11283: case '1':
11284: case '2':
11285: case '3':
11286: case '4':
11287: case '5':
11288: case '6':
11289: case '7': {
11290: yyRepetition1 = yyIndex;
11291: continue;
11292: }
11293:
11294: default:
11295: /* No match. */
11296: }
11297: }
11298: break;
11299: }
11300:
11301: yyOption1 = yyRepetition1;
11302:
11303: yyResult = pIntegerSuffix(yyOption1);
11304: yyError = yyResult.select(yyError);
11305: if (yyResult.hasValue()) {
11306:
11307: yyOption1 = yyResult.index;
11308: }
11309:
11310: yyValue = difference(yyStart, yyOption1);
11311:
11312: return new SemanticValue(yyValue, yyOption1, yyError);
11313: }
11314:
11315: // Done.
11316: yyError = yyError.select("octal constant expected", yyStart);
11317: return yyError;
11318: }
11319:
11320: // =========================================================================
11321:
11322: /**
11323: * Parse nonterminal xtc.lang.CConstant.IntegerSuffix.
11324: *
11325: * @param yyStart The index.
11326: * @return The result.
11327: * @throws IOException Signals an I/O error.
11328: */
11329: private Result pIntegerSuffix(final int yyStart) throws IOException {
11330: int yyC;
11331: int yyIndex;
11332: Result yyResult;
11333: Void yyValue;
11334: ParseError yyError = ParseError.DUMMY;
11335:
11336: // Alternative 1.
11337:
11338: yyResult = pLongLongSuffix(yyStart);
11339: yyError = yyResult.select(yyError);
11340: if (yyResult.hasValue()) {
11341:
11342: final int yyChoice1 = yyResult.index;
11343:
11344: // Nested alternative 1.
11345:
11346: yyC = character(yyChoice1);
11347: if (-1 != yyC) {
11348: yyIndex = yyChoice1 + 1;
11349:
11350: switch (yyC) {
11351: case 'U':
11352: case 'u': {
11353: yyValue = null;
11354:
11355: return new SemanticValue(yyValue, yyIndex, yyError);
11356: }
11357:
11358: default:
11359: /* No match. */
11360: }
11361: }
11362:
11363: // Nested alternative 2.
11364:
11365: yyValue = null;
11366:
11367: return new SemanticValue(yyValue, yyChoice1, yyError);
11368: }
11369:
11370: // Alternative 2.
11371:
11372: yyC = character(yyStart);
11373: if (-1 != yyC) {
11374: yyIndex = yyStart + 1;
11375:
11376: switch (yyC) {
11377: case 'L':
11378: case 'l': {
11379: final int yyChoice1 = yyIndex;
11380:
11381: // Nested alternative 1.
11382:
11383: yyC = character(yyChoice1);
11384: if (-1 != yyC) {
11385: yyIndex = yyChoice1 + 1;
11386:
11387: switch (yyC) {
11388: case 'U':
11389: case 'u': {
11390: yyValue = null;
11391:
11392: return new SemanticValue(yyValue, yyIndex,
11393: yyError);
11394: }
11395:
11396: default:
11397: /* No match. */
11398: }
11399: }
11400:
11401: // Nested alternative 2.
11402:
11403: yyValue = null;
11404:
11405: return new SemanticValue(yyValue, yyChoice1, yyError);
11406: }
11407:
11408: case 'U':
11409: case 'u': {
11410: final int yyChoice1 = yyIndex;
11411:
11412: // Nested alternative 1.
11413:
11414: yyC = character(yyChoice1);
11415: if (-1 != yyC) {
11416: yyIndex = yyChoice1 + 1;
11417:
11418: switch (yyC) {
11419: case 'l': {
11420: yyC = character(yyIndex);
11421: if (-1 != yyC) {
11422: yyIndex = yyIndex + 1;
11423: if ('l' == yyC) {
11424:
11425: yyValue = null;
11426:
11427: return new SemanticValue(yyValue,
11428: yyIndex, yyError);
11429: }
11430: }
11431: }
11432: break;
11433:
11434: case 'L': {
11435: yyC = character(yyIndex);
11436: if (-1 != yyC) {
11437: yyIndex = yyIndex + 1;
11438: if ('L' == yyC) {
11439:
11440: yyValue = null;
11441:
11442: return new SemanticValue(yyValue,
11443: yyIndex, yyError);
11444: }
11445: }
11446: }
11447: break;
11448:
11449: default:
11450: /* No match. */
11451: }
11452: }
11453:
11454: // Nested alternative 2.
11455:
11456: yyC = character(yyChoice1);
11457: if (-1 != yyC) {
11458: yyIndex = yyChoice1 + 1;
11459:
11460: switch (yyC) {
11461: case 'L':
11462: case 'l': {
11463: yyValue = null;
11464:
11465: return new SemanticValue(yyValue, yyIndex,
11466: yyError);
11467: }
11468:
11469: default:
11470: /* No match. */
11471: }
11472: }
11473:
11474: // Nested alternative 3.
11475:
11476: yyValue = null;
11477:
11478: return new SemanticValue(yyValue, yyChoice1, yyError);
11479: }
11480:
11481: default:
11482: /* No match. */
11483: }
11484: }
11485:
11486: // Done.
11487: yyError = yyError.select("integer suffix expected", yyStart);
11488: return yyError;
11489: }
11490:
11491: // =========================================================================
11492:
11493: /**
11494: * Parse nonterminal xtc.lang.CConstant.LongLongSuffix.
11495: *
11496: * @param yyStart The index.
11497: * @return The result.
11498: * @throws IOException Signals an I/O error.
11499: */
11500: private Result pLongLongSuffix(final int yyStart)
11501: throws IOException {
11502: int yyC;
11503: int yyIndex;
11504: Void yyValue;
11505: ParseError yyError = ParseError.DUMMY;
11506:
11507: // Alternative 1.
11508:
11509: yyC = character(yyStart);
11510: if (-1 != yyC) {
11511: yyIndex = yyStart + 1;
11512:
11513: switch (yyC) {
11514: case 'l': {
11515: yyC = character(yyIndex);
11516: if (-1 != yyC) {
11517: yyIndex = yyIndex + 1;
11518: if ('l' == yyC) {
11519:
11520: yyValue = null;
11521:
11522: return new SemanticValue(yyValue, yyIndex,
11523: yyError);
11524: }
11525: }
11526: }
11527: break;
11528:
11529: case 'L': {
11530: yyC = character(yyIndex);
11531: if (-1 != yyC) {
11532: yyIndex = yyIndex + 1;
11533: if ('L' == yyC) {
11534:
11535: yyValue = null;
11536:
11537: return new SemanticValue(yyValue, yyIndex,
11538: yyError);
11539: }
11540: }
11541: }
11542: break;
11543:
11544: default:
11545: /* No match. */
11546: }
11547: }
11548:
11549: // Done.
11550: yyError = yyError.select("long long suffix expected", yyStart);
11551: return yyError;
11552: }
11553:
11554: // =========================================================================
11555:
11556: /**
11557: * Parse nonterminal xtc.lang.CConstant.FloatingConstant.
11558: *
11559: * @param yyStart The index.
11560: * @return The result.
11561: * @throws IOException Signals an I/O error.
11562: */
11563: private Result pFloatingConstant(final int yyStart)
11564: throws IOException {
11565: Result yyResult;
11566: Node yyValue;
11567: ParseError yyError = ParseError.DUMMY;
11568:
11569: // Alternative <Decimal>.
11570:
11571: yyResult = pDecimalFloatingConstant(yyStart);
11572: yyError = yyResult.select(yyError);
11573: if (yyResult.hasValue()) {
11574: final String v$g$1 = yyResult.semanticValue();
11575:
11576: yyValue = GNode.create("FloatingConstant", v$g$1);
11577: yyValue.setLocation(location(yyStart));
11578:
11579: return yyResult.createValue(yyValue, yyError);
11580: }
11581:
11582: // Alternative <Hex>.
11583:
11584: yyResult = pHexFloatingConstant(yyStart);
11585: yyError = yyResult.select(yyError);
11586: if (yyResult.hasValue()) {
11587: final String v$g$2 = yyResult.semanticValue();
11588:
11589: yyValue = GNode.create("FloatingConstant", v$g$2);
11590: yyValue.setLocation(location(yyStart));
11591:
11592: return yyResult.createValue(yyValue, yyError);
11593: }
11594:
11595: // Done.
11596: return yyError;
11597: }
11598:
11599: // =========================================================================
11600:
11601: /**
11602: * Parse nonterminal xtc.lang.CConstant.DecimalFloatingConstant.
11603: *
11604: * @param yyStart The index.
11605: * @return The result.
11606: * @throws IOException Signals an I/O error.
11607: */
11608: private Result pDecimalFloatingConstant(final int yyStart)
11609: throws IOException {
11610:
11611: int yyC;
11612: int yyIndex;
11613: Result yyResult;
11614: int yyRepetition1;
11615: boolean yyRepeated1;
11616: int yyOption1;
11617: String yyValue;
11618: ParseError yyError = ParseError.DUMMY;
11619:
11620: // Alternative 1.
11621:
11622: yyRepetition1 = yyStart;
11623: yyRepeated1 = false;
11624: while (true) {
11625:
11626: yyC = character(yyRepetition1);
11627: if (-1 != yyC) {
11628: yyIndex = yyRepetition1 + 1;
11629:
11630: switch (yyC) {
11631: case '0':
11632: case '1':
11633: case '2':
11634: case '3':
11635: case '4':
11636: case '5':
11637: case '6':
11638: case '7':
11639: case '8':
11640: case '9': {
11641: yyRepetition1 = yyIndex;
11642: yyRepeated1 = true;
11643: continue;
11644: }
11645:
11646: default:
11647: /* No match. */
11648: }
11649: }
11650: break;
11651: }
11652:
11653: if (yyRepeated1) {
11654:
11655: yyC = character(yyRepetition1);
11656: if ('.' == yyC) {
11657: yyIndex = yyRepetition1 + 1;
11658:
11659: yyRepetition1 = yyIndex;
11660: while (true) {
11661:
11662: yyC = character(yyRepetition1);
11663: if (-1 != yyC) {
11664: yyIndex = yyRepetition1 + 1;
11665:
11666: switch (yyC) {
11667: case '0':
11668: case '1':
11669: case '2':
11670: case '3':
11671: case '4':
11672: case '5':
11673: case '6':
11674: case '7':
11675: case '8':
11676: case '9': {
11677: yyRepetition1 = yyIndex;
11678: continue;
11679: }
11680:
11681: default:
11682: /* No match. */
11683: }
11684: }
11685: break;
11686: }
11687:
11688: yyOption1 = yyRepetition1;
11689:
11690: yyResult = pExponent(yyOption1);
11691: yyError = yyResult.select(yyError);
11692: if (yyResult.hasValue()) {
11693:
11694: yyOption1 = yyResult.index;
11695: }
11696:
11697: yyC = character(yyOption1);
11698: if (-1 != yyC) {
11699: yyIndex = yyOption1 + 1;
11700:
11701: switch (yyC) {
11702: case 'F':
11703: case 'L':
11704: case 'f':
11705: case 'l': {
11706: yyOption1 = yyIndex;
11707: }
11708:
11709: default:
11710: /* No match. */
11711: }
11712: }
11713:
11714: yyValue = difference(yyStart, yyOption1);
11715:
11716: return new SemanticValue(yyValue, yyOption1, yyError);
11717: }
11718: }
11719:
11720: // Alternative 2.
11721:
11722: yyC = character(yyStart);
11723: if ('.' == yyC) {
11724: yyIndex = yyStart + 1;
11725:
11726: yyRepetition1 = yyIndex;
11727: yyRepeated1 = false;
11728: while (true) {
11729:
11730: yyC = character(yyRepetition1);
11731: if (-1 != yyC) {
11732: yyIndex = yyRepetition1 + 1;
11733:
11734: switch (yyC) {
11735: case '0':
11736: case '1':
11737: case '2':
11738: case '3':
11739: case '4':
11740: case '5':
11741: case '6':
11742: case '7':
11743: case '8':
11744: case '9': {
11745: yyRepetition1 = yyIndex;
11746: yyRepeated1 = true;
11747: continue;
11748: }
11749:
11750: default:
11751: /* No match. */
11752: }
11753: }
11754: break;
11755: }
11756:
11757: if (yyRepeated1) {
11758:
11759: yyOption1 = yyRepetition1;
11760:
11761: yyResult = pExponent(yyOption1);
11762: yyError = yyResult.select(yyError);
11763: if (yyResult.hasValue()) {
11764:
11765: yyOption1 = yyResult.index;
11766: }
11767:
11768: yyC = character(yyOption1);
11769: if (-1 != yyC) {
11770: yyIndex = yyOption1 + 1;
11771:
11772: switch (yyC) {
11773: case 'F':
11774: case 'L':
11775: case 'f':
11776: case 'l': {
11777: yyOption1 = yyIndex;
11778: }
11779:
11780: default:
11781: /* No match. */
11782: }
11783: }
11784:
11785: yyValue = difference(yyStart, yyOption1);
11786:
11787: return new SemanticValue(yyValue, yyOption1, yyError);
11788: }
11789: }
11790:
11791: // Alternative 3.
11792:
11793: yyRepetition1 = yyStart;
11794: yyRepeated1 = false;
11795: while (true) {
11796:
11797: yyC = character(yyRepetition1);
11798: if (-1 != yyC) {
11799: yyIndex = yyRepetition1 + 1;
11800:
11801: switch (yyC) {
11802: case '0':
11803: case '1':
11804: case '2':
11805: case '3':
11806: case '4':
11807: case '5':
11808: case '6':
11809: case '7':
11810: case '8':
11811: case '9': {
11812: yyRepetition1 = yyIndex;
11813: yyRepeated1 = true;
11814: continue;
11815: }
11816:
11817: default:
11818: /* No match. */
11819: }
11820: }
11821: break;
11822: }
11823:
11824: if (yyRepeated1) {
11825:
11826: yyResult = pExponent(yyRepetition1);
11827: yyError = yyResult.select(yyError);
11828: if (yyResult.hasValue()) {
11829:
11830: yyOption1 = yyResult.index;
11831:
11832: yyC = character(yyOption1);
11833: if (-1 != yyC) {
11834: yyIndex = yyOption1 + 1;
11835:
11836: switch (yyC) {
11837: case 'F':
11838: case 'L':
11839: case 'f':
11840: case 'l': {
11841: yyOption1 = yyIndex;
11842: }
11843:
11844: default:
11845: /* No match. */
11846: }
11847: }
11848:
11849: yyValue = difference(yyStart, yyOption1);
11850:
11851: return new SemanticValue(yyValue, yyOption1, yyError);
11852: }
11853: }
11854:
11855: // Done.
11856: yyError = yyError.select("decimal floating constant expected",
11857: yyStart);
11858: return yyError;
11859: }
11860:
11861: // =========================================================================
11862:
11863: /**
11864: * Parse nonterminal xtc.lang.CConstant.HexFloatingConstant.
11865: *
11866: * @param yyStart The index.
11867: * @return The result.
11868: * @throws IOException Signals an I/O error.
11869: */
11870: private Result pHexFloatingConstant(final int yyStart)
11871: throws IOException {
11872: int yyC;
11873: int yyIndex;
11874: Result yyResult;
11875: int yyRepetition1;
11876: boolean yyRepeated1;
11877: int yyOption1;
11878: String yyValue;
11879: ParseError yyError = ParseError.DUMMY;
11880:
11881: // Alternative 1.
11882:
11883: yyResult = pHexPrefix(yyStart);
11884: yyError = yyResult.select(yyError);
11885: if (yyResult.hasValue()) {
11886:
11887: final int yyChoice1 = yyResult.index;
11888:
11889: // Nested alternative 1.
11890:
11891: yyRepetition1 = yyChoice1;
11892: yyRepeated1 = false;
11893: while (true) {
11894:
11895: yyC = character(yyRepetition1);
11896: if (-1 != yyC) {
11897: yyIndex = yyRepetition1 + 1;
11898:
11899: switch (yyC) {
11900: case '0':
11901: case '1':
11902: case '2':
11903: case '3':
11904: case '4':
11905: case '5':
11906: case '6':
11907: case '7':
11908: case '8':
11909: case '9':
11910: case 'A':
11911: case 'B':
11912: case 'C':
11913: case 'D':
11914: case 'E':
11915: case 'F':
11916: case 'a':
11917: case 'b':
11918: case 'c':
11919: case 'd':
11920: case 'e':
11921: case 'f': {
11922: yyRepetition1 = yyIndex;
11923: yyRepeated1 = true;
11924: continue;
11925: }
11926:
11927: default:
11928: /* No match. */
11929: }
11930: }
11931: break;
11932: }
11933:
11934: if (yyRepeated1) {
11935:
11936: yyC = character(yyRepetition1);
11937: if ('.' == yyC) {
11938: yyIndex = yyRepetition1 + 1;
11939:
11940: yyRepetition1 = yyIndex;
11941: while (true) {
11942:
11943: yyC = character(yyRepetition1);
11944: if (-1 != yyC) {
11945: yyIndex = yyRepetition1 + 1;
11946:
11947: switch (yyC) {
11948: case '0':
11949: case '1':
11950: case '2':
11951: case '3':
11952: case '4':
11953: case '5':
11954: case '6':
11955: case '7':
11956: case '8':
11957: case '9':
11958: case 'A':
11959: case 'B':
11960: case 'C':
11961: case 'D':
11962: case 'E':
11963: case 'F':
11964: case 'a':
11965: case 'b':
11966: case 'c':
11967: case 'd':
11968: case 'e':
11969: case 'f': {
11970: yyRepetition1 = yyIndex;
11971: continue;
11972: }
11973:
11974: default:
11975: /* No match. */
11976: }
11977: }
11978: break;
11979: }
11980:
11981: yyResult = pBinaryExponent(yyRepetition1);
11982: yyError = yyResult.select(yyError);
11983: if (yyResult.hasValue()) {
11984:
11985: yyOption1 = yyResult.index;
11986:
11987: yyC = character(yyOption1);
11988: if (-1 != yyC) {
11989: yyIndex = yyOption1 + 1;
11990:
11991: switch (yyC) {
11992: case 'F':
11993: case 'L':
11994: case 'f':
11995: case 'l': {
11996: yyOption1 = yyIndex;
11997: }
11998:
11999: default:
12000: /* No match. */
12001: }
12002: }
12003:
12004: yyValue = difference(yyStart, yyOption1);
12005:
12006: return new SemanticValue(yyValue, yyOption1,
12007: yyError);
12008: }
12009: }
12010: }
12011:
12012: // Nested alternative 2.
12013:
12014: yyC = character(yyChoice1);
12015: if ('.' == yyC) {
12016: yyIndex = yyChoice1 + 1;
12017:
12018: yyRepetition1 = yyIndex;
12019: yyRepeated1 = false;
12020: while (true) {
12021:
12022: yyC = character(yyRepetition1);
12023: if (-1 != yyC) {
12024: yyIndex = yyRepetition1 + 1;
12025:
12026: switch (yyC) {
12027: case '0':
12028: case '1':
12029: case '2':
12030: case '3':
12031: case '4':
12032: case '5':
12033: case '6':
12034: case '7':
12035: case '8':
12036: case '9':
12037: case 'A':
12038: case 'B':
12039: case 'C':
12040: case 'D':
12041: case 'E':
12042: case 'F':
12043: case 'a':
12044: case 'b':
12045: case 'c':
12046: case 'd':
12047: case 'e':
12048: case 'f': {
12049: yyRepetition1 = yyIndex;
12050: yyRepeated1 = true;
12051: continue;
12052: }
12053:
12054: default:
12055: /* No match. */
12056: }
12057: }
12058: break;
12059: }
12060:
12061: if (yyRepeated1) {
12062:
12063: yyResult = pBinaryExponent(yyRepetition1);
12064: yyError = yyResult.select(yyError);
12065: if (yyResult.hasValue()) {
12066:
12067: yyOption1 = yyResult.index;
12068:
12069: yyC = character(yyOption1);
12070: if (-1 != yyC) {
12071: yyIndex = yyOption1 + 1;
12072:
12073: switch (yyC) {
12074: case 'F':
12075: case 'L':
12076: case 'f':
12077: case 'l': {
12078: yyOption1 = yyIndex;
12079: }
12080:
12081: default:
12082: /* No match. */
12083: }
12084: }
12085:
12086: yyValue = difference(yyStart, yyOption1);
12087:
12088: return new SemanticValue(yyValue, yyOption1,
12089: yyError);
12090: }
12091: }
12092: }
12093:
12094: // Nested alternative 3.
12095:
12096: yyRepetition1 = yyChoice1;
12097: yyRepeated1 = false;
12098: while (true) {
12099:
12100: yyC = character(yyRepetition1);
12101: if (-1 != yyC) {
12102: yyIndex = yyRepetition1 + 1;
12103:
12104: switch (yyC) {
12105: case '0':
12106: case '1':
12107: case '2':
12108: case '3':
12109: case '4':
12110: case '5':
12111: case '6':
12112: case '7':
12113: case '8':
12114: case '9':
12115: case 'A':
12116: case 'B':
12117: case 'C':
12118: case 'D':
12119: case 'E':
12120: case 'F':
12121: case 'a':
12122: case 'b':
12123: case 'c':
12124: case 'd':
12125: case 'e':
12126: case 'f': {
12127: yyRepetition1 = yyIndex;
12128: yyRepeated1 = true;
12129: continue;
12130: }
12131:
12132: default:
12133: /* No match. */
12134: }
12135: }
12136: break;
12137: }
12138:
12139: if (yyRepeated1) {
12140:
12141: yyResult = pBinaryExponent(yyRepetition1);
12142: yyError = yyResult.select(yyError);
12143: if (yyResult.hasValue()) {
12144:
12145: yyOption1 = yyResult.index;
12146:
12147: yyC = character(yyOption1);
12148: if (-1 != yyC) {
12149: yyIndex = yyOption1 + 1;
12150:
12151: switch (yyC) {
12152: case 'F':
12153: case 'L':
12154: case 'f':
12155: case 'l': {
12156: yyOption1 = yyIndex;
12157: }
12158:
12159: default:
12160: /* No match. */
12161: }
12162: }
12163:
12164: yyValue = difference(yyStart, yyOption1);
12165:
12166: return new SemanticValue(yyValue, yyOption1,
12167: yyError);
12168: }
12169: }
12170: }
12171:
12172: // Done.
12173: yyError = yyError.select("hex floating constant expected",
12174: yyStart);
12175: return yyError;
12176: }
12177:
12178: // =========================================================================
12179:
12180: /**
12181: * Parse nonterminal xtc.lang.CConstant.Exponent.
12182: *
12183: * @param yyStart The index.
12184: * @return The result.
12185: * @throws IOException Signals an I/O error.
12186: */
12187: private Result pExponent(final int yyStart) throws IOException {
12188: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
12189: if (null == yyColumn.chunk4)
12190: yyColumn.chunk4 = new Chunk4();
12191: if (null == yyColumn.chunk4.fExponent)
12192: yyColumn.chunk4.fExponent = pExponent$1(yyStart);
12193: return yyColumn.chunk4.fExponent;
12194: }
12195:
12196: /** Actually parse xtc.lang.CConstant.Exponent. */
12197: private Result pExponent$1(final int yyStart) throws IOException {
12198: int yyC;
12199: int yyIndex;
12200: Result yyResult;
12201: int yyOption1;
12202: Void yyValue;
12203: ParseError yyError = ParseError.DUMMY;
12204:
12205: // Alternative 1.
12206:
12207: yyC = character(yyStart);
12208: if (-1 != yyC) {
12209: yyIndex = yyStart + 1;
12210:
12211: switch (yyC) {
12212: case 'E':
12213: case 'e': {
12214: yyOption1 = yyIndex;
12215:
12216: yyC = character(yyOption1);
12217: if (-1 != yyC) {
12218: yyIndex = yyOption1 + 1;
12219:
12220: switch (yyC) {
12221: case '+':
12222: case '-': {
12223: yyOption1 = yyIndex;
12224: }
12225:
12226: default:
12227: /* No match. */
12228: }
12229: }
12230:
12231: yyResult = p$$Shared2(yyOption1);
12232: yyError = yyResult.select(yyError);
12233: if (yyResult.hasValue()) {
12234:
12235: yyValue = null;
12236:
12237: return yyResult.createValue(yyValue, yyError);
12238: }
12239: }
12240: break;
12241:
12242: default:
12243: /* No match. */
12244: }
12245: }
12246:
12247: // Done.
12248: yyError = yyError.select("exponent expected", yyStart);
12249: return yyError;
12250: }
12251:
12252: // =========================================================================
12253:
12254: /**
12255: * Parse synthetic nonterminal xtc.lang.CFactory.$$Shared2.
12256: * This nonterminal represents the duplicate productions
12257: * xtc.lang.CFactory.Exponent$$Plus1
12258: * and xtc.lang.CFactory.BinaryExponent$$Plus1.
12259: *
12260: * @param yyStart The index.
12261: * @return The result.
12262: * @throws IOException Signals an I/O error.
12263: */
12264: private Result p$$Shared2(final int yyStart) throws IOException {
12265: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
12266: if (null == yyColumn.chunk4)
12267: yyColumn.chunk4 = new Chunk4();
12268: if (null == yyColumn.chunk4.f$$Shared2)
12269: yyColumn.chunk4.f$$Shared2 = p$$Shared2$1(yyStart);
12270: return yyColumn.chunk4.f$$Shared2;
12271: }
12272:
12273: /** Actually parse xtc.lang.CFactory.$$Shared2. */
12274: private Result p$$Shared2$1(final int yyStart) throws IOException {
12275: int yyC;
12276: int yyIndex;
12277: Result yyResult;
12278: Void yyValue;
12279: ParseError yyError = ParseError.DUMMY;
12280:
12281: // Alternative 1.
12282:
12283: yyC = character(yyStart);
12284: if (-1 != yyC) {
12285: yyIndex = yyStart + 1;
12286:
12287: switch (yyC) {
12288: case '0':
12289: case '1':
12290: case '2':
12291: case '3':
12292: case '4':
12293: case '5':
12294: case '6':
12295: case '7':
12296: case '8':
12297: case '9': {
12298: final int yyChoice1 = yyIndex;
12299:
12300: // Nested alternative 1.
12301:
12302: yyResult = p$$Shared2(yyChoice1);
12303: yyError = yyResult.select(yyError);
12304: if (yyResult.hasValue()) {
12305:
12306: yyValue = null;
12307:
12308: return yyResult.createValue(yyValue, yyError);
12309: }
12310:
12311: // Nested alternative 2.
12312:
12313: yyValue = null;
12314:
12315: return new SemanticValue(yyValue, yyChoice1, yyError);
12316: }
12317:
12318: default:
12319: /* No match. */
12320: }
12321: }
12322:
12323: // Done.
12324: yyError = yyError.select(" expected", yyStart);
12325: return yyError;
12326: }
12327:
12328: // =========================================================================
12329:
12330: /**
12331: * Parse nonterminal xtc.lang.CConstant.BinaryExponent.
12332: *
12333: * @param yyStart The index.
12334: * @return The result.
12335: * @throws IOException Signals an I/O error.
12336: */
12337: private Result pBinaryExponent(final int yyStart)
12338: throws IOException {
12339: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
12340: if (null == yyColumn.chunk4)
12341: yyColumn.chunk4 = new Chunk4();
12342: if (null == yyColumn.chunk4.fBinaryExponent)
12343: yyColumn.chunk4.fBinaryExponent = pBinaryExponent$1(yyStart);
12344: return yyColumn.chunk4.fBinaryExponent;
12345: }
12346:
12347: /** Actually parse xtc.lang.CConstant.BinaryExponent. */
12348: private Result pBinaryExponent$1(final int yyStart)
12349: throws IOException {
12350: int yyC;
12351: int yyIndex;
12352: Result yyResult;
12353: int yyOption1;
12354: Void yyValue;
12355: ParseError yyError = ParseError.DUMMY;
12356:
12357: // Alternative 1.
12358:
12359: yyC = character(yyStart);
12360: if (-1 != yyC) {
12361: yyIndex = yyStart + 1;
12362:
12363: switch (yyC) {
12364: case 'P':
12365: case 'p': {
12366: yyOption1 = yyIndex;
12367:
12368: yyC = character(yyOption1);
12369: if (-1 != yyC) {
12370: yyIndex = yyOption1 + 1;
12371:
12372: switch (yyC) {
12373: case '+':
12374: case '-': {
12375: yyOption1 = yyIndex;
12376: }
12377:
12378: default:
12379: /* No match. */
12380: }
12381: }
12382:
12383: yyResult = p$$Shared2(yyOption1);
12384: yyError = yyResult.select(yyError);
12385: if (yyResult.hasValue()) {
12386:
12387: yyValue = null;
12388:
12389: return yyResult.createValue(yyValue, yyError);
12390: }
12391: }
12392: break;
12393:
12394: default:
12395: /* No match. */
12396: }
12397: }
12398:
12399: // Done.
12400: yyError = yyError.select("binary exponent expected", yyStart);
12401: return yyError;
12402: }
12403:
12404: // =========================================================================
12405:
12406: /**
12407: * Parse nonterminal xtc.lang.CConstant.CharacterConstant.
12408: *
12409: * @param yyStart The index.
12410: * @return The result.
12411: * @throws IOException Signals an I/O error.
12412: */
12413: private Result pCharacterConstant(final int yyStart)
12414: throws IOException {
12415: Result yyResult;
12416: Node yyValue;
12417: ParseError yyError = ParseError.DUMMY;
12418:
12419: // Alternative 1.
12420:
12421: yyResult = pWideCharacterLiteral(yyStart);
12422: yyError = yyResult.select(yyError);
12423: if (yyResult.hasValue()) {
12424: final String v$g$1 = yyResult.semanticValue();
12425:
12426: yyResult = pSpacing(yyResult.index);
12427: yyError = yyResult.select(yyError);
12428: if (yyResult.hasValue()) {
12429:
12430: yyValue = GNode.create("CharacterConstant", v$g$1);
12431: yyValue.setLocation(location(yyStart));
12432:
12433: return yyResult.createValue(yyValue, yyError);
12434: }
12435: }
12436:
12437: // Alternative 2.
12438:
12439: yyResult = pCharacterLiteral(yyStart);
12440: yyError = yyResult.select(yyError);
12441: if (yyResult.hasValue()) {
12442: final String v$g$2 = yyResult.semanticValue();
12443:
12444: yyResult = pSpacing(yyResult.index);
12445: yyError = yyResult.select(yyError);
12446: if (yyResult.hasValue()) {
12447:
12448: yyValue = GNode.create("CharacterConstant", v$g$2);
12449: yyValue.setLocation(location(yyStart));
12450:
12451: return yyResult.createValue(yyValue, yyError);
12452: }
12453: }
12454:
12455: // Done.
12456: return yyError;
12457: }
12458:
12459: // =========================================================================
12460:
12461: /**
12462: * Parse nonterminal xtc.lang.CConstant.WideCharacterLiteral.
12463: *
12464: * @param yyStart The index.
12465: * @return The result.
12466: * @throws IOException Signals an I/O error.
12467: */
12468: private Result pWideCharacterLiteral(final int yyStart)
12469: throws IOException {
12470: int yyC;
12471: int yyIndex;
12472: Result yyResult;
12473: String yyValue;
12474: ParseError yyError = ParseError.DUMMY;
12475:
12476: // Alternative 1.
12477:
12478: yyC = character(yyStart);
12479: if ('L' == yyC) {
12480: yyIndex = yyStart + 1;
12481:
12482: yyResult = pCharacterLiteral(yyIndex);
12483: yyError = yyResult.select(yyError);
12484: if (yyResult.hasValue()) {
12485:
12486: yyValue = difference(yyStart, yyResult.index);
12487:
12488: return yyResult.createValue(yyValue, yyError);
12489: }
12490: }
12491:
12492: // Done.
12493: yyError = yyError.select("wide character literal expected",
12494: yyStart);
12495: return yyError;
12496: }
12497:
12498: // =========================================================================
12499:
12500: /**
12501: * Parse nonterminal xtc.lang.CConstant.CharacterLiteral.
12502: *
12503: * @param yyStart The index.
12504: * @return The result.
12505: * @throws IOException Signals an I/O error.
12506: */
12507: private Result pCharacterLiteral(final int yyStart)
12508: throws IOException {
12509: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
12510: if (null == yyColumn.chunk4)
12511: yyColumn.chunk4 = new Chunk4();
12512: if (null == yyColumn.chunk4.fCharacterLiteral)
12513: yyColumn.chunk4.fCharacterLiteral = pCharacterLiteral$1(yyStart);
12514: return yyColumn.chunk4.fCharacterLiteral;
12515: }
12516:
12517: /** Actually parse xtc.lang.CConstant.CharacterLiteral. */
12518: private Result pCharacterLiteral$1(final int yyStart)
12519: throws IOException {
12520: int yyC;
12521: int yyIndex;
12522: Result yyResult;
12523: String yyValue;
12524: ParseError yyError = ParseError.DUMMY;
12525:
12526: // Alternative 1.
12527:
12528: yyC = character(yyStart);
12529: if ('\'' == yyC) {
12530: yyIndex = yyStart + 1;
12531:
12532: yyResult = pCharacterLiteral$$Plus1(yyIndex);
12533: yyError = yyResult.select(yyError);
12534: if (yyResult.hasValue()) {
12535:
12536: yyC = character(yyResult.index);
12537: if ('\'' == yyC) {
12538: yyIndex = yyResult.index + 1;
12539:
12540: yyValue = difference(yyStart, yyIndex);
12541:
12542: return new SemanticValue(yyValue, yyIndex, yyError);
12543: }
12544: }
12545: }
12546:
12547: // Done.
12548: yyError = yyError.select("character literal expected", yyStart);
12549: return yyError;
12550: }
12551:
12552: // =========================================================================
12553:
12554: /**
12555: * Parse synthetic nonterminal xtc.lang.CFactory.CharacterLiteral$$Plus1.
12556: *
12557: * @param yyStart The index.
12558: * @return The result.
12559: * @throws IOException Signals an I/O error.
12560: */
12561: private Result pCharacterLiteral$$Plus1(final int yyStart)
12562: throws IOException {
12563:
12564: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
12565: if (null == yyColumn.chunk4)
12566: yyColumn.chunk4 = new Chunk4();
12567: if (null == yyColumn.chunk4.fCharacterLiteral$$Plus1)
12568: yyColumn.chunk4.fCharacterLiteral$$Plus1 = pCharacterLiteral$$Plus1$1(yyStart);
12569: return yyColumn.chunk4.fCharacterLiteral$$Plus1;
12570: }
12571:
12572: /** Actually parse xtc.lang.CFactory.CharacterLiteral$$Plus1. */
12573: private Result pCharacterLiteral$$Plus1$1(final int yyStart)
12574: throws IOException {
12575:
12576: int yyC;
12577: int yyIndex;
12578: Result yyResult;
12579: Void yyValue;
12580: ParseError yyError = ParseError.DUMMY;
12581:
12582: // Alternative 1.
12583:
12584: yyResult = pEscapeCharacter(yyStart);
12585: yyError = yyResult.select(yyError);
12586: if (yyResult.hasValue()) {
12587:
12588: yyResult = pCharacterLiteral$$Plus1(yyResult.index);
12589: yyError = yyResult.select(yyError);
12590: if (yyResult.hasValue()) {
12591:
12592: yyValue = null;
12593:
12594: return yyResult.createValue(yyValue, yyError);
12595: }
12596: }
12597:
12598: // Alternative 2.
12599:
12600: yyC = character(yyStart);
12601: if (-1 != yyC) {
12602: yyIndex = yyStart + 1;
12603:
12604: switch (yyC) {
12605: case '\n':
12606: case '\r':
12607: case '\'':
12608: case '\\':
12609: /* No match. */
12610: break;
12611:
12612: default: {
12613: yyResult = pCharacterLiteral$$Plus1(yyIndex);
12614: yyError = yyResult.select(yyError);
12615: if (yyResult.hasValue()) {
12616:
12617: yyValue = null;
12618:
12619: return yyResult.createValue(yyValue, yyError);
12620: }
12621: }
12622: }
12623: }
12624:
12625: // Alternative 3.
12626:
12627: yyC = character(yyStart);
12628: if (-1 != yyC) {
12629: yyIndex = yyStart + 1;
12630:
12631: switch (yyC) {
12632: case '\\': {
12633: final int yyChoice1 = yyIndex;
12634:
12635: // Nested alternative 1.
12636:
12637: yyResult = pEscapeCode(yyChoice1);
12638: yyError = yyResult.select(yyError);
12639: if (yyResult.hasValue()) {
12640:
12641: yyValue = null;
12642:
12643: return yyResult.createValue(yyValue, yyError);
12644: }
12645:
12646: // Nested alternative 2.
12647:
12648: yyC = character(yyChoice1);
12649: if (-1 != yyC) {
12650: yyIndex = yyChoice1 + 1;
12651:
12652: switch (yyC) {
12653: case 'u': {
12654: yyResult = pHexQuad(yyIndex);
12655: yyError = yyResult.select(yyError);
12656: if (yyResult.hasValue()) {
12657:
12658: yyValue = null;
12659:
12660: return yyResult.createValue(yyValue,
12661: yyError);
12662: }
12663: }
12664: break;
12665:
12666: case 'U': {
12667: yyResult = pHexQuad(yyIndex);
12668: yyError = yyResult.select(yyError);
12669: if (yyResult.hasValue()) {
12670:
12671: yyResult = pHexQuad(yyResult.index);
12672: yyError = yyResult.select(yyError);
12673: if (yyResult.hasValue()) {
12674:
12675: yyValue = null;
12676:
12677: return yyResult.createValue(yyValue,
12678: yyError);
12679: }
12680: }
12681: }
12682: break;
12683:
12684: default:
12685: /* No match. */
12686: }
12687: }
12688: }
12689: break;
12690:
12691: default:
12692: /* No match. */
12693: }
12694: }
12695:
12696: // Alternative 4.
12697:
12698: yyC = character(yyStart);
12699: if (-1 != yyC) {
12700: yyIndex = yyStart + 1;
12701:
12702: switch (yyC) {
12703: case '\n':
12704: case '\r':
12705: case '\'':
12706: case '\\':
12707: /* No match. */
12708: break;
12709:
12710: default: {
12711: yyValue = null;
12712:
12713: return new SemanticValue(yyValue, yyIndex, yyError);
12714: }
12715: }
12716: }
12717:
12718: // Done.
12719: yyError = yyError.select("character literal expected", yyStart);
12720: return yyError;
12721: }
12722:
12723: // =========================================================================
12724:
12725: /**
12726: * Parse nonterminal xtc.lang.CConstant.StringConstant.
12727: *
12728: * @param yyStart The index.
12729: * @return The result.
12730: * @throws IOException Signals an I/O error.
12731: */
12732: private Result pStringConstant(final int yyStart)
12733: throws IOException {
12734: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
12735: if (null == yyColumn.chunk4)
12736: yyColumn.chunk4 = new Chunk4();
12737: if (null == yyColumn.chunk4.fStringConstant)
12738: yyColumn.chunk4.fStringConstant = pStringConstant$1(yyStart);
12739: return yyColumn.chunk4.fStringConstant;
12740: }
12741:
12742: /** Actually parse xtc.lang.CConstant.StringConstant. */
12743: private Result pStringConstant$1(final int yyStart)
12744: throws IOException {
12745: Result yyResult;
12746: Node yyValue;
12747: ParseError yyError = ParseError.DUMMY;
12748:
12749: // Alternative 1.
12750:
12751: yyResult = pStringConstant$$Plus1(yyStart);
12752: yyError = yyResult.select(yyError);
12753: if (yyResult.hasValue()) {
12754: final Pair<String> v$g$1 = yyResult.semanticValue();
12755:
12756: yyValue = GNode.createFromPair("StringConstant", v$g$1);
12757: yyValue.setLocation(location(yyStart));
12758:
12759: return yyResult.createValue(yyValue, yyError);
12760: }
12761:
12762: // Done.
12763: return yyError;
12764: }
12765:
12766: // =========================================================================
12767:
12768: /**
12769: * Parse synthetic nonterminal xtc.lang.CFactory.StringConstant$$Choice1.
12770: *
12771: * @param yyStart The index.
12772: * @return The result.
12773: * @throws IOException Signals an I/O error.
12774: */
12775: private Result pStringConstant$$Choice1(final int yyStart)
12776: throws IOException {
12777:
12778: Result yyResult;
12779: String yyValue;
12780: ParseError yyError = ParseError.DUMMY;
12781:
12782: // Alternative 1.
12783:
12784: yyResult = pWideStringLiteral(yyStart);
12785: yyError = yyResult.select(yyError);
12786: if (yyResult.hasValue()) {
12787: yyValue = yyResult.semanticValue();
12788:
12789: yyResult = pSpacing(yyResult.index);
12790: yyError = yyResult.select(yyError);
12791: if (yyResult.hasValue()) {
12792:
12793: return yyResult.createValue(yyValue, yyError);
12794: }
12795: }
12796:
12797: // Alternative 2.
12798:
12799: yyResult = pStringLiteral(yyStart);
12800: yyError = yyResult.select(yyError);
12801: if (yyResult.hasValue()) {
12802: yyValue = yyResult.semanticValue();
12803:
12804: yyResult = pSpacing(yyResult.index);
12805: yyError = yyResult.select(yyError);
12806: if (yyResult.hasValue()) {
12807:
12808: return yyResult.createValue(yyValue, yyError);
12809: }
12810: }
12811:
12812: // Done.
12813: return yyError;
12814: }
12815:
12816: // =========================================================================
12817:
12818: /**
12819: * Parse synthetic nonterminal xtc.lang.CFactory.StringConstant$$Plus1.
12820: *
12821: * @param yyStart The index.
12822: * @return The result.
12823: * @throws IOException Signals an I/O error.
12824: */
12825: private Result pStringConstant$$Plus1(final int yyStart)
12826: throws IOException {
12827:
12828: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
12829: if (null == yyColumn.chunk4)
12830: yyColumn.chunk4 = new Chunk4();
12831: if (null == yyColumn.chunk4.fStringConstant$$Plus1)
12832: yyColumn.chunk4.fStringConstant$$Plus1 = pStringConstant$$Plus1$1(yyStart);
12833: return yyColumn.chunk4.fStringConstant$$Plus1;
12834: }
12835:
12836: /** Actually parse xtc.lang.CFactory.StringConstant$$Plus1. */
12837: private Result pStringConstant$$Plus1$1(final int yyStart)
12838: throws IOException {
12839:
12840: Result yyResult;
12841: Pair<String> yyValue;
12842: ParseError yyError = ParseError.DUMMY;
12843:
12844: // Alternative 1.
12845:
12846: yyResult = pStringConstant$$Choice1(yyStart);
12847: yyError = yyResult.select(yyError);
12848: if (yyResult.hasValue()) {
12849: final String v$el$1 = yyResult.semanticValue();
12850:
12851: final int yyChoice1 = yyResult.index;
12852:
12853: // Nested alternative 1.
12854:
12855: yyResult = pStringConstant$$Plus1(yyChoice1);
12856: yyError = yyResult.select(yyError);
12857: if (yyResult.hasValue()) {
12858: final Pair<String> v$4 = yyResult.semanticValue();
12859:
12860: yyValue = new Pair<String>(v$el$1, v$4);
12861:
12862: return yyResult.createValue(yyValue, yyError);
12863: }
12864:
12865: // Nested alternative 2.
12866:
12867: yyValue = new Pair<String>(v$el$1);
12868:
12869: return new SemanticValue(yyValue, yyChoice1, yyError);
12870: }
12871:
12872: // Done.
12873: return yyError;
12874: }
12875:
12876: // =========================================================================
12877:
12878: /**
12879: * Parse nonterminal xtc.lang.CConstant.WideStringLiteral.
12880: *
12881: * @param yyStart The index.
12882: * @return The result.
12883: * @throws IOException Signals an I/O error.
12884: */
12885: private Result pWideStringLiteral(final int yyStart)
12886: throws IOException {
12887: int yyC;
12888: int yyIndex;
12889: Result yyResult;
12890: String yyValue;
12891: ParseError yyError = ParseError.DUMMY;
12892:
12893: // Alternative 1.
12894:
12895: yyC = character(yyStart);
12896: if ('L' == yyC) {
12897: yyIndex = yyStart + 1;
12898:
12899: yyResult = pStringLiteral(yyIndex);
12900: yyError = yyResult.select(yyError);
12901: if (yyResult.hasValue()) {
12902:
12903: yyValue = difference(yyStart, yyResult.index);
12904:
12905: return yyResult.createValue(yyValue, yyError);
12906: }
12907: }
12908:
12909: // Done.
12910: yyError = yyError.select("wide string literal expected",
12911: yyStart);
12912: return yyError;
12913: }
12914:
12915: // =========================================================================
12916:
12917: /**
12918: * Parse nonterminal xtc.lang.CConstant.StringLiteral.
12919: *
12920: * @param yyStart The index.
12921: * @return The result.
12922: * @throws IOException Signals an I/O error.
12923: */
12924: private Result pStringLiteral(final int yyStart) throws IOException {
12925: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
12926: if (null == yyColumn.chunk4)
12927: yyColumn.chunk4 = new Chunk4();
12928: if (null == yyColumn.chunk4.fStringLiteral)
12929: yyColumn.chunk4.fStringLiteral = pStringLiteral$1(yyStart);
12930: return yyColumn.chunk4.fStringLiteral;
12931: }
12932:
12933: /** Actually parse xtc.lang.CConstant.StringLiteral. */
12934: private Result pStringLiteral$1(final int yyStart)
12935: throws IOException {
12936: int yyC;
12937: int yyIndex;
12938: Result yyResult;
12939: String yyValue;
12940: ParseError yyError = ParseError.DUMMY;
12941:
12942: // Alternative 1.
12943:
12944: yyC = character(yyStart);
12945: if ('\"' == yyC) {
12946: yyIndex = yyStart + 1;
12947:
12948: yyResult = pStringLiteral$$Star1(yyIndex);
12949: yyError = yyResult.select(yyError);
12950: if (yyResult.hasValue()) {
12951:
12952: yyC = character(yyResult.index);
12953: if ('\"' == yyC) {
12954: yyIndex = yyResult.index + 1;
12955:
12956: yyValue = difference(yyStart, yyIndex);
12957:
12958: return new SemanticValue(yyValue, yyIndex, yyError);
12959: }
12960: }
12961: }
12962:
12963: // Done.
12964: yyError = yyError.select("string literal expected", yyStart);
12965: return yyError;
12966: }
12967:
12968: // =========================================================================
12969:
12970: /**
12971: * Parse synthetic nonterminal xtc.lang.CFactory.StringLiteral$$Star1.
12972: *
12973: * @param yyStart The index.
12974: * @return The result.
12975: * @throws IOException Signals an I/O error.
12976: */
12977: private Result pStringLiteral$$Star1(final int yyStart)
12978: throws IOException {
12979: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
12980: if (null == yyColumn.chunk4)
12981: yyColumn.chunk4 = new Chunk4();
12982: if (null == yyColumn.chunk4.fStringLiteral$$Star1)
12983: yyColumn.chunk4.fStringLiteral$$Star1 = pStringLiteral$$Star1$1(yyStart);
12984: return yyColumn.chunk4.fStringLiteral$$Star1;
12985: }
12986:
12987: /** Actually parse xtc.lang.CFactory.StringLiteral$$Star1. */
12988: private Result pStringLiteral$$Star1$1(final int yyStart)
12989: throws IOException {
12990:
12991: int yyC;
12992: int yyIndex;
12993: Result yyResult;
12994: Void yyValue;
12995: ParseError yyError = ParseError.DUMMY;
12996:
12997: // Alternative 1.
12998:
12999: yyResult = pEscapeCharacter(yyStart);
13000: yyError = yyResult.select(yyError);
13001: if (yyResult.hasValue()) {
13002:
13003: yyResult = pStringLiteral$$Star1(yyResult.index);
13004: yyError = yyResult.select(yyError);
13005: if (yyResult.hasValue()) {
13006:
13007: yyValue = null;
13008:
13009: return yyResult.createValue(yyValue, yyError);
13010: }
13011: }
13012:
13013: // Alternative 2.
13014:
13015: yyC = character(yyStart);
13016: if (-1 != yyC) {
13017: yyIndex = yyStart + 1;
13018:
13019: switch (yyC) {
13020: case '\n':
13021: case '\r':
13022: case '\"':
13023: case '\\':
13024: /* No match. */
13025: break;
13026:
13027: default: {
13028: yyResult = pStringLiteral$$Star1(yyIndex);
13029: yyError = yyResult.select(yyError);
13030: if (yyResult.hasValue()) {
13031:
13032: yyValue = null;
13033:
13034: return yyResult.createValue(yyValue, yyError);
13035: }
13036: }
13037: }
13038: }
13039:
13040: // Alternative 3.
13041:
13042: yyValue = null;
13043:
13044: return new SemanticValue(yyValue, yyStart, yyError);
13045: }
13046:
13047: // =========================================================================
13048:
13049: /**
13050: * Parse nonterminal xtc.lang.CConstant.EscapeCharacter.
13051: *
13052: * @param yyStart The index.
13053: * @return The result.
13054: * @throws IOException Signals an I/O error.
13055: */
13056: private Result pEscapeCharacter(final int yyStart)
13057: throws IOException {
13058: int yyC;
13059: int yyIndex;
13060: Result yyResult;
13061: Void yyValue;
13062: ParseError yyError = ParseError.DUMMY;
13063:
13064: // Alternative 1.
13065:
13066: yyC = character(yyStart);
13067: if (-1 != yyC) {
13068: yyIndex = yyStart + 1;
13069: if ('\\' == yyC) {
13070:
13071: final int yyChoice1 = yyIndex;
13072:
13073: // Nested alternative 1.
13074:
13075: yyResult = pEscapeCode(yyChoice1);
13076: yyError = yyResult.select(yyError);
13077: if (yyResult.hasValue()) {
13078:
13079: yyValue = null;
13080:
13081: return yyResult.createValue(yyValue, yyError);
13082: }
13083:
13084: // Nested alternative 2.
13085:
13086: yyC = character(yyChoice1);
13087: if (-1 != yyC) {
13088: yyIndex = yyChoice1 + 1;
13089:
13090: switch (yyC) {
13091: case 'u': {
13092: yyResult = pHexQuad(yyIndex);
13093: yyError = yyResult.select(yyError);
13094: if (yyResult.hasValue()) {
13095:
13096: yyValue = null;
13097:
13098: return yyResult.createValue(yyValue,
13099: yyError);
13100: }
13101: }
13102: break;
13103:
13104: case 'U': {
13105: yyResult = pHexQuad(yyIndex);
13106: yyError = yyResult.select(yyError);
13107: if (yyResult.hasValue()) {
13108:
13109: yyResult = pHexQuad(yyResult.index);
13110: yyError = yyResult.select(yyError);
13111: if (yyResult.hasValue()) {
13112:
13113: yyValue = null;
13114:
13115: return yyResult.createValue(yyValue,
13116: yyError);
13117: }
13118: }
13119: }
13120: break;
13121:
13122: default:
13123: /* No match. */
13124: }
13125: }
13126: }
13127: }
13128:
13129: // Done.
13130: yyError = yyError.select("escape character expected", yyStart);
13131: return yyError;
13132: }
13133:
13134: // =========================================================================
13135:
13136: /**
13137: * Parse nonterminal xtc.lang.CConstant.EscapeCode.
13138: *
13139: * @param yyStart The index.
13140: * @return The result.
13141: * @throws IOException Signals an I/O error.
13142: */
13143: private Result pEscapeCode(final int yyStart) throws IOException {
13144: int yyC;
13145: int yyIndex;
13146: int yyRepetition1;
13147: boolean yyRepeated1;
13148: Void yyValue;
13149: ParseError yyError = ParseError.DUMMY;
13150:
13151: // Alternative 1.
13152:
13153: yyC = character(yyStart);
13154: if (-1 != yyC) {
13155: yyIndex = yyStart + 1;
13156:
13157: switch (yyC) {
13158: case '\"':
13159: case '\'':
13160: case '?':
13161: case '\\':
13162: case 'a':
13163: case 'b':
13164: case 'f':
13165: case 'n':
13166: case 'r':
13167: case 't':
13168: case 'v': {
13169: yyValue = null;
13170:
13171: return new SemanticValue(yyValue, yyIndex, yyError);
13172: }
13173:
13174: case '0':
13175: case '1':
13176: case '2':
13177: case '3':
13178: case '4':
13179: case '5':
13180: case '6':
13181: case '7': {
13182: final int yyChoice1 = yyIndex;
13183:
13184: // Nested alternative 1.
13185:
13186: yyC = character(yyChoice1);
13187: if (-1 != yyC) {
13188: yyIndex = yyChoice1 + 1;
13189:
13190: switch (yyC) {
13191: case '0':
13192: case '1':
13193: case '2':
13194: case '3':
13195: case '4':
13196: case '5':
13197: case '6':
13198: case '7': {
13199: final int yyChoice2 = yyIndex;
13200:
13201: // Nested alternative 1.
13202:
13203: yyC = character(yyChoice2);
13204: if (-1 != yyC) {
13205: yyIndex = yyChoice2 + 1;
13206:
13207: switch (yyC) {
13208: case '0':
13209: case '1':
13210: case '2':
13211: case '3':
13212: case '4':
13213: case '5':
13214: case '6':
13215: case '7': {
13216: yyValue = null;
13217:
13218: return new SemanticValue(yyValue,
13219: yyIndex, yyError);
13220: }
13221:
13222: default:
13223: /* No match. */
13224: }
13225: }
13226:
13227: // Nested alternative 2.
13228:
13229: yyValue = null;
13230:
13231: return new SemanticValue(yyValue, yyChoice2,
13232: yyError);
13233: }
13234:
13235: default:
13236: /* No match. */
13237: }
13238: }
13239:
13240: // Nested alternative 2.
13241:
13242: yyValue = null;
13243:
13244: return new SemanticValue(yyValue, yyChoice1, yyError);
13245: }
13246:
13247: case 'x': {
13248: yyRepetition1 = yyIndex;
13249: yyRepeated1 = false;
13250: while (true) {
13251:
13252: yyC = character(yyRepetition1);
13253: if (-1 != yyC) {
13254: yyIndex = yyRepetition1 + 1;
13255:
13256: switch (yyC) {
13257: case '0':
13258: case '1':
13259: case '2':
13260: case '3':
13261: case '4':
13262: case '5':
13263: case '6':
13264: case '7':
13265: case '8':
13266: case '9':
13267: case 'A':
13268: case 'B':
13269: case 'C':
13270: case 'D':
13271: case 'E':
13272: case 'F':
13273: case 'a':
13274: case 'b':
13275: case 'c':
13276: case 'd':
13277: case 'e':
13278: case 'f': {
13279: yyRepetition1 = yyIndex;
13280: yyRepeated1 = true;
13281: continue;
13282: }
13283:
13284: default:
13285: /* No match. */
13286: }
13287: }
13288: break;
13289: }
13290:
13291: if (yyRepeated1) {
13292:
13293: yyValue = null;
13294:
13295: return new SemanticValue(yyValue, yyRepetition1,
13296: yyError);
13297: }
13298: }
13299: break;
13300:
13301: default:
13302: /* No match. */
13303: }
13304: }
13305:
13306: // Done.
13307: yyError = yyError.select("escape code expected", yyStart);
13308: return yyError;
13309: }
13310:
13311: // =========================================================================
13312:
13313: /**
13314: * Parse nonterminal xtc.lang.CConstant.HexQuad.
13315: *
13316: * @param yyStart The index.
13317: * @return The result.
13318: * @throws IOException Signals an I/O error.
13319: */
13320: private Result pHexQuad(final int yyStart) throws IOException {
13321: int yyC;
13322: int yyIndex;
13323: Void yyValue;
13324: ParseError yyError = ParseError.DUMMY;
13325:
13326: // Alternative 1.
13327:
13328: yyC = character(yyStart);
13329: if (-1 != yyC) {
13330: yyIndex = yyStart + 1;
13331:
13332: switch (yyC) {
13333: case '0':
13334: case '1':
13335: case '2':
13336: case '3':
13337: case '4':
13338: case '5':
13339: case '6':
13340: case '7':
13341: case '8':
13342: case '9':
13343: case 'A':
13344: case 'B':
13345: case 'C':
13346: case 'D':
13347: case 'E':
13348: case 'F':
13349: case 'a':
13350: case 'b':
13351: case 'c':
13352: case 'd':
13353: case 'e':
13354: case 'f': {
13355: yyC = character(yyIndex);
13356: if (-1 != yyC) {
13357: yyIndex = yyIndex + 1;
13358:
13359: switch (yyC) {
13360: case '0':
13361: case '1':
13362: case '2':
13363: case '3':
13364: case '4':
13365: case '5':
13366: case '6':
13367: case '7':
13368: case '8':
13369: case '9':
13370: case 'A':
13371: case 'B':
13372: case 'C':
13373: case 'D':
13374: case 'E':
13375: case 'F':
13376: case 'a':
13377: case 'b':
13378: case 'c':
13379: case 'd':
13380: case 'e':
13381: case 'f': {
13382: yyC = character(yyIndex);
13383: if (-1 != yyC) {
13384: yyIndex = yyIndex + 1;
13385:
13386: switch (yyC) {
13387: case '0':
13388: case '1':
13389: case '2':
13390: case '3':
13391: case '4':
13392: case '5':
13393: case '6':
13394: case '7':
13395: case '8':
13396: case '9':
13397: case 'A':
13398: case 'B':
13399: case 'C':
13400: case 'D':
13401: case 'E':
13402: case 'F':
13403: case 'a':
13404: case 'b':
13405: case 'c':
13406: case 'd':
13407: case 'e':
13408: case 'f': {
13409: yyC = character(yyIndex);
13410: if (-1 != yyC) {
13411: yyIndex = yyIndex + 1;
13412:
13413: switch (yyC) {
13414: case '0':
13415: case '1':
13416: case '2':
13417: case '3':
13418: case '4':
13419: case '5':
13420: case '6':
13421: case '7':
13422: case '8':
13423: case '9':
13424: case 'A':
13425: case 'B':
13426: case 'C':
13427: case 'D':
13428: case 'E':
13429: case 'F':
13430: case 'a':
13431: case 'b':
13432: case 'c':
13433: case 'd':
13434: case 'e':
13435: case 'f': {
13436: yyValue = null;
13437:
13438: return new SemanticValue(
13439: yyValue, yyIndex,
13440: yyError);
13441: }
13442:
13443: default:
13444: /* No match. */
13445: }
13446: }
13447: }
13448: break;
13449:
13450: default:
13451: /* No match. */
13452: }
13453: }
13454: }
13455: break;
13456:
13457: default:
13458: /* No match. */
13459: }
13460: }
13461: }
13462: break;
13463:
13464: default:
13465: /* No match. */
13466: }
13467: }
13468:
13469: // Done.
13470: yyError = yyError.select("hex quad expected", yyStart);
13471: return yyError;
13472: }
13473:
13474: // =========================================================================
13475:
13476: /**
13477: * Parse nonterminal xtc.lang.CIdentifier.Identifier.
13478: *
13479: * @param yyStart The index.
13480: * @return The result.
13481: * @throws IOException Signals an I/O error.
13482: */
13483: private Result pCIdentifier$Identifier(final int yyStart)
13484: throws IOException {
13485:
13486: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
13487: if (null == yyColumn.chunk5)
13488: yyColumn.chunk5 = new Chunk5();
13489: if (null == yyColumn.chunk5.fCIdentifier$Identifier)
13490: yyColumn.chunk5.fCIdentifier$Identifier = pCIdentifier$Identifier$1(yyStart);
13491: return yyColumn.chunk5.fCIdentifier$Identifier;
13492: }
13493:
13494: /** Actually parse xtc.lang.CIdentifier.Identifier. */
13495: private Result pCIdentifier$Identifier$1(final int yyStart)
13496: throws IOException {
13497:
13498: Result yyResult;
13499: String yyValue;
13500: ParseError yyError = ParseError.DUMMY;
13501:
13502: // Alternative 1.
13503:
13504: yyResult = pCIdentifier$Word(yyStart);
13505: yyError = yyResult.select(yyError);
13506: if (yyResult.hasValue()) {
13507: yyValue = yyResult.semanticValue();
13508:
13509: if (!contains(C_KEYWORDS, toText(yyValue))) {
13510:
13511: return yyResult.createValue(yyValue, yyError);
13512: }
13513: }
13514:
13515: // Done.
13516: yyError = yyError.select("identifier expected", yyStart);
13517: return yyError;
13518: }
13519:
13520: // =========================================================================
13521:
13522: /**
13523: * Parse nonterminal xtc.lang.CIdentifier.Keyword.
13524: *
13525: * @param yyStart The index.
13526: * @return The result.
13527: * @throws IOException Signals an I/O error.
13528: */
13529: private Result pKeyword(final int yyStart) throws IOException {
13530: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
13531: if (null == yyColumn.chunk5)
13532: yyColumn.chunk5 = new Chunk5();
13533: if (null == yyColumn.chunk5.fKeyword)
13534: yyColumn.chunk5.fKeyword = pKeyword$1(yyStart);
13535: return yyColumn.chunk5.fKeyword;
13536: }
13537:
13538: /** Actually parse xtc.lang.CIdentifier.Keyword. */
13539: private Result pKeyword$1(final int yyStart) throws IOException {
13540: Result yyResult;
13541: String yyValue;
13542: ParseError yyError = ParseError.DUMMY;
13543:
13544: // Alternative 1.
13545:
13546: yyResult = pCIdentifier$Word(yyStart);
13547: yyError = yyResult.select(yyError);
13548: if (yyResult.hasValue()) {
13549: yyValue = yyResult.semanticValue();
13550:
13551: if (contains(C_KEYWORDS, toText(yyValue))) {
13552:
13553: return yyResult.createValue(yyValue, yyError);
13554: }
13555: }
13556:
13557: // Done.
13558: yyError = yyError.select("keyword expected", yyStart);
13559: return yyError;
13560: }
13561:
13562: // =========================================================================
13563:
13564: /**
13565: * Parse nonterminal xtc.lang.CIdentifier.Word.
13566: *
13567: * @param yyStart The index.
13568: * @return The result.
13569: * @throws IOException Signals an I/O error.
13570: */
13571: private Result pCIdentifier$Word(final int yyStart)
13572: throws IOException {
13573: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
13574: if (null == yyColumn.chunk5)
13575: yyColumn.chunk5 = new Chunk5();
13576: if (null == yyColumn.chunk5.fCIdentifier$Word)
13577: yyColumn.chunk5.fCIdentifier$Word = pCIdentifier$Word$1(yyStart);
13578: return yyColumn.chunk5.fCIdentifier$Word;
13579: }
13580:
13581: /** Actually parse xtc.lang.CIdentifier.Word. */
13582: private Result pCIdentifier$Word$1(final int yyStart)
13583: throws IOException {
13584: Result yyResult;
13585: String yyValue;
13586: ParseError yyError = ParseError.DUMMY;
13587:
13588: // Alternative 1.
13589:
13590: yyResult = pCIdentifier$WordCharacters(yyStart);
13591: yyError = yyResult.select(yyError);
13592: if (yyResult.hasValue()) {
13593: yyValue = yyResult.semanticValue();
13594:
13595: yyResult = pSpacing(yyResult.index);
13596: yyError = yyResult.select(yyError);
13597: if (yyResult.hasValue()) {
13598:
13599: return yyResult.createValue(yyValue, yyError);
13600: }
13601: }
13602:
13603: // Done.
13604: return yyError;
13605: }
13606:
13607: // =========================================================================
13608:
13609: /**
13610: * Parse nonterminal xtc.lang.CIdentifier.WordCharacters.
13611: *
13612: * @param yyStart The index.
13613: * @return The result.
13614: * @throws IOException Signals an I/O error.
13615: */
13616: private Result pCIdentifier$WordCharacters(final int yyStart)
13617: throws IOException {
13618:
13619: int yyC;
13620: int yyIndex;
13621: int yyRepetition1;
13622: String yyValue;
13623: ParseError yyError = ParseError.DUMMY;
13624:
13625: // Alternative 1.
13626:
13627: yyC = character(yyStart);
13628: if (-1 != yyC) {
13629: yyIndex = yyStart + 1;
13630: if ((('A' <= yyC) && (yyC <= 'Z')) || ('_' == yyC)
13631: || (('a' <= yyC) && (yyC <= 'z'))) {
13632:
13633: yyRepetition1 = yyIndex;
13634: while (true) {
13635:
13636: yyC = character(yyRepetition1);
13637: if (-1 != yyC) {
13638: yyIndex = yyRepetition1 + 1;
13639: if ((('0' <= yyC) && (yyC <= '9'))
13640: || (('A' <= yyC) && (yyC <= 'Z'))
13641: || ('_' == yyC)
13642: || (('a' <= yyC) && (yyC <= 'z'))) {
13643:
13644: yyRepetition1 = yyIndex;
13645: continue;
13646: }
13647: }
13648: break;
13649: }
13650:
13651: yyValue = difference(yyStart, yyRepetition1);
13652:
13653: return new SemanticValue(yyValue, yyRepetition1,
13654: yyError);
13655: }
13656: }
13657:
13658: // Done.
13659: yyError = yyError.select("word characters expected", yyStart);
13660: return yyError;
13661: }
13662:
13663: // =========================================================================
13664:
13665: /**
13666: * Parse nonterminal xtc.lang.CSymbol.Symbol.
13667: *
13668: * @param yyStart The index.
13669: * @return The result.
13670: * @throws IOException Signals an I/O error.
13671: */
13672: private Result pSymbol(final int yyStart) throws IOException {
13673: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
13674: if (null == yyColumn.chunk5)
13675: yyColumn.chunk5 = new Chunk5();
13676: if (null == yyColumn.chunk5.fSymbol)
13677: yyColumn.chunk5.fSymbol = pSymbol$1(yyStart);
13678: return yyColumn.chunk5.fSymbol;
13679: }
13680:
13681: /** Actually parse xtc.lang.CSymbol.Symbol. */
13682: private Result pSymbol$1(final int yyStart) throws IOException {
13683: Result yyResult;
13684: String yyValue;
13685: ParseError yyError = ParseError.DUMMY;
13686:
13687: // Alternative 1.
13688:
13689: yyResult = pSymbolCharacters(yyStart);
13690: yyError = yyResult.select(yyError);
13691: if (yyResult.hasValue()) {
13692: yyValue = yyResult.semanticValue();
13693:
13694: yyResult = pSpacing(yyResult.index);
13695: yyError = yyResult.select(yyError);
13696: if (yyResult.hasValue()) {
13697:
13698: return yyResult.createValue(yyValue, yyError);
13699: }
13700: }
13701:
13702: // Done.
13703: return yyError;
13704: }
13705:
13706: // =========================================================================
13707:
13708: /**
13709: * Parse nonterminal xtc.lang.CSymbol.SymbolCharacters.
13710: *
13711: * @param yyStart The index.
13712: * @return The result.
13713: * @throws IOException Signals an I/O error.
13714: */
13715: private Result pSymbolCharacters(final int yyStart)
13716: throws IOException {
13717: int yyC;
13718: int yyIndex;
13719: String yyValue;
13720: ParseError yyError = ParseError.DUMMY;
13721:
13722: // Alternative 1.
13723:
13724: yyC = character(yyStart);
13725: if (-1 != yyC) {
13726: yyIndex = yyStart + 1;
13727:
13728: switch (yyC) {
13729: case '>': {
13730: final int yyChoice1 = yyIndex;
13731:
13732: // Nested alternative 1.
13733:
13734: yyC = character(yyChoice1);
13735: if (-1 != yyC) {
13736: yyIndex = yyChoice1 + 1;
13737:
13738: switch (yyC) {
13739: case '>': {
13740: final int yyChoice2 = yyIndex;
13741:
13742: // Nested alternative 1.
13743:
13744: yyC = character(yyChoice2);
13745: if (-1 != yyC) {
13746: yyIndex = yyChoice2 + 1;
13747: if ('=' == yyC) {
13748:
13749: yyValue = ">>=";
13750:
13751: return new SemanticValue(yyValue,
13752: yyIndex, yyError);
13753: }
13754: }
13755:
13756: // Nested alternative 2.
13757:
13758: yyValue = ">>";
13759:
13760: return new SemanticValue(yyValue, yyChoice2,
13761: yyError);
13762: }
13763:
13764: case '=': {
13765: yyValue = ">=";
13766:
13767: return new SemanticValue(yyValue, yyIndex,
13768: yyError);
13769: }
13770:
13771: default:
13772: /* No match. */
13773: }
13774: }
13775:
13776: // Nested alternative 2.
13777:
13778: yyValue = ">";
13779:
13780: return new SemanticValue(yyValue, yyChoice1, yyError);
13781: }
13782:
13783: case '<': {
13784: final int yyChoice1 = yyIndex;
13785:
13786: // Nested alternative 1.
13787:
13788: yyC = character(yyChoice1);
13789: if (-1 != yyC) {
13790: yyIndex = yyChoice1 + 1;
13791:
13792: switch (yyC) {
13793: case '<': {
13794: final int yyChoice2 = yyIndex;
13795:
13796: // Nested alternative 1.
13797:
13798: yyC = character(yyChoice2);
13799: if (-1 != yyC) {
13800: yyIndex = yyChoice2 + 1;
13801: if ('=' == yyC) {
13802:
13803: yyValue = "<<=";
13804:
13805: return new SemanticValue(yyValue,
13806: yyIndex, yyError);
13807: }
13808: }
13809:
13810: // Nested alternative 2.
13811:
13812: yyValue = "<<";
13813:
13814: return new SemanticValue(yyValue, yyChoice2,
13815: yyError);
13816: }
13817:
13818: case '=': {
13819: yyValue = "<=";
13820:
13821: return new SemanticValue(yyValue, yyIndex,
13822: yyError);
13823: }
13824:
13825: default:
13826: /* No match. */
13827: }
13828: }
13829:
13830: // Nested alternative 2.
13831:
13832: yyValue = "<";
13833:
13834: return new SemanticValue(yyValue, yyChoice1, yyError);
13835: }
13836:
13837: case '.': {
13838: final int yyChoice1 = yyIndex;
13839:
13840: // Nested alternative 1.
13841:
13842: yyC = character(yyChoice1);
13843: if (-1 != yyC) {
13844: yyIndex = yyChoice1 + 1;
13845: if ('.' == yyC) {
13846:
13847: yyC = character(yyIndex);
13848: if (-1 != yyC) {
13849: yyIndex = yyIndex + 1;
13850: if ('.' == yyC) {
13851:
13852: yyValue = "...";
13853:
13854: return new SemanticValue(yyValue,
13855: yyIndex, yyError);
13856: }
13857: }
13858: }
13859: }
13860:
13861: // Nested alternative 2.
13862:
13863: yyValue = ".";
13864:
13865: return new SemanticValue(yyValue, yyChoice1, yyError);
13866: }
13867:
13868: case '+': {
13869: final int yyChoice1 = yyIndex;
13870:
13871: // Nested alternative 1.
13872:
13873: yyC = character(yyChoice1);
13874: if (-1 != yyC) {
13875: yyIndex = yyChoice1 + 1;
13876:
13877: switch (yyC) {
13878: case '=': {
13879: yyValue = "+=";
13880:
13881: return new SemanticValue(yyValue, yyIndex,
13882: yyError);
13883: }
13884:
13885: case '+': {
13886: yyValue = "++";
13887:
13888: return new SemanticValue(yyValue, yyIndex,
13889: yyError);
13890: }
13891:
13892: default:
13893: /* No match. */
13894: }
13895: }
13896:
13897: // Nested alternative 2.
13898:
13899: yyValue = "+";
13900:
13901: return new SemanticValue(yyValue, yyChoice1, yyError);
13902: }
13903:
13904: case '-': {
13905: final int yyChoice1 = yyIndex;
13906:
13907: // Nested alternative 1.
13908:
13909: yyC = character(yyChoice1);
13910: if (-1 != yyC) {
13911: yyIndex = yyChoice1 + 1;
13912:
13913: switch (yyC) {
13914: case '=': {
13915: yyValue = "-=";
13916:
13917: return new SemanticValue(yyValue, yyIndex,
13918: yyError);
13919: }
13920:
13921: case '-': {
13922: yyValue = "--";
13923:
13924: return new SemanticValue(yyValue, yyIndex,
13925: yyError);
13926: }
13927:
13928: case '>': {
13929: yyValue = "->";
13930:
13931: return new SemanticValue(yyValue, yyIndex,
13932: yyError);
13933: }
13934:
13935: default:
13936: /* No match. */
13937: }
13938: }
13939:
13940: // Nested alternative 2.
13941:
13942: yyValue = "-";
13943:
13944: return new SemanticValue(yyValue, yyChoice1, yyError);
13945: }
13946:
13947: case '*': {
13948: final int yyChoice1 = yyIndex;
13949:
13950: // Nested alternative 1.
13951:
13952: yyC = character(yyChoice1);
13953: if (-1 != yyC) {
13954: yyIndex = yyChoice1 + 1;
13955: if ('=' == yyC) {
13956:
13957: yyValue = "*=";
13958:
13959: return new SemanticValue(yyValue, yyIndex,
13960: yyError);
13961: }
13962: }
13963:
13964: // Nested alternative 2.
13965:
13966: yyValue = "*";
13967:
13968: return new SemanticValue(yyValue, yyChoice1, yyError);
13969: }
13970:
13971: case '/': {
13972: final int yyChoice1 = yyIndex;
13973:
13974: // Nested alternative 1.
13975:
13976: yyC = character(yyChoice1);
13977: if (-1 != yyC) {
13978: yyIndex = yyChoice1 + 1;
13979: if ('=' == yyC) {
13980:
13981: yyValue = "/=";
13982:
13983: return new SemanticValue(yyValue, yyIndex,
13984: yyError);
13985: }
13986: }
13987:
13988: // Nested alternative 2.
13989:
13990: yyValue = "/";
13991:
13992: return new SemanticValue(yyValue, yyChoice1, yyError);
13993: }
13994:
13995: case '%': {
13996: final int yyChoice1 = yyIndex;
13997:
13998: // Nested alternative 1.
13999:
14000: yyC = character(yyChoice1);
14001: if (-1 != yyC) {
14002: yyIndex = yyChoice1 + 1;
14003: if ('=' == yyC) {
14004:
14005: yyValue = "%=";
14006:
14007: return new SemanticValue(yyValue, yyIndex,
14008: yyError);
14009: }
14010: }
14011:
14012: // Nested alternative 2.
14013:
14014: yyValue = "%";
14015:
14016: return new SemanticValue(yyValue, yyChoice1, yyError);
14017: }
14018:
14019: case '&': {
14020: final int yyChoice1 = yyIndex;
14021:
14022: // Nested alternative 1.
14023:
14024: yyC = character(yyChoice1);
14025: if (-1 != yyC) {
14026: yyIndex = yyChoice1 + 1;
14027:
14028: switch (yyC) {
14029: case '=': {
14030: yyValue = "&=";
14031:
14032: return new SemanticValue(yyValue, yyIndex,
14033: yyError);
14034: }
14035:
14036: case '&': {
14037: yyValue = "&&";
14038:
14039: return new SemanticValue(yyValue, yyIndex,
14040: yyError);
14041: }
14042:
14043: default:
14044: /* No match. */
14045: }
14046: }
14047:
14048: // Nested alternative 2.
14049:
14050: yyValue = "&";
14051:
14052: return new SemanticValue(yyValue, yyChoice1, yyError);
14053: }
14054:
14055: case '^': {
14056: final int yyChoice1 = yyIndex;
14057:
14058: // Nested alternative 1.
14059:
14060: yyC = character(yyChoice1);
14061: if (-1 != yyC) {
14062: yyIndex = yyChoice1 + 1;
14063: if ('=' == yyC) {
14064:
14065: yyValue = "^=";
14066:
14067: return new SemanticValue(yyValue, yyIndex,
14068: yyError);
14069: }
14070: }
14071:
14072: // Nested alternative 2.
14073:
14074: yyValue = "^";
14075:
14076: return new SemanticValue(yyValue, yyChoice1, yyError);
14077: }
14078:
14079: case '|': {
14080: final int yyChoice1 = yyIndex;
14081:
14082: // Nested alternative 1.
14083:
14084: yyC = character(yyChoice1);
14085: if (-1 != yyC) {
14086: yyIndex = yyChoice1 + 1;
14087:
14088: switch (yyC) {
14089: case '=': {
14090: yyValue = "|=";
14091:
14092: return new SemanticValue(yyValue, yyIndex,
14093: yyError);
14094: }
14095:
14096: case '|': {
14097: yyValue = "||";
14098:
14099: return new SemanticValue(yyValue, yyIndex,
14100: yyError);
14101: }
14102:
14103: default:
14104: /* No match. */
14105: }
14106: }
14107:
14108: // Nested alternative 2.
14109:
14110: yyValue = "|";
14111:
14112: return new SemanticValue(yyValue, yyChoice1, yyError);
14113: }
14114:
14115: case '=': {
14116: final int yyChoice1 = yyIndex;
14117:
14118: // Nested alternative 1.
14119:
14120: yyC = character(yyChoice1);
14121: if (-1 != yyC) {
14122: yyIndex = yyChoice1 + 1;
14123: if ('=' == yyC) {
14124:
14125: yyValue = "==";
14126:
14127: return new SemanticValue(yyValue, yyIndex,
14128: yyError);
14129: }
14130: }
14131:
14132: // Nested alternative 2.
14133:
14134: yyValue = "=";
14135:
14136: return new SemanticValue(yyValue, yyChoice1, yyError);
14137: }
14138:
14139: case '!': {
14140: final int yyChoice1 = yyIndex;
14141:
14142: // Nested alternative 1.
14143:
14144: yyC = character(yyChoice1);
14145: if (-1 != yyC) {
14146: yyIndex = yyChoice1 + 1;
14147: if ('=' == yyC) {
14148:
14149: yyValue = "!=";
14150:
14151: return new SemanticValue(yyValue, yyIndex,
14152: yyError);
14153: }
14154: }
14155:
14156: // Nested alternative 2.
14157:
14158: yyValue = "!";
14159:
14160: return new SemanticValue(yyValue, yyChoice1, yyError);
14161: }
14162:
14163: case ';': {
14164: yyValue = ";";
14165:
14166: return new SemanticValue(yyValue, yyIndex, yyError);
14167: }
14168:
14169: case ':': {
14170: yyValue = ":";
14171:
14172: return new SemanticValue(yyValue, yyIndex, yyError);
14173: }
14174:
14175: case ',': {
14176: yyValue = ",";
14177:
14178: return new SemanticValue(yyValue, yyIndex, yyError);
14179: }
14180:
14181: case '{': {
14182: yyValue = "{";
14183:
14184: return new SemanticValue(yyValue, yyIndex, yyError);
14185: }
14186:
14187: case '}': {
14188: yyValue = "}";
14189:
14190: return new SemanticValue(yyValue, yyIndex, yyError);
14191: }
14192:
14193: case '(': {
14194: yyValue = "(";
14195:
14196: return new SemanticValue(yyValue, yyIndex, yyError);
14197: }
14198:
14199: case ')': {
14200: yyValue = ")";
14201:
14202: return new SemanticValue(yyValue, yyIndex, yyError);
14203: }
14204:
14205: case '[': {
14206: yyValue = "[";
14207:
14208: return new SemanticValue(yyValue, yyIndex, yyError);
14209: }
14210:
14211: case ']': {
14212: yyValue = "]";
14213:
14214: return new SemanticValue(yyValue, yyIndex, yyError);
14215: }
14216:
14217: case '~': {
14218: yyValue = "~";
14219:
14220: return new SemanticValue(yyValue, yyIndex, yyError);
14221: }
14222:
14223: case '?': {
14224: yyValue = "?";
14225:
14226: return new SemanticValue(yyValue, yyIndex, yyError);
14227: }
14228:
14229: default:
14230: /* No match. */
14231: }
14232: }
14233:
14234: // Done.
14235: yyError = yyError.select("symbol characters expected", yyStart);
14236: return yyError;
14237: }
14238:
14239: // =========================================================================
14240:
14241: /**
14242: * Parse nonterminal xtc.lang.CSpacing.Spacing.
14243: *
14244: * @param yyStart The index.
14245: * @return The result.
14246: * @throws IOException Signals an I/O error.
14247: */
14248: private Result pSpacing(final int yyStart) throws IOException {
14249: int yyC;
14250: int yyIndex;
14251: Result yyResult;
14252: Result yyPredResult;
14253: boolean yyPredMatched;
14254: int yyBase;
14255: int yyRepetition1;
14256: int yyRepetition2;
14257: Void yyValue;
14258: ParseError yyError = ParseError.DUMMY;
14259:
14260: // Alternative 1.
14261:
14262: yyRepetition1 = yyStart;
14263: while (true) {
14264:
14265: final int yyChoice1 = yyRepetition1;
14266:
14267: // Nested alternative 1.
14268:
14269: yyC = character(yyChoice1);
14270: if (-1 != yyC) {
14271: yyIndex = yyChoice1 + 1;
14272:
14273: switch (yyC) {
14274: case ' ': {
14275: yyRepetition1 = yyIndex;
14276: continue;
14277: }
14278:
14279: case '\t': {
14280: yyRepetition1 = yyIndex;
14281: continue;
14282: }
14283:
14284: case '\f': {
14285: yyRepetition1 = yyIndex;
14286: continue;
14287: }
14288:
14289: case '/': {
14290: yyC = character(yyIndex);
14291: if (-1 != yyC) {
14292: yyIndex = yyIndex + 1;
14293:
14294: switch (yyC) {
14295: case '*': {
14296: yyRepetition2 = yyIndex;
14297: while (true) {
14298:
14299: final int yyChoice2 = yyRepetition2;
14300:
14301: // Nested alternative 1.
14302:
14303: yyC = character(yyChoice2);
14304: if (-1 != yyC) {
14305: yyIndex = yyChoice2 + 1;
14306:
14307: switch (yyC) {
14308: case '*': {
14309: yyPredMatched = false;
14310:
14311: yyC = character(yyIndex);
14312: if ('/' == yyC) {
14313:
14314: yyPredMatched = true;
14315: }
14316:
14317: if (!yyPredMatched) {
14318:
14319: yyRepetition2 = yyIndex;
14320: continue;
14321: } else {
14322: yyError = yyError.select(
14323: "spacing expected",
14324: yyStart);
14325: }
14326: }
14327: break;
14328:
14329: default: {
14330: yyRepetition2 = yyIndex;
14331: continue;
14332: }
14333: }
14334: }
14335: break;
14336: }
14337:
14338: yyBase = yyRepetition2;
14339: yyC = character(yyBase);
14340: if ('*' == yyC) {
14341: yyIndex = yyRepetition2 + 1;
14342:
14343: yyC = character(yyIndex);
14344: if ('/' == yyC) {
14345: yyIndex = yyIndex + 1;
14346:
14347: yyRepetition1 = yyIndex;
14348: continue;
14349: } else {
14350: yyError = yyError.select(
14351: "\"*/\" expected", yyBase);
14352: }
14353: } else {
14354: yyError = yyError.select(
14355: "\"*/\" expected", yyBase);
14356: }
14357: }
14358: break;
14359:
14360: case '/': {
14361: yyRepetition2 = yyIndex;
14362: while (true) {
14363:
14364: yyC = character(yyRepetition2);
14365: if (-1 != yyC) {
14366: yyIndex = yyRepetition2 + 1;
14367:
14368: switch (yyC) {
14369: case '\n':
14370: case '\r':
14371: /* No match. */
14372: break;
14373:
14374: default: {
14375: yyRepetition2 = yyIndex;
14376: continue;
14377: }
14378: }
14379: }
14380: break;
14381: }
14382:
14383: yyPredResult = pLineTerminator(yyRepetition2);
14384: yyError = yyPredResult.select(yyError);
14385: if (yyPredResult.hasValue()) {
14386:
14387: yyRepetition1 = yyRepetition2;
14388: continue;
14389: }
14390: }
14391: break;
14392:
14393: default:
14394: /* No match. */
14395: }
14396: }
14397: }
14398: break;
14399:
14400: case '\r': {
14401: final int yyChoice2 = yyIndex;
14402:
14403: // Nested alternative 1.
14404:
14405: yyC = character(yyChoice2);
14406: if ('\n' == yyC) {
14407: yyIndex = yyChoice2 + 1;
14408:
14409: yyResult = pDirective(yyIndex);
14410: yyError = yyResult.select(yyError);
14411: if (yyResult.hasValue()) {
14412:
14413: yyRepetition1 = yyResult.index;
14414: continue;
14415: }
14416: }
14417:
14418: // Nested alternative 2.
14419:
14420: yyResult = pDirective(yyChoice2);
14421: yyError = yyResult.select(yyError);
14422: if (yyResult.hasValue()) {
14423:
14424: yyRepetition1 = yyResult.index;
14425: continue;
14426: }
14427: }
14428: break;
14429:
14430: case '\n': {
14431: yyResult = pDirective(yyIndex);
14432: yyError = yyResult.select(yyError);
14433: if (yyResult.hasValue()) {
14434:
14435: yyRepetition1 = yyResult.index;
14436: continue;
14437: }
14438: }
14439: break;
14440:
14441: default:
14442: /* No match. */
14443: }
14444: }
14445: break;
14446: }
14447:
14448: yyValue = null;
14449:
14450: return new SemanticValue(yyValue, yyRepetition1, yyError);
14451: }
14452:
14453: // =========================================================================
14454:
14455: /**
14456: * Parse nonterminal xtc.lang.CSpacing.Space.
14457: *
14458: * @param yyStart The index.
14459: * @return The result.
14460: * @throws IOException Signals an I/O error.
14461: */
14462: private Result pSpace(final int yyStart) throws IOException {
14463: int yyC;
14464: int yyIndex;
14465: Void yyValue;
14466: ParseError yyError = ParseError.DUMMY;
14467:
14468: // Alternative 1.
14469:
14470: yyC = character(yyStart);
14471: if (-1 != yyC) {
14472: yyIndex = yyStart + 1;
14473:
14474: switch (yyC) {
14475: case ' ': {
14476: yyValue = null;
14477:
14478: return new SemanticValue(yyValue, yyIndex, yyError);
14479: }
14480:
14481: case '\t': {
14482: yyValue = null;
14483:
14484: return new SemanticValue(yyValue, yyIndex, yyError);
14485: }
14486:
14487: case '\f': {
14488: yyValue = null;
14489:
14490: return new SemanticValue(yyValue, yyIndex, yyError);
14491: }
14492:
14493: default:
14494: /* No match. */
14495: }
14496: }
14497:
14498: // Done.
14499: yyError = yyError.select("space expected", yyStart);
14500: return yyError;
14501: }
14502:
14503: // =========================================================================
14504:
14505: /**
14506: * Parse nonterminal xtc.lang.CSpacing.LineTerminator.
14507: *
14508: * @param yyStart The index.
14509: * @return The result.
14510: * @throws IOException Signals an I/O error.
14511: */
14512: private Result pLineTerminator(final int yyStart)
14513: throws IOException {
14514: int yyC;
14515: int yyIndex;
14516: Void yyValue;
14517: ParseError yyError = ParseError.DUMMY;
14518:
14519: // Alternative 1.
14520:
14521: yyC = character(yyStart);
14522: if (-1 != yyC) {
14523: yyIndex = yyStart + 1;
14524:
14525: switch (yyC) {
14526: case '\r': {
14527: final int yyChoice1 = yyIndex;
14528:
14529: // Nested alternative 1.
14530:
14531: yyC = character(yyChoice1);
14532: if ('\n' == yyC) {
14533: yyIndex = yyChoice1 + 1;
14534:
14535: yyValue = null;
14536:
14537: return new SemanticValue(yyValue, yyIndex, yyError);
14538: }
14539:
14540: // Nested alternative 2.
14541:
14542: yyValue = null;
14543:
14544: return new SemanticValue(yyValue, yyChoice1, yyError);
14545: }
14546:
14547: case '\n': {
14548: yyValue = null;
14549:
14550: return new SemanticValue(yyValue, yyIndex, yyError);
14551: }
14552:
14553: default:
14554: /* No match. */
14555: }
14556: }
14557:
14558: // Done.
14559: yyError = yyError.select("line terminator expected", yyStart);
14560: return yyError;
14561: }
14562:
14563: // =========================================================================
14564:
14565: /**
14566: * Parse nonterminal xtc.lang.CSpacing.EndOfFile.
14567: *
14568: * @param yyStart The index.
14569: * @return The result.
14570: * @throws IOException Signals an I/O error.
14571: */
14572: private Result pEndOfFile(final int yyStart) throws IOException {
14573: int yyC;
14574: boolean yyPredMatched;
14575: Void yyValue;
14576: ParseError yyError = ParseError.DUMMY;
14577:
14578: // Alternative 1.
14579:
14580: yyPredMatched = false;
14581:
14582: yyC = character(yyStart);
14583: if (-1 != yyC) {
14584:
14585: yyPredMatched = true;
14586: }
14587:
14588: if (!yyPredMatched) {
14589:
14590: yyValue = null;
14591:
14592: return new SemanticValue(yyValue, yyStart, yyError);
14593: } else {
14594: yyError = yyError.select("end of file expected", yyStart);
14595: }
14596:
14597: // Done.
14598: return yyError;
14599: }
14600:
14601: // =========================================================================
14602:
14603: /**
14604: * Parse nonterminal xtc.lang.CSpacing.Directive.
14605: *
14606: * @param yyStart The index.
14607: * @return The result.
14608: * @throws IOException Signals an I/O error.
14609: */
14610: private Result pDirective(final int yyStart) throws IOException {
14611: int yyC;
14612: int yyIndex;
14613: Result yyResult;
14614: Result yyPredResult;
14615: int yyBase;
14616: int yyRepetition1;
14617: boolean yyRepeated1;
14618: int yyOption1;
14619: String yyOpValue1;
14620: Void yyValue;
14621: ParseError yyError = ParseError.DUMMY;
14622:
14623: // Alternative 1.
14624:
14625: yyC = character(yyStart);
14626: if ('#' == yyC) {
14627: yyIndex = yyStart + 1;
14628:
14629: final int yyChoice1 = yyIndex;
14630:
14631: // Nested alternative 1.
14632:
14633: yyC = character(yyChoice1);
14634: if (' ' == yyC) {
14635: yyIndex = yyChoice1 + 1;
14636:
14637: yyResult = pLineNumber(yyIndex);
14638: yyError = yyResult.select(yyError);
14639: if (yyResult.hasValue()) {
14640: final String line = yyResult.semanticValue();
14641:
14642: yyC = character(yyResult.index);
14643: if (' ' == yyC) {
14644: yyIndex = yyResult.index + 1;
14645:
14646: yyC = character(yyIndex);
14647: if ('\"' == yyC) {
14648: yyIndex = yyIndex + 1;
14649:
14650: yyResult = pFileName(yyIndex);
14651: yyError = yyResult.select(yyError);
14652: if (yyResult.hasValue()) {
14653: final String file = yyResult
14654: .semanticValue();
14655:
14656: yyC = character(yyResult.index);
14657: if ('\"' == yyC) {
14658: yyIndex = yyResult.index + 1;
14659:
14660: yyOption1 = yyIndex;
14661: yyOpValue1 = null;
14662:
14663: yyBase = yyOption1;
14664: yyC = character(yyBase);
14665: if (' ' == yyC) {
14666: yyIndex = yyOption1 + 1;
14667:
14668: yyC = character(yyIndex);
14669: if ('1' == yyC) {
14670: yyIndex = yyIndex + 1;
14671: final String v$el$1 = " 1";
14672:
14673: yyOption1 = yyIndex;
14674: yyOpValue1 = v$el$1;
14675: } else {
14676: yyError = yyError.select(
14677: "\" 1\" expected",
14678: yyBase);
14679: }
14680: } else {
14681: yyError = yyError.select(
14682: "\" 1\" expected",
14683: yyBase);
14684: }
14685: { // Start scope for f1.
14686: final String f1 = yyOpValue1;
14687:
14688: yyOpValue1 = null;
14689:
14690: yyBase = yyOption1;
14691: yyC = character(yyBase);
14692: if (' ' == yyC) {
14693: yyIndex = yyOption1 + 1;
14694:
14695: yyC = character(yyIndex);
14696: if ('2' == yyC) {
14697: yyIndex = yyIndex + 1;
14698: final String v$el$2 = " 2";
14699:
14700: yyOption1 = yyIndex;
14701: yyOpValue1 = v$el$2;
14702: } else {
14703: yyError = yyError
14704: .select(
14705: "\" 2\" expected",
14706: yyBase);
14707: }
14708: } else {
14709: yyError = yyError.select(
14710: "\" 2\" expected",
14711: yyBase);
14712: }
14713: { // Start scope for f2.
14714: final String f2 = yyOpValue1;
14715:
14716: yyOpValue1 = null;
14717:
14718: yyBase = yyOption1;
14719: yyC = character(yyBase);
14720: if (' ' == yyC) {
14721: yyIndex = yyOption1 + 1;
14722:
14723: yyC = character(yyIndex);
14724: if ('3' == yyC) {
14725: yyIndex = yyIndex + 1;
14726: final String v$el$3 = " 3";
14727:
14728: yyOption1 = yyIndex;
14729: yyOpValue1 = v$el$3;
14730: } else {
14731: yyError = yyError
14732: .select(
14733: "\" 3\" expected",
14734: yyBase);
14735: }
14736: } else {
14737: yyError = yyError
14738: .select(
14739: "\" 3\" expected",
14740: yyBase);
14741: }
14742: { // Start scope for f3.
14743: final String f3 = yyOpValue1;
14744:
14745: yyOpValue1 = null;
14746:
14747: yyBase = yyOption1;
14748: yyC = character(yyBase);
14749: if (' ' == yyC) {
14750: yyIndex = yyOption1 + 1;
14751:
14752: yyC = character(yyIndex);
14753: if ('4' == yyC) {
14754: yyIndex = yyIndex + 1;
14755: final String v$el$4 = " 4";
14756:
14757: yyOption1 = yyIndex;
14758: yyOpValue1 = v$el$4;
14759: } else {
14760: yyError = yyError
14761: .select(
14762: "\" 4\" expected",
14763: yyBase);
14764: }
14765: } else {
14766: yyError = yyError
14767: .select(
14768: "\" 4\" expected",
14769: yyBase);
14770: }
14771: { // Start scope for f4.
14772: final String f4 = yyOpValue1;
14773:
14774: yyPredResult = pLineTerminator(yyOption1);
14775: yyError = yyPredResult
14776: .select(yyError);
14777: if (yyPredResult
14778: .hasValue()) {
14779:
14780: final int lineNo = Integer
14781: .parseInt(line);
14782: if (RELOCATE)
14783: setLocation(
14784: yyStart,
14785: file,
14786: lineNo - 1,
14787: FIRST_COLUMN);
14788: yyState
14789: .lineMarker(
14790: file,
14791: lineNo,
14792: f1,
14793: f2,
14794: f3,
14795: f4,
14796: location(yyStart));
14797:
14798: yyValue = null;
14799:
14800: return new SemanticValue(
14801: yyValue,
14802: yyOption1,
14803: yyError);
14804: }
14805: } // End scope for f4.
14806: } // End scope for f3.
14807: } // End scope for f2.
14808: } // End scope for f1.
14809: }
14810: }
14811: }
14812: }
14813: }
14814: }
14815:
14816: // Nested alternative 2.
14817:
14818: yyRepetition1 = yyChoice1;
14819: while (true) {
14820:
14821: yyResult = pSpace(yyRepetition1);
14822: yyError = yyResult.select(yyError);
14823: if (yyResult.hasValue()) {
14824:
14825: yyRepetition1 = yyResult.index;
14826: continue;
14827: }
14828: break;
14829: }
14830: { // Start scope for nested choice.
14831:
14832: final int yyChoice2 = yyRepetition1;
14833:
14834: // Nested alternative 1.
14835:
14836: yyC = character(yyChoice2);
14837: if (-1 != yyC) {
14838: yyIndex = yyChoice2 + 1;
14839:
14840: switch (yyC) {
14841: case 'p': {
14842: yyC = character(yyIndex);
14843: if (-1 != yyC) {
14844: yyIndex = yyIndex + 1;
14845: if ('r' == yyC) {
14846:
14847: yyC = character(yyIndex);
14848: if (-1 != yyC) {
14849: yyIndex = yyIndex + 1;
14850: if ('a' == yyC) {
14851:
14852: yyC = character(yyIndex);
14853: if (-1 != yyC) {
14854: yyIndex = yyIndex + 1;
14855: if ('g' == yyC) {
14856:
14857: yyC = character(yyIndex);
14858: if (-1 != yyC) {
14859: yyIndex = yyIndex + 1;
14860: if ('m' == yyC) {
14861:
14862: yyC = character(yyIndex);
14863: if (-1 != yyC) {
14864: yyIndex = yyIndex + 1;
14865: if ('a' == yyC) {
14866:
14867: yyC = character(yyIndex);
14868: if (-1 != yyC) {
14869: yyIndex = yyIndex + 1;
14870: if (' ' == yyC) {
14871:
14872: yyResult = pPragma(yyIndex);
14873: yyError = yyResult
14874: .select(yyError);
14875: if (yyResult
14876: .hasValue()) {
14877: final String pragma = yyResult
14878: .semanticValue();
14879:
14880: yyPredResult = pLineTerminator(yyResult.index);
14881: yyError = yyPredResult
14882: .select(yyError);
14883: if (yyPredResult
14884: .hasValue()) {
14885:
14886: yyState
14887: .pragma(
14888: pragma,
14889: location(yyStart));
14890:
14891: yyValue = null;
14892:
14893: return yyResult
14894: .createValue(
14895: yyValue,
14896: yyError);
14897: }
14898: }
14899: }
14900: }
14901: }
14902: }
14903: }
14904: }
14905: }
14906: }
14907: }
14908: }
14909: }
14910: }
14911: }
14912: break;
14913:
14914: case 'i': {
14915: yyC = character(yyIndex);
14916: if (-1 != yyC) {
14917: yyIndex = yyIndex + 1;
14918: if ('d' == yyC) {
14919:
14920: yyC = character(yyIndex);
14921: if (-1 != yyC) {
14922: yyIndex = yyIndex + 1;
14923: if ('e' == yyC) {
14924:
14925: yyC = character(yyIndex);
14926: if (-1 != yyC) {
14927: yyIndex = yyIndex + 1;
14928: if ('n' == yyC) {
14929:
14930: yyC = character(yyIndex);
14931: if (-1 != yyC) {
14932: yyIndex = yyIndex + 1;
14933: if ('t' == yyC) {
14934:
14935: yyRepetition1 = yyIndex;
14936: yyRepeated1 = false;
14937: while (true) {
14938:
14939: yyResult = pSpace(yyRepetition1);
14940: yyError = yyResult
14941: .select(yyError);
14942: if (yyResult
14943: .hasValue()) {
14944:
14945: yyRepetition1 = yyResult.index;
14946: yyRepeated1 = true;
14947: continue;
14948: }
14949: break;
14950: }
14951:
14952: if (yyRepeated1) {
14953:
14954: yyC = character(yyRepetition1);
14955: if ('\"' == yyC) {
14956: yyIndex = yyRepetition1 + 1;
14957:
14958: yyResult = pFileName(yyIndex);
14959: yyError = yyResult
14960: .select(yyError);
14961: if (yyResult
14962: .hasValue()) {
14963: final String s = yyResult
14964: .semanticValue();
14965:
14966: yyC = character(yyResult.index);
14967: if ('\"' == yyC) {
14968: yyIndex = yyResult.index + 1;
14969:
14970: yyPredResult = pLineTerminator(yyIndex);
14971: yyError = yyPredResult
14972: .select(yyError);
14973: if (yyPredResult
14974: .hasValue()) {
14975:
14976: yyState
14977: .ident(
14978: s,
14979: location(yyStart));
14980:
14981: yyValue = null;
14982:
14983: return new SemanticValue(
14984: yyValue,
14985: yyIndex,
14986: yyError);
14987: }
14988: }
14989: }
14990: }
14991: }
14992: }
14993: }
14994: }
14995: }
14996: }
14997: }
14998: }
14999: }
15000: }
15001: break;
15002:
15003: default:
15004: /* No match. */
15005: }
15006: }
15007: } // End scope for nested choice.
15008: }
15009:
15010: // Alternative 2.
15011:
15012: yyValue = null;
15013:
15014: return new SemanticValue(yyValue, yyStart, yyError);
15015: }
15016:
15017: // =========================================================================
15018:
15019: /**
15020: * Parse nonterminal xtc.lang.CSpacing.LineNumber.
15021: *
15022: * @param yyStart The index.
15023: * @return The result.
15024: * @throws IOException Signals an I/O error.
15025: */
15026: private Result pLineNumber(final int yyStart) throws IOException {
15027: int yyC;
15028: int yyIndex;
15029: int yyRepetition1;
15030: String yyValue;
15031: ParseError yyError = ParseError.DUMMY;
15032:
15033: // Alternative 1.
15034:
15035: yyC = character(yyStart);
15036: if (-1 != yyC) {
15037: yyIndex = yyStart + 1;
15038:
15039: switch (yyC) {
15040: case '1':
15041: case '2':
15042: case '3':
15043: case '4':
15044: case '5':
15045: case '6':
15046: case '7':
15047: case '8':
15048: case '9': {
15049: yyRepetition1 = yyIndex;
15050: while (true) {
15051:
15052: yyC = character(yyRepetition1);
15053: if (-1 != yyC) {
15054: yyIndex = yyRepetition1 + 1;
15055:
15056: switch (yyC) {
15057: case '0':
15058: case '1':
15059: case '2':
15060: case '3':
15061: case '4':
15062: case '5':
15063: case '6':
15064: case '7':
15065: case '8':
15066: case '9': {
15067: yyRepetition1 = yyIndex;
15068: continue;
15069: }
15070:
15071: default:
15072: /* No match. */
15073: }
15074: }
15075: break;
15076: }
15077:
15078: yyValue = difference(yyStart, yyRepetition1);
15079:
15080: return new SemanticValue(yyValue, yyRepetition1,
15081: yyError);
15082: }
15083:
15084: default:
15085: /* No match. */
15086: }
15087: }
15088:
15089: // Done.
15090: yyError = yyError.select("line number expected", yyStart);
15091: return yyError;
15092: }
15093:
15094: // =========================================================================
15095:
15096: /**
15097: * Parse nonterminal xtc.lang.CSpacing.FileName.
15098: *
15099: * @param yyStart The index.
15100: * @return The result.
15101: * @throws IOException Signals an I/O error.
15102: */
15103: private Result pFileName(final int yyStart) throws IOException {
15104: int yyC;
15105: int yyIndex;
15106: int yyRepetition1;
15107: String yyValue;
15108: ParseError yyError = ParseError.DUMMY;
15109:
15110: // Alternative 1.
15111:
15112: yyRepetition1 = yyStart;
15113: while (true) {
15114:
15115: final int yyChoice1 = yyRepetition1;
15116:
15117: // Nested alternative 1.
15118:
15119: yyC = character(yyChoice1);
15120: if (-1 != yyC) {
15121: yyIndex = yyChoice1 + 1;
15122:
15123: switch (yyC) {
15124: case '\\': {
15125: yyC = character(yyIndex);
15126: if (-1 != yyC) {
15127: yyIndex = yyIndex + 1;
15128:
15129: yyRepetition1 = yyIndex;
15130: continue;
15131: }
15132: }
15133: break;
15134:
15135: default:
15136: /* No match. */
15137: }
15138: }
15139:
15140: // Nested alternative 2.
15141:
15142: yyC = character(yyChoice1);
15143: if (-1 != yyC) {
15144: yyIndex = yyChoice1 + 1;
15145:
15146: switch (yyC) {
15147: case '\"':
15148: case '\\':
15149: /* No match. */
15150: break;
15151:
15152: default: {
15153: yyRepetition1 = yyIndex;
15154: continue;
15155: }
15156: }
15157: }
15158: break;
15159: }
15160:
15161: yyValue = difference(yyStart, yyRepetition1);
15162:
15163: return new SemanticValue(yyValue, yyRepetition1, yyError);
15164: }
15165:
15166: // =========================================================================
15167:
15168: /**
15169: * Parse nonterminal xtc.lang.CSpacing.Pragma.
15170: *
15171: * @param yyStart The index.
15172: * @return The result.
15173: * @throws IOException Signals an I/O error.
15174: */
15175: private Result pPragma(final int yyStart) throws IOException {
15176: int yyC;
15177: int yyIndex;
15178: int yyRepetition1;
15179: String yyValue;
15180: ParseError yyError = ParseError.DUMMY;
15181:
15182: // Alternative 1.
15183:
15184: yyRepetition1 = yyStart;
15185: while (true) {
15186:
15187: yyC = character(yyRepetition1);
15188: if (-1 != yyC) {
15189: yyIndex = yyRepetition1 + 1;
15190:
15191: switch (yyC) {
15192: case '\n':
15193: case '\r':
15194: /* No match. */
15195: break;
15196:
15197: default: {
15198: yyRepetition1 = yyIndex;
15199: continue;
15200: }
15201: }
15202: }
15203: break;
15204: }
15205:
15206: yyValue = difference(yyStart, yyRepetition1);
15207:
15208: return new SemanticValue(yyValue, yyRepetition1, yyError);
15209: }
15210:
15211: // =========================================================================
15212:
15213: /**
15214: * Parse nonterminal xtc.lang.CContext.TypedefContext.
15215: *
15216: * @param yyStart The index.
15217: * @return The result.
15218: * @throws IOException Signals an I/O error.
15219: */
15220: private Result pTypedefContext(final int yyStart)
15221: throws IOException {
15222: Void yyValue;
15223: ParseError yyError = ParseError.DUMMY;
15224:
15225: // Alternative 1.
15226:
15227: yyState.typedef();
15228:
15229: yyValue = null;
15230:
15231: return new SemanticValue(yyValue, yyStart, yyError);
15232: }
15233:
15234: // =========================================================================
15235:
15236: /**
15237: * Parse nonterminal xtc.lang.CContext.ParameterContext.
15238: *
15239: * @param yyStart The index.
15240: * @return The result.
15241: * @throws IOException Signals an I/O error.
15242: */
15243: private Result pParameterContext(final int yyStart)
15244: throws IOException {
15245: Void yyValue;
15246: ParseError yyError = ParseError.DUMMY;
15247:
15248: // Alternative 1.
15249:
15250: yyState.parameters();
15251:
15252: yyValue = null;
15253:
15254: return new SemanticValue(yyValue, yyStart, yyError);
15255: }
15256:
15257: // =========================================================================
15258:
15259: /**
15260: * Parse nonterminal xtc.lang.CContext.FunctionDeclaratorContext.
15261: *
15262: * @param yyStart The index.
15263: * @return The result.
15264: * @throws IOException Signals an I/O error.
15265: */
15266: private Result pFunctionDeclaratorContext(final int yyStart)
15267: throws IOException {
15268:
15269: Void yyValue;
15270: ParseError yyError = ParseError.DUMMY;
15271:
15272: // Alternative 1.
15273:
15274: yyState.functionDeclarator();
15275:
15276: yyValue = null;
15277:
15278: return new SemanticValue(yyValue, yyStart, yyError);
15279: }
15280:
15281: // =========================================================================
15282:
15283: /**
15284: * Parse nonterminal xtc.lang.CContext.TypeSpecContext.
15285: *
15286: * @param yyStart The index.
15287: * @return The result.
15288: * @throws IOException Signals an I/O error.
15289: */
15290: private Result pTypeSpecContext(final int yyStart)
15291: throws IOException {
15292: Void yyValue;
15293: ParseError yyError = ParseError.DUMMY;
15294:
15295: // Alternative 1.
15296:
15297: yyState.typeSpecifier();
15298:
15299: yyValue = null;
15300:
15301: return new SemanticValue(yyValue, yyStart, yyError);
15302: }
15303:
15304: // =========================================================================
15305:
15306: /**
15307: * Parse nonterminal xtc.lang.CContext.PushScope.
15308: *
15309: * @param yyStart The index.
15310: * @return The result.
15311: * @throws IOException Signals an I/O error.
15312: */
15313: private Result pPushScope(final int yyStart) throws IOException {
15314: Void yyValue;
15315: ParseError yyError = ParseError.DUMMY;
15316:
15317: // Alternative 1.
15318:
15319: yyState.pushScope();
15320:
15321: yyValue = null;
15322:
15323: return new SemanticValue(yyValue, yyStart, yyError);
15324: }
15325:
15326: // =========================================================================
15327:
15328: /**
15329: * Parse nonterminal xtc.lang.CContext.PopScope.
15330: *
15331: * @param yyStart The index.
15332: * @return The result.
15333: * @throws IOException Signals an I/O error.
15334: */
15335: private Result pPopScope(final int yyStart) throws IOException {
15336: Void yyValue;
15337: ParseError yyError = ParseError.DUMMY;
15338:
15339: // Alternative 1.
15340:
15341: yyState.popScope();
15342:
15343: yyValue = null;
15344:
15345: return new SemanticValue(yyValue, yyStart, yyError);
15346: }
15347:
15348: // =========================================================================
15349:
15350: /**
15351: * Parse nonterminal xtc.lang.CContext.EnterStructure.
15352: *
15353: * @param yyStart The index.
15354: * @return The result.
15355: * @throws IOException Signals an I/O error.
15356: */
15357: private Result pEnterStructure(final int yyStart)
15358: throws IOException {
15359: Void yyValue;
15360: ParseError yyError = ParseError.DUMMY;
15361:
15362: // Alternative 1.
15363:
15364: yyState.enterStructure();
15365:
15366: yyValue = null;
15367:
15368: return new SemanticValue(yyValue, yyStart, yyError);
15369: }
15370:
15371: // =========================================================================
15372:
15373: /**
15374: * Parse nonterminal xtc.lang.CContext.ExitStructure.
15375: *
15376: * @param yyStart The index.
15377: * @return The result.
15378: * @throws IOException Signals an I/O error.
15379: */
15380: private Result pExitStructure(final int yyStart) throws IOException {
15381: Void yyValue;
15382: ParseError yyError = ParseError.DUMMY;
15383:
15384: // Alternative 1.
15385:
15386: yyState.exitStructure();
15387:
15388: yyValue = null;
15389:
15390: return new SemanticValue(yyValue, yyStart, yyError);
15391: }
15392:
15393: // =========================================================================
15394:
15395: /**
15396: * Parse nonterminal xtc.lang.JavaIdentifier.QualifiedIdentifier.
15397: *
15398: * @param yyStart The index.
15399: * @return The result.
15400: * @throws IOException Signals an I/O error.
15401: */
15402: private Result pQualifiedIdentifier(final int yyStart)
15403: throws IOException {
15404: Result yyResult;
15405: int yyBase;
15406: int yyRepetition1;
15407: Pair<String> yyRepValue1;
15408: Node yyValue;
15409: ParseError yyError = ParseError.DUMMY;
15410:
15411: // Alternative 1.
15412:
15413: yyResult = pJavaIdentifier$Identifier(yyStart);
15414: yyError = yyResult.select(yyError);
15415: if (yyResult.hasValue()) {
15416: final String v$g$1 = yyResult.semanticValue();
15417:
15418: yyRepetition1 = yyResult.index;
15419: yyRepValue1 = Pair.empty();
15420: while (true) {
15421:
15422: yyBase = yyRepetition1;
15423: yyResult = pSymbol(yyBase);
15424: yyError = yyResult.select(yyError);
15425: if (yyResult.hasValue(".")) {
15426:
15427: yyResult = pJavaIdentifier$Identifier(yyResult.index);
15428: yyError = yyResult.select(yyError);
15429: if (yyResult.hasValue()) {
15430: final String v$el$1 = yyResult.semanticValue();
15431:
15432: yyRepetition1 = yyResult.index;
15433: yyRepValue1 = new Pair<String>(v$el$1,
15434: yyRepValue1);
15435: continue;
15436: }
15437: } else {
15438: yyError = yyError.select("\".\" expected", yyBase);
15439: }
15440: break;
15441: }
15442: { // Start scope for v$g$2.
15443: final Pair<String> v$g$2 = yyRepValue1.reverse();
15444:
15445: yyValue = GNode.createFromPair("QualifiedIdentifier",
15446: v$g$1, v$g$2);
15447: yyValue.setLocation(location(yyStart));
15448:
15449: return new SemanticValue(yyValue, yyRepetition1,
15450: yyError);
15451: } // End scope for v$g$2.
15452: }
15453:
15454: // Done.
15455: return yyError;
15456: }
15457:
15458: // =========================================================================
15459:
15460: /**
15461: * Parse nonterminal xtc.lang.JavaIdentifier.Identifier.
15462: *
15463: * @param yyStart The index.
15464: * @return The result.
15465: * @throws IOException Signals an I/O error.
15466: */
15467: private Result pJavaIdentifier$Identifier(final int yyStart)
15468: throws IOException {
15469:
15470: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
15471: if (null == yyColumn.chunk5)
15472: yyColumn.chunk5 = new Chunk5();
15473: if (null == yyColumn.chunk5.fJavaIdentifier$Identifier)
15474: yyColumn.chunk5.fJavaIdentifier$Identifier = pJavaIdentifier$Identifier$1(yyStart);
15475: return yyColumn.chunk5.fJavaIdentifier$Identifier;
15476: }
15477:
15478: /** Actually parse xtc.lang.JavaIdentifier.Identifier. */
15479: private Result pJavaIdentifier$Identifier$1(final int yyStart)
15480: throws IOException {
15481:
15482: Result yyResult;
15483: String yyValue;
15484: ParseError yyError = ParseError.DUMMY;
15485:
15486: // Alternative 1.
15487:
15488: yyResult = pJavaIdentifier$Word(yyStart);
15489: yyError = yyResult.select(yyError);
15490: if (yyResult.hasValue()) {
15491: yyValue = yyResult.semanticValue();
15492:
15493: if (!contains(JAVA_KEYWORDS, toText(yyValue))) {
15494:
15495: return yyResult.createValue(yyValue, yyError);
15496: }
15497: }
15498:
15499: // Done.
15500: yyError = yyError.select("identifier expected", yyStart);
15501: return yyError;
15502: }
15503:
15504: // =========================================================================
15505:
15506: /**
15507: * Parse nonterminal xtc.lang.JavaIdentifier.Word.
15508: *
15509: * @param yyStart The index.
15510: * @return The result.
15511: * @throws IOException Signals an I/O error.
15512: */
15513: private Result pJavaIdentifier$Word(final int yyStart)
15514: throws IOException {
15515: CFactoryParserColumn yyColumn = (CFactoryParserColumn) column(yyStart);
15516: if (null == yyColumn.chunk5)
15517: yyColumn.chunk5 = new Chunk5();
15518: if (null == yyColumn.chunk5.fJavaIdentifier$Word)
15519: yyColumn.chunk5.fJavaIdentifier$Word = pJavaIdentifier$Word$1(yyStart);
15520: return yyColumn.chunk5.fJavaIdentifier$Word;
15521: }
15522:
15523: /** Actually parse xtc.lang.JavaIdentifier.Word. */
15524: private Result pJavaIdentifier$Word$1(final int yyStart)
15525: throws IOException {
15526:
15527: Result yyResult;
15528: String yyValue;
15529: ParseError yyError = ParseError.DUMMY;
15530:
15531: // Alternative 1.
15532:
15533: yyResult = pJavaIdentifier$WordCharacters(yyStart);
15534: yyError = yyResult.select(yyError);
15535: if (yyResult.hasValue()) {
15536: yyValue = yyResult.semanticValue();
15537:
15538: yyResult = pSpacing(yyResult.index);
15539: yyError = yyResult.select(yyError);
15540: if (yyResult.hasValue()) {
15541:
15542: return yyResult.createValue(yyValue, yyError);
15543: }
15544: }
15545:
15546: // Done.
15547: return yyError;
15548: }
15549:
15550: // =========================================================================
15551:
15552: /**
15553: * Parse nonterminal xtc.lang.JavaIdentifier.WordCharacters.
15554: *
15555: * @param yyStart The index.
15556: * @return The result.
15557: * @throws IOException Signals an I/O error.
15558: */
15559: private Result pJavaIdentifier$WordCharacters(final int yyStart)
15560: throws IOException {
15561:
15562: int yyC;
15563: int yyIndex;
15564: int yyRepetition1;
15565: String yyValue;
15566: ParseError yyError = ParseError.DUMMY;
15567:
15568: // Alternative 1.
15569:
15570: yyC = character(yyStart);
15571: if (-1 != yyC) {
15572: yyIndex = yyStart + 1;
15573: final char start = (char) yyC;
15574:
15575: if (Character.isJavaIdentifierStart(start)) {
15576:
15577: yyRepetition1 = yyIndex;
15578: while (true) {
15579:
15580: yyC = character(yyRepetition1);
15581: if (-1 != yyC) {
15582: yyIndex = yyRepetition1 + 1;
15583: final char part = (char) yyC;
15584:
15585: if (Character.isJavaIdentifierPart(part)) {
15586:
15587: yyRepetition1 = yyIndex;
15588: continue;
15589: }
15590: }
15591: break;
15592: }
15593:
15594: yyValue = difference(yyStart, yyRepetition1);
15595:
15596: return new SemanticValue(yyValue, yyRepetition1,
15597: yyError);
15598: }
15599: }
15600:
15601: // Done.
15602: yyError = yyError.select("word characters expected", yyStart);
15603: return yyError;
15604: }
15605:
15606: // =========================================================================
15607:
15608: static {
15609: add(JAVA_KEYWORDS, new String[] { "abstract", "continue",
15610: "for", "new", "switch", "assert", "default", "if",
15611: "package", "synchronized", "boolean", "do", "goto",
15612: "private", "this", "break", "double", "implements",
15613: "protected", "throw", "byte", "else", "import",
15614: "public", "throws", "case", "instanceof", "return",
15615: "transient", "catch", "extends", "int", "short", "try",
15616: "char", "final", "interface", "static", "void",
15617: "class", "finally", "long", "strictfp", "volatile",
15618: "const", "float", "native", "super", "while" });
15619: }
15620: static {
15621: add(C_KEYWORDS, new String[] { "auto", "break", "case", "char",
15622: "const", "continue", "default", "do", "double", "else",
15623: "enum", "extern", "float", "for", "goto", "if", "int",
15624: "long", "register", "return", "short", "signed",
15625: "sizeof", "static", "struct", "switch", "typedef",
15626: "union", "unsigned", "void", "volatile", "while" });
15627:
15628: if (C99)
15629: add(C_KEYWORDS, new String[] { "_Bool", "_Complex",
15630: "inline", "restrict" });
15631:
15632: if (GCC)
15633: add(C_KEYWORDS, new String[] { "__alignof", "__alignof__",
15634: "asm", "__asm", "__asm__", "__attribute",
15635: "__attribute__", "__builtin_offsetof",
15636: "__builtin_types_compatible_p", "__builtin_va_arg",
15637: "__builtin_va_list", "__complex__", "__const",
15638: "__const__", "__extension__", "__inline",
15639: "__inline__", "__label__", "__restrict",
15640: "__restrict__", "__signed", "__signed__", "typeof",
15641: "__typeof", "__typeof__", "__volatile",
15642: "__volatile__" });
15643:
15644: }
15645:
15646: // =========================================================================
15647:
15648: /**
15649: * Get the specified text.
15650: *
15651: * @param s The text.
15652: * @return The text.
15653: */
15654: protected static final String toText(String s) {
15655: return s;
15656: }
15657:
15658: // =========================================================================
15659:
15660: /**
15661: * Add the specified values to the specified set.
15662: *
15663: * @param set The set.
15664: * @param values The new values.
15665: */
15666: protected static final <T> void add(Set<T> set, T[] values) {
15667: for (T v : values)
15668: set.add(v);
15669: }
15670:
15671: /**
15672: * Check whether the specified set contains the specified value.
15673: *
15674: * @param set The set.
15675: * @param value The value.
15676: * @return <code>true</code> if the set contains the value.
15677: */
15678: protected static final <T> boolean contains(Set<T> set, T value) {
15679: return set.contains(value);
15680: }
15681:
15682: }
|