// =========================================================================== // This file has been generated by // Rats! Parser Generator, version 2.1.0, // (C) 2004-2011 Robert Grimm, // on Thursday, August 4, 2011 at 12:11:53 PM. // Edit at your own risk. // =========================================================================== package xtc.lang.jeannie; import java.io.Reader; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.OutputStreamWriter; import java.io.IOException; import java.util.HashSet; import java.util.Set; import xtc.util.Action; import xtc.util.Pair; import xtc.tree.Node; import xtc.tree.GNode; import xtc.tree.Printer; import xtc.parser.ParserBase; import xtc.parser.Column; import xtc.parser.Result; import xtc.parser.SemanticValue; import xtc.parser.ParseError; import xtc.lang.CParserState; /** * Packrat parser for grammar <code>xtc.lang.jeannie.Jeannie</code>. * * <p />This class has been generated by the <i>Rats!</i> parser * generator, version 2.1.0, (C) 2004-2011 Robert Grimm. */ public final class JeannieParser extends ParserBase { /** The RELOCATE flag. */ public static final boolean RELOCATE = true; /** The C_KEYWORDS set. */ public static final Set<String> C_KEYWORDS = new HashSet<String>(); /** The GCC flag. */ public static final boolean GCC = true; /** The JAVA_KEYWORDS set. */ public static final Set<String> JAVA_KEYWORDS = new HashSet<String>(); /** The C99 flag. */ public static final boolean C99 = true; // ========================================================================= /** Chunk 1 of memoized results. */ static final class Chunk1 { Result fCConstant$Exponent; Result f$$Shared10; Result fBinaryExponent; Result fCConstant$CharacterLiteral; Result fCConstant$StringConstant; Result fCConstant$StringConstant$$Plus1; Result fCConstant$StringLiteral; Result fSymbol; Result fCIdentifier$Identifier; Result fKeyword; } /** Chunk 2 of memoized results. */ static final class Chunk2 { Result fCIdentifier$Word; Result fResultType; Result fType; Result fJavaType$TypeName; Result fPrimitiveType; Result fDimensions; Result fDimensions$$Plus1; Result fQualifiedIdentifier; Result fQualifiedIdentifier$$Star1; Result fJavaIdentifier$Identifier; } /** Chunk 3 of memoized results. */ static final class Chunk3 { Result fJavaIdentifier$Word; Result fExternalDeclaration; Result fDeclarationSpecifiers; Result fInitializedDeclaratorList; Result fInitializedDeclaratorList$$Star1; Result fSpecifierQualifierList; Result fAttributedDeclarator; Result fJeannieC$Declarator; Result fPointer; Result fVariableLength; } /** Chunk 4 of memoized results. */ static final class Chunk4 { Result fParameterTypeList; Result fAbstractDeclarator; Result fJeannieC$TypeName; Result fAttributeSpecifierList; Result fAttributeSpecifier; Result fJeannieC$Statement; Result fCompoundStatement; Result fCommaExpression; Result fAssignmentExpression; Result fJeannieC$ConditionalExpression; } /** Chunk 5 of memoized results. */ static final class Chunk5 { Result fJeannieC$LogicalOrExpression; Result f$$Shared7; Result f$$Shared8; Result f$$Shared9; Result fJeannieC$CastExpression; Result fJeannieC$UnaryExpression; Result fJeannieC$ExpressionList; Result fJeannieC$ExpressionList$$Star1; Result fSimpleAssemblyExpression; Result fAssemblyOperands; } /** Chunk 6 of memoized results. */ static final class Chunk6 { Result fAssemblyOperands$$Star1; Result fAssemblyOperand; Result fAsmKeyword; Result fJavaInC; Result fCInCBlock; Result fCInCBlock$$Star1; Result fCInCBlock$$Star2; Result fJavaThrows; Result fModifiers; Result fFormalParameters; } /** Chunk 7 of memoized results. */ static final class Chunk7 { Result fFormalParameters$$Star1; Result fDeclarators; Result fDeclarators$$Star1; Result fBlock; Result fParExpression; Result fCatchClause; Result fJeannieJava$Expression; Result fJeannieJava$ConditionalExpression; Result fJeannieJava$LogicalOrExpression; Result fJeannieJava$RelationalExpression; } /** Chunk 8 of memoized results. */ static final class Chunk8 { Result fVariableInitializer; Result fCInJava; Result fJavaInJavaBlock; Result fJavaInJavaBlock$$Star1; } // ========================================================================= /** Memoization table column. */ static final class JeannieParserColumn extends Column { Chunk1 chunk1; Chunk2 chunk2; Chunk3 chunk3; Chunk4 chunk4; Chunk5 chunk5; Chunk6 chunk6; Chunk7 chunk7; Chunk8 chunk8; } // ========================================================================= /** The global state object. */ protected final xtc.lang.CParserState yyState; // ========================================================================= /** * Create a new packrat parser. * * @param reader The reader. * @param file The file name. */ public JeannieParser(final Reader reader, final String file) { super(reader, file); yyState = new xtc.lang.CParserState(); } /** * Create a new packrat parser. * * @param reader The file reader. * @param file The file name. * @param size The file size. */ public JeannieParser(final Reader reader, final String file, final int size) { super(reader, file, size); yyState = new xtc.lang.CParserState(); } // ========================================================================= protected Column newColumn() { return new JeannieParserColumn(); } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.Jeannie.File. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ public Result pFile(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Reset the global state object. yyState.reset(column(yyStart).file); // Alternative <JavaFile>. yyResult = pCompilationUnit(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <CFile>. yyResult = pTranslationUnit(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.Constant. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pConstant(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pFloatingConstant(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyResult = pSpacing(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { return yyResult.createValue(yyValue, yyError); } } // Alternative 2. yyResult = pIntegerConstant(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyResult = pSpacing(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { return yyResult.createValue(yyValue, yyError); } } // Alternative 3. yyResult = pCConstant$CharacterConstant(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative 4. yyResult = pCConstant$StringConstant(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.IntegerConstant. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pIntegerConstant(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Hex>. yyResult = pHexConstant(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("IntegerConstant", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Octal>. yyResult = pOctalConstant(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("IntegerConstant", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Decimal>. yyResult = pDecimalConstant(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$3 = yyResult.semanticValue(); yyValue = GNode.create("IntegerConstant", v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.DecimalConstant. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDecimalConstant(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyRepetition1; int yyOption1; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; continue; } default: /* No match. */ } } break; } yyOption1 = yyRepetition1; yyResult = pIntegerSuffix(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyValue = difference(yyStart, yyOption1); return new SemanticValue(yyValue, yyOption1, yyError); } default: /* No match. */ } } // Done. yyError = yyError.select("decimal constant expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.HexConstant. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pHexConstant(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyRepetition1; boolean yyRepeated1; int yyOption1; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pHexPrefix(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; yyRepeated1 = false; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyRepetition1 = yyIndex; yyRepeated1 = true; continue; } default: /* No match. */ } } break; } if (yyRepeated1) { yyOption1 = yyRepetition1; yyResult = pIntegerSuffix(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyValue = difference(yyStart, yyOption1); return new SemanticValue(yyValue, yyOption1, yyError); } } // Done. yyError = yyError.select("hex constant expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.HexPrefix. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pHexPrefix(final int yyStart) throws IOException { int yyC; int yyIndex; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if ('0' == yyC) { yyIndex = yyStart + 1; yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case 'X': case 'x': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } } // Done. yyError = yyError.select("hex prefix expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.OctalConstant. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pOctalConstant(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyRepetition1; int yyOption1; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if ('0' == yyC) { yyIndex = yyStart + 1; yyRepetition1 = yyIndex; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { yyRepetition1 = yyIndex; continue; } default: /* No match. */ } } break; } yyOption1 = yyRepetition1; yyResult = pIntegerSuffix(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyValue = difference(yyStart, yyOption1); return new SemanticValue(yyValue, yyOption1, yyError); } // Done. yyError = yyError.select("octal constant expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.IntegerSuffix. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pIntegerSuffix(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pLongLongSuffix(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case 'U': case 'u': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } // Nested alternative 2. yyValue = null; return new SemanticValue(yyValue, yyChoice1, yyError); } // Alternative 2. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case 'L': case 'l': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case 'U': case 'u': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } // Nested alternative 2. yyValue = null; return new SemanticValue(yyValue, yyChoice1, yyError); } case 'U': case 'u': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case 'l': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; if ('l' == yyC) { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } } } break; case 'L': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; if ('L' == yyC) { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } } } break; default: /* No match. */ } } // Nested alternative 2. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case 'L': case 'l': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } // Nested alternative 3. yyValue = null; return new SemanticValue(yyValue, yyChoice1, yyError); } default: /* No match. */ } } // Done. yyError = yyError.select("integer suffix expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.LongLongSuffix. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pLongLongSuffix(final int yyStart) throws IOException { int yyC; int yyIndex; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case 'l': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; if ('l' == yyC) { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } } } break; case 'L': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; if ('L' == yyC) { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } } } break; default: /* No match. */ } } // Done. yyError = yyError.select("long long suffix expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.FloatingConstant. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pFloatingConstant(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Decimal>. yyResult = pDecimalFloatingConstant(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("FloatingConstant", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Hex>. yyResult = pHexFloatingConstant(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("FloatingConstant", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.DecimalFloatingConstant. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDecimalFloatingConstant(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyRepetition1; boolean yyRepeated1; int yyOption1; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyRepetition1 = yyStart; yyRepeated1 = false; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; yyRepeated1 = true; continue; } default: /* No match. */ } } break; } if (yyRepeated1) { yyC = character(yyRepetition1); if ('.' == yyC) { yyIndex = yyRepetition1 + 1; yyRepetition1 = yyIndex; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; continue; } default: /* No match. */ } } break; } yyOption1 = yyRepetition1; yyResult = pCConstant$Exponent(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyC = character(yyOption1); if (-1 != yyC) { yyIndex = yyOption1 + 1; switch (yyC) { case 'F': case 'L': case 'f': case 'l': { yyOption1 = yyIndex; } break; default: /* No match. */ } } yyValue = difference(yyStart, yyOption1); return new SemanticValue(yyValue, yyOption1, yyError); } } // Alternative 2. yyC = character(yyStart); if ('.' == yyC) { yyIndex = yyStart + 1; yyRepetition1 = yyIndex; yyRepeated1 = false; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; yyRepeated1 = true; continue; } default: /* No match. */ } } break; } if (yyRepeated1) { yyOption1 = yyRepetition1; yyResult = pCConstant$Exponent(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyC = character(yyOption1); if (-1 != yyC) { yyIndex = yyOption1 + 1; switch (yyC) { case 'F': case 'L': case 'f': case 'l': { yyOption1 = yyIndex; } break; default: /* No match. */ } } yyValue = difference(yyStart, yyOption1); return new SemanticValue(yyValue, yyOption1, yyError); } } // Alternative 3. yyRepetition1 = yyStart; yyRepeated1 = false; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; yyRepeated1 = true; continue; } default: /* No match. */ } } break; } if (yyRepeated1) { yyResult = pCConstant$Exponent(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyC = character(yyOption1); if (-1 != yyC) { yyIndex = yyOption1 + 1; switch (yyC) { case 'F': case 'L': case 'f': case 'l': { yyOption1 = yyIndex; } break; default: /* No match. */ } } yyValue = difference(yyStart, yyOption1); return new SemanticValue(yyValue, yyOption1, yyError); } } // Done. yyError = yyError.select("decimal floating constant expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.HexFloatingConstant. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pHexFloatingConstant(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyRepetition1; boolean yyRepeated1; int yyOption1; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pHexPrefix(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyRepetition1 = yyChoice1; yyRepeated1 = false; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyRepetition1 = yyIndex; yyRepeated1 = true; continue; } default: /* No match. */ } } break; } if (yyRepeated1) { yyC = character(yyRepetition1); if ('.' == yyC) { yyIndex = yyRepetition1 + 1; yyRepetition1 = yyIndex; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyRepetition1 = yyIndex; continue; } default: /* No match. */ } } break; } yyResult = pBinaryExponent(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyC = character(yyOption1); if (-1 != yyC) { yyIndex = yyOption1 + 1; switch (yyC) { case 'F': case 'L': case 'f': case 'l': { yyOption1 = yyIndex; } break; default: /* No match. */ } } yyValue = difference(yyStart, yyOption1); return new SemanticValue(yyValue, yyOption1, yyError); } } } // Nested alternative 2. yyC = character(yyChoice1); if ('.' == yyC) { yyIndex = yyChoice1 + 1; yyRepetition1 = yyIndex; yyRepeated1 = false; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyRepetition1 = yyIndex; yyRepeated1 = true; continue; } default: /* No match. */ } } break; } if (yyRepeated1) { yyResult = pBinaryExponent(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyC = character(yyOption1); if (-1 != yyC) { yyIndex = yyOption1 + 1; switch (yyC) { case 'F': case 'L': case 'f': case 'l': { yyOption1 = yyIndex; } break; default: /* No match. */ } } yyValue = difference(yyStart, yyOption1); return new SemanticValue(yyValue, yyOption1, yyError); } } } // Nested alternative 3. yyRepetition1 = yyChoice1; yyRepeated1 = false; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyRepetition1 = yyIndex; yyRepeated1 = true; continue; } default: /* No match. */ } } break; } if (yyRepeated1) { yyResult = pBinaryExponent(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyC = character(yyOption1); if (-1 != yyC) { yyIndex = yyOption1 + 1; switch (yyC) { case 'F': case 'L': case 'f': case 'l': { yyOption1 = yyIndex; } break; default: /* No match. */ } } yyValue = difference(yyStart, yyOption1); return new SemanticValue(yyValue, yyOption1, yyError); } } } // Done. yyError = yyError.select("hex floating constant expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.Exponent. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCConstant$Exponent(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fCConstant$Exponent) yyColumn.chunk1.fCConstant$Exponent = pCConstant$Exponent$1(yyStart); return yyColumn.chunk1.fCConstant$Exponent; } /** Actually parse xtc.lang.CConstant.Exponent. */ private Result pCConstant$Exponent$1(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyOption1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case 'E': case 'e': { yyOption1 = yyIndex; yyC = character(yyOption1); if (-1 != yyC) { yyIndex = yyOption1 + 1; switch (yyC) { case '+': case '-': { yyOption1 = yyIndex; } break; default: /* No match. */ } } yyResult = p$$Shared10(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } break; default: /* No match. */ } } // Done. yyError = yyError.select("exponent expected", yyStart); return yyError; } // ========================================================================= /** * Parse synthetic nonterminal xtc.lang.jeannie.Jeannie.$$Shared10. * This nonterminal represents the duplicate productions * CConstant.Exponent$$Plus1 * and xtc.lang.jeannie.Jeannie.BinaryExponent$$Plus1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result p$$Shared10(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.f$$Shared10) yyColumn.chunk1.f$$Shared10 = p$$Shared10$1(yyStart); return yyColumn.chunk1.f$$Shared10; } /** Actually parse xtc.lang.jeannie.Jeannie.$$Shared10. */ private Result p$$Shared10$1(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyResult = p$$Shared10(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Nested alternative 2. yyValue = null; return new SemanticValue(yyValue, yyChoice1, yyError); } default: /* No match. */ } } // Done. yyError = yyError.select(" expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.BinaryExponent. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pBinaryExponent(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fBinaryExponent) yyColumn.chunk1.fBinaryExponent = pBinaryExponent$1(yyStart); return yyColumn.chunk1.fBinaryExponent; } /** Actually parse xtc.lang.CConstant.BinaryExponent. */ private Result pBinaryExponent$1(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyOption1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case 'P': case 'p': { yyOption1 = yyIndex; yyC = character(yyOption1); if (-1 != yyC) { yyIndex = yyOption1 + 1; switch (yyC) { case '+': case '-': { yyOption1 = yyIndex; } break; default: /* No match. */ } } yyResult = p$$Shared10(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } break; default: /* No match. */ } } // Done. yyError = yyError.select("binary exponent expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.CharacterConstant. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCConstant$CharacterConstant(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pWideCharacterLiteral(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyResult = pSpacing(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = GNode.create("CharacterConstant", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative 2. yyResult = pCConstant$CharacterLiteral(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyResult = pSpacing(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = GNode.create("CharacterConstant", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.WideCharacterLiteral. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pWideCharacterLiteral(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if ('L' == yyC) { yyIndex = yyStart + 1; yyResult = pCConstant$CharacterLiteral(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = difference(yyStart, yyResult.index); return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("wide character literal expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.CharacterLiteral. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCConstant$CharacterLiteral(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fCConstant$CharacterLiteral) yyColumn.chunk1.fCConstant$CharacterLiteral = pCConstant$CharacterLiteral$1(yyStart); return yyColumn.chunk1.fCConstant$CharacterLiteral; } /** Actually parse xtc.lang.CConstant.CharacterLiteral. */ private Result pCConstant$CharacterLiteral$1(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if ('\'' == yyC) { yyIndex = yyStart + 1; yyResult = pCharacterContents(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyC = character(yyResult.index); if ('\'' == yyC) { yyIndex = yyResult.index + 1; yyValue = difference(yyStart, yyIndex); return new SemanticValue(yyValue, yyIndex, yyError); } } } // Done. yyError = yyError.select("character literal expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.CharacterContents. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCharacterContents(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyRepetition1; boolean yyRepeated1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyRepetition1 = yyStart; yyRepeated1 = false; while (true) { final int yyChoice1 = yyRepetition1; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case '\\': { final int yyChoice2 = yyIndex; // Nested alternative 1. yyResult = pEscapeCode(yyChoice2); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; yyRepeated1 = true; continue; } // Nested alternative 2. yyC = character(yyChoice2); if (-1 != yyC) { yyIndex = yyChoice2 + 1; switch (yyC) { case 'u': { yyResult = pHexQuad(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; yyRepeated1 = true; continue; } } break; case 'U': { yyResult = pHexQuad(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pHexQuad(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; yyRepeated1 = true; continue; } } } break; default: /* No match. */ } } } break; default: /* No match. */ } } // Nested alternative 2. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case '\n': case '\r': case '\'': case '\\': /* No match. */ break; default: { yyRepetition1 = yyIndex; yyRepeated1 = true; continue; } } } break; } if (yyRepeated1) { yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. yyError = yyError.select("character contents expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.StringConstant. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCConstant$StringConstant(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fCConstant$StringConstant) yyColumn.chunk1.fCConstant$StringConstant = pCConstant$StringConstant$1(yyStart); return yyColumn.chunk1.fCConstant$StringConstant; } /** Actually parse xtc.lang.CConstant.StringConstant. */ private Result pCConstant$StringConstant$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pCConstant$StringConstant$$Plus1(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<String> v$g$1 = yyResult.semanticValue(); yyValue = GNode.createFromPair("StringConstant", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal CConstant.StringConstant$$Choice1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCConstant$StringConstant$$Choice1(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pWideStringLiteral(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyResult = pSpacing(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { return yyResult.createValue(yyValue, yyError); } } // Alternative 2. yyResult = pCConstant$StringLiteral(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyResult = pSpacing(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal CConstant.StringConstant$$Plus1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCConstant$StringConstant$$Plus1(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fCConstant$StringConstant$$Plus1) yyColumn.chunk1.fCConstant$StringConstant$$Plus1 = pCConstant$StringConstant$$Plus1$1(yyStart); return yyColumn.chunk1.fCConstant$StringConstant$$Plus1; } /** Actually parse CConstant.StringConstant$$Plus1. */ private Result pCConstant$StringConstant$$Plus1$1(final int yyStart) throws IOException { Result yyResult; Pair<String> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pCConstant$StringConstant$$Choice1(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$el$1 = yyResult.semanticValue(); final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pCConstant$StringConstant$$Plus1(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<String> v$4 = yyResult.semanticValue(); yyValue = new Pair<String>(v$el$1, v$4); return yyResult.createValue(yyValue, yyError); } // Nested alternative 2. yyValue = new Pair<String>(v$el$1); return new SemanticValue(yyValue, yyChoice1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.WideStringLiteral. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pWideStringLiteral(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if ('L' == yyC) { yyIndex = yyStart + 1; yyResult = pCConstant$StringLiteral(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = difference(yyStart, yyResult.index); return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("wide string literal expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.StringLiteral. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCConstant$StringLiteral(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fCConstant$StringLiteral) yyColumn.chunk1.fCConstant$StringLiteral = pCConstant$StringLiteral$1(yyStart); return yyColumn.chunk1.fCConstant$StringLiteral; } /** Actually parse xtc.lang.CConstant.StringLiteral. */ private Result pCConstant$StringLiteral$1(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if ('\"' == yyC) { yyIndex = yyStart + 1; yyResult = pStringContents(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyC = character(yyResult.index); if ('\"' == yyC) { yyIndex = yyResult.index + 1; yyValue = difference(yyStart, yyIndex); return new SemanticValue(yyValue, yyIndex, yyError); } } } // Done. yyError = yyError.select("string literal expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.StringContents. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pStringContents(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyRepetition1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyRepetition1 = yyStart; while (true) { final int yyChoice1 = yyRepetition1; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case '\\': { final int yyChoice2 = yyIndex; // Nested alternative 1. yyResult = pEscapeCode(yyChoice2); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } // Nested alternative 2. yyC = character(yyChoice2); if (-1 != yyC) { yyIndex = yyChoice2 + 1; switch (yyC) { case 'u': { yyResult = pHexQuad(yyIndex); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } break; case 'U': { yyResult = pHexQuad(yyIndex); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyResult = pHexQuad(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } } break; default: /* No match. */ } } } break; default: /* No match. */ } } // Nested alternative 2. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case '\n': case '\r': case '\"': case '\\': /* No match. */ break; default: { yyRepetition1 = yyIndex; continue; } } } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.EscapeCode. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pEscapeCode(final int yyStart) throws IOException { int yyC; int yyIndex; int yyRepetition1; boolean yyRepeated1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case '\"': case '\'': case '?': case '\\': case 'a': case 'b': case 'f': case 'n': case 'r': case 't': case 'v': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { final int yyChoice2 = yyIndex; // Nested alternative 1. yyC = character(yyChoice2); if (-1 != yyC) { yyIndex = yyChoice2 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } // Nested alternative 2. yyValue = null; return new SemanticValue(yyValue, yyChoice2, yyError); } default: /* No match. */ } } // Nested alternative 2. yyValue = null; return new SemanticValue(yyValue, yyChoice1, yyError); } case 'x': { yyRepetition1 = yyIndex; yyRepeated1 = false; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyRepetition1 = yyIndex; yyRepeated1 = true; continue; } default: /* No match. */ } } break; } if (yyRepeated1) { yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } } break; default: /* No match. */ } } // Done. yyError = yyError.select("escape code expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CConstant.HexQuad. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pHexQuad(final int yyStart) throws IOException { int yyC; int yyIndex; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } } break; default: /* No match. */ } } } break; default: /* No match. */ } } } break; default: /* No match. */ } } // Done. yyError = yyError.select("hex quad expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CSpacing.Spacing. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pSpacing(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; Result yyPredResult; boolean yyPredMatched; int yyBase; int yyRepetition1; int yyRepetition2; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyRepetition1 = yyStart; while (true) { final int yyChoice1 = yyRepetition1; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case ' ': { yyRepetition1 = yyIndex; continue; } case '\t': { yyRepetition1 = yyIndex; continue; } case '\f': { yyRepetition1 = yyIndex; continue; } case '/': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case '*': { yyRepetition2 = yyIndex; while (true) { final int yyChoice2 = yyRepetition2; // Nested alternative 1. yyC = character(yyChoice2); if (-1 != yyC) { yyIndex = yyChoice2 + 1; switch (yyC) { case '*': { yyPredMatched = false; yyC = character(yyIndex); if ('/' == yyC) { yyPredMatched = true; } if (! yyPredMatched) { yyRepetition2 = yyIndex; continue; } else { yyError = yyError.select("spacing expected", yyStart); } } break; default: { yyRepetition2 = yyIndex; continue; } } } break; } yyBase = yyRepetition2; yyC = character(yyBase); if ('*' == yyC) { yyIndex = yyRepetition2 + 1; yyC = character(yyIndex); if ('/' == yyC) { yyIndex = yyIndex + 1; yyRepetition1 = yyIndex; continue; } else { yyError = yyError.select("'*/' expected", yyBase); } } else { yyError = yyError.select("'*/' expected", yyBase); } } break; case '/': { yyRepetition2 = yyIndex; while (true) { yyC = character(yyRepetition2); if (-1 != yyC) { yyIndex = yyRepetition2 + 1; switch (yyC) { case '\n': case '\r': /* No match. */ break; default: { yyRepetition2 = yyIndex; continue; } } } break; } yyPredResult = pLineTerminator(yyRepetition2); yyError = yyPredResult.select(yyError); if (yyPredResult.hasValue()) { yyRepetition1 = yyRepetition2; continue; } } break; default: /* No match. */ } } } break; case '\r': { final int yyChoice2 = yyIndex; // Nested alternative 1. yyC = character(yyChoice2); if ('\n' == yyC) { yyIndex = yyChoice2 + 1; yyResult = pDirective(yyIndex); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } // Nested alternative 2. yyResult = pDirective(yyChoice2); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } break; case '\n': { yyResult = pDirective(yyIndex); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } break; default: /* No match. */ } } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.CSpacing.Space. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pSpace(final int yyStart) throws IOException { int yyC; int yyIndex; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case ' ': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } case '\t': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } case '\f': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } // Done. yyError = yyError.select("space expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CSpacing.LineTerminator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pLineTerminator(final int yyStart) throws IOException { int yyC; int yyIndex; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case '\r': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if ('\n' == yyC) { yyIndex = yyChoice1 + 1; yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } // Nested alternative 2. yyValue = null; return new SemanticValue(yyValue, yyChoice1, yyError); } case '\n': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } // Done. yyError = yyError.select("line terminator expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CSpacing.EndOfFile. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pEndOfFile(final int yyStart) throws IOException { int yyC; boolean yyPredMatched; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyPredMatched = false; yyC = character(yyStart); if (-1 != yyC) { yyPredMatched = true; } if (! yyPredMatched) { yyValue = null; return new SemanticValue(yyValue, yyStart, yyError); } else { yyError = yyError.select("end of file expected", yyStart); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CSpacing.Directive. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDirective(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; Result yyPredResult; int yyBase; int yyRepetition1; boolean yyRepeated1; int yyOption1; String yyOpValue1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if ('#' == yyC) { yyIndex = yyStart + 1; final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (' ' == yyC) { yyIndex = yyChoice1 + 1; yyResult = pLineNumber(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String line = yyResult.semanticValue(); yyC = character(yyResult.index); if (' ' == yyC) { yyIndex = yyResult.index + 1; yyC = character(yyIndex); if ('\"' == yyC) { yyIndex = yyIndex + 1; yyResult = pFileName(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String file = yyResult.semanticValue(); yyC = character(yyResult.index); if ('\"' == yyC) { yyIndex = yyResult.index + 1; yyOption1 = yyIndex; yyOpValue1 = null; yyBase = yyOption1; yyC = character(yyBase); if (' ' == yyC) { yyIndex = yyOption1 + 1; yyC = character(yyIndex); if ('1' == yyC) { yyIndex = yyIndex + 1; final String v$el$1 = " 1"; yyOption1 = yyIndex; yyOpValue1 = v$el$1; } else { yyError = yyError.select("' 1' expected", yyBase); } } else { yyError = yyError.select("' 1' expected", yyBase); } { // Start scope for f1. final String f1 = yyOpValue1; yyOpValue1 = null; yyBase = yyOption1; yyC = character(yyBase); if (' ' == yyC) { yyIndex = yyOption1 + 1; yyC = character(yyIndex); if ('2' == yyC) { yyIndex = yyIndex + 1; final String v$el$2 = " 2"; yyOption1 = yyIndex; yyOpValue1 = v$el$2; } else { yyError = yyError.select("' 2' expected", yyBase); } } else { yyError = yyError.select("' 2' expected", yyBase); } { // Start scope for f2. final String f2 = yyOpValue1; yyOpValue1 = null; yyBase = yyOption1; yyC = character(yyBase); if (' ' == yyC) { yyIndex = yyOption1 + 1; yyC = character(yyIndex); if ('3' == yyC) { yyIndex = yyIndex + 1; final String v$el$3 = " 3"; yyOption1 = yyIndex; yyOpValue1 = v$el$3; } else { yyError = yyError.select("' 3' expected", yyBase); } } else { yyError = yyError.select("' 3' expected", yyBase); } { // Start scope for f3. final String f3 = yyOpValue1; yyOpValue1 = null; yyBase = yyOption1; yyC = character(yyBase); if (' ' == yyC) { yyIndex = yyOption1 + 1; yyC = character(yyIndex); if ('4' == yyC) { yyIndex = yyIndex + 1; final String v$el$4 = " 4"; yyOption1 = yyIndex; yyOpValue1 = v$el$4; } else { yyError = yyError.select("' 4' expected", yyBase); } } else { yyError = yyError.select("' 4' expected", yyBase); } { // Start scope for f4. final String f4 = yyOpValue1; yyPredResult = pLineTerminator(yyOption1); yyError = yyPredResult.select(yyError); if (yyPredResult.hasValue()) { final int lineNo = Integer.parseInt(line); if (RELOCATE) setLocation(yyStart, file, lineNo-1, FIRST_COLUMN); yyState.lineMarker(file, lineNo, f1, f2, f3, f4, location(yyStart)); yyValue = null; return new SemanticValue(yyValue, yyOption1, yyError); } } // End scope for f4. } // End scope for f3. } // End scope for f2. } // End scope for f1. } } } } } } // Nested alternative 2. yyRepetition1 = yyChoice1; while (true) { yyResult = pSpace(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } break; } { // Start scope for nested choice. final int yyChoice2 = yyRepetition1; // Nested alternative 1. yyC = character(yyChoice2); if (-1 != yyC) { yyIndex = yyChoice2 + 1; switch (yyC) { case 'p': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; if ('r' == yyC) { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; if ('a' == yyC) { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; if ('g' == yyC) { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; if ('m' == yyC) { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; if ('a' == yyC) { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; if (' ' == yyC) { yyResult = pPragma(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String pragma = yyResult.semanticValue(); yyPredResult = pLineTerminator(yyResult.index); yyError = yyPredResult.select(yyError); if (yyPredResult.hasValue()) { yyState.pragma(pragma, location(yyStart)); yyValue = null; return yyResult.createValue(yyValue, yyError); } } } } } } } } } } } } } } } break; case 'i': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; if ('d' == yyC) { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; if ('e' == yyC) { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; if ('n' == yyC) { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; if ('t' == yyC) { yyRepetition1 = yyIndex; yyRepeated1 = false; while (true) { yyResult = pSpace(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; yyRepeated1 = true; continue; } break; } if (yyRepeated1) { yyC = character(yyRepetition1); if ('\"' == yyC) { yyIndex = yyRepetition1 + 1; yyResult = pFileName(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String s = yyResult.semanticValue(); yyC = character(yyResult.index); if ('\"' == yyC) { yyIndex = yyResult.index + 1; yyPredResult = pLineTerminator(yyIndex); yyError = yyPredResult.select(yyError); if (yyPredResult.hasValue()) { yyState.ident(s, location(yyStart)); yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } } } } } } } } } } } } } } break; default: /* No match. */ } } } // End scope for nested choice. } // Alternative 2. yyValue = null; return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.CSpacing.LineNumber. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pLineNumber(final int yyStart) throws IOException { int yyC; int yyIndex; int yyRepetition1; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; continue; } default: /* No match. */ } } break; } yyValue = difference(yyStart, yyRepetition1); return new SemanticValue(yyValue, yyRepetition1, yyError); } default: /* No match. */ } } // Done. yyError = yyError.select("line number expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CSpacing.FileName. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pFileName(final int yyStart) throws IOException { int yyC; int yyIndex; int yyRepetition1; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyRepetition1 = yyStart; while (true) { final int yyChoice1 = yyRepetition1; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case '\\': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; yyRepetition1 = yyIndex; continue; } } break; default: /* No match. */ } } // Nested alternative 2. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case '\"': case '\\': /* No match. */ break; default: { yyRepetition1 = yyIndex; continue; } } } break; } yyValue = difference(yyStart, yyRepetition1); return new SemanticValue(yyValue, yyRepetition1, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.CSpacing.Pragma. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pPragma(final int yyStart) throws IOException { int yyC; int yyIndex; int yyRepetition1; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyRepetition1 = yyStart; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '\n': case '\r': /* No match. */ break; default: { yyRepetition1 = yyIndex; continue; } } } break; } yyValue = difference(yyStart, yyRepetition1); return new SemanticValue(yyValue, yyRepetition1, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieSymbol.Symbol. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pSymbol(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fSymbol) yyColumn.chunk1.fSymbol = pSymbol$1(yyStart); return yyColumn.chunk1.fSymbol; } /** Actually parse xtc.lang.jeannie.JeannieSymbol.Symbol. */ private Result pSymbol$1(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbolCharacters(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyResult = pSpacing(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieSymbol.SymbolCharacters. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pSymbolCharacters(final int yyStart) throws IOException { int yyC; int yyIndex; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case '>': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case '>': { final int yyChoice2 = yyIndex; // Nested alternative 1. yyC = character(yyChoice2); if (-1 != yyC) { yyIndex = yyChoice2 + 1; switch (yyC) { case '>': { final int yyChoice3 = yyIndex; // Nested alternative 1. yyC = character(yyChoice3); if (-1 != yyC) { yyIndex = yyChoice3 + 1; if ('=' == yyC) { yyValue = ">>>="; return new SemanticValue(yyValue, yyIndex, yyError); } } // Nested alternative 2. yyValue = ">>>"; return new SemanticValue(yyValue, yyChoice3, yyError); } case '=': { yyValue = ">>="; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } // Nested alternative 2. yyValue = ">>"; return new SemanticValue(yyValue, yyChoice2, yyError); } case '=': { yyValue = ">="; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } // Nested alternative 2. yyValue = ">"; return new SemanticValue(yyValue, yyChoice1, yyError); } case '<': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case '<': { final int yyChoice2 = yyIndex; // Nested alternative 1. yyC = character(yyChoice2); if (-1 != yyC) { yyIndex = yyChoice2 + 1; if ('=' == yyC) { yyValue = "<<="; return new SemanticValue(yyValue, yyIndex, yyError); } } // Nested alternative 2. yyValue = "<<"; return new SemanticValue(yyValue, yyChoice2, yyError); } case '=': { yyValue = "<="; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } // Nested alternative 2. yyValue = "<"; return new SemanticValue(yyValue, yyChoice1, yyError); } case '.': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; if ('.' == yyC) { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; if ('.' == yyC) { yyValue = "..."; return new SemanticValue(yyValue, yyIndex, yyError); } } } } // Nested alternative 2. yyValue = "."; return new SemanticValue(yyValue, yyChoice1, yyError); } case '+': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case '=': { yyValue = "+="; return new SemanticValue(yyValue, yyIndex, yyError); } case '+': { yyValue = "++"; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } // Nested alternative 2. yyValue = "+"; return new SemanticValue(yyValue, yyChoice1, yyError); } case '-': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case '=': { yyValue = "-="; return new SemanticValue(yyValue, yyIndex, yyError); } case '-': { yyValue = "--"; return new SemanticValue(yyValue, yyIndex, yyError); } case '>': { yyValue = "->"; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } // Nested alternative 2. yyValue = "-"; return new SemanticValue(yyValue, yyChoice1, yyError); } case '*': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; if ('=' == yyC) { yyValue = "*="; return new SemanticValue(yyValue, yyIndex, yyError); } } // Nested alternative 2. yyValue = "*"; return new SemanticValue(yyValue, yyChoice1, yyError); } case '/': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; if ('=' == yyC) { yyValue = "/="; return new SemanticValue(yyValue, yyIndex, yyError); } } // Nested alternative 2. yyValue = "/"; return new SemanticValue(yyValue, yyChoice1, yyError); } case '%': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; if ('=' == yyC) { yyValue = "%="; return new SemanticValue(yyValue, yyIndex, yyError); } } // Nested alternative 2. yyValue = "%"; return new SemanticValue(yyValue, yyChoice1, yyError); } case '&': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case '=': { yyValue = "&="; return new SemanticValue(yyValue, yyIndex, yyError); } case '&': { yyValue = "&&"; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } // Nested alternative 2. yyValue = "&"; return new SemanticValue(yyValue, yyChoice1, yyError); } case '^': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; if ('=' == yyC) { yyValue = "^="; return new SemanticValue(yyValue, yyIndex, yyError); } } // Nested alternative 2. yyValue = "^"; return new SemanticValue(yyValue, yyChoice1, yyError); } case '|': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case '=': { yyValue = "|="; return new SemanticValue(yyValue, yyIndex, yyError); } case '|': { yyValue = "||"; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } // Nested alternative 2. yyValue = "|"; return new SemanticValue(yyValue, yyChoice1, yyError); } case '=': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; if ('=' == yyC) { yyValue = "=="; return new SemanticValue(yyValue, yyIndex, yyError); } } // Nested alternative 2. yyValue = "="; return new SemanticValue(yyValue, yyChoice1, yyError); } case '!': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; if ('=' == yyC) { yyValue = "!="; return new SemanticValue(yyValue, yyIndex, yyError); } } // Nested alternative 2. yyValue = "!"; return new SemanticValue(yyValue, yyChoice1, yyError); } case ';': { yyValue = ";"; return new SemanticValue(yyValue, yyIndex, yyError); } case ':': { yyValue = ":"; return new SemanticValue(yyValue, yyIndex, yyError); } case ',': { yyValue = ","; return new SemanticValue(yyValue, yyIndex, yyError); } case '{': { yyValue = "{"; return new SemanticValue(yyValue, yyIndex, yyError); } case '}': { yyValue = "}"; return new SemanticValue(yyValue, yyIndex, yyError); } case '(': { yyValue = "("; return new SemanticValue(yyValue, yyIndex, yyError); } case ')': { yyValue = ")"; return new SemanticValue(yyValue, yyIndex, yyError); } case '[': { yyValue = "["; return new SemanticValue(yyValue, yyIndex, yyError); } case ']': { yyValue = "]"; return new SemanticValue(yyValue, yyIndex, yyError); } case '`': { yyValue = "`"; return new SemanticValue(yyValue, yyIndex, yyError); } case '~': { yyValue = "~"; return new SemanticValue(yyValue, yyIndex, yyError); } case '?': { yyValue = "?"; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } // Done. yyError = yyError.select("symbol characters expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CIdentifier.Identifier. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCIdentifier$Identifier(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fCIdentifier$Identifier) yyColumn.chunk1.fCIdentifier$Identifier = pCIdentifier$Identifier$1(yyStart); return yyColumn.chunk1.fCIdentifier$Identifier; } /** Actually parse xtc.lang.CIdentifier.Identifier. */ private Result pCIdentifier$Identifier$1(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pCIdentifier$Word(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); if (! contains(C_KEYWORDS, toText(yyValue))) { return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("identifier expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CIdentifier.Keyword. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pKeyword(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fKeyword) yyColumn.chunk1.fKeyword = pKeyword$1(yyStart); return yyColumn.chunk1.fKeyword; } /** Actually parse xtc.lang.CIdentifier.Keyword. */ private Result pKeyword$1(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pCIdentifier$Word(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); if (contains(C_KEYWORDS, toText(yyValue))) { return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("keyword expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CIdentifier.Word. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCIdentifier$Word(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk2) yyColumn.chunk2 = new Chunk2(); if (null == yyColumn.chunk2.fCIdentifier$Word) yyColumn.chunk2.fCIdentifier$Word = pCIdentifier$Word$1(yyStart); return yyColumn.chunk2.fCIdentifier$Word; } /** Actually parse xtc.lang.CIdentifier.Word. */ private Result pCIdentifier$Word$1(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pCIdentifier$WordCharacters(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyResult = pSpacing(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CIdentifier.WordCharacters. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCIdentifier$WordCharacters(final int yyStart) throws IOException { int yyC; int yyIndex; int yyRepetition1; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; if ((('A' <= yyC) && (yyC <= 'Z')) || ('_' == yyC) || (('a' <= yyC) && (yyC <= 'z'))) { yyRepetition1 = yyIndex; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; if ((('0' <= yyC) && (yyC <= '9')) || (('A' <= yyC) && (yyC <= 'Z')) || ('_' == yyC) || (('a' <= yyC) && (yyC <= 'z'))) { yyRepetition1 = yyIndex; continue; } } break; } yyValue = difference(yyStart, yyRepetition1); return new SemanticValue(yyValue, yyRepetition1, yyError); } } // Done. yyError = yyError.select("word characters expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.CContext.TypedefContext. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pTypedefContext(final int yyStart) throws IOException { Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyState.typedef(); yyValue = null; return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.CContext.ParameterContext. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pParameterContext(final int yyStart) throws IOException { Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyState.parameters(); yyValue = null; return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.CContext.FunctionDeclaratorContext. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pFunctionDeclaratorContext(final int yyStart) throws IOException { Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyState.functionDeclarator(); yyValue = null; return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.CContext.TypeSpecContext. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pTypeSpecContext(final int yyStart) throws IOException { Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyState.typeSpecifier(); yyValue = null; return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.CContext.PushScope. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pPushScope(final int yyStart) throws IOException { Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyState.pushScope(); yyValue = null; return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.CContext.PopScope. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pPopScope(final int yyStart) throws IOException { Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyState.popScope(); yyValue = null; return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.CContext.EnterStructure. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pEnterStructure(final int yyStart) throws IOException { Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyState.enterStructure(); yyValue = null; return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.CContext.ExitStructure. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pExitStructure(final int yyStart) throws IOException { Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyState.exitStructure(); yyValue = null; return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaType.ResultType. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pResultType(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk2) yyColumn.chunk2 = new Chunk2(); if (null == yyColumn.chunk2.fResultType) yyColumn.chunk2.fResultType = pResultType$1(yyStart); return yyColumn.chunk2.fResultType; } /** Actually parse xtc.lang.JavaType.ResultType. */ private Result pResultType$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Void>. yyResult = pVoidType(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <Regular>. yyResult = pType(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaType.VoidType. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pVoidType(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Void>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("void")) { yyValue = GNode.create("VoidType", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("void type expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaType.Type. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pType(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk2) yyColumn.chunk2 = new Chunk2(); if (null == yyColumn.chunk2.fType) yyColumn.chunk2.fType = pType$1(yyStart); return yyColumn.chunk2.fType; } /** Actually parse xtc.lang.JavaType.Type. */ private Result pType$1(final int yyStart) throws IOException { Result yyResult; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Type>. yyResult = pJavaType$TypeName(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pDimensions(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$2. final Node v$g$2 = yyOpValue1; yyValue = GNode.create("Type", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$2. } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaType.TypeName. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaType$TypeName(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk2) yyColumn.chunk2 = new Chunk2(); if (null == yyColumn.chunk2.fJavaType$TypeName) yyColumn.chunk2.fJavaType$TypeName = pJavaType$TypeName$1(yyStart); return yyColumn.chunk2.fJavaType$TypeName; } /** Actually parse xtc.lang.JavaType.TypeName. */ private Result pJavaType$TypeName$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Basic>. yyResult = pPrimitiveType(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <Class>. yyResult = pQualifiedIdentifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaType.PrimitiveType. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pPrimitiveType(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk2) yyColumn.chunk2 = new Chunk2(); if (null == yyColumn.chunk2.fPrimitiveType) yyColumn.chunk2.fPrimitiveType = pPrimitiveType$1(yyStart); return yyColumn.chunk2.fPrimitiveType; } /** Actually parse xtc.lang.JavaType.PrimitiveType. */ private Result pPrimitiveType$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Byte>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("byte")) { final String v$g$1 = "byte"; yyValue = GNode.create("PrimitiveType", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Short>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("short")) { final String v$g$2 = "short"; yyValue = GNode.create("PrimitiveType", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Char>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("char")) { final String v$g$3 = "char"; yyValue = GNode.create("PrimitiveType", v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Int>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("int")) { final String v$g$4 = "int"; yyValue = GNode.create("PrimitiveType", v$g$4); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Long>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("long")) { final String v$g$5 = "long"; yyValue = GNode.create("PrimitiveType", v$g$5); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Float>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("float")) { final String v$g$6 = "float"; yyValue = GNode.create("PrimitiveType", v$g$6); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Double>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("double")) { final String v$g$7 = "double"; yyValue = GNode.create("PrimitiveType", v$g$7); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Boolean>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("boolean")) { final String v$g$8 = "boolean"; yyValue = GNode.create("PrimitiveType", v$g$8); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("primitive type expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaType.Dimensions. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDimensions(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk2) yyColumn.chunk2 = new Chunk2(); if (null == yyColumn.chunk2.fDimensions) yyColumn.chunk2.fDimensions = pDimensions$1(yyStart); return yyColumn.chunk2.fDimensions; } /** Actually parse xtc.lang.JavaType.Dimensions. */ private Result pDimensions$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pDimensions$$Plus1(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<String> v$g$1 = yyResult.semanticValue(); yyValue = GNode.createFromPair("Dimensions", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal xtc.lang.jeannie.Jeannie.Dimensions$$Plus1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDimensions$$Plus1(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk2) yyColumn.chunk2 = new Chunk2(); if (null == yyColumn.chunk2.fDimensions$$Plus1) yyColumn.chunk2.fDimensions$$Plus1 = pDimensions$$Plus1$1(yyStart); return yyColumn.chunk2.fDimensions$$Plus1; } /** Actually parse xtc.lang.jeannie.Jeannie.Dimensions$$Plus1. */ private Result pDimensions$$Plus1$1(final int yyStart) throws IOException { Result yyResult; int yyBase; Pair<String> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("[")) { final String v$el$1 = "["; yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pDimensions$$Plus1(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<String> v$2 = yyResult.semanticValue(); yyValue = new Pair<String>(v$el$1, v$2); return yyResult.createValue(yyValue, yyError); } // Nested alternative 2. yyValue = new Pair<String>(v$el$1); return new SemanticValue(yyValue, yyChoice1, yyError); } else { yyError = yyError.select("']' expected", yyBase); } } // Done. yyError = yyError.select("dimensions expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.Literal. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pLiteral(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <FloatingPoint>. yyResult = pFloatingPointLiteral(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyResult = pSpacing(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { return yyResult.createValue(yyValue, yyError); } } // Alternative <Integer>. yyResult = pIntegerLiteral(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyResult = pSpacing(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { return yyResult.createValue(yyValue, yyError); } } // Alternative <Character>. yyResult = pJavaConstant$CharacterLiteral(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyResult = pSpacing(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { return yyResult.createValue(yyValue, yyError); } } // Alternative <String>. yyResult = pJavaConstant$StringLiteral(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyResult = pSpacing(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { return yyResult.createValue(yyValue, yyError); } } // Alternative <True>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("true")) { final String v$g$1 = "true"; yyValue = GNode.create("BooleanLiteral", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <False>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("false")) { final String v$g$2 = "false"; yyValue = GNode.create("BooleanLiteral", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Null>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("null")) { yyValue = GNode.create("NullLiteral", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("literal expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.IntegerLiteral. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pIntegerLiteral(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Hex>. yyResult = pHexLiteral(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("IntegerLiteral", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Octal>. yyResult = pOctalLiteral(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("IntegerLiteral", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Decimal>. yyResult = pDecimalLiteral(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$3 = yyResult.semanticValue(); yyValue = GNode.create("IntegerLiteral", v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.HexLiteral. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pHexLiteral(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyOption1; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pHexNumeral(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyC = character(yyOption1); if (-1 != yyC) { yyIndex = yyOption1 + 1; switch (yyC) { case 'L': case 'l': { yyOption1 = yyIndex; } break; default: /* No match. */ } } yyValue = difference(yyStart, yyOption1); return new SemanticValue(yyValue, yyOption1, yyError); } // Done. yyError = yyError.select("hex literal expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.OctalLiteral. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pOctalLiteral(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyOption1; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pOctalNumeral(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyC = character(yyOption1); if (-1 != yyC) { yyIndex = yyOption1 + 1; switch (yyC) { case 'L': case 'l': { yyOption1 = yyIndex; } break; default: /* No match. */ } } yyValue = difference(yyStart, yyOption1); return new SemanticValue(yyValue, yyOption1, yyError); } // Done. yyError = yyError.select("octal literal expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.DecimalLiteral. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDecimalLiteral(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyOption1; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pDecimalNumeral(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyC = character(yyOption1); if (-1 != yyC) { yyIndex = yyOption1 + 1; switch (yyC) { case 'L': case 'l': { yyOption1 = yyIndex; } break; default: /* No match. */ } } yyValue = difference(yyStart, yyOption1); return new SemanticValue(yyValue, yyOption1, yyError); } // Done. yyError = yyError.select("decimal literal expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.DecimalNumeral. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDecimalNumeral(final int yyStart) throws IOException { int yyC; int yyIndex; int yyRepetition1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case '0': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; continue; } default: /* No match. */ } } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } default: /* No match. */ } } // Done. yyError = yyError.select("decimal numeral expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.HexNumeral. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pHexNumeral(final int yyStart) throws IOException { int yyC; int yyIndex; int yyRepetition1; boolean yyRepeated1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if ('0' == yyC) { yyIndex = yyStart + 1; yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case 'X': case 'x': { yyRepetition1 = yyIndex; yyRepeated1 = false; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyRepetition1 = yyIndex; yyRepeated1 = true; continue; } default: /* No match. */ } } break; } if (yyRepeated1) { yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } } break; default: /* No match. */ } } } // Done. yyError = yyError.select("hex numeral expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.OctalNumeral. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pOctalNumeral(final int yyStart) throws IOException { int yyC; int yyIndex; int yyRepetition1; boolean yyRepeated1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if ('0' == yyC) { yyIndex = yyStart + 1; yyRepetition1 = yyIndex; yyRepeated1 = false; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { yyRepetition1 = yyIndex; yyRepeated1 = true; continue; } default: /* No match. */ } } break; } if (yyRepeated1) { yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } } // Done. yyError = yyError.select("octal numeral expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.FloatingPointLiteral. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pFloatingPointLiteral(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pFloatingPointString(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("FloatingPointLiteral", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.FloatingPointString. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pFloatingPointString(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyRepetition1; boolean yyRepeated1; int yyOption1; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyRepetition1 = yyStart; yyRepeated1 = false; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; yyRepeated1 = true; continue; } default: /* No match. */ } } break; } if (yyRepeated1) { yyC = character(yyRepetition1); if ('.' == yyC) { yyIndex = yyRepetition1 + 1; yyRepetition1 = yyIndex; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; continue; } default: /* No match. */ } } break; } yyOption1 = yyRepetition1; yyResult = pJavaConstant$Exponent(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyC = character(yyOption1); if (-1 != yyC) { yyIndex = yyOption1 + 1; switch (yyC) { case 'D': case 'F': case 'd': case 'f': { yyOption1 = yyIndex; } break; default: /* No match. */ } } yyValue = difference(yyStart, yyOption1); return new SemanticValue(yyValue, yyOption1, yyError); } } // Alternative 2. yyC = character(yyStart); if ('.' == yyC) { yyIndex = yyStart + 1; yyRepetition1 = yyIndex; yyRepeated1 = false; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; yyRepeated1 = true; continue; } default: /* No match. */ } } break; } if (yyRepeated1) { yyOption1 = yyRepetition1; yyResult = pJavaConstant$Exponent(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyC = character(yyOption1); if (-1 != yyC) { yyIndex = yyOption1 + 1; switch (yyC) { case 'D': case 'F': case 'd': case 'f': { yyOption1 = yyIndex; } break; default: /* No match. */ } } yyValue = difference(yyStart, yyOption1); return new SemanticValue(yyValue, yyOption1, yyError); } } // Alternative 3. yyRepetition1 = yyStart; yyRepeated1 = false; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; yyRepeated1 = true; continue; } default: /* No match. */ } } break; } if (yyRepeated1) { final int yyChoice1 = yyRepetition1; // Nested alternative 1. yyResult = pJavaConstant$Exponent(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyC = character(yyOption1); if (-1 != yyC) { yyIndex = yyOption1 + 1; switch (yyC) { case 'D': case 'F': case 'd': case 'f': { yyOption1 = yyIndex; } break; default: /* No match. */ } } yyValue = difference(yyStart, yyOption1); return new SemanticValue(yyValue, yyOption1, yyError); } // Nested alternative 2. yyOption1 = yyChoice1; yyResult = pJavaConstant$Exponent(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyC = character(yyOption1); if (-1 != yyC) { yyIndex = yyOption1 + 1; switch (yyC) { case 'D': case 'F': case 'd': case 'f': { yyValue = difference(yyStart, yyIndex); return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } } // Done. yyError = yyError.select("floating point string expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.Exponent. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaConstant$Exponent(final int yyStart) throws IOException { int yyC; int yyIndex; int yyRepetition1; boolean yyRepeated1; int yyOption1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case 'E': case 'e': { yyOption1 = yyIndex; yyC = character(yyOption1); if (-1 != yyC) { yyIndex = yyOption1 + 1; switch (yyC) { case '+': case '-': { yyOption1 = yyIndex; } break; default: /* No match. */ } } yyRepetition1 = yyOption1; yyRepeated1 = false; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { yyRepetition1 = yyIndex; yyRepeated1 = true; continue; } default: /* No match. */ } } break; } if (yyRepeated1) { yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } } break; default: /* No match. */ } } // Done. yyError = yyError.select("exponent expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.CharacterLiteral. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaConstant$CharacterLiteral(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaConstant$CharacterConstant(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("CharacterLiteral", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.StringLiteral. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaConstant$StringLiteral(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaConstant$StringConstant(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("StringLiteral", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.CharacterConstant. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaConstant$CharacterConstant(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if ('\'' == yyC) { yyIndex = yyStart + 1; yyResult = pJavaConstant$CharacterConstant$$Choice1(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyC = character(yyResult.index); if ('\'' == yyC) { yyIndex = yyResult.index + 1; yyValue = difference(yyStart, yyIndex); return new SemanticValue(yyValue, yyIndex, yyError); } } } // Done. yyError = yyError.select("character constant expected", yyStart); return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JavaConstant.CharacterConstant$$Choice1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaConstant$CharacterConstant$$Choice1(final int yyStart) throws IOException { int yyC; int yyIndex; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case '\\': { final int yyChoice1 = yyIndex; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case '\"': case '\'': case '\\': case 'b': case 'f': case 'n': case 'r': case 't': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } case 'u': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } } break; default: /* No match. */ } } } break; default: /* No match. */ } } } break; default: /* No match. */ } } } break; default: /* No match. */ } } // Nested alternative 2. { // Start scope for nested choice. final int yyChoice2 = yyChoice1; // Nested alternative 1. yyC = character(yyChoice2); if (-1 != yyC) { yyIndex = yyChoice2 + 1; switch (yyC) { case '0': case '1': case '2': case '3': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } } break; default: /* No match. */ } } } break; default: /* No match. */ } } // Nested alternative 2. yyC = character(yyChoice2); if (-1 != yyC) { yyIndex = yyChoice2 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { final int yyChoice3 = yyIndex; // Nested alternative 1. yyC = character(yyChoice3); if (-1 != yyC) { yyIndex = yyChoice3 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } default: /* No match. */ } } // Nested alternative 2. yyValue = null; return new SemanticValue(yyValue, yyChoice3, yyError); } default: /* No match. */ } } } // End scope for nested choice. } break; default: /* No match. */ } } // Alternative 2. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; switch (yyC) { case '\'': case '\\': /* No match. */ break; default: { yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } } } // Done. yyError = yyError.select("character constant expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.StringConstant. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaConstant$StringConstant(final int yyStart) throws IOException { int yyC; int yyIndex; int yyRepetition1; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if ('\"' == yyC) { yyIndex = yyStart + 1; yyRepetition1 = yyIndex; while (true) { final int yyChoice1 = yyRepetition1; // Nested alternative 1. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case '\\': { final int yyChoice2 = yyIndex; // Nested alternative 1. yyC = character(yyChoice2); if (-1 != yyC) { yyIndex = yyChoice2 + 1; switch (yyC) { case '\"': case '\'': case '\\': case 'b': case 'f': case 'n': case 'r': case 't': { yyRepetition1 = yyIndex; continue; } case 'u': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { yyRepetition1 = yyIndex; continue; } default: /* No match. */ } } } break; default: /* No match. */ } } } break; default: /* No match. */ } } } break; default: /* No match. */ } } } break; default: /* No match. */ } } // Nested alternative 2. { // Start scope for nested choice. final int yyChoice3 = yyChoice2; // Nested alternative 1. yyC = character(yyChoice3); if (-1 != yyC) { yyIndex = yyChoice3 + 1; switch (yyC) { case '0': case '1': case '2': case '3': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { yyC = character(yyIndex); if (-1 != yyC) { yyIndex = yyIndex + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { yyRepetition1 = yyIndex; continue; } default: /* No match. */ } } } break; default: /* No match. */ } } } break; default: /* No match. */ } } // Nested alternative 2. yyC = character(yyChoice3); if (-1 != yyC) { yyIndex = yyChoice3 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { final int yyChoice4 = yyIndex; // Nested alternative 1. yyC = character(yyChoice4); if (-1 != yyC) { yyIndex = yyChoice4 + 1; switch (yyC) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { yyRepetition1 = yyIndex; continue; } default: /* No match. */ } } // Nested alternative 2. yyRepetition1 = yyChoice4; continue; } default: /* No match. */ } } } // End scope for nested choice. } break; default: /* No match. */ } } // Nested alternative 2. yyC = character(yyChoice1); if (-1 != yyC) { yyIndex = yyChoice1 + 1; switch (yyC) { case '\"': case '\\': /* No match. */ break; default: { yyRepetition1 = yyIndex; continue; } } } break; } yyC = character(yyRepetition1); if ('\"' == yyC) { yyIndex = yyRepetition1 + 1; yyValue = difference(yyStart, yyIndex); return new SemanticValue(yyValue, yyIndex, yyError); } } // Done. yyError = yyError.select("string constant expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaIdentifier.QualifiedIdentifier. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pQualifiedIdentifier(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk2) yyColumn.chunk2 = new Chunk2(); if (null == yyColumn.chunk2.fQualifiedIdentifier) yyColumn.chunk2.fQualifiedIdentifier = pQualifiedIdentifier$1(yyStart); return yyColumn.chunk2.fQualifiedIdentifier; } /** Actually parse xtc.lang.JavaIdentifier.QualifiedIdentifier. */ private Result pQualifiedIdentifier$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaIdentifier$Identifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyResult = pQualifiedIdentifier$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<String> v$g$2 = yyResult.semanticValue(); yyValue = GNode.createFromPair("QualifiedIdentifier", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal * xtc.lang.jeannie.Jeannie.QualifiedIdentifier$$Star1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pQualifiedIdentifier$$Star1(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk2) yyColumn.chunk2 = new Chunk2(); if (null == yyColumn.chunk2.fQualifiedIdentifier$$Star1) yyColumn.chunk2.fQualifiedIdentifier$$Star1 = pQualifiedIdentifier$$Star1$1(yyStart); return yyColumn.chunk2.fQualifiedIdentifier$$Star1; } /** Actually parse xtc.lang.jeannie.Jeannie.QualifiedIdentifier$$Star1. */ private Result pQualifiedIdentifier$$Star1$1(final int yyStart) throws IOException { Result yyResult; Pair<String> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue(".")) { yyResult = pJavaIdentifier$Identifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$el$1 = yyResult.semanticValue(); yyResult = pQualifiedIdentifier$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<String> v$2 = yyResult.semanticValue(); yyValue = new Pair<String>(v$el$1, v$2); return yyResult.createValue(yyValue, yyError); } } } // Alternative 2. yyValue = Pair.empty(); return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaIdentifier.Identifier. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaIdentifier$Identifier(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk2) yyColumn.chunk2 = new Chunk2(); if (null == yyColumn.chunk2.fJavaIdentifier$Identifier) yyColumn.chunk2.fJavaIdentifier$Identifier = pJavaIdentifier$Identifier$1(yyStart); return yyColumn.chunk2.fJavaIdentifier$Identifier; } /** Actually parse xtc.lang.JavaIdentifier.Identifier. */ private Result pJavaIdentifier$Identifier$1(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaIdentifier$Word(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); if (! contains(JAVA_KEYWORDS, toText(yyValue))) { return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("identifier expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaIdentifier.Word. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaIdentifier$Word(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk3) yyColumn.chunk3 = new Chunk3(); if (null == yyColumn.chunk3.fJavaIdentifier$Word) yyColumn.chunk3.fJavaIdentifier$Word = pJavaIdentifier$Word$1(yyStart); return yyColumn.chunk3.fJavaIdentifier$Word; } /** Actually parse xtc.lang.JavaIdentifier.Word. */ private Result pJavaIdentifier$Word$1(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaIdentifier$WordCharacters(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyResult = pSpacing(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaIdentifier.WordCharacters. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaIdentifier$WordCharacters(final int yyStart) throws IOException { int yyC; int yyIndex; int yyRepetition1; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if (-1 != yyC) { yyIndex = yyStart + 1; final char start = (char)yyC; if (Character.isJavaIdentifierStart(start)) { yyRepetition1 = yyIndex; while (true) { yyC = character(yyRepetition1); if (-1 != yyC) { yyIndex = yyRepetition1 + 1; final char part = (char)yyC; if (Character.isJavaIdentifierPart(part)) { yyRepetition1 = yyIndex; continue; } } break; } yyValue = difference(yyStart, yyRepetition1); return new SemanticValue(yyValue, yyRepetition1, yyError); } } // Done. yyError = yyError.select("word characters expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.TranslationUnit. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pTranslationUnit(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Node> yyRepValue1; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pDirective(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pSpacing(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pJeannieC$JavaImports(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$1. final Node v$g$1 = yyOpValue1; yyRepetition1 = yyOption1; yyRepValue1 = Pair.empty(); while (true) { yyResult = pExternalDeclaration(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$2, yyRepValue1); continue; } break; } { // Start scope for v$g$2. final Pair<Node> v$g$2 = yyRepValue1.reverse(); yyResult = pAnnotations(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyResult = pEndOfFile(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = GNode.create("TranslationUnit", v$g$2.size() + 2). add(v$g$1).addAll(v$g$2).add(v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } } // End scope for v$g$2. } // End scope for v$g$1. } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.Prelude. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pPrelude(final int yyStart) throws IOException { Result yyResult; Void yyValue; ParseError yyError = ParseError.DUMMY; // Reset the global state object. yyState.reset(column(yyStart).file); // Alternative 1. yyResult = pDirective(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pSpacing(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.ExternalDeclaration. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pExternalDeclaration(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk3) yyColumn.chunk3 = new Chunk3(); if (null == yyColumn.chunk3.fExternalDeclaration) yyColumn.chunk3.fExternalDeclaration = pExternalDeclaration$1(yyStart); return yyColumn.chunk3.fExternalDeclaration; } /** Actually parse xtc.lang.jeannie.JeannieC.ExternalDeclaration. */ private Result pExternalDeclaration$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Start a state modification. yyState.start(); // Alternative <Declaration>. yyState.mark(); yyResult = pJeannieC$Declaration(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node d = yyResult.semanticValue(); yyValue = yyState.annotate(d); // Commit the state modification. yyState.commit(); setLocation(yyValue, yyStart); return yyResult.createValue(yyValue, yyError); } // Alternative <Function>. yyResult = pFunctionDefinition(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node fd = yyResult.semanticValue(); yyValue = yyState.annotate(fd); // Commit the state modification. yyState.commit(); setLocation(yyValue, yyStart); return yyResult.createValue(yyValue, yyError); } // Alternative <Assembly>. yyResult = pAssemblyDefinition(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node a = yyResult.semanticValue(); yyValue = yyState.annotate(a); // Commit the state modification. yyState.commit(); setLocation(yyValue, yyStart); return yyResult.createValue(yyValue, yyError); } // Alternative <Empty>. yyResult = pEmptyDefinition(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node e = yyResult.semanticValue(); yyValue = yyState.annotate(e); // Commit the state modification. yyState.commit(); setLocation(yyValue, yyStart); return yyResult.createValue(yyValue, yyError); } // Abort the state modification. yyState.abort(); // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.FunctionDefinition. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pFunctionDefinition(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Object yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Definition>. yyOption1 = yyStart; yyOpValue1 = null; yyBase = yyOption1; yyResult = pKeyword(yyBase); if (yyResult.hasValue("__extension__")) { final String v$el$1 = "__extension__"; yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } else { yyError = yyError.select("'__extension__' expected", yyBase); } { // Start scope for v$g$1. final String v$g$1 = cast(yyOpValue1); yyOpValue1 = null; yyResult = pDeclarationSpecifiers(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$2. final Node v$g$2 = cast(yyOpValue1); yyResult = pJeannieC$Declarator(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyResult = pFunctionDeclaratorContext(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pDeclarationList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$3 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$3; } { // Start scope for v$g$4. final Node v$g$4 = cast(yyOpValue1); yyResult = pCompoundStatement(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$5 = yyResult.semanticValue(); yyValue = GNode.create("FunctionDefinition", v$g$1, v$g$2, v$g$3, v$g$4, v$g$5); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // End scope for v$g$4. } } } // End scope for v$g$2. } // End scope for v$g$1. // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.DeclarationList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDeclarationList(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; boolean yyRepeated1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <List>. yyRepetition1 = yyStart; yyRepeated1 = false; yyRepValue1 = Pair.empty(); while (true) { yyResult = pDeclarationListEntry(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepeated1 = true; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } if (yyRepeated1) { final Pair<Node> v$g$1 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("DeclarationList", v$g$1); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.DeclarationListEntry. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDeclarationListEntry(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Start a state modification. yyState.start(); // Alternative <Entry>. yyResult = pJeannieC$Declaration(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); // Commit the state modification. yyState.commit(); return yyResult.createValue(yyValue, yyError); } // Abort the state modification. yyState.abort(); // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.EmptyDefinition. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pEmptyDefinition(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue(";")) { yyValue = GNode.create("EmptyDefinition", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("empty definition expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.Annotations. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAnnotations(final int yyStart) throws IOException { Node yyValue; ParseError yyError = ParseError.DUMMY; // Start a state modification. yyState.start(); // Alternative 1. yyState.mark(); yyValue = yyState.annotate(null); // Commit the state modification. yyState.commit(); setLocation(yyValue, yyStart); return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.Declaration. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$Declaration(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Object yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyOption1 = yyStart; yyOpValue1 = null; yyBase = yyOption1; yyResult = pKeyword(yyBase); if (yyResult.hasValue("__extension__")) { final String v$el$1 = "__extension__"; yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } else { yyError = yyError.select("'__extension__' expected", yyBase); } { // Start scope for v$g$1. final String v$g$1 = cast(yyOpValue1); yyResult = pDeclarationSpecifiers(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pInitializedDeclaratorList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for l. final Node l = cast(yyOpValue1); if (yyState.isValid(l)) { yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("Declaration", v$g$1, v$g$2, l); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } // End scope for l. } } // End scope for v$g$1. // Done. yyError = yyError.select("declaration expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.DeclarationSpecifiers. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDeclarationSpecifiers(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk3) yyColumn.chunk3 = new Chunk3(); if (null == yyColumn.chunk3.fDeclarationSpecifiers) yyColumn.chunk3.fDeclarationSpecifiers = pDeclarationSpecifiers$1(yyStart); return yyColumn.chunk3.fDeclarationSpecifiers; } /** Actually parse xtc.lang.jeannie.JeannieC.DeclarationSpecifiers. */ private Result pDeclarationSpecifiers$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pDeclarationSpecifierPlus(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$g$1 = yyResult.semanticValue(); yyValue = GNode.createFromPair("DeclarationSpecifiers", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.DeclarationSpecifierPlus. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDeclarationSpecifierPlus(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; boolean yyRepeated1; Pair<Node> yyRepValue1; Pair<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyRepetition1 = yyStart; yyRepeated1 = false; yyRepValue1 = Pair.empty(); while (true) { yyResult = pDeclarationSpecifier(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepeated1 = true; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } if (yyRepeated1) { yyValue = yyRepValue1.reverse(); return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.DeclarationSpecifier. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDeclarationSpecifier(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <StorageClass>. yyResult = pStorageClassSpecifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <TypeSpecifier>. yyResult = pTypeSpecifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyResult = pTypeSpecContext(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { return yyResult.createValue(yyValue, yyError); } } // Alternative <TypeQualifier>. yyResult = pTypeQualifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative 4. yyResult = pKeyword(yyStart); if (yyResult.hasValue("inline")) { final String v$g$1 = "inline"; yyValue = GNode.create("FunctionSpecifier", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 5. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__inline")) { final String v$g$2 = "__inline"; yyValue = GNode.create("FunctionSpecifier", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 6. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__inline__")) { final String v$g$3 = "__inline__"; yyValue = GNode.create("FunctionSpecifier", v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Attribute>. yyResult = pAttributeSpecifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("declaration specifier expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.InitializedDeclaratorList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pInitializedDeclaratorList(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk3) yyColumn.chunk3 = new Chunk3(); if (null == yyColumn.chunk3.fInitializedDeclaratorList) yyColumn.chunk3.fInitializedDeclaratorList = pInitializedDeclaratorList$1(yyStart); return yyColumn.chunk3.fInitializedDeclaratorList; } /** Actually parse xtc.lang.jeannie.JeannieC.InitializedDeclaratorList. */ private Result pInitializedDeclaratorList$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <List>. yyResult = pInitializedDeclarator(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyResult = pInitializedDeclaratorList$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$g$2 = yyResult.semanticValue(); yyValue = GNode.createFromPair("InitializedDeclaratorList", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal * xtc.lang.jeannie.Jeannie.InitializedDeclaratorList$$Star1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pInitializedDeclaratorList$$Star1(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk3) yyColumn.chunk3 = new Chunk3(); if (null == yyColumn.chunk3.fInitializedDeclaratorList$$Star1) yyColumn.chunk3.fInitializedDeclaratorList$$Star1 = pInitializedDeclaratorList$$Star1$1(yyStart); return yyColumn.chunk3.fInitializedDeclaratorList$$Star1; } /** Actually parse xtc.lang.jeannie.Jeannie.InitializedDeclaratorList$$Star1. */ private Result pInitializedDeclaratorList$$Star1$1(final int yyStart) throws IOException { Result yyResult; Pair<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue(",")) { yyResult = pInitializedDeclarator(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyResult = pInitializedDeclaratorList$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$2 = yyResult.semanticValue(); yyValue = new Pair<Node>(v$el$1, v$2); return yyResult.createValue(yyValue, yyError); } } } // Alternative 2. yyValue = Pair.empty(); return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.InitializedDeclarator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pInitializedDeclarator(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyOption1 = yyStart; yyOpValue1 = null; yyResult = pAttributeSpecifierList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$1. final Node v$g$1 = yyOpValue1; yyResult = pJeannieC$Declarator(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pSimpleAssemblyExpression(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$3. final Node v$g$3 = yyOpValue1; yyOpValue1 = null; yyResult = pAttributeSpecifierList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$3 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$3; } { // Start scope for v$g$4. final Node v$g$4 = yyOpValue1; yyOpValue1 = null; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("=")) { yyResult = pInitializer(yyResult.index); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$4 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$4; } } else { yyError = yyError.select("'=' expected", yyBase); } { // Start scope for v$g$5. final Node v$g$5 = yyOpValue1; yyValue = GNode.create("InitializedDeclarator", v$g$1, v$g$2, v$g$3, v$g$4, v$g$5); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$5. } // End scope for v$g$4. } // End scope for v$g$3. } } // End scope for v$g$1. // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.StorageClassSpecifier. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pStorageClassSpecifier(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pKeyword(yyStart); if (yyResult.hasValue("auto")) { yyValue = GNode.create("AutoSpecifier", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 2. yyResult = pKeyword(yyStart); if (yyResult.hasValue("extern")) { yyValue = GNode.create("ExternSpecifier", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 3. yyResult = pKeyword(yyStart); if (yyResult.hasValue("register")) { yyValue = GNode.create("RegisterSpecifier", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 4. yyResult = pKeyword(yyStart); if (yyResult.hasValue("static")) { yyValue = GNode.create("StaticSpecifier", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 5. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__thread")) { yyValue = GNode.create("ThreadSpecifier", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 6. yyResult = pKeyword(yyStart); if (yyResult.hasValue("typedef")) { yyResult = pTypedefContext(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = GNode.create("TypedefSpecifier", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("storage class specifier expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.TypeQualifier. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pTypeQualifier(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pKeyword(yyStart); if (yyResult.hasValue("volatile")) { final String v$g$1 = "volatile"; yyValue = GNode.create("VolatileQualifier", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 2. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__volatile")) { final String v$g$2 = "__volatile"; yyValue = GNode.create("VolatileQualifier", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 3. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__volatile__")) { final String v$g$3 = "__volatile__"; yyValue = GNode.create("VolatileQualifier", v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 4. yyResult = pKeyword(yyStart); if (yyResult.hasValue("const")) { final String v$g$1 = "const"; yyValue = GNode.create("ConstantQualifier", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 5. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__const")) { final String v$g$2 = "__const"; yyValue = GNode.create("ConstantQualifier", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 6. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__const__")) { final String v$g$3 = "__const__"; yyValue = GNode.create("ConstantQualifier", v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 7. yyResult = pKeyword(yyStart); if (yyResult.hasValue("restrict")) { final String v$g$1 = "restrict"; yyValue = GNode.create("RestrictQualifier", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 8. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__restrict")) { final String v$g$2 = "__restrict"; yyValue = GNode.create("RestrictQualifier", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 9. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__restrict__")) { final String v$g$3 = "__restrict__"; yyValue = GNode.create("RestrictQualifier", v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("type qualifier expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.TypeSpecifier. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pTypeSpecifier(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Enumeration>. yyResult = pEnumerationTypeSpecifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <Structure>. yyResult = pStructureTypeSpecifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <Union>. yyResult = pUnionTypeSpecifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <Floating>. yyResult = pFloatingPointTypeSpecifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <Integer>. yyResult = pIntegerTypeSpecifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <JavaTyp>. yyResult = pJavaType(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative 7. yyResult = pCIdentifier$Identifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String id = yyResult.semanticValue(); if (yyState.isType(toText(id))) { yyValue = GNode.create("TypedefName", id); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative 8. yyResult = pTypeofKeyword(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pJeannieC$TypeName(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = GNode.create("TypeofSpecifier", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } // Nested alternative 2. yyResult = pCommaExpression(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = GNode.create("TypeofSpecifier", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } } // Alternative 9. yyResult = pKeyword(yyStart); if (yyResult.hasValue("void")) { yyValue = GNode.create("VoidTypeSpecifier", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 10. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__builtin_va_list")) { yyValue = GNode.create("VarArgListSpecifier", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("type specifier expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.EnumerationTypeSpecifier. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pEnumerationTypeSpecifier(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Object yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pKeyword(yyStart); if (yyResult.hasValue("enum")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pAttributeSpecifierList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$1. final Node v$g$1 = cast(yyOpValue1); final int yyChoice1 = yyOption1; // Nested alternative 1. yyOption1 = yyChoice1; yyOpValue1 = null; yyResult = pCIdentifier$Identifier(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final String v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$2. final String v$g$2 = cast(yyOpValue1); yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("{")) { yyResult = pEnumeratorList(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyOption1 = yyResult.index; } else { yyError = yyError.select("',' expected", yyBase); } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("}")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pAttributeSpecifierList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$3 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$3; } { // Start scope for v$g$4. final Node v$g$4 = cast(yyOpValue1); yyValue = GNode.create("EnumerationTypeDefinition", v$g$1, v$g$2, v$g$3, v$g$4); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$4. } else { yyError = yyError.select("'}' expected", yyBase); } } } else { yyError = yyError.select("'{' expected", yyBase); } } // End scope for v$g$2. // Nested alternative 2. yyResult = pCIdentifier$Identifier(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("EnumerationTypeReference", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // End scope for v$g$1. } // Done. yyError = yyError.select("enumeration type specifier expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.EnumeratorList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pEnumeratorList(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <List>. yyResult = pEnumerator(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pEnumerator(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } { // Start scope for v$g$2. final Pair<Node> v$g$2 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("EnumeratorList", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$g$2. } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.Enumerator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pEnumerator(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Enumerator>. yyResult = pCIdentifier$Identifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String id = yyResult.semanticValue(); yyState.bind(toText(id), false); yyOption1 = yyResult.index; yyOpValue1 = null; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("=")) { yyResult = pJeannieC$ConditionalExpression(yyResult.index); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } } else { yyError = yyError.select("'=' expected", yyBase); } { // Start scope for v$g$1. final Node v$g$1 = yyOpValue1; yyValue = GNode.create("Enumerator", id, v$g$1); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$1. } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.StructureTypeSpecifier. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pStructureTypeSpecifier(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Object yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pKeyword(yyStart); if (yyResult.hasValue("struct")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pAttributeSpecifierList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$1. final Node v$g$1 = cast(yyOpValue1); final int yyChoice1 = yyOption1; // Nested alternative 1. yyOption1 = yyChoice1; yyOpValue1 = null; yyResult = pCIdentifier$Identifier(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final String v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$2. final String v$g$2 = cast(yyOpValue1); yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("{")) { yyResult = pPushScope(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pEnterStructure(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pStructureDeclarationList(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("}")) { yyResult = pExitStructure(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pPopScope(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pAttributeSpecifierList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$3 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$3; } { // Start scope for v$g$4. final Node v$g$4 = cast(yyOpValue1); yyValue = GNode.create("StructureTypeDefinition", v$g$1, v$g$2, v$g$3, v$g$4); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$4. } } } else { yyError = yyError.select("'}' expected", yyBase); } } } } } else { yyError = yyError.select("'{' expected", yyBase); } } // End scope for v$g$2. // Nested alternative 2. yyResult = pCIdentifier$Identifier(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("StructureTypeReference", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // End scope for v$g$1. } // Done. yyError = yyError.select("structure type specifier expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.UnionTypeSpecifier. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pUnionTypeSpecifier(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Object yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pKeyword(yyStart); if (yyResult.hasValue("union")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pAttributeSpecifierList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$1. final Node v$g$1 = cast(yyOpValue1); final int yyChoice1 = yyOption1; // Nested alternative 1. yyOption1 = yyChoice1; yyOpValue1 = null; yyResult = pCIdentifier$Identifier(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final String v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$2. final String v$g$2 = cast(yyOpValue1); yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("{")) { yyResult = pPushScope(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pEnterStructure(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pStructureDeclarationList(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("}")) { yyResult = pExitStructure(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pPopScope(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pAttributeSpecifierList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$3 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$3; } { // Start scope for v$g$4. final Node v$g$4 = cast(yyOpValue1); yyValue = GNode.create("UnionTypeDefinition", v$g$1, v$g$2, v$g$3, v$g$4); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$4. } } } else { yyError = yyError.select("'}' expected", yyBase); } } } } } else { yyError = yyError.select("'{' expected", yyBase); } } // End scope for v$g$2. // Nested alternative 2. yyResult = pCIdentifier$Identifier(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("UnionTypeReference", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // End scope for v$g$1. } // Done. yyError = yyError.select("union type specifier expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.StructureDeclarationList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pStructureDeclarationList(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; boolean yyRepeated1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Regular>. yyRepetition1 = yyStart; yyRepeated1 = false; yyRepValue1 = Pair.empty(); while (true) { yyResult = pAnnotatedStructureDeclaration(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepeated1 = true; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } if (yyRepeated1) { final Pair<Node> v$g$1 = yyRepValue1.reverse(); yyResult = pAnnotations(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("StructureDeclarationList", v$g$1.size() + 1). addAll(v$g$1).add(v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative <Empty>. if (GCC) { yyResult = pAnnotations(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = GNode.create("StructureDeclarationList", v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("structure declaration list expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal * xtc.lang.jeannie.JeannieC.AnnotatedStructureDeclaration. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAnnotatedStructureDeclaration(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Start a state modification. yyState.start(); // Alternative 1. yyState.mark(); yyResult = pStructureDeclaration(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node d = yyResult.semanticValue(); yyValue = yyState.annotate(d); // Commit the state modification. yyState.commit(); setLocation(yyValue, yyStart); return yyResult.createValue(yyValue, yyError); } // Abort the state modification. yyState.abort(); // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.StructureDeclaration. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pStructureDeclaration(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; boolean yyRepeated1; int yyOption1; String yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Declaration>. yyOption1 = yyStart; yyOpValue1 = null; yyBase = yyOption1; yyResult = pKeyword(yyBase); if (yyResult.hasValue("__extension__")) { final String v$el$1 = "__extension__"; yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } else { yyError = yyError.select("'__extension__' expected", yyBase); } { // Start scope for v$g$1. final String v$g$1 = yyOpValue1; yyResult = pSpecifierQualifierList(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyResult = pOptionalStructureDeclaratorList(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyOption1 = yyResult.index; if (GCC) { yyRepetition1 = yyOption1; yyRepeated1 = false; while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyRepetition1 = yyResult.index; yyRepeated1 = true; continue; } else { yyError = yyError.select("';' expected", yyBase); } break; } if (yyRepeated1) { yyOption1 = yyRepetition1; } } yyValue = GNode.create("StructureDeclaration", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } } // End scope for v$g$1. // Done. yyError = yyError.select("structure declaration expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.SpecifierQualifierList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pSpecifierQualifierList(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk3) yyColumn.chunk3 = new Chunk3(); if (null == yyColumn.chunk3.fSpecifierQualifierList) yyColumn.chunk3.fSpecifierQualifierList = pSpecifierQualifierList$1(yyStart); return yyColumn.chunk3.fSpecifierQualifierList; } /** Actually parse xtc.lang.jeannie.JeannieC.SpecifierQualifierList. */ private Result pSpecifierQualifierList$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSpecifierQualifierPlus(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$g$1 = yyResult.semanticValue(); yyValue = GNode.createFromPair("SpecifierQualifierList", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.SpecifierQualifierPlus. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pSpecifierQualifierPlus(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; boolean yyRepeated1; Pair<Node> yyRepValue1; Pair<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyRepetition1 = yyStart; yyRepeated1 = false; yyRepValue1 = Pair.empty(); while (true) { yyResult = pSpecifierQualifier(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepeated1 = true; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } if (yyRepeated1) { yyValue = yyRepValue1.reverse(); return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.SpecifierQualifier. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pSpecifierQualifier(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <TypeSpecifier>. yyResult = pTypeSpecifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyResult = pTypeSpecContext(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { return yyResult.createValue(yyValue, yyError); } } // Alternative <TypeQualifier>. yyResult = pTypeQualifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <Attribute>. yyResult = pAttributeSpecifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal * xtc.lang.jeannie.JeannieC.OptionalStructureDeclaratorList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pOptionalStructureDeclaratorList(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <List>. yyResult = pStructureDeclaratorList(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <Null>. if (GCC) { { // Start scope for yyValue. yyValue = null; return new SemanticValue(yyValue, yyStart, yyError); } // End scope for yyValue. } // Done. yyError = yyError.select("optional structure declarator list expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.StructureDeclaratorList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pStructureDeclaratorList(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <List>. yyResult = pStructureDeclarator(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pStructureDeclarator(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } { // Start scope for v$g$2. final Pair<Node> v$g$2 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("StructureDeclaratorList", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$g$2. } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.StructureDeclarator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pStructureDeclarator(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyOption1 = yyStart; yyOpValue1 = null; yyResult = pAttributeSpecifierList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$1. final Node v$g$1 = yyOpValue1; yyOpValue1 = null; yyResult = pJeannieC$Declarator(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$2. final Node v$g$2 = yyOpValue1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyResult = pJeannieC$ConditionalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pAttributeSpecifierList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$3 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$3; } { // Start scope for v$g$4. final Node v$g$4 = yyOpValue1; yyValue = GNode.create("BitField", v$g$1, v$g$2, v$g$3, v$g$4); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$4. } } else { yyError = yyError.select("':' expected", yyBase); } } // End scope for v$g$2. } // End scope for v$g$1. // Alternative <Simple>. yyResult = pAttributedDeclarator(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AttributedDeclarator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAttributedDeclarator(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk3) yyColumn.chunk3 = new Chunk3(); if (null == yyColumn.chunk3.fAttributedDeclarator) yyColumn.chunk3.fAttributedDeclarator = pAttributedDeclarator$1(yyStart); return yyColumn.chunk3.fAttributedDeclarator; } /** Actually parse xtc.lang.jeannie.JeannieC.AttributedDeclarator. */ private Result pAttributedDeclarator$1(final int yyStart) throws IOException { Result yyResult; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyOption1 = yyStart; yyOpValue1 = null; yyResult = pAttributeSpecifierList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$1. final Node v$g$1 = yyOpValue1; yyResult = pJeannieC$Declarator(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pAttributeSpecifierList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$3. final Node v$g$3 = yyOpValue1; yyValue = GNode.create("AttributedDeclarator", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$3. } } // End scope for v$g$1. // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.Declarator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$Declarator(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk3) yyColumn.chunk3 = new Chunk3(); if (null == yyColumn.chunk3.fJeannieC$Declarator) yyColumn.chunk3.fJeannieC$Declarator = pJeannieC$Declarator$1(yyStart); return yyColumn.chunk3.fJeannieC$Declarator; } /** Actually parse xtc.lang.jeannie.JeannieC.Declarator. */ private Result pJeannieC$Declarator$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Pointer>. yyResult = pPointerDeclarator(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <Direct>. yyResult = pDirectDeclarator(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.PointerDeclarator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pPointerDeclarator(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pPointer(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyResult = pDirectDeclarator(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("PointerDeclarator", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.Pointer. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pPointer(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk3) yyColumn.chunk3 = new Chunk3(); if (null == yyColumn.chunk3.fPointer) yyColumn.chunk3.fPointer = pPointer$1(yyStart); return yyColumn.chunk3.fPointer; } /** Actually parse xtc.lang.jeannie.JeannieC.Pointer. */ private Result pPointer$1(final int yyStart) throws IOException { Result yyResult; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("*")) { yyResult = pTypeQualifierList(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pPointer(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$2. final Node v$g$2 = yyOpValue1; yyValue = GNode.create("Pointer", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$2. } } // Done. yyError = yyError.select("pointer expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.TypeQualifierList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pTypeQualifierList(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyRepetition1 = yyStart; yyRepValue1 = Pair.empty(); while (true) { yyResult = pTypeQualifierList$$Choice1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } { // Start scope for v$g$1. final Pair<Node> v$g$1 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("TypeQualifierList", v$g$1); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$g$1. } // ========================================================================= /** * Parse synthetic nonterminal * xtc.lang.jeannie.Jeannie.TypeQualifierList$$Choice1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pTypeQualifierList$$Choice1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pTypeQualifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative 2. yyResult = pAttributeSpecifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.DirectDeclarator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDirectDeclarator(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <FullBase>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { yyResult = pAttributedDeclarator(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$7 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pDirectDeclarator$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$8 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$8, yyRepValue1); continue; } break; } { // Start scope for v$9. final Pair<Action<Node>> v$9 = yyRepValue1.reverse(); yyValue = apply(v$9, v$g$7, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$9. } else { yyError = yyError.select("')' expected", yyBase); } } } // Alternative <SimpleBase>. yyResult = pSimpleDeclarator(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$10 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pDirectDeclarator$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$11 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$11, yyRepValue1); continue; } break; } { // Start scope for v$12. final Pair<Action<Node>> v$12 = yyRepValue1.reverse(); yyValue = apply(v$12, v$g$10, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$12. } // Done. yyError = yyError.select("direct declarator expected", yyStart); return yyError; } // ========================================================================= /** * Parse synthetic nonterminal * xtc.lang.jeannie.Jeannie.DirectDeclarator$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDirectDeclarator$$Tail1(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { yyResult = pPushScope(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pParameterTypeList(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pParameterContext(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pJavaThrows(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node javaThrows = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("FunctionDeclarator", v$1, v$g$2, javaThrows); }}; return yyResult.createValue(yyValue, yyError); } } } else { yyError = yyError.select("')' expected", yyBase); } } // Nested alternative 2. yyOption1 = yyChoice1; yyOpValue1 = null; yyResult = pIdentifierList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$3. final Node v$g$3 = yyOpValue1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pParameterContext(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pJavaThrows(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node javaThrows = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("FunctionDeclarator", v$1, v$g$3, javaThrows); }}; return yyResult.createValue(yyValue, yyError); } } } else { yyError = yyError.select("')' expected", yyBase); } } // End scope for v$g$3. } } // Alternative 2. yyResult = pSymbol(yyStart); if (yyResult.hasValue("[")) { yyResult = pArrayQualifierList(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$4 = yyResult.semanticValue(); final int yyChoice1 = yyResult.index; // Nested alternative 1. yyOption1 = yyChoice1; yyOpValue1 = null; yyResult = pAssignmentExpression(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$5. final Node v$g$5 = yyOpValue1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("ArrayDeclarator", v$1, v$g$4, v$g$5); }}; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("']' expected", yyBase); } } // End scope for v$g$5. // Nested alternative 2. yyResult = pVariableLength(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$6 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("ArrayDeclarator", v$1, v$g$4, v$g$6); }}; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("']' expected", yyBase); } } } } // Done. yyError = yyError.select("direct declarator expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.VariableLength. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pVariableLength(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk3) yyColumn.chunk3 = new Chunk3(); if (null == yyColumn.chunk3.fVariableLength) yyColumn.chunk3.fVariableLength = pVariableLength$1(yyStart); return yyColumn.chunk3.fVariableLength; } /** Actually parse xtc.lang.jeannie.JeannieC.VariableLength. */ private Result pVariableLength$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("*")) { yyValue = GNode.create("VariableLength", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("variable length expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.SimpleDeclarator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pSimpleDeclarator(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Declarator>. yyResult = pCIdentifier$Identifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String id = yyResult.semanticValue(); yyState.bind(toText(id)); yyValue = GNode.create("SimpleDeclarator", id); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.ParameterTypeList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pParameterTypeList(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk4) yyColumn.chunk4 = new Chunk4(); if (null == yyColumn.chunk4.fParameterTypeList) yyColumn.chunk4.fParameterTypeList = pParameterTypeList$1(yyStart); return yyColumn.chunk4.fParameterTypeList; } /** Actually parse xtc.lang.jeannie.JeannieC.ParameterTypeList. */ private Result pParameterTypeList$1(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; String yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pParameterList(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("...")) { final String v$el$1 = "..."; yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } else { yyError = yyError.select("'...' expected", yyBase); } } else { yyError = yyError.select("',' expected", yyBase); } { // Start scope for v$g$2. final String v$g$2 = yyOpValue1; yyValue = GNode.create("ParameterTypeList", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$2. } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.ParameterList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pParameterList(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pParameterDeclaration(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pParameterDeclaration(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } { // Start scope for v$g$2. final Pair<Node> v$g$2 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("ParameterList", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$g$2. } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.ParameterDeclaration. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pParameterDeclaration(final int yyStart) throws IOException { Result yyResult; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Start a state modification. yyState.start(); // Alternative 1. yyResult = pDeclarationSpecifiers(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pJeannieC$Declarator(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pAttributeSpecifierList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$3. final Node v$g$3 = yyOpValue1; yyValue = GNode.create("ParameterDeclaration", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); // Commit the state modification. yyState.commit(); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$3. } // Nested alternative 2. yyOption1 = yyChoice1; yyOpValue1 = null; yyResult = pAbstractDeclarator(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$4. final Node v$g$4 = yyOpValue1; yyOpValue1 = null; yyResult = pAttributeSpecifierList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$3 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$3; } { // Start scope for v$g$5. final Node v$g$5 = yyOpValue1; yyValue = GNode.create("ParameterDeclaration", v$g$1, v$g$4, v$g$5); yyValue.setLocation(location(yyStart)); // Commit the state modification. yyState.commit(); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$5. } // End scope for v$g$4. } // Abort the state modification. yyState.abort(); // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AttributedAbstractDeclarator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAttributedAbstractDeclarator(final int yyStart) throws IOException { Result yyResult; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyOption1 = yyStart; yyOpValue1 = null; yyResult = pAttributeSpecifierList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$1. final Node v$g$1 = yyOpValue1; yyResult = pAbstractDeclarator(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("AttributedAbstractDeclarator", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // End scope for v$g$1. // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AbstractDeclarator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAbstractDeclarator(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk4) yyColumn.chunk4 = new Chunk4(); if (null == yyColumn.chunk4.fAbstractDeclarator) yyColumn.chunk4.fAbstractDeclarator = pAbstractDeclarator$1(yyStart); return yyColumn.chunk4.fAbstractDeclarator; } /** Actually parse xtc.lang.jeannie.JeannieC.AbstractDeclarator. */ private Result pAbstractDeclarator$1(final int yyStart) throws IOException { Result yyResult; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyOption1 = yyStart; yyOpValue1 = null; yyResult = pPointer(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for p. final Node p = yyOpValue1; yyResult = pDirectAbstractDeclarator(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node d = yyResult.semanticValue(); if ((null != p) || (null != d)) { yyValue = GNode.create("AbstractDeclarator", p, d); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } } // End scope for p. // Done. yyError = yyError.select("abstract declarator expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.DirectAbstractDeclarator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDirectAbstractDeclarator(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Parenthesized>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { yyResult = pAttributedAbstractDeclarator(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$7 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pDirectAbstractDeclarator$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$8 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$8, yyRepValue1); continue; } break; } { // Start scope for v$9. final Pair<Action<Node>> v$9 = yyRepValue1.reverse(); yyValue = apply(v$9, v$g$7, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$9. } else { yyError = yyError.select("')' expected", yyBase); } } } // Alternative <Empty>. yyRepetition1 = yyStart; yyRepValue1 = Pair.empty(); while (true) { yyResult = pDirectAbstractDeclarator$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$11 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$11, yyRepValue1); continue; } break; } { // Start scope for v$12. final Pair<Action<Node>> v$12 = yyRepValue1.reverse(); yyValue = apply(v$12, null, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$12. } // ========================================================================= /** * Parse synthetic nonterminal * xtc.lang.jeannie.Jeannie.DirectAbstractDeclarator$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDirectAbstractDeclarator$$Tail1(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("[")) { final String v$g$2 = "["; final int yyChoice1 = yyResult.index; // Nested alternative 1. yyOption1 = yyChoice1; yyOpValue1 = null; yyResult = pAssignmentExpression(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$3. final Node v$g$3 = yyOpValue1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("DirectAbstractDeclarator", v$1, v$g$2, v$g$3); }}; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("']' expected", yyBase); } } // End scope for v$g$3. // Nested alternative 2. yyResult = pVariableLength(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$4 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("DirectAbstractDeclarator", v$1, v$g$2, v$g$4); }}; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("']' expected", yyBase); } } } // Alternative 2. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { final String v$g$5 = "("; yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pParameterTypeList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$6. final Node v$g$6 = yyOpValue1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("DirectAbstractDeclarator", v$1, v$g$5, v$g$6); }}; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } // End scope for v$g$6. } // Done. yyError = yyError.select("direct abstract declarator expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.IdentifierList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pIdentifierList(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<String> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pCIdentifier$Identifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String id1 = yyResult.semanticValue(); yyState.bind(toText(id1)); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pCIdentifier$Identifier(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final String id2 = yyResult.semanticValue(); yyState.bind(toText(id2)); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<String>(id2, yyRepValue1); continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } { // Start scope for v$g$1. final Pair<String> v$g$1 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("IdentifierList", id1, v$g$1); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$g$1. } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.ArrayQualifierList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pArrayQualifierList(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyRepetition1 = yyStart; yyRepValue1 = Pair.empty(); while (true) { yyResult = pArrayQualifierList$$Choice1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } { // Start scope for v$g$1. final Pair<Node> v$g$1 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("ArrayQualifierList", v$g$1); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$g$1. } // ========================================================================= /** * Parse synthetic nonterminal * xtc.lang.jeannie.Jeannie.ArrayQualifierList$$Choice1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pArrayQualifierList$$Choice1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pKeyword(yyStart); if (yyResult.hasValue("static")) { yyValue = GNode.create("StaticSpecifier", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 2. yyResult = pKeyword(yyStart); if (yyResult.hasValue("volatile")) { final String v$g$1 = "volatile"; yyValue = GNode.create("VolatileQualifier", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 3. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__volatile")) { final String v$g$2 = "__volatile"; yyValue = GNode.create("VolatileQualifier", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 4. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__volatile__")) { final String v$g$3 = "__volatile__"; yyValue = GNode.create("VolatileQualifier", v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 5. yyResult = pKeyword(yyStart); if (yyResult.hasValue("restrict")) { final String v$g$1 = "restrict"; yyValue = GNode.create("RestrictQualifier", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 6. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__restrict")) { final String v$g$2 = "__restrict"; yyValue = GNode.create("RestrictQualifier", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 7. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__restrict__")) { final String v$g$3 = "__restrict__"; yyValue = GNode.create("RestrictQualifier", v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 8. yyResult = pKeyword(yyStart); if (yyResult.hasValue("const")) { final String v$g$1 = "const"; yyValue = GNode.create("ConstantQualifier", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 9. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__const")) { final String v$g$2 = "__const"; yyValue = GNode.create("ConstantQualifier", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 10. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__const__")) { final String v$g$3 = "__const__"; yyValue = GNode.create("ConstantQualifier", v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 11. yyResult = pAttributeSpecifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("array qualifier list expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.FloatingPointTypeSpecifier. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pFloatingPointTypeSpecifier(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pKeyword(yyStart); if (yyResult.hasValue("_Complex")) { final String v$g$1 = "_Complex"; yyValue = GNode.create("Complex", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 2. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__complex__")) { final String v$g$2 = "__complex__"; yyValue = GNode.create("Complex", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 3. yyResult = pKeyword(yyStart); if (yyResult.hasValue("double")) { yyValue = GNode.create("Double", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 4. yyResult = pKeyword(yyStart); if (yyResult.hasValue("float")) { yyValue = GNode.create("Float", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("floating point type specifier expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.IntegerTypeSpecifier. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pIntegerTypeSpecifier(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pKeyword(yyStart); if (yyResult.hasValue("long")) { yyValue = GNode.create("Long", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 2. yyResult = pKeyword(yyStart); if (yyResult.hasValue("int")) { yyValue = GNode.create("Int", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 3. yyResult = pKeyword(yyStart); if (yyResult.hasValue("short")) { yyValue = GNode.create("Short", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 4. yyResult = pKeyword(yyStart); if (yyResult.hasValue("char")) { yyValue = GNode.create("Char", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 5. yyResult = pKeyword(yyStart); if (yyResult.hasValue("_Bool")) { yyValue = GNode.create("Bool", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 6. yyResult = pKeyword(yyStart); if (yyResult.hasValue("unsigned")) { yyValue = GNode.create("Unsigned", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 7. yyResult = pKeyword(yyStart); if (yyResult.hasValue("signed")) { final String v$g$1 = "signed"; yyValue = GNode.create("Signed", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 8. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__signed")) { final String v$g$2 = "__signed"; yyValue = GNode.create("Signed", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 9. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__signed__")) { final String v$g$3 = "__signed__"; yyValue = GNode.create("Signed", v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("integer type specifier expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.TypeofKeyword. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pTypeofKeyword(final int yyStart) throws IOException { Result yyResult; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pKeyword(yyStart); if (yyResult.hasValue("typeof")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative 2. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__typeof")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative 3. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__typeof__")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("typeof keyword expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.Initializer. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pInitializer(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Complex>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("{")) { yyResult = pInitializerList(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyOption1 = yyResult.index; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyOption1 = yyResult.index; } else { yyError = yyError.select("',' expected", yyBase); } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("}")) { return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'}' expected", yyBase); } } } // Alternative <Simple>. yyResult = pAssignmentExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("initializer expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.InitializerList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pInitializerList(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pInitializerListEntry(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pInitializerListEntry(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } { // Start scope for v$g$2. final Pair<Node> v$g$2 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("InitializerList", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$g$2. } // Alternative 2. if (GCC) { yyValue = GNode.create("InitializerList", false); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyStart, yyError); } // Done. yyError = yyError.select("initializer list expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.InitializerListEntry. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pInitializerListEntry(final int yyStart) throws IOException { Result yyResult; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyOption1 = yyStart; yyOpValue1 = null; yyResult = pDesignation(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$1. final Node v$g$1 = yyOpValue1; yyResult = pInitializer(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("InitializerListEntry", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // End scope for v$g$1. // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.Designation. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDesignation(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; boolean yyRepeated1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Standard>. yyRepetition1 = yyStart; yyRepeated1 = false; yyRepValue1 = Pair.empty(); while (true) { yyResult = pDesignator(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepeated1 = true; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } if (yyRepeated1) { final Pair<Node> v$g$1 = yyRepValue1.reverse(); yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("=")) { yyValue = GNode.createFromPair("Designation", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'=' expected", yyBase); } } // Alternative 2. if (GCC) { final int yyChoice1 = yyStart; // Nested alternative 1. yyResult = pObsoleteArrayDesignation(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Nested alternative 2. yyResult = pObsoleteFieldDesignation(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("designation expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.Designator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDesignator(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Array>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("[")) { final String v$g$1 = "["; yyResult = pJeannieC$ConditionalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyValue = GNode.create("Designator", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("']' expected", yyBase); } } } // Alternative <ArrayRange>. if (GCC) { yyResult = pSymbol(yyStart); if (yyResult.hasValue("[")) { final String v$g$3 = "["; yyResult = pJeannieC$ConditionalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$4 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("...")) { yyResult = pJeannieC$ConditionalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$5 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyValue = GNode.create("Designator", v$g$3, v$g$4, v$g$5); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("']' expected", yyBase); } } } else { yyError = yyError.select("'...' expected", yyBase); } } } } // Alternative <Structure>. yyResult = pSymbol(yyStart); if (yyResult.hasValue(".")) { final String v$g$6 = "."; yyResult = pJeannieC$PrimaryIdentifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$7 = yyResult.semanticValue(); yyValue = GNode.create("Designator", v$g$6, v$g$7); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("designator expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.ObsoleteArrayDesignation. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pObsoleteArrayDesignation(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("[")) { final String v$g$1 = "["; yyResult = pJeannieC$ConditionalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); final int yyChoice1 = yyResult.index; // Nested alternative 1. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyValue = GNode.create("ObsoleteArrayDesignation", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("']' expected", yyBase); } // Nested alternative 2. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("...")) { yyResult = pJeannieC$ConditionalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyValue = GNode.create("ObsoleteArrayDesignation", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("']' expected", yyBase); } } } else { yyError = yyError.select("'...' expected", yyBase); } } } // Done. yyError = yyError.select("obsolete array designation expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.ObsoleteFieldDesignation. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pObsoleteFieldDesignation(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pCIdentifier$Identifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyValue = GNode.create("ObsoleteFieldDesignation", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("':' expected", yyBase); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.TypeName. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$TypeName(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk4) yyColumn.chunk4 = new Chunk4(); if (null == yyColumn.chunk4.fJeannieC$TypeName) yyColumn.chunk4.fJeannieC$TypeName = pJeannieC$TypeName$1(yyStart); return yyColumn.chunk4.fJeannieC$TypeName; } /** Actually parse xtc.lang.jeannie.JeannieC.TypeName. */ private Result pJeannieC$TypeName$1(final int yyStart) throws IOException { Result yyResult; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Start a state modification. yyState.start(); // Alternative 1. yyResult = pSpecifierQualifierList(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pAbstractDeclarator(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$2. final Node v$g$2 = yyOpValue1; yyValue = GNode.create("TypeName", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); // Commit the state modification. yyState.commit(); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$2. } // Abort the state modification. yyState.abort(); // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AttributeSpecifierList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAttributeSpecifierList(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk4) yyColumn.chunk4 = new Chunk4(); if (null == yyColumn.chunk4.fAttributeSpecifierList) yyColumn.chunk4.fAttributeSpecifierList = pAttributeSpecifierList$1(yyStart); return yyColumn.chunk4.fAttributeSpecifierList; } /** Actually parse xtc.lang.jeannie.JeannieC.AttributeSpecifierList. */ private Result pAttributeSpecifierList$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pAttributeSpecifierPlus(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$g$1 = yyResult.semanticValue(); yyValue = GNode.createFromPair("AttributeSpecifierList", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AttributeSpecifierPlus. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAttributeSpecifierPlus(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; boolean yyRepeated1; Pair<Node> yyRepValue1; Pair<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyRepetition1 = yyStart; yyRepeated1 = false; yyRepValue1 = Pair.empty(); while (true) { yyResult = pAttributeSpecifier(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepeated1 = true; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } if (yyRepeated1) { yyValue = yyRepValue1.reverse(); return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AttributeSpecifier. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAttributeSpecifier(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk4) yyColumn.chunk4 = new Chunk4(); if (null == yyColumn.chunk4.fAttributeSpecifier) yyColumn.chunk4.fAttributeSpecifier = pAttributeSpecifier$1(yyStart); return yyColumn.chunk4.fAttributeSpecifier; } /** Actually parse xtc.lang.jeannie.JeannieC.AttributeSpecifier. */ private Result pAttributeSpecifier$1(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pAttributeKeyword(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pAttributeList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$1. final Node v$g$1 = yyOpValue1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = GNode.create("AttributeSpecifier", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } else { yyError = yyError.select("')' expected", yyBase); } } // End scope for v$g$1. } else { yyError = yyError.select("'(' expected", yyBase); } } else { yyError = yyError.select("'(' expected", yyBase); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AttributeKeyword. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAttributeKeyword(final int yyStart) throws IOException { Result yyResult; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__attribute")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative 2. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__attribute__")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("attribute keyword expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AttributeList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAttributeList(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pAttributeListEntry(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pAttributeListEntry(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } { // Start scope for v$g$2. final Pair<Node> v$g$2 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("AttributeList", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$g$2. } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AttributeListEntry. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAttributeListEntry(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; int yyOption2; Node yyOpValue2; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pCIdentifier$Word(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyOption2 = yyResult.index; yyOpValue2 = null; yyResult = pJeannieC$ExpressionList(yyOption2); yyError = yyResult.select(yyError, yyOption2); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption2 = yyResult.index; yyOpValue2 = v$el$2; } { // Start scope for v$el$1. final Node v$el$1 = yyOpValue2; yyBase = yyOption2; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } else { yyError = yyError.select("')' expected", yyBase); } } // End scope for v$el$1. } else { yyError = yyError.select("'(' expected", yyBase); } { // Start scope for v$g$2. final Node v$g$2 = yyOpValue1; yyValue = GNode.create("AttributeListEntry", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$2. } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.Statement. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$Statement(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk4) yyColumn.chunk4 = new Chunk4(); if (null == yyColumn.chunk4.fJeannieC$Statement) yyColumn.chunk4.fJeannieC$Statement = pJeannieC$Statement$1(yyStart); return yyColumn.chunk4.fJeannieC$Statement; } /** Actually parse xtc.lang.jeannie.JeannieC.Statement. */ private Result pJeannieC$Statement$1(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pCommaExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("ExpressionStatement", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // Alternative <JavaInCStatement>. yyResult = pJavaInCStatement(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <Cancel>. yyResult = pCancelStatement(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <Commit>. yyResult = pCommitStatement(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <With>. yyResult = pWithStatement(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <Compound>. yyResult = pCompoundStatement(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative 7. yyResult = pKeyword(yyStart); if (yyResult.hasValue("if")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyResult = pCommaExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pJeannieC$Statement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); final int yyChoice1 = yyResult.index; // Nested alternative 1. yyBase = yyChoice1; yyResult = pKeyword(yyBase); if (yyResult.hasValue("else")) { yyResult = pJeannieC$Statement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = GNode.create("IfElseStatement", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("'else' expected", yyBase); } // Nested alternative 2. yyValue = GNode.create("IfStatement", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyChoice1, yyError); } } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } } // Alternative 8. yyResult = pKeyword(yyStart); if (yyResult.hasValue("while")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyResult = pCommaExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pJeannieC$Statement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("WhileStatement", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } } // Alternative 9. yyResult = pKeyword(yyStart); if (yyResult.hasValue("do")) { yyResult = pJeannieC$Statement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pKeyword(yyBase); if (yyResult.hasValue("while")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyResult = pCommaExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("DoStatement", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } } else { yyError = yyError.select("'while' expected", yyBase); } } } // Alternative 10. yyResult = pKeyword(yyStart); if (yyResult.hasValue("for")) { yyResult = pPushScope(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyResult = pInitialClause(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pCommaExpression(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$2. final Node v$g$2 = yyOpValue1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pCommaExpression(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$3. final Node v$g$3 = yyOpValue1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pJeannieC$Statement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$4 = yyResult.semanticValue(); yyResult = pPopScope(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = GNode.create("ForStatement", v$g$1, v$g$2, v$g$3, v$g$4); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } } else { yyError = yyError.select("')' expected", yyBase); } } // End scope for v$g$3. } else { yyError = yyError.select("';' expected", yyBase); } } // End scope for v$g$2. } } else { yyError = yyError.select("'(' expected", yyBase); } } } // Alternative 11. yyResult = pKeyword(yyStart); if (yyResult.hasValue("switch")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyResult = pCommaExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pJeannieC$Statement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("SwitchStatement", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } } // Alternative <Complete>. yyResult = pLabel(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyResult = pJeannieC$Statement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("LabeledStatement", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative <Incomplete>. if (GCC) { yyResult = pLabel(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = GNode.create("LabeledStatement", v$g$3, null); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative 14. yyResult = pKeyword(yyStart); if (yyResult.hasValue("break")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("BreakStatement", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // Alternative 15. yyResult = pKeyword(yyStart); if (yyResult.hasValue("continue")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("ContinueStatement", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // Alternative 16. yyResult = pKeyword(yyStart); if (yyResult.hasValue("return")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pCommaExpression(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$1. final Node v$g$1 = yyOpValue1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("ReturnStatement", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // End scope for v$g$1. } // Alternative <Direct>. yyResult = pKeyword(yyStart); if (yyResult.hasValue("goto")) { yyResult = pJeannieC$PrimaryIdentifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("GotoStatement", null, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } // Alternative <Computed>. if (GCC) { yyResult = pKeyword(yyStart); if (yyResult.hasValue("goto")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("*")) { final String v$g$3 = "*"; yyResult = pCommaExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$4 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("GotoStatement", v$g$3, v$g$4); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } else { yyError = yyError.select("'*' expected", yyBase); } } } // Alternative 19. yyResult = pAsmKeyword(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pTypeQualifier(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$1. final Node v$g$1 = yyOpValue1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyResult = pAssemblyArgument(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { final String v$g$3 = ";"; yyValue = GNode.create("AssemblyStatement", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } } // End scope for v$g$1. } // Alternative 20. yyResult = pSymbol(yyStart); if (yyResult.hasValue(";")) { yyValue = GNode.create("EmptyStatement", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("statement expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.Label. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pLabel(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Label>. yyResult = pCIdentifier$Identifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pAttributeSpecifierList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$2. final Node v$g$2 = yyOpValue1; yyValue = GNode.create("NamedLabel", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$2. } else { yyError = yyError.select("':' expected", yyBase); } } // Alternative <Range>. if (GCC) { yyResult = pKeyword(yyStart); if (yyResult.hasValue("case")) { yyResult = pJeannieC$ConditionalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("...")) { yyResult = pJeannieC$ConditionalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyValue = GNode.create("CaseLabel", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("':' expected", yyBase); } } } else { yyError = yyError.select("'...' expected", yyBase); } } } } // Alternative <Simple>. yyResult = pKeyword(yyStart); if (yyResult.hasValue("case")) { yyResult = pJeannieC$ConditionalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyValue = GNode.create("CaseLabel", v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("':' expected", yyBase); } } } // Alternative 4. yyResult = pKeyword(yyStart); if (yyResult.hasValue("default")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyValue = GNode.create("DefaultLabel", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("':' expected", yyBase); } } // Done. yyError = yyError.select("label expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.CompoundStatement. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCompoundStatement(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk4) yyColumn.chunk4 = new Chunk4(); if (null == yyColumn.chunk4.fCompoundStatement) yyColumn.chunk4.fCompoundStatement = pCompoundStatement$1(yyStart); return yyColumn.chunk4.fCompoundStatement; } /** Actually parse xtc.lang.jeannie.JeannieC.CompoundStatement. */ private Result pCompoundStatement$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <CBlock>. yyResult = pCInCBlock(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <JavaBlock>. yyResult = pJavaInCBlock(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.LocalLabelDeclaration. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pLocalLabelDeclaration(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<String> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__label__")) { yyResult = pCIdentifier$Identifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pCIdentifier$Identifier(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final String v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<String>(v$el$1, yyRepValue1); continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } { // Start scope for v$g$2. final Pair<String> v$g$2 = yyRepValue1.reverse(); yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.createFromPair("LocalLabelDeclaration", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // End scope for v$g$2. } } // Done. yyError = yyError.select("local label declaration expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.DeclarationOrStatement. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$DeclarationOrStatement(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Start a state modification. yyState.start(); // Alternative <Declaration>. yyState.mark(); yyResult = pJeannieC$Declaration(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node d = yyResult.semanticValue(); yyValue = yyState.annotate(d); // Commit the state modification. yyState.commit(); setLocation(yyValue, yyStart); return yyResult.createValue(yyValue, yyError); } // Alternative <Statement>. yyResult = pJeannieC$Statement(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node s = yyResult.semanticValue(); yyValue = yyState.annotate(s); // Commit the state modification. yyState.commit(); setLocation(yyValue, yyStart); return yyResult.createValue(yyValue, yyError); } // Abort the state modification. yyState.abort(); // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.InitialClause. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pInitialClause(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Start a state modification. yyState.start(); // Alternative <Declaration>. yyResult = pJeannieC$Declaration(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); // Commit the state modification. yyState.commit(); return yyResult.createValue(yyValue, yyError); } // Alternative <Expression>. yyOption1 = yyStart; yyOpValue1 = null; yyResult = pCommaExpression(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$3 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$3; } { // Start scope for yyValue. yyValue = yyOpValue1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { // Commit the state modification. yyState.commit(); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // End scope for yyValue. // Abort the state modification. yyState.abort(); // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.CommaExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCommaExpression(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk4) yyColumn.chunk4 = new Chunk4(); if (null == yyColumn.chunk4.fCommaExpression) yyColumn.chunk4.fCommaExpression = pCommaExpression$1(yyStart); return yyColumn.chunk4.fCommaExpression; } /** Actually parse xtc.lang.jeannie.JeannieC.CommaExpression. */ private Result pCommaExpression$1(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pAssignmentExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pCommaExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$3 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$3, yyRepValue1); continue; } break; } { // Start scope for v$4. final Pair<Action<Node>> v$4 = yyRepValue1.reverse(); yyValue = apply(v$4, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$4. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal * xtc.lang.jeannie.Jeannie.CommaExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCommaExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Comma>. yyResult = pSymbol(yyStart); if (yyResult.hasValue(",")) { yyResult = pAssignmentExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("CommaExpression", v$1, v$g$2); }}; return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("comma expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AssignmentExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAssignmentExpression(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk4) yyColumn.chunk4 = new Chunk4(); if (null == yyColumn.chunk4.fAssignmentExpression) yyColumn.chunk4.fAssignmentExpression = pAssignmentExpression$1(yyStart); return yyColumn.chunk4.fAssignmentExpression; } /** Actually parse xtc.lang.jeannie.JeannieC.AssignmentExpression. */ private Result pAssignmentExpression$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Assignment>. yyResult = pJeannieC$UnaryExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyResult = pJeannieC$AssignmentOperator(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyResult = pAssignmentExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = GNode.create("AssignmentExpression", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } } // Alternative <Base>. yyResult = pJeannieC$ConditionalExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AssignmentOperator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$AssignmentOperator(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Equal>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("=")) { yyValue = "="; return yyResult.createValue(yyValue, yyError); } // Alternative <PlusEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("+=")) { yyValue = "+="; return yyResult.createValue(yyValue, yyError); } // Alternative <MinusEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("-=")) { yyValue = "-="; return yyResult.createValue(yyValue, yyError); } // Alternative <TimesEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("*=")) { yyValue = "*="; return yyResult.createValue(yyValue, yyError); } // Alternative <OverEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("/=")) { yyValue = "/="; return yyResult.createValue(yyValue, yyError); } // Alternative <ModuloEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("%=")) { yyValue = "%="; return yyResult.createValue(yyValue, yyError); } // Alternative <LeftEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("<<=")) { yyValue = "<<="; return yyResult.createValue(yyValue, yyError); } // Alternative <RightEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue(">>=")) { yyValue = ">>="; return yyResult.createValue(yyValue, yyError); } // Alternative <AndEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("&=")) { yyValue = "&="; return yyResult.createValue(yyValue, yyError); } // Alternative <XorEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("^=")) { yyValue = "^="; return yyResult.createValue(yyValue, yyError); } // Alternative <OrEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("|=")) { yyValue = "|="; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("assignment operator expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.ConditionalExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$ConditionalExpression(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk4) yyColumn.chunk4 = new Chunk4(); if (null == yyColumn.chunk4.fJeannieC$ConditionalExpression) yyColumn.chunk4.fJeannieC$ConditionalExpression = pJeannieC$ConditionalExpression$1(yyStart); return yyColumn.chunk4.fJeannieC$ConditionalExpression; } /** Actually parse xtc.lang.jeannie.JeannieC.ConditionalExpression. */ private Result pJeannieC$ConditionalExpression$1(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Conditional>. yyResult = pJeannieC$LogicalOrExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("?")) { yyResult = pCommaExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyResult = pJeannieC$ConditionalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = GNode.create("ConditionalExpression", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("':' expected", yyBase); } } } else { yyError = yyError.select("'?' expected", yyBase); } } // Alternative <IncompleteConditional>. if (GCC) { yyResult = pJeannieC$LogicalOrExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$4 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("?")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyResult = pJeannieC$ConditionalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$6 = yyResult.semanticValue(); yyValue = GNode.create("ConditionalExpression", v$g$4, null, v$g$6); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("':' expected", yyBase); } } else { yyError = yyError.select("'?' expected", yyBase); } } } // Alternative <Base>. yyResult = pJeannieC$LogicalOrExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("conditional expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.LogicalOrExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$LogicalOrExpression(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk5) yyColumn.chunk5 = new Chunk5(); if (null == yyColumn.chunk5.fJeannieC$LogicalOrExpression) yyColumn.chunk5.fJeannieC$LogicalOrExpression = pJeannieC$LogicalOrExpression$1(yyStart); return yyColumn.chunk5.fJeannieC$LogicalOrExpression; } /** Actually parse xtc.lang.jeannie.JeannieC.LogicalOrExpression. */ private Result pJeannieC$LogicalOrExpression$1(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieC$LogicalAndExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieC$LogicalOrExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$3 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$3, yyRepValue1); continue; } break; } { // Start scope for v$4. final Pair<Action<Node>> v$4 = yyRepValue1.reverse(); yyValue = apply(v$4, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$4. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieC.LogicalOrExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$LogicalOrExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Or>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("||")) { yyResult = pJeannieC$LogicalAndExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("LogicalOrExpression", v$1, v$g$2); }}; return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("logical or expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.LogicalAndExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$LogicalAndExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieC$BitwiseOrExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieC$LogicalAndExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$3 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$3, yyRepValue1); continue; } break; } { // Start scope for v$4. final Pair<Action<Node>> v$4 = yyRepValue1.reverse(); yyValue = apply(v$4, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$4. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieC.LogicalAndExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$LogicalAndExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <And>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("&&")) { yyResult = pJeannieC$BitwiseOrExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("LogicalAndExpression", v$1, v$g$2); }}; return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("logical and expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.BitwiseOrExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$BitwiseOrExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieC$BitwiseXorExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieC$BitwiseOrExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$3 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$3, yyRepValue1); continue; } break; } { // Start scope for v$4. final Pair<Action<Node>> v$4 = yyRepValue1.reverse(); yyValue = apply(v$4, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$4. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieC.BitwiseOrExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$BitwiseOrExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Or>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("|")) { yyResult = pJeannieC$BitwiseXorExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("BitwiseOrExpression", v$1, v$g$2); }}; return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("bitwise or expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.BitwiseXorExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$BitwiseXorExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieC$BitwiseAndExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieC$BitwiseXorExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$3 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$3, yyRepValue1); continue; } break; } { // Start scope for v$4. final Pair<Action<Node>> v$4 = yyRepValue1.reverse(); yyValue = apply(v$4, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$4. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieC.BitwiseXorExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$BitwiseXorExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Xor>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("^")) { yyResult = pJeannieC$BitwiseAndExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("BitwiseXorExpression", v$1, v$g$2); }}; return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("bitwise xor expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.BitwiseAndExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$BitwiseAndExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieC$EqualityExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieC$BitwiseAndExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$3 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$3, yyRepValue1); continue; } break; } { // Start scope for v$4. final Pair<Action<Node>> v$4 = yyRepValue1.reverse(); yyValue = apply(v$4, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$4. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieC.BitwiseAndExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$BitwiseAndExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <And>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("&")) { yyResult = pJeannieC$EqualityExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("BitwiseAndExpression", v$1, v$g$2); }}; return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("bitwise and expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.EqualityExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$EqualityExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieC$RelationalExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieC$EqualityExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$4 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$4, yyRepValue1); continue; } break; } { // Start scope for v$5. final Pair<Action<Node>> v$5 = yyRepValue1.reverse(); yyValue = apply(v$5, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$5. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieC.EqualityExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$EqualityExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Recursion>. yyResult = p$$Shared7(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyResult = pJeannieC$RelationalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("EqualityExpression", v$1, v$g$2, v$g$3); }}; return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal xtc.lang.jeannie.Jeannie.$$Shared7. * This nonterminal represents the duplicate productions * xtc.lang.jeannie.JeannieC.EqualityOperator * and xtc.lang.jeannie.JeannieJava.EqualityOperator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result p$$Shared7(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk5) yyColumn.chunk5 = new Chunk5(); if (null == yyColumn.chunk5.f$$Shared7) yyColumn.chunk5.f$$Shared7 = p$$Shared7$1(yyStart); return yyColumn.chunk5.f$$Shared7; } /** Actually parse xtc.lang.jeannie.Jeannie.$$Shared7. */ private Result p$$Shared7$1(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Equal>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("==")) { yyValue = "=="; return yyResult.createValue(yyValue, yyError); } // Alternative <NotEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("!=")) { yyValue = "!="; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select(" expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.RelationalExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$RelationalExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieC$ShiftExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieC$RelationalExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$4 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$4, yyRepValue1); continue; } break; } { // Start scope for v$5. final Pair<Action<Node>> v$5 = yyRepValue1.reverse(); yyValue = apply(v$5, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$5. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieC.RelationalExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$RelationalExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Recursion>. yyResult = pJeannieC$RelationalOperator(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyResult = pJeannieC$ShiftExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("RelationalExpression", v$1, v$g$2, v$g$3); }}; return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.RelationalOperator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$RelationalOperator(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <LessEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("<=")) { yyValue = "<="; return yyResult.createValue(yyValue, yyError); } // Alternative <Less>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("<")) { yyValue = "<"; return yyResult.createValue(yyValue, yyError); } // Alternative <GreaterEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue(">=")) { yyValue = ">="; return yyResult.createValue(yyValue, yyError); } // Alternative <Greater>. yyResult = pSymbol(yyStart); if (yyResult.hasValue(">")) { yyValue = ">"; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("relational operator expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.ShiftExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$ShiftExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieC$AdditiveExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieC$ShiftExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$4 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$4, yyRepValue1); continue; } break; } { // Start scope for v$5. final Pair<Action<Node>> v$5 = yyRepValue1.reverse(); yyValue = apply(v$5, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$5. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieC.ShiftExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$ShiftExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Recursion>. yyResult = pJeannieC$ShiftOperator(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyResult = pJeannieC$AdditiveExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("ShiftExpression", v$1, v$g$2, v$g$3); }}; return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.ShiftOperator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$ShiftOperator(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Left>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("<<")) { yyValue = "<<"; return yyResult.createValue(yyValue, yyError); } // Alternative <Right>. yyResult = pSymbol(yyStart); if (yyResult.hasValue(">>")) { yyValue = ">>"; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("shift operator expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AdditiveExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$AdditiveExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieC$MultiplicativeExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieC$AdditiveExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$4 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$4, yyRepValue1); continue; } break; } { // Start scope for v$5. final Pair<Action<Node>> v$5 = yyRepValue1.reverse(); yyValue = apply(v$5, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$5. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieC.AdditiveExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$AdditiveExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Recursion>. yyResult = p$$Shared8(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyResult = pJeannieC$MultiplicativeExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("AdditiveExpression", v$1, v$g$2, v$g$3); }}; return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal xtc.lang.jeannie.Jeannie.$$Shared8. * This nonterminal represents the duplicate productions * xtc.lang.jeannie.JeannieC.AdditiveOperator * and xtc.lang.jeannie.JeannieJava.AdditiveOperator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result p$$Shared8(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk5) yyColumn.chunk5 = new Chunk5(); if (null == yyColumn.chunk5.f$$Shared8) yyColumn.chunk5.f$$Shared8 = p$$Shared8$1(yyStart); return yyColumn.chunk5.f$$Shared8; } /** Actually parse xtc.lang.jeannie.Jeannie.$$Shared8. */ private Result p$$Shared8$1(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Plus>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("+")) { yyValue = "+"; return yyResult.createValue(yyValue, yyError); } // Alternative <Minus>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("-")) { yyValue = "-"; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select(" expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.MultiplicativeExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$MultiplicativeExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieC$CastExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieC$MultiplicativeExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$4 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$4, yyRepValue1); continue; } break; } { // Start scope for v$5. final Pair<Action<Node>> v$5 = yyRepValue1.reverse(); yyValue = apply(v$5, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$5. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieC.MultiplicativeExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$MultiplicativeExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Recursion>. yyResult = p$$Shared9(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyResult = pJeannieC$CastExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("MultiplicativeExpression", v$1, v$g$2, v$g$3); }}; return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal xtc.lang.jeannie.Jeannie.$$Shared9. * This nonterminal represents the duplicate productions * xtc.lang.jeannie.JeannieC.MultiplicativeOperator * and xtc.lang.jeannie.JeannieJava.MultiplicativeOperator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result p$$Shared9(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk5) yyColumn.chunk5 = new Chunk5(); if (null == yyColumn.chunk5.f$$Shared9) yyColumn.chunk5.f$$Shared9 = p$$Shared9$1(yyStart); return yyColumn.chunk5.f$$Shared9; } /** Actually parse xtc.lang.jeannie.Jeannie.$$Shared9. */ private Result p$$Shared9$1(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Times>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("*")) { yyValue = "*"; return yyResult.createValue(yyValue, yyError); } // Alternative <Over>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("/")) { yyValue = "/"; return yyResult.createValue(yyValue, yyError); } // Alternative <Modulo>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("%")) { yyValue = "%"; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select(" expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.CastExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$CastExpression(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk5) yyColumn.chunk5 = new Chunk5(); if (null == yyColumn.chunk5.fJeannieC$CastExpression) yyColumn.chunk5.fJeannieC$CastExpression = pJeannieC$CastExpression$1(yyStart); return yyColumn.chunk5.fJeannieC$CastExpression; } /** Actually parse xtc.lang.jeannie.JeannieC.CastExpression. */ private Result pJeannieC$CastExpression$1(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Cast>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { yyResult = pJeannieC$TypeName(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pJeannieC$CastExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("CastExpression", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("')' expected", yyBase); } } } // Alternative <Base>. yyResult = pJeannieC$UnaryExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("cast expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.UnaryExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$UnaryExpression(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk5) yyColumn.chunk5 = new Chunk5(); if (null == yyColumn.chunk5.fJeannieC$UnaryExpression) yyColumn.chunk5.fJeannieC$UnaryExpression = pJeannieC$UnaryExpression$1(yyStart); return yyColumn.chunk5.fJeannieC$UnaryExpression; } /** Actually parse xtc.lang.jeannie.JeannieC.UnaryExpression. */ private Result pJeannieC$UnaryExpression$1(final int yyStart) throws IOException { Result yyResult; Result yyPredResult; boolean yyPredMatched; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pKeyword(yyStart); if (yyResult.hasValue("sizeof")) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyResult = pJeannieC$TypeName(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyPredMatched = false; yyPredResult = pSymbol(yyResult.index); if (yyPredResult.hasValue("{")) { yyPredMatched = true; } if (! yyPredMatched) { yyValue = GNode.create("SizeofExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("unary expression expected", yyStart); } } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } // Nested alternative 2. yyResult = pJeannieC$UnaryExpression(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("SizeofExpression", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative 2. yyResult = pAlignofKeyword(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyResult = pJeannieC$TypeName(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyPredMatched = false; yyPredResult = pSymbol(yyResult.index); if (yyPredResult.hasValue("{")) { yyPredMatched = true; } if (! yyPredMatched) { yyValue = GNode.create("AlignofExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("unary expression expected", yyStart); } } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } // Nested alternative 2. yyResult = pJeannieC$UnaryExpression(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("AlignofExpression", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative 3. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__builtin_offsetof")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyResult = pJeannieC$TypeName(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pJeannieC$PostfixExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = GNode.create("OffsetofExpression", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("',' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } } // Alternative 4. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__builtin_types_compatible_p")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyResult = pJeannieC$TypeName(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pJeannieC$TypeName(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = GNode.create("TypeCompatibilityExpression", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("',' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } } // Alternative 5. yyResult = pSymbol(yyStart); if (yyResult.hasValue("-")) { yyResult = pJeannieC$CastExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("UnaryMinusExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative 6. yyResult = pSymbol(yyStart); if (yyResult.hasValue("+")) { yyResult = pJeannieC$CastExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("UnaryPlusExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative <JavaInCExpression>. yyResult = pJavaInCExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative 8. yyResult = pSymbol(yyStart); if (yyResult.hasValue("!")) { yyResult = pJeannieC$CastExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("LogicalNegationExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative 9. yyResult = pSymbol(yyStart); if (yyResult.hasValue("~")) { yyResult = pJeannieC$CastExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("BitwiseNegationExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative 10. yyResult = pSymbol(yyStart); if (yyResult.hasValue("&")) { yyResult = pJeannieC$CastExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("AddressExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative <LabelAddress>. if (GCC) { yyResult = pSymbol(yyStart); if (yyResult.hasValue("&&")) { yyResult = pCIdentifier$Identifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("LabelAddressExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } } // Alternative 12. yyResult = pSymbol(yyStart); if (yyResult.hasValue("*")) { yyResult = pJeannieC$CastExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("IndirectionExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative 13. yyResult = pSymbol(yyStart); if (yyResult.hasValue("++")) { yyResult = pJeannieC$UnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("PreincrementExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative 14. yyResult = pSymbol(yyStart); if (yyResult.hasValue("--")) { yyResult = pJeannieC$UnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("PredecrementExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative <Extension>. if (GCC) { yyResult = pKeyword(yyStart); if (yyResult.hasValue("__extension__")) { yyResult = pJeannieC$CastExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("ExtensionExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } } // Alternative <Base>. yyResult = pJeannieC$PostfixExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("unary expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AlignofKeyword. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAlignofKeyword(final int yyStart) throws IOException { Result yyResult; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__alignof__")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative 2. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__alignof")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("alignof keyword expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.PostfixExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$PostfixExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Compound>. yyResult = pCompoundLiteral(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$6 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieC$PostfixExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$7 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$7, yyRepValue1); continue; } break; } { // Start scope for v$8. final Pair<Action<Node>> v$8 = yyRepValue1.reverse(); yyValue = apply(v$8, v$g$6, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$8. } // Alternative <Primary>. yyResult = pJeannieC$PrimaryExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$9 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieC$PostfixExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$10 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$10, yyRepValue1); continue; } break; } { // Start scope for v$11. final Pair<Action<Node>> v$11 = yyRepValue1.reverse(); yyValue = apply(v$11, v$g$9, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$11. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieC.PostfixExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$PostfixExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("[")) { yyResult = pCommaExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("SubscriptExpression", v$1, v$g$2); }}; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("']' expected", yyBase); } } } // Alternative 2. yyResult = pSymbol(yyStart); if (yyResult.hasValue(".")) { yyResult = pCIdentifier$Identifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$3 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("DirectComponentSelection", v$1, v$g$3); }}; return yyResult.createValue(yyValue, yyError); } } // Alternative 3. yyResult = pSymbol(yyStart); if (yyResult.hasValue("->")) { yyResult = pCIdentifier$Identifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$4 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("IndirectComponentSelection", v$1, v$g$4); }}; return yyResult.createValue(yyValue, yyError); } } // Alternative 4. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pJeannieC$ExpressionList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$5. final Node v$g$5 = yyOpValue1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("FunctionCall", v$1, v$g$5); }}; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } // End scope for v$g$5. } // Alternative 5. yyResult = pSymbol(yyStart); if (yyResult.hasValue("++")) { yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("PostincrementExpression", v$1); }}; return yyResult.createValue(yyValue, yyError); } // Alternative 6. yyResult = pSymbol(yyStart); if (yyResult.hasValue("--")) { yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("PostdecrementExpression", v$1); }}; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("postfix expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.ExpressionList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$ExpressionList(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk5) yyColumn.chunk5 = new Chunk5(); if (null == yyColumn.chunk5.fJeannieC$ExpressionList) yyColumn.chunk5.fJeannieC$ExpressionList = pJeannieC$ExpressionList$1(yyStart); return yyColumn.chunk5.fJeannieC$ExpressionList; } /** Actually parse xtc.lang.jeannie.JeannieC.ExpressionList. */ private Result pJeannieC$ExpressionList$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Expressions>. yyResult = pAssignmentExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyResult = pJeannieC$ExpressionList$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$g$2 = yyResult.semanticValue(); yyValue = GNode.createFromPair("ExpressionList", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieC.ExpressionList$$Star1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$ExpressionList$$Star1(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk5) yyColumn.chunk5 = new Chunk5(); if (null == yyColumn.chunk5.fJeannieC$ExpressionList$$Star1) yyColumn.chunk5.fJeannieC$ExpressionList$$Star1 = pJeannieC$ExpressionList$$Star1$1(yyStart); return yyColumn.chunk5.fJeannieC$ExpressionList$$Star1; } /** Actually parse JeannieC.ExpressionList$$Star1. */ private Result pJeannieC$ExpressionList$$Star1$1(final int yyStart) throws IOException { Result yyResult; Pair<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue(",")) { yyResult = pAssignmentExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyResult = pJeannieC$ExpressionList$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$2 = yyResult.semanticValue(); yyValue = new Pair<Node>(v$el$1, v$2); return yyResult.createValue(yyValue, yyError); } } } // Alternative 2. yyValue = Pair.empty(); return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.CompoundLiteral. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCompoundLiteral(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { yyResult = pJeannieC$TypeName(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("{")) { yyResult = pInitializerList(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyOption1 = yyResult.index; } else { yyError = yyError.select("',' expected", yyBase); } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("}")) { yyValue = GNode.create("CompoundLiteral", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'}' expected", yyBase); } } } else { yyError = yyError.select("'{' expected", yyBase); } } else { yyError = yyError.select("')' expected", yyBase); } } } // Done. yyError = yyError.select("compound literal expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.PrimaryExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$PrimaryExpression(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Constant>. yyResult = pConstant(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative 2. yyResult = pCIdentifier$Identifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("PrimaryIdentifier", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative 3. if (GCC) { yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { yyResult = pCompoundStatement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = GNode.create("StatementAsExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } } } // Alternative 4. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__builtin_va_arg")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyResult = pAssignmentExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pJeannieC$TypeName(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = GNode.create("VariableArgumentAccess", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("',' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } } // Alternative <ParenthesizedExpression>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { yyResult = pCommaExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } } // Done. yyError = yyError.select("primary expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.PrimaryIdentifier. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$PrimaryIdentifier(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pCIdentifier$Identifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("PrimaryIdentifier", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AssemblyDefinition. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAssemblyDefinition(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSimpleAssemblyExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("AssemblyDefinition", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.SimpleAssemblyExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pSimpleAssemblyExpression(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk5) yyColumn.chunk5 = new Chunk5(); if (null == yyColumn.chunk5.fSimpleAssemblyExpression) yyColumn.chunk5.fSimpleAssemblyExpression = pSimpleAssemblyExpression$1(yyStart); return yyColumn.chunk5.fSimpleAssemblyExpression; } /** Actually parse xtc.lang.jeannie.JeannieC.SimpleAssemblyExpression. */ private Result pSimpleAssemblyExpression$1(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pAsmKeyword(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyResult = pCConstant$StringConstant(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = GNode.create("SimpleAssemblyExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AssemblyArgument. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAssemblyArgument(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pCConstant$StringConstant(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); final int yyChoice1 = yyResult.index; // Nested alternative 1. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pAssemblyOperands(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$2. final Node v$g$2 = yyOpValue1; final int yyChoice2 = yyOption1; // Nested alternative 1. yyBase = yyChoice2; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pAssemblyOperands(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$3. final Node v$g$3 = yyOpValue1; final int yyChoice3 = yyOption1; // Nested alternative 1. yyBase = yyChoice3; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyResult = pAssemblyClobbers(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$4 = yyResult.semanticValue(); yyValue = GNode.create("AssemblyArgument", v$g$1, v$g$2, v$g$3, v$g$4); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("':' expected", yyBase); } // Nested alternative 2. yyValue = GNode.create("AssemblyArgument", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyChoice3, yyError); } // End scope for v$g$3. } else { yyError = yyError.select("':' expected", yyBase); } // Nested alternative 2. yyValue = GNode.create("AssemblyArgument", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyChoice2, yyError); } // End scope for v$g$2. } else { yyError = yyError.select("':' expected", yyBase); } // Nested alternative 2. yyValue = GNode.create("AssemblyArgument", v$g$1); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyChoice1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AssemblyOperands. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAssemblyOperands(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk5) yyColumn.chunk5 = new Chunk5(); if (null == yyColumn.chunk5.fAssemblyOperands) yyColumn.chunk5.fAssemblyOperands = pAssemblyOperands$1(yyStart); return yyColumn.chunk5.fAssemblyOperands; } /** Actually parse xtc.lang.jeannie.JeannieC.AssemblyOperands. */ private Result pAssemblyOperands$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pAssemblyOperand(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyResult = pAssemblyOperands$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$g$2 = yyResult.semanticValue(); yyValue = GNode.createFromPair("AssemblyOperands", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal * xtc.lang.jeannie.Jeannie.AssemblyOperands$$Star1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAssemblyOperands$$Star1(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk6) yyColumn.chunk6 = new Chunk6(); if (null == yyColumn.chunk6.fAssemblyOperands$$Star1) yyColumn.chunk6.fAssemblyOperands$$Star1 = pAssemblyOperands$$Star1$1(yyStart); return yyColumn.chunk6.fAssemblyOperands$$Star1; } /** Actually parse xtc.lang.jeannie.Jeannie.AssemblyOperands$$Star1. */ private Result pAssemblyOperands$$Star1$1(final int yyStart) throws IOException { Result yyResult; Pair<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue(",")) { yyResult = pAssemblyOperand(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyResult = pAssemblyOperands$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$2 = yyResult.semanticValue(); yyValue = new Pair<Node>(v$el$1, v$2); return yyResult.createValue(yyValue, yyError); } } } // Alternative 2. yyValue = Pair.empty(); return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AssemblyOperand. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAssemblyOperand(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk6) yyColumn.chunk6 = new Chunk6(); if (null == yyColumn.chunk6.fAssemblyOperand) yyColumn.chunk6.fAssemblyOperand = pAssemblyOperand$1(yyStart); return yyColumn.chunk6.fAssemblyOperand; } /** Actually parse xtc.lang.jeannie.JeannieC.AssemblyOperand. */ private Result pAssemblyOperand$1(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; String yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyOption1 = yyStart; yyOpValue1 = null; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("[")) { yyResult = pCIdentifier$Word(yyResult.index); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final String v$el$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } else { yyError = yyError.select("']' expected", yyBase); } } } else { yyError = yyError.select("'[' expected", yyBase); } { // Start scope for v$g$1. final String v$g$1 = yyOpValue1; yyResult = pCConstant$StringConstant(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyResult = pCommaExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = GNode.create("AssemblyOperand", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } } } // End scope for v$g$1. // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AssemblyClobbers. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAssemblyClobbers(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pCConstant$StringConstant(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pCConstant$StringConstant(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } { // Start scope for v$g$2. final Pair<Node> v$g$2 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("AssemblyClobbers", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$g$2. } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.AsmKeyword. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAsmKeyword(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk6) yyColumn.chunk6 = new Chunk6(); if (null == yyColumn.chunk6.fAsmKeyword) yyColumn.chunk6.fAsmKeyword = pAsmKeyword$1(yyStart); return yyColumn.chunk6.fAsmKeyword; } /** Actually parse xtc.lang.jeannie.JeannieC.AsmKeyword. */ private Result pAsmKeyword$1(final int yyStart) throws IOException { Result yyResult; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pKeyword(yyStart); if (yyResult.hasValue("asm")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative 2. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__asm")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative 3. yyResult = pKeyword(yyStart); if (yyResult.hasValue("__asm__")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("asm keyword expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.WithStatement. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pWithStatement(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pKeyword(yyStart); if (yyResult.hasValue("_with")) { yyResult = pPushScope(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyResult = pWithInitializer(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pCInCBlock(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyResult = pPopScope(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = GNode.create("WithStatement", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } } } // Done. yyError = yyError.select("with statement expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.WithInitializer. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pWithInitializer(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Declaration>. yyResult = pDeclarationNoSemicolon(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <Assignment>. yyResult = pAssignmentExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.DeclarationNoSemicolon. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDeclarationNoSemicolon(final int yyStart) throws IOException { Result yyResult; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pDeclarationSpecifiers(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pInitializedDeclaratorList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for l. final Node l = yyOpValue1; if (yyState.isValid(l)) { yyValue = GNode.create("Declaration", null, v$g$2, l); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } } // End scope for l. } // Done. yyError = yyError.select("declaration no semicolon expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.CancelStatement. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCancelStatement(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pKeyword(yyStart); if (yyResult.hasValue("_cancel")) { yyResult = pJeannieC$PrimaryIdentifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("CancelStatement", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } // Done. yyError = yyError.select("cancel statement expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.CommitStatement. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCommitStatement(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pKeyword(yyStart); if (yyResult.hasValue("_commit")) { yyResult = pJeannieC$PrimaryIdentifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("CommitStatement", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } // Done. yyError = yyError.select("commit statement expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.JavaInC. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaInC(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk6) yyColumn.chunk6 = new Chunk6(); if (null == yyColumn.chunk6.fJavaInC) yyColumn.chunk6.fJavaInC = pJavaInC$1(yyStart); return yyColumn.chunk6.fJavaInC; } /** Actually parse xtc.lang.jeannie.JeannieC.JavaInC. */ private Result pJavaInC$1(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyBase; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("`")) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(".")) { yyBase = yyResult.index; yyC = character(yyBase); if ('J' == yyC) { yyIndex = yyResult.index + 1; yyC = character(yyIndex); if ('a' == yyC) { yyIndex = yyIndex + 1; yyC = character(yyIndex); if ('v' == yyC) { yyIndex = yyIndex + 1; yyC = character(yyIndex); if ('a' == yyC) { yyIndex = yyIndex + 1; yyResult = pSpacing(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("'Java' expected", yyBase); } } else { yyError = yyError.select("'Java' expected", yyBase); } } else { yyError = yyError.select("'Java' expected", yyBase); } } else { yyError = yyError.select("'Java' expected", yyBase); } } else { yyError = yyError.select("'.' expected", yyBase); } // Nested alternative 2. yyValue = null; return new SemanticValue(yyValue, yyChoice1, yyError); } // Done. yyError = yyError.select("java in c expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.CInCBlock. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCInCBlock(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk6) yyColumn.chunk6 = new Chunk6(); if (null == yyColumn.chunk6.fCInCBlock) yyColumn.chunk6.fCInCBlock = pCInCBlock$1(yyStart); return yyColumn.chunk6.fCInCBlock; } /** Actually parse xtc.lang.jeannie.JeannieC.CInCBlock. */ private Result pCInCBlock$1(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("{")) { yyResult = pPushScope(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pCInCBlock$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$g$1 = yyResult.semanticValue(); yyResult = pCInCBlock$$Star2(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$g$2 = yyResult.semanticValue(); yyResult = pAnnotations(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyBase = yyResult.index; yyC = character(yyBase); if ('}' == yyC) { yyIndex = yyResult.index + 1; yyResult = pSpacing(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pPopScope(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = GNode.create("CInCBlock", v$g$1.size() + v$g$2.size() + 1). addAll(v$g$1).addAll(v$g$2).add(v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } } else { yyError = yyError.select("'}' expected", yyBase); } } } } } } // Done. yyError = yyError.select("c in c block expected", yyStart); return yyError; } // ========================================================================= /** * Parse synthetic nonterminal xtc.lang.jeannie.Jeannie.CInCBlock$$Star1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCInCBlock$$Star1(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk6) yyColumn.chunk6 = new Chunk6(); if (null == yyColumn.chunk6.fCInCBlock$$Star1) yyColumn.chunk6.fCInCBlock$$Star1 = pCInCBlock$$Star1$1(yyStart); return yyColumn.chunk6.fCInCBlock$$Star1; } /** Actually parse xtc.lang.jeannie.Jeannie.CInCBlock$$Star1. */ private Result pCInCBlock$$Star1$1(final int yyStart) throws IOException { Result yyResult; Pair<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pLocalLabelDeclaration(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyResult = pCInCBlock$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$2 = yyResult.semanticValue(); yyValue = new Pair<Node>(v$el$1, v$2); return yyResult.createValue(yyValue, yyError); } } // Alternative 2. yyValue = Pair.empty(); return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse synthetic nonterminal xtc.lang.jeannie.Jeannie.CInCBlock$$Star2. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCInCBlock$$Star2(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk6) yyColumn.chunk6 = new Chunk6(); if (null == yyColumn.chunk6.fCInCBlock$$Star2) yyColumn.chunk6.fCInCBlock$$Star2 = pCInCBlock$$Star2$1(yyStart); return yyColumn.chunk6.fCInCBlock$$Star2; } /** Actually parse xtc.lang.jeannie.Jeannie.CInCBlock$$Star2. */ private Result pCInCBlock$$Star2$1(final int yyStart) throws IOException { Result yyResult; Pair<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJeannieC$DeclarationOrStatement(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$el$3 = yyResult.semanticValue(); yyResult = pCInCBlock$$Star2(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$4 = yyResult.semanticValue(); yyValue = new Pair<Node>(v$el$3, v$4); return yyResult.createValue(yyValue, yyError); } } // Alternative 2. yyValue = Pair.empty(); return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.JavaInCBlock. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaInCBlock(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaInC(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pJavaInJavaBlock(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("JavaInCBlock", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.JavaInCExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaInCExpression(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaInC(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pJeannieJava$UnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("JavaInCExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.JavaImports. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieC$JavaImports(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaInC(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("{")) { yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pImportDeclaration(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } { // Start scope for v$g$1. final Pair<Node> v$g$1 = yyRepValue1.reverse(); yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("}")) { yyValue = GNode.createFromPair("JavaImports", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'}' expected", yyBase); } } // End scope for v$g$1. } else { yyError = yyError.select("'{' expected", yyBase); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.JavaInCStatement. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaInCStatement(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaInC(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pTryCatchFinallyStatement(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("JavaInCStatement", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Nested alternative 2. yyResult = pSynchronizedStatement(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("JavaInCStatement", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Nested alternative 3. yyResult = pThrowStatement(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = GNode.create("JavaInCStatement", v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.JavaThrows. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaThrows(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk6) yyColumn.chunk6 = new Chunk6(); if (null == yyColumn.chunk6.fJavaThrows) yyColumn.chunk6.fJavaThrows = pJavaThrows$1(yyStart); return yyColumn.chunk6.fJavaThrows; } /** Actually parse xtc.lang.jeannie.JeannieC.JavaThrows. */ private Result pJavaThrows$1(final int yyStart) throws IOException { Result yyResult; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyOption1 = yyStart; yyOpValue1 = null; yyResult = pJavaInC(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyResult = pThrowsClause(yyResult.index); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } } { // Start scope for v$g$1. final Node v$g$1 = yyOpValue1; yyValue = GNode.create("JavaThrows", v$g$1); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$1. } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieC.JavaType. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaType(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaInC(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pJavaType$TypeName(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("JavaType", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.CompilationUnit. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCompilationUnit(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyRepetition1; Pair<Node> yyRepValue1; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pPrelude(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pPackageDeclaration(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$1. final Node v$g$1 = yyOpValue1; yyResult = pJeannieJava$JavaImports(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyResult = pCDeclarations(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pClassOrInterfaceDeclaration(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$2, yyRepValue1); continue; } break; } { // Start scope for v$g$4. final Pair<Node> v$g$4 = yyRepValue1.reverse(); yyOption1 = yyRepetition1; yyC = character(yyOption1); if ('\u001a' == yyC) { yyIndex = yyOption1 + 1; yyOption1 = yyIndex; } yyResult = pEndOfFile(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = GNode.create("CompilationUnit", v$g$4.size() + 3). add(v$g$1).add(v$g$2).add(v$g$3).addAll(v$g$4); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // End scope for v$g$4. } } } // End scope for v$g$1. } // Done. yyError = yyError.select("compilation unit expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.PackageDeclaration. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pPackageDeclaration(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Declaration>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("package")) { yyResult = pQualifiedIdentifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("PackageDeclaration", null, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } // Done. yyError = yyError.select("package declaration expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.ImportDeclaration. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pImportDeclaration(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; String yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Declaration>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("import")) { yyResult = pQualifiedIdentifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pDotStarTail(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final String v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$3. final String v$g$3 = yyOpValue1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("ImportDeclaration", null, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // End scope for v$g$3. } } // Done. yyError = yyError.select("import declaration expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.DotStarTail. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDotStarTail(final int yyStart) throws IOException { Result yyResult; int yyBase; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue(".")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("*")) { yyValue = "*"; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'*' expected", yyBase); } } // Done. yyError = yyError.select("dot star tail expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.Modifiers. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pModifiers(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk6) yyColumn.chunk6 = new Chunk6(); if (null == yyColumn.chunk6.fModifiers) yyColumn.chunk6.fModifiers = pModifiers$1(yyStart); return yyColumn.chunk6.fModifiers; } /** Actually parse xtc.lang.jeannie.JeannieJava.Modifiers. */ private Result pModifiers$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pModifierList(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$g$1 = yyResult.semanticValue(); yyValue = GNode.createFromPair("Modifiers", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.ModifierList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pModifierList(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Node> yyRepValue1; Pair<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyRepetition1 = yyStart; yyRepValue1 = Pair.empty(); while (true) { yyResult = pModifier(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } { // Start scope for yyValue. yyValue = yyRepValue1.reverse(); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for yyValue. } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.Modifier. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pModifier(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Public>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("public")) { final String v$g$1 = "public"; yyValue = GNode.create("Modifier", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Protected>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("protected")) { final String v$g$2 = "protected"; yyValue = GNode.create("Modifier", v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Private>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("private")) { final String v$g$3 = "private"; yyValue = GNode.create("Modifier", v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Static>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("static")) { final String v$g$4 = "static"; yyValue = GNode.create("Modifier", v$g$4); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Abstract>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("abstract")) { final String v$g$5 = "abstract"; yyValue = GNode.create("Modifier", v$g$5); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Final>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("final")) { final String v$g$6 = "final"; yyValue = GNode.create("Modifier", v$g$6); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Native>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("native")) { final String v$g$7 = "native"; yyValue = GNode.create("Modifier", v$g$7); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Synchronized>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("synchronized")) { final String v$g$8 = "synchronized"; yyValue = GNode.create("Modifier", v$g$8); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Transient>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("transient")) { final String v$g$9 = "transient"; yyValue = GNode.create("Modifier", v$g$9); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Volatile>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("volatile")) { final String v$g$10 = "volatile"; yyValue = GNode.create("Modifier", v$g$10); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Strictfp>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("strictfp")) { final String v$g$11 = "strictfp"; yyValue = GNode.create("Modifier", v$g$11); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("modifier expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.FormalParameter. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pFormalParameter(final int yyStart) throws IOException { Result yyResult; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Parameter>. yyResult = pVariableModifiers(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyResult = pType(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyResult = pJavaIdentifier$Identifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$4 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pDimensions(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$5. final Node v$g$5 = yyOpValue1; yyValue = GNode.create("FormalParameter", v$g$1, v$g$2, null, v$g$4, v$g$5); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$5. } } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.VariableModifiers. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pVariableModifiers(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Final>. yyResult = pFinalModifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("Modifiers", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Nonfinal>. yyValue = GNode.create("Modifiers", false); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.FinalModifier. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pFinalModifier(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("final")) { final String v$g$1 = "final"; yyValue = GNode.create("Modifier", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("final modifier expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.FormalParameters. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pFormalParameters(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk6) yyColumn.chunk6 = new Chunk6(); if (null == yyColumn.chunk6.fFormalParameters) yyColumn.chunk6.fFormalParameters = pFormalParameters$1(yyStart); return yyColumn.chunk6.fFormalParameters; } /** Actually parse xtc.lang.jeannie.JeannieJava.FormalParameters. */ private Result pFormalParameters$1(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pFormalParameter(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyResult = pFormalParameters$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = GNode.createFromPair("FormalParameters", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } } // Nested alternative 2. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = GNode.create("FormalParameters", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } // Done. yyError = yyError.select("formal parameters expected", yyStart); return yyError; } // ========================================================================= /** * Parse synthetic nonterminal * xtc.lang.jeannie.Jeannie.FormalParameters$$Star1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pFormalParameters$$Star1(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk7) yyColumn.chunk7 = new Chunk7(); if (null == yyColumn.chunk7.fFormalParameters$$Star1) yyColumn.chunk7.fFormalParameters$$Star1 = pFormalParameters$$Star1$1(yyStart); return yyColumn.chunk7.fFormalParameters$$Star1; } /** Actually parse xtc.lang.jeannie.Jeannie.FormalParameters$$Star1. */ private Result pFormalParameters$$Star1$1(final int yyStart) throws IOException { Result yyResult; Pair<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue(",")) { yyResult = pFormalParameter(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyResult = pFormalParameters$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$2 = yyResult.semanticValue(); yyValue = new Pair<Node>(v$el$1, v$2); return yyResult.createValue(yyValue, yyError); } } } // Alternative 2. yyValue = Pair.empty(); return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.Declarator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$Declarator(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Declarator>. yyResult = pJavaIdentifier$Identifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pDimensions(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$2. final Node v$g$2 = yyOpValue1; yyOpValue1 = null; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("=")) { yyResult = pVariableInitializer(yyResult.index); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } } else { yyError = yyError.select("'=' expected", yyBase); } { // Start scope for v$g$3. final Node v$g$3 = yyOpValue1; yyValue = GNode.create("Declarator", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$3. } // End scope for v$g$2. } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.Declarators. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDeclarators(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk7) yyColumn.chunk7 = new Chunk7(); if (null == yyColumn.chunk7.fDeclarators) yyColumn.chunk7.fDeclarators = pDeclarators$1(yyStart); return yyColumn.chunk7.fDeclarators; } /** Actually parse xtc.lang.jeannie.JeannieJava.Declarators. */ private Result pDeclarators$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJeannieJava$Declarator(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyResult = pDeclarators$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$g$2 = yyResult.semanticValue(); yyValue = GNode.createFromPair("Declarators", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal xtc.lang.jeannie.Jeannie.Declarators$$Star1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDeclarators$$Star1(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk7) yyColumn.chunk7 = new Chunk7(); if (null == yyColumn.chunk7.fDeclarators$$Star1) yyColumn.chunk7.fDeclarators$$Star1 = pDeclarators$$Star1$1(yyStart); return yyColumn.chunk7.fDeclarators$$Star1; } /** Actually parse xtc.lang.jeannie.Jeannie.Declarators$$Star1. */ private Result pDeclarators$$Star1$1(final int yyStart) throws IOException { Result yyResult; Pair<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue(",")) { yyResult = pJeannieJava$Declarator(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyResult = pDeclarators$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$2 = yyResult.semanticValue(); yyValue = new Pair<Node>(v$el$1, v$2); return yyResult.createValue(yyValue, yyError); } } } // Alternative 2. yyValue = Pair.empty(); return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.ClassBody. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pClassBody(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Body>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("{")) { yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieJava$Declaration(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } { // Start scope for v$g$1. final Pair<Node> v$g$1 = yyRepValue1.reverse(); yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("}")) { yyValue = GNode.createFromPair("ClassBody", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'}' expected", yyBase); } } // End scope for v$g$1. } // Done. yyError = yyError.select("class body expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.Declaration. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$Declaration(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Object yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pModifiers(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pType(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyResult = pDeclarators(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("FieldDeclaration", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } // Nested alternative 2. { // Start scope for nested choice. final int yyChoice2 = yyChoice1; // Nested alternative 1. yyResult = pResultType(yyChoice2); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyResult = pJavaIdentifier$Identifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$4 = yyResult.semanticValue(); yyResult = pFormalParameters(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$5 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pDimensions(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$6. final Node v$g$6 = cast(yyOpValue1); yyOpValue1 = null; yyResult = pThrowsClause(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$7. final Node v$g$7 = cast(yyOpValue1); final int yyChoice3 = yyOption1; // Nested alternative 1. yyResult = pBlock(yyChoice3); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$8 = yyResult.semanticValue(); yyValue = GNode.create("MethodDeclaration", v$g$1, null, v$g$3, v$g$4, v$g$5, v$g$6, v$g$7, v$g$8); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Nested alternative 2. yyBase = yyChoice3; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("MethodDeclaration", v$g$1, null, v$g$3, v$g$4, v$g$5, v$g$6, v$g$7, null); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // End scope for v$g$7. } // End scope for v$g$6. } } } // Nested alternative 2. yyResult = pJavaIdentifier$Identifier(yyChoice2); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$3 = yyResult.semanticValue(); yyResult = pFormalParameters(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$4 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pThrowsClause(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$5. final Node v$g$5 = cast(yyOpValue1); yyResult = pBlock(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$6 = yyResult.semanticValue(); yyValue = GNode.create("ConstructorDeclaration", v$g$1, null, v$g$3, v$g$4, v$g$5, v$g$6); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // End scope for v$g$5. } } } // End scope for nested choice. // Nested alternative 3. yyBase = yyChoice1; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("class")) { yyResult = pJavaIdentifier$Identifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pExtension(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$4. final Node v$g$4 = cast(yyOpValue1); yyOpValue1 = null; yyResult = pImplementation(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$5. final Node v$g$5 = cast(yyOpValue1); yyResult = pClassBody(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$6 = yyResult.semanticValue(); yyValue = GNode.create("ClassDeclaration", v$g$1, v$g$2, null, v$g$4, v$g$5, v$g$6); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // End scope for v$g$5. } // End scope for v$g$4. } } else { yyError = yyError.select("'class' expected", yyBase); } // Nested alternative 4. yyBase = yyChoice1; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("interface")) { yyResult = pJavaIdentifier$Identifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pExtension(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$4. final Node v$g$4 = cast(yyOpValue1); yyResult = pClassBody(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$5 = yyResult.semanticValue(); yyValue = GNode.create("InterfaceDeclaration", v$g$1, v$g$2, null, v$g$4, v$g$5); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // End scope for v$g$4. } } else { yyError = yyError.select("'interface' expected", yyBase); } } // Alternative 2. yyOption1 = yyStart; yyOpValue1 = null; yyBase = yyOption1; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("static")) { final String v$el$1 = "static"; yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } else { yyError = yyError.select("'static' expected", yyBase); } { // Start scope for v$g$1. final String v$g$1 = cast(yyOpValue1); yyResult = pBlock(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("BlockDeclaration", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // End scope for v$g$1. // Alternative 3. yyResult = pSymbol(yyStart); if (yyResult.hasValue(";")) { yyValue = GNode.create("EmptyDeclaration", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("declaration expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.ThrowsClause. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pThrowsClause(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("throws")) { yyResult = pQualifiedIdentifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pQualifiedIdentifier(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } { // Start scope for v$g$2. final Pair<Node> v$g$2 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("ThrowsClause", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$g$2. } } // Done. yyError = yyError.select("throws clause expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.Extension. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pExtension(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("extends")) { yyResult = pType(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pType(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } { // Start scope for v$g$2. final Pair<Node> v$g$2 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("Extension", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$g$2. } } // Done. yyError = yyError.select("extension expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.Implementation. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pImplementation(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("implements")) { yyResult = pType(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pType(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } { // Start scope for v$g$2. final Pair<Node> v$g$2 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("Implementation", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$g$2. } } // Done. yyError = yyError.select("implementation expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.Block. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pBlock(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk7) yyColumn.chunk7 = new Chunk7(); if (null == yyColumn.chunk7.fBlock) yyColumn.chunk7.fBlock = pBlock$1(yyStart); return yyColumn.chunk7.fBlock; } /** Actually parse xtc.lang.jeannie.JeannieJava.Block. */ private Result pBlock$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <JavaBlock>. yyResult = pJavaInJavaBlock(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <CBlock>. yyResult = pCInJavaBlock(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.DeclarationOrStatement. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$DeclarationOrStatement(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Declaration>. yyResult = pInBlockDeclaration(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <Statement>. yyResult = pJeannieJava$Statement(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.InBlockDeclaration. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pInBlockDeclaration(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Variable>. yyResult = pVariableDeclaration(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative 2. yyResult = pModifiers(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); final int yyChoice1 = yyResult.index; // Nested alternative 1. yyBase = yyChoice1; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("class")) { yyResult = pJavaIdentifier$Identifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pExtension(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$4. final Node v$g$4 = yyOpValue1; yyOpValue1 = null; yyResult = pImplementation(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$5. final Node v$g$5 = yyOpValue1; yyResult = pClassBody(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$6 = yyResult.semanticValue(); yyValue = GNode.create("ClassDeclaration", v$g$1, v$g$2, null, v$g$4, v$g$5, v$g$6); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // End scope for v$g$5. } // End scope for v$g$4. } } else { yyError = yyError.select("'class' expected", yyBase); } // Nested alternative 2. yyBase = yyChoice1; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("interface")) { yyResult = pJavaIdentifier$Identifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pExtension(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$4. final Node v$g$4 = yyOpValue1; yyResult = pClassBody(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$5 = yyResult.semanticValue(); yyValue = GNode.create("InterfaceDeclaration", v$g$1, v$g$2, null, v$g$4, v$g$5); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // End scope for v$g$4. } } else { yyError = yyError.select("'interface' expected", yyBase); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.VariableDeclaration. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pVariableDeclaration(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Declaration>. yyResult = pVariableModifiers(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyResult = pType(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyResult = pDeclarators(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("FieldDeclaration", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.Statement. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$Statement(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; boolean yyRepeated1; Pair<Node> yyRepValue1; int yyOption1; Object yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Block>. yyResult = pBlock(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative 2. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("if")) { yyResult = pParExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyResult = pJeannieJava$Statement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); final int yyChoice1 = yyResult.index; // Nested alternative 1. yyBase = yyChoice1; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("else")) { yyResult = pJeannieJava$Statement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = GNode.create("ConditionalStatement", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("'else' expected", yyBase); } // Nested alternative 2. yyValue = GNode.create("ConditionalStatement", v$g$1, v$g$2, null); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyChoice1, yyError); } } } // Alternative 3. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("for")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyResult = pBasicForControl(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pJeannieJava$Statement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("ForStatement", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } } // Alternative 4. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("while")) { yyResult = pParExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyResult = pJeannieJava$Statement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("WhileStatement", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } } // Alternative 5. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("do")) { yyResult = pJeannieJava$Statement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("while")) { yyResult = pParExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("DoWhileStatement", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } else { yyError = yyError.select("'while' expected", yyBase); } } } // Alternative 6. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("try")) { yyResult = pBlock(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); final int yyChoice1 = yyResult.index; // Nested alternative 1. yyRepetition1 = yyChoice1; yyRepValue1 = Pair.empty(); while (true) { yyResult = pCatchClause(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } { // Start scope for v$g$3. final Pair<Node> v$g$3 = yyRepValue1.reverse(); yyBase = yyRepetition1; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("finally")) { yyResult = pBlock(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$4 = yyResult.semanticValue(); yyValue = GNode.create("TryCatchFinallyStatement", v$g$3.size() + 3). add(null).add(v$g$2).addAll(v$g$3).add(v$g$4); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("'finally' expected", yyBase); } } // End scope for v$g$3. // Nested alternative 2. yyRepetition1 = yyChoice1; yyRepeated1 = false; yyRepValue1 = Pair.empty(); while (true) { yyResult = pCatchClause(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepeated1 = true; yyRepValue1 = new Pair<Node>(v$el$2, yyRepValue1); continue; } break; } if (yyRepeated1) { final Pair<Node> v$g$5 = yyRepValue1.reverse(); yyValue = GNode.create("TryCatchFinallyStatement", v$g$5.size() + 3). add(null).add(v$g$2).addAll(v$g$5).add(null); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } } } // Alternative 7. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("switch")) { yyResult = pParExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("{")) { yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pSwitchClause(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } { // Start scope for v$g$2. final Pair<Node> v$g$2 = yyRepValue1.reverse(); yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("}")) { yyValue = GNode.createFromPair("SwitchStatement", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'}' expected", yyBase); } } // End scope for v$g$2. } else { yyError = yyError.select("'{' expected", yyBase); } } } // Alternative 8. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("synchronized")) { yyResult = pParExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyResult = pBlock(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("SynchronizedStatement", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } } // Alternative 9. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("return")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pJeannieJava$Expression(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$1. final Node v$g$1 = cast(yyOpValue1); yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("ReturnStatement", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // End scope for v$g$1. } // Alternative 10. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("throw")) { yyResult = pJeannieJava$Expression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("ThrowStatement", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } // Alternative 11. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("break")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pJavaIdentifier$Identifier(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final String v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$1. final String v$g$1 = cast(yyOpValue1); yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("BreakStatement", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // End scope for v$g$1. } // Alternative 12. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("continue")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pJavaIdentifier$Identifier(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final String v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$1. final String v$g$1 = cast(yyOpValue1); yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("ContinueStatement", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // End scope for v$g$1. } // Alternative 13. yyResult = pJavaIdentifier$Identifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyResult = pJeannieJava$Statement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("LabeledStatement", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("':' expected", yyBase); } } // Alternative 14. yyResult = pJeannieJava$Expression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("ExpressionStatement", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // Alternative 15. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("assert")) { yyResult = pJeannieJava$Expression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyResult = pJeannieJava$Expression(yyResult.index); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } } else { yyError = yyError.select("':' expected", yyBase); } { // Start scope for v$g$2. final Node v$g$2 = cast(yyOpValue1); yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("AssertStatement", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // End scope for v$g$2. } } // Alternative 16. yyResult = pSymbol(yyStart); if (yyResult.hasValue(";")) { yyValue = GNode.create("EmptyStatement", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("statement expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.BasicForControl. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pBasicForControl(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Declaration>. yyResult = pVariableModifiers(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyResult = pType(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyResult = pDeclarators(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pJeannieJava$Expression(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$4. final Node v$g$4 = yyOpValue1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pJeannieJava$ExpressionList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$5. final Node v$g$5 = yyOpValue1; yyValue = GNode.create("BasicForControl", v$g$1, v$g$2, v$g$3, v$g$4, v$g$5); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$5. } else { yyError = yyError.select("';' expected", yyBase); } } // End scope for v$g$4. } else { yyError = yyError.select("';' expected", yyBase); } } } } // Alternative <Initialization>. yyOption1 = yyStart; yyOpValue1 = null; yyResult = pJeannieJava$ExpressionList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$3 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$3; } { // Start scope for v$g$8. final Node v$g$8 = yyOpValue1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pJeannieJava$Expression(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$4 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$4; } { // Start scope for v$g$9. final Node v$g$9 = yyOpValue1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pJeannieJava$ExpressionList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$5 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$5; } { // Start scope for v$g$10. final Node v$g$10 = yyOpValue1; yyValue = GNode.create("BasicForControl", null, null, v$g$8, v$g$9, v$g$10); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$10. } else { yyError = yyError.select("';' expected", yyBase); } } // End scope for v$g$9. } else { yyError = yyError.select("';' expected", yyBase); } } // End scope for v$g$8. // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.ParExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pParExpression(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk7) yyColumn.chunk7 = new Chunk7(); if (null == yyColumn.chunk7.fParExpression) yyColumn.chunk7.fParExpression = pParExpression$1(yyStart); return yyColumn.chunk7.fParExpression; } /** Actually parse xtc.lang.jeannie.JeannieJava.ParExpression. */ private Result pParExpression$1(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { yyResult = pJeannieJava$Expression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } } // Done. yyError = yyError.select("par expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.TryCatchFinallyStatement. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pTryCatchFinallyStatement(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; boolean yyRepeated1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("try")) { yyResult = pBlock(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); final int yyChoice1 = yyResult.index; // Nested alternative 1. yyRepetition1 = yyChoice1; yyRepValue1 = Pair.empty(); while (true) { yyResult = pCatchClause(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } { // Start scope for v$g$3. final Pair<Node> v$g$3 = yyRepValue1.reverse(); yyBase = yyRepetition1; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("finally")) { yyResult = pBlock(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$4 = yyResult.semanticValue(); yyValue = GNode.create("TryCatchFinallyStatement", v$g$3.size() + 3). add(null).add(v$g$2).addAll(v$g$3).add(v$g$4); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("'finally' expected", yyBase); } } // End scope for v$g$3. // Nested alternative 2. yyRepetition1 = yyChoice1; yyRepeated1 = false; yyRepValue1 = Pair.empty(); while (true) { yyResult = pCatchClause(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepeated1 = true; yyRepValue1 = new Pair<Node>(v$el$2, yyRepValue1); continue; } break; } if (yyRepeated1) { final Pair<Node> v$g$5 = yyRepValue1.reverse(); yyValue = GNode.create("TryCatchFinallyStatement", v$g$5.size() + 3). add(null).add(v$g$2).addAll(v$g$5).add(null); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } } } // Done. yyError = yyError.select("try catch finally statement expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.CatchClause. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCatchClause(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk7) yyColumn.chunk7 = new Chunk7(); if (null == yyColumn.chunk7.fCatchClause) yyColumn.chunk7.fCatchClause = pCatchClause$1(yyStart); return yyColumn.chunk7.fCatchClause; } /** Actually parse xtc.lang.jeannie.JeannieJava.CatchClause. */ private Result pCatchClause$1(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Catch>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("catch")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("(")) { yyResult = pFormalParameter(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pBlock(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("CatchClause", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } } // Done. yyError = yyError.select("catch clause expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.SwitchClause. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pSwitchClause(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("case")) { yyResult = pJeannieJava$Expression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieJava$DeclarationOrStatement(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } { // Start scope for v$g$2. final Pair<Node> v$g$2 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("CaseClause", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$g$2. } else { yyError = yyError.select("':' expected", yyBase); } } } // Alternative 2. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("default")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieJava$DeclarationOrStatement(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } { // Start scope for v$g$1. final Pair<Node> v$g$1 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("DefaultClause", v$g$1); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$g$1. } else { yyError = yyError.select("':' expected", yyBase); } } // Done. yyError = yyError.select("switch clause expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.SynchronizedStatement. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pSynchronizedStatement(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("synchronized")) { yyResult = pParExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyResult = pBlock(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("SynchronizedStatement", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } } // Done. yyError = yyError.select("synchronized statement expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.ThrowStatement. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pThrowStatement(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("throw")) { yyResult = pJeannieJava$Expression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = GNode.create("ThrowStatement", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } // Done. yyError = yyError.select("throw statement expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.ExpressionList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$ExpressionList(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJeannieJava$Expression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pJeannieJava$Expression(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } { // Start scope for v$g$2. final Pair<Node> v$g$2 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("ExpressionList", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$g$2. } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.Expression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$Expression(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk7) yyColumn.chunk7 = new Chunk7(); if (null == yyColumn.chunk7.fJeannieJava$Expression) yyColumn.chunk7.fJeannieJava$Expression = pJeannieJava$Expression$1(yyStart); return yyColumn.chunk7.fJeannieJava$Expression; } /** Actually parse xtc.lang.jeannie.JeannieJava.Expression. */ private Result pJeannieJava$Expression$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Assignment>. yyResult = pJeannieJava$ConditionalExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyResult = pJeannieJava$AssignmentOperator(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyResult = pJeannieJava$Expression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = GNode.create("Expression", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } } // Alternative <Base>. yyResult = pJeannieJava$ConditionalExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.AssignmentOperator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$AssignmentOperator(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Equal>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("=")) { yyValue = "="; return yyResult.createValue(yyValue, yyError); } // Alternative <PlusEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("+=")) { yyValue = "+="; return yyResult.createValue(yyValue, yyError); } // Alternative <MinusEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("-=")) { yyValue = "-="; return yyResult.createValue(yyValue, yyError); } // Alternative <StarEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("*=")) { yyValue = "*="; return yyResult.createValue(yyValue, yyError); } // Alternative <SlashEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("/=")) { yyValue = "/="; return yyResult.createValue(yyValue, yyError); } // Alternative <AmpersandEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("&=")) { yyValue = "&="; return yyResult.createValue(yyValue, yyError); } // Alternative <BarEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("|=")) { yyValue = "|="; return yyResult.createValue(yyValue, yyError); } // Alternative <CaretEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("^=")) { yyValue = "^="; return yyResult.createValue(yyValue, yyError); } // Alternative <PercentEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("%=")) { yyValue = "%="; return yyResult.createValue(yyValue, yyError); } // Alternative <DoubleLessEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("<<=")) { yyValue = "<<="; return yyResult.createValue(yyValue, yyError); } // Alternative <DoubleGreaterEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue(">>=")) { yyValue = ">>="; return yyResult.createValue(yyValue, yyError); } // Alternative <TripleGreaterEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue(">>>=")) { yyValue = ">>>="; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("assignment operator expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.ConditionalExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$ConditionalExpression(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk7) yyColumn.chunk7 = new Chunk7(); if (null == yyColumn.chunk7.fJeannieJava$ConditionalExpression) yyColumn.chunk7.fJeannieJava$ConditionalExpression = pJeannieJava$ConditionalExpression$1(yyStart); return yyColumn.chunk7.fJeannieJava$ConditionalExpression; } /** Actually parse xtc.lang.jeannie.JeannieJava.ConditionalExpression. */ private Result pJeannieJava$ConditionalExpression$1(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Conditional>. yyResult = pJeannieJava$LogicalOrExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("?")) { yyResult = pJeannieJava$Expression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyResult = pJeannieJava$ConditionalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = GNode.create("ConditionalExpression", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("':' expected", yyBase); } } } else { yyError = yyError.select("'?' expected", yyBase); } } // Alternative <Base>. yyResult = pJeannieJava$LogicalOrExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.LogicalOrExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$LogicalOrExpression(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk7) yyColumn.chunk7 = new Chunk7(); if (null == yyColumn.chunk7.fJeannieJava$LogicalOrExpression) yyColumn.chunk7.fJeannieJava$LogicalOrExpression = pJeannieJava$LogicalOrExpression$1(yyStart); return yyColumn.chunk7.fJeannieJava$LogicalOrExpression; } /** Actually parse xtc.lang.jeannie.JeannieJava.LogicalOrExpression. */ private Result pJeannieJava$LogicalOrExpression$1(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieJava$LogicalAndExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieJava$LogicalOrExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$3 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$3, yyRepValue1); continue; } break; } { // Start scope for v$4. final Pair<Action<Node>> v$4 = yyRepValue1.reverse(); yyValue = apply(v$4, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$4. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieJava.LogicalOrExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$LogicalOrExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Or>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("||")) { yyResult = pJeannieJava$LogicalAndExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("LogicalOrExpression", v$1, v$g$2); }}; return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("logical or expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.LogicalAndExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$LogicalAndExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieJava$BitwiseOrExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieJava$LogicalAndExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$3 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$3, yyRepValue1); continue; } break; } { // Start scope for v$4. final Pair<Action<Node>> v$4 = yyRepValue1.reverse(); yyValue = apply(v$4, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$4. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieJava.LogicalAndExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$LogicalAndExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <And>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("&&")) { yyResult = pJeannieJava$BitwiseOrExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("LogicalAndExpression", v$1, v$g$2); }}; return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("logical and expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.BitwiseOrExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$BitwiseOrExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieJava$BitwiseXorExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieJava$BitwiseOrExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$3 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$3, yyRepValue1); continue; } break; } { // Start scope for v$4. final Pair<Action<Node>> v$4 = yyRepValue1.reverse(); yyValue = apply(v$4, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$4. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieJava.BitwiseOrExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$BitwiseOrExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Or>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("|")) { yyResult = pJeannieJava$BitwiseXorExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("BitwiseOrExpression", v$1, v$g$2); }}; return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("bitwise or expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.BitwiseXorExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$BitwiseXorExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieJava$BitwiseAndExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieJava$BitwiseXorExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$3 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$3, yyRepValue1); continue; } break; } { // Start scope for v$4. final Pair<Action<Node>> v$4 = yyRepValue1.reverse(); yyValue = apply(v$4, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$4. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieJava.BitwiseXorExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$BitwiseXorExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Xor>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("^")) { yyResult = pJeannieJava$BitwiseAndExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("BitwiseXorExpression", v$1, v$g$2); }}; return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("bitwise xor expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.BitwiseAndExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$BitwiseAndExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieJava$EqualityExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieJava$BitwiseAndExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$3 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$3, yyRepValue1); continue; } break; } { // Start scope for v$4. final Pair<Action<Node>> v$4 = yyRepValue1.reverse(); yyValue = apply(v$4, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$4. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieJava.BitwiseAndExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$BitwiseAndExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <And>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("&")) { yyResult = pJeannieJava$EqualityExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("BitwiseAndExpression", v$1, v$g$2); }}; return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("bitwise and expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.EqualityExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$EqualityExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pInstanceOfExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieJava$EqualityExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$4 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$4, yyRepValue1); continue; } break; } { // Start scope for v$5. final Pair<Action<Node>> v$5 = yyRepValue1.reverse(); yyValue = apply(v$5, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$5. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieJava.EqualityExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$EqualityExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Recursion>. yyResult = p$$Shared7(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyResult = pInstanceOfExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("EqualityExpression", v$1, v$g$2, v$g$3); }}; return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.InstanceOfExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pInstanceOfExpression(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Instanceof>. yyResult = pJeannieJava$RelationalExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("instanceof")) { yyResult = pType(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("InstanceOfExpression", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("'instanceof' expected", yyBase); } } // Alternative <Base>. yyResult = pJeannieJava$RelationalExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.RelationalExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$RelationalExpression(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk7) yyColumn.chunk7 = new Chunk7(); if (null == yyColumn.chunk7.fJeannieJava$RelationalExpression) yyColumn.chunk7.fJeannieJava$RelationalExpression = pJeannieJava$RelationalExpression$1(yyStart); return yyColumn.chunk7.fJeannieJava$RelationalExpression; } /** Actually parse xtc.lang.jeannie.JeannieJava.RelationalExpression. */ private Result pJeannieJava$RelationalExpression$1(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieJava$ShiftExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieJava$RelationalExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$4 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$4, yyRepValue1); continue; } break; } { // Start scope for v$5. final Pair<Action<Node>> v$5 = yyRepValue1.reverse(); yyValue = apply(v$5, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$5. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieJava.RelationalExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$RelationalExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Recursion>. yyResult = pJeannieJava$RelationalOperator(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyResult = pJeannieJava$ShiftExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("RelationalExpression", v$1, v$g$2, v$g$3); }}; return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.RelationalOperator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$RelationalOperator(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Less>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("<")) { yyValue = "<"; return yyResult.createValue(yyValue, yyError); } // Alternative <Greater>. yyResult = pSymbol(yyStart); if (yyResult.hasValue(">")) { yyValue = ">"; return yyResult.createValue(yyValue, yyError); } // Alternative <LessEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("<=")) { yyValue = "<="; return yyResult.createValue(yyValue, yyError); } // Alternative <GreaterEqual>. yyResult = pSymbol(yyStart); if (yyResult.hasValue(">=")) { yyValue = ">="; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("relational operator expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.ShiftExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$ShiftExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieJava$AdditiveExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieJava$ShiftExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$4 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$4, yyRepValue1); continue; } break; } { // Start scope for v$5. final Pair<Action<Node>> v$5 = yyRepValue1.reverse(); yyValue = apply(v$5, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$5. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieJava.ShiftExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$ShiftExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Recursion>. yyResult = pJeannieJava$ShiftOperator(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyResult = pJeannieJava$AdditiveExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("ShiftExpression", v$1, v$g$2, v$g$3); }}; return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.ShiftOperator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$ShiftOperator(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Left>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("<<")) { yyValue = "<<"; return yyResult.createValue(yyValue, yyError); } // Alternative <Right>. yyResult = pSymbol(yyStart); if (yyResult.hasValue(">>")) { yyValue = ">>"; return yyResult.createValue(yyValue, yyError); } // Alternative <UnsignedRight>. yyResult = pSymbol(yyStart); if (yyResult.hasValue(">>>")) { yyValue = ">>>"; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("shift operator expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.AdditiveExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$AdditiveExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieJava$MultiplicativeExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieJava$AdditiveExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$4 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$4, yyRepValue1); continue; } break; } { // Start scope for v$5. final Pair<Action<Node>> v$5 = yyRepValue1.reverse(); yyValue = apply(v$5, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$5. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieJava.AdditiveExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$AdditiveExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Recursion>. yyResult = p$$Shared8(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyResult = pJeannieJava$MultiplicativeExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("AdditiveExpression", v$1, v$g$2, v$g$3); }}; return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.MultiplicativeExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$MultiplicativeExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieJava$UnaryExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieJava$MultiplicativeExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$4 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$4, yyRepValue1); continue; } break; } { // Start scope for v$5. final Pair<Action<Node>> v$5 = yyRepValue1.reverse(); yyValue = apply(v$5, yyValue, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$5. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieJava.MultiplicativeExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$MultiplicativeExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Times>. yyResult = p$$Shared9(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyResult = pJeannieJava$UnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("MultiplicativeExpression", v$1, v$g$2, v$g$3); }}; return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.UnaryExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$UnaryExpression(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Plus>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("+")) { final String v$g$1 = "+"; yyResult = pJeannieJava$UnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("UnaryExpression", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative <Minus>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("-")) { final String v$g$3 = "-"; yyResult = pJeannieJava$UnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$4 = yyResult.semanticValue(); yyValue = GNode.create("UnaryExpression", v$g$3, v$g$4); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative <Increment>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("++")) { final String v$g$5 = "++"; yyResult = pJeannieJava$UnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$6 = yyResult.semanticValue(); yyValue = GNode.create("UnaryExpression", v$g$5, v$g$6); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative <Decrement>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("--")) { final String v$g$7 = "--"; yyResult = pJeannieJava$UnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$8 = yyResult.semanticValue(); yyValue = GNode.create("UnaryExpression", v$g$7, v$g$8); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative <Base>. yyResult = pUnaryExpressionNotPlusMinus(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("unary expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal * xtc.lang.jeannie.JeannieJava.UnaryExpressionNotPlusMinus. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pUnaryExpressionNotPlusMinus(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("~")) { yyResult = pJeannieJava$UnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("BitwiseNegationExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative <CInJavaExpression>. yyResult = pCInJavaExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative 3. yyResult = pSymbol(yyStart); if (yyResult.hasValue("!")) { yyResult = pJeannieJava$UnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("LogicalNegationExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative 4. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pPrimitiveType(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pDimensions(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$2. final Node v$g$2 = yyOpValue1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pJeannieJava$UnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyValue = GNode.create("BasicCastExpression", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("')' expected", yyBase); } } // End scope for v$g$2. } // Nested alternative 2. yyResult = pType(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pUnaryExpressionNotPlusMinus(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyValue = GNode.create("CastExpression", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("')' expected", yyBase); } } } // Alternative <Base>. yyResult = pJeannieJava$PostfixExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("unary expression not plus minus expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.PostfixExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$PostfixExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Action<Node>> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pJeannieJava$PrimaryExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$15 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pJeannieJava$PostfixExpression$$Tail1(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Action<Node> v$16 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Action<Node>>(v$16, yyRepValue1); continue; } break; } { // Start scope for v$17. final Pair<Action<Node>> v$17 = yyRepValue1.reverse(); yyValue = apply(v$17, v$g$15, yyStart); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$17. } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal JeannieJava.PostfixExpression$$Tail1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$PostfixExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue(".")) { final int yyChoice1 = yyResult.index; // Nested alternative 1. { // Start scope for nested choice. final int yyChoice2 = yyChoice1; // Nested alternative 1. yyResult = pJavaIdentifier$Identifier(yyChoice2); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$3 = yyResult.semanticValue(); yyResult = pArguments(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$4 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("CallExpression", v$1, null, v$g$3, v$g$4); }}; return yyResult.createValue(yyValue, yyError); } } // Nested alternative 2. yyBase = yyChoice2; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("super")) { final String v$g$5 = "super"; yyResult = pArguments(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$6 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("CallExpression", v$1, null, v$g$5, v$g$6); }}; return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("'super' expected", yyBase); } } // End scope for nested choice. // Nested alternative 2. yyBase = yyChoice1; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("super")) { yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("SuperExpression", v$1); }}; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'super' expected", yyBase); } // Nested alternative 3. yyResult = pJavaIdentifier$Identifier(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$7 = yyResult.semanticValue(); yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("SelectionExpression", v$1, v$g$7); }}; return yyResult.createValue(yyValue, yyError); } } // Alternative 2. yyResult = pSymbol(yyStart); if (yyResult.hasValue("[")) { yyResult = pJeannieJava$Expression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$8 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("SubscriptExpression", v$1, v$g$8); }}; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("']' expected", yyBase); } } } // Alternative 3. yyResult = pSymbol(yyStart); if (yyResult.hasValue("++")) { final String v$g$9 = "++"; yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("PostfixExpression", v$1, v$g$9); }}; return yyResult.createValue(yyValue, yyError); } // Alternative 4. yyResult = pSymbol(yyStart); if (yyResult.hasValue("--")) { final String v$g$10 = "--"; yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("PostfixExpression", v$1, v$g$10); }}; return yyResult.createValue(yyValue, yyError); } // Alternative 5. yyResult = pSymbol(yyStart); if (yyResult.hasValue(".")) { yyBase = yyResult.index; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("new")) { yyResult = pJavaType$TypeName(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$12 = yyResult.semanticValue(); yyResult = pArguments(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$13 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pClassBody(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$14. final Node v$g$14 = yyOpValue1; yyValue = new Action<Node>() { public Node run(Node v$1) { return GNode.create("NewClassExpression", v$1, null, v$g$12, v$g$13, v$g$14); }}; return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$14. } } } else { yyError = yyError.select("'new' expected", yyBase); } } // Done. yyError = yyError.select("postfix expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.PrimaryExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$PrimaryExpression(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Literal>. yyResult = pLiteral(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <Expression>. yyResult = pJavaIdentifier$Identifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$3 = yyResult.semanticValue(); yyResult = pArguments(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$4 = yyResult.semanticValue(); yyValue = GNode.create("CallExpression", null, null, v$g$3, v$g$4); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative <Expression>. yyResult = pResultType(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(".")) { yyBase = yyResult.index; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("class")) { yyValue = GNode.create("ClassLiteralExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'class' expected", yyBase); } } else { yyError = yyError.select("'.' expected", yyBase); } } // Alternative <Expression>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("this")) { final String v$g$3 = "this"; yyResult = pArguments(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$4 = yyResult.semanticValue(); yyValue = GNode.create("CallExpression", null, null, v$g$3, v$g$4); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Alternative <Expression>. yyOption1 = yyStart; yyOpValue1 = null; yyResult = pQualifiedIdentifier(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(".")) { yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } else { yyError = yyError.select("'.' expected", yyBase); } } { // Start scope for v$g$1. final Node v$g$1 = yyOpValue1; yyBase = yyOption1; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("this")) { yyValue = GNode.create("ThisExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'this' expected", yyBase); } } // End scope for v$g$1. // Alternative 6. { // Start scope for nested choice. final int yyChoice1 = yyStart; // Nested alternative 1. yyResult = pJavaIdentifier$Word(yyChoice1); if (yyResult.hasValue("super")) { final String v$g$3 = "super"; yyResult = pArguments(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$4 = yyResult.semanticValue(); yyValue = GNode.create("CallExpression", null, null, v$g$3, v$g$4); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Nested alternative 2. yyBase = yyChoice1; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("super")) { yyValue = GNode.create("SuperExpression", null); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'super' expected", yyBase); } } // End scope for nested choice. // Alternative 7. yyResult = pJavaIdentifier$Identifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("PrimaryIdentifier", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } // Alternative <Expression>. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("new")) { yyResult = pJavaType$TypeName(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyResult = pArguments(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$4 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pClassBody(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$5. final Node v$g$5 = yyOpValue1; yyValue = GNode.create("NewClassExpression", null, null, v$g$3, v$g$4, v$g$5); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$5. } } } // Alternative 9. yyResult = pJavaIdentifier$Word(yyStart); if (yyResult.hasValue("new")) { yyResult = pJavaType$TypeName(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pConcreteDimensions(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pDimensions(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$3. final Node v$g$3 = yyOpValue1; yyValue = GNode.create("NewArrayExpression", v$g$1, v$g$2, v$g$3, null); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyOption1, yyError); } // End scope for v$g$3. } // Nested alternative 2. yyOption1 = yyChoice1; yyOpValue1 = null; yyResult = pDimensions(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$6. final Node v$g$6 = yyOpValue1; yyResult = pArrayInitializer(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$7 = yyResult.semanticValue(); yyValue = GNode.create("NewArrayExpression", v$g$1, null, v$g$6, v$g$7); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // End scope for v$g$6. } } // Alternative <Nested>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { yyResult = pJeannieJava$Expression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } } // Done. yyError = yyError.select("primary expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.ConcreteDimensions. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pConcreteDimensions(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; boolean yyRepeated1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyRepetition1 = yyStart; yyRepeated1 = false; yyRepValue1 = Pair.empty(); while (true) { yyResult = pConcreteDimension(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepeated1 = true; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } if (yyRepeated1) { final Pair<Node> v$g$1 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("ConcreteDimensions", v$g$1); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.ConcreteDimension. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pConcreteDimension(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("[")) { yyResult = pJeannieJava$Expression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("']' expected", yyBase); } } } // Done. yyError = yyError.select("concrete dimension expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.ArrayInitializer. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pArrayInitializer(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Node> yyRepValue1; int yyOption1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("{")) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pVariableInitializer(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pVariableInitializer(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } { // Start scope for v$g$2. final Pair<Node> v$g$2 = yyRepValue1.reverse(); yyOption1 = yyRepetition1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyOption1 = yyResult.index; } else { yyError = yyError.select("',' expected", yyBase); } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("}")) { yyValue = GNode.createFromPair("ArrayInitializer", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'}' expected", yyBase); } } // End scope for v$g$2. } // Nested alternative 2. yyOption1 = yyChoice1; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyOption1 = yyResult.index; } else { yyError = yyError.select("',' expected", yyBase); } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("}")) { yyValue = GNode.create("ArrayInitializer", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'}' expected", yyBase); } } // Done. yyError = yyError.select("array initializer expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.VariableInitializer. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pVariableInitializer(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk8) yyColumn.chunk8 = new Chunk8(); if (null == yyColumn.chunk8.fVariableInitializer) yyColumn.chunk8.fVariableInitializer = pVariableInitializer$1(yyStart); return yyColumn.chunk8.fVariableInitializer; } /** Actually parse xtc.lang.jeannie.JeannieJava.VariableInitializer. */ private Result pVariableInitializer$1(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Array>. yyResult = pArrayInitializer(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Alternative <Expression>. yyResult = pJeannieJava$Expression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = yyResult.semanticValue(); return yyResult.createValue(yyValue, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.Arguments. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pArguments(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pJeannieJava$Expression(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pJeannieJava$Expression(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } { // Start scope for v$g$2. final Pair<Node> v$g$2 = yyRepValue1.reverse(); yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = GNode.createFromPair("Arguments", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } // End scope for v$g$2. } // Nested alternative 2. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = GNode.create("Arguments", false); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } // Done. yyError = yyError.select("arguments expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.CInJava. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCInJava(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk8) yyColumn.chunk8 = new Chunk8(); if (null == yyColumn.chunk8.fCInJava) yyColumn.chunk8.fCInJava = pCInJava$1(yyStart); return yyColumn.chunk8.fCInJava; } /** Actually parse xtc.lang.jeannie.JeannieJava.CInJava. */ private Result pCInJava$1(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyBase; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("`")) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(".")) { yyBase = yyResult.index; yyC = character(yyBase); if ('C' == yyC) { yyIndex = yyResult.index + 1; yyResult = pSpacing(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("'C' expected", yyBase); } } else { yyError = yyError.select("'.' expected", yyBase); } // Nested alternative 2. yyValue = null; return new SemanticValue(yyValue, yyChoice1, yyError); } // Done. yyError = yyError.select("c in java expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.JavaInJavaBlock. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaInJavaBlock(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk8) yyColumn.chunk8 = new Chunk8(); if (null == yyColumn.chunk8.fJavaInJavaBlock) yyColumn.chunk8.fJavaInJavaBlock = pJavaInJavaBlock$1(yyStart); return yyColumn.chunk8.fJavaInJavaBlock; } /** Actually parse xtc.lang.jeannie.JeannieJava.JavaInJavaBlock. */ private Result pJavaInJavaBlock$1(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("{")) { yyResult = pJavaInJavaBlock$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$g$1 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("}")) { yyValue = GNode.createFromPair("JavaInJavaBlock", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'}' expected", yyBase); } } } // Done. yyError = yyError.select("java in java block expected", yyStart); return yyError; } // ========================================================================= /** * Parse synthetic nonterminal * xtc.lang.jeannie.Jeannie.JavaInJavaBlock$$Star1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJavaInJavaBlock$$Star1(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk8) yyColumn.chunk8 = new Chunk8(); if (null == yyColumn.chunk8.fJavaInJavaBlock$$Star1) yyColumn.chunk8.fJavaInJavaBlock$$Star1 = pJavaInJavaBlock$$Star1$1(yyStart); return yyColumn.chunk8.fJavaInJavaBlock$$Star1; } /** Actually parse xtc.lang.jeannie.Jeannie.JavaInJavaBlock$$Star1. */ private Result pJavaInJavaBlock$$Star1$1(final int yyStart) throws IOException { Result yyResult; Pair<Node> yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pJeannieJava$DeclarationOrStatement(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyResult = pJavaInJavaBlock$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Pair<Node> v$2 = yyResult.semanticValue(); yyValue = new Pair<Node>(v$el$1, v$2); return yyResult.createValue(yyValue, yyError); } } // Alternative 2. yyValue = Pair.empty(); return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.CInJavaBlock. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCInJavaBlock(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pCInJava(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pCInCBlock(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("CInJavaBlock", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.CInJavaExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCInJavaExpression(final int yyStart) throws IOException { Result yyResult; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pCInJava(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pJeannieC$UnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); yyValue = GNode.create("CInJavaExpression", v$g$1); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.JavaImports. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pJeannieJava$JavaImports(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyRepetition1 = yyStart; yyRepValue1 = Pair.empty(); while (true) { yyResult = pImportDeclaration(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } { // Start scope for v$g$1. final Pair<Node> v$g$1 = yyRepValue1.reverse(); yyValue = GNode.createFromPair("JavaImports", v$g$1); yyValue.setLocation(location(yyStart)); return new SemanticValue(yyValue, yyRepetition1, yyError); } // End scope for v$g$1. } // ========================================================================= /** * Parse nonterminal * xtc.lang.jeannie.JeannieJava.ClassOrInterfaceDeclaration. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pClassOrInterfaceDeclaration(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Node yyOpValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Start a state modification. yyState.start(); // Alternative 1. yyResult = pModifiers(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$1 = yyResult.semanticValue(); final int yyChoice1 = yyResult.index; // Nested alternative 1. yyBase = yyChoice1; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("class")) { yyResult = pJavaIdentifier$Identifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pExtension(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$4. final Node v$g$4 = yyOpValue1; yyOpValue1 = null; yyResult = pImplementation(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$2; } { // Start scope for v$g$5. final Node v$g$5 = yyOpValue1; yyResult = pClassBody(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$6 = yyResult.semanticValue(); yyValue = GNode.create("ClassDeclaration", v$g$1, v$g$2, null, v$g$4, v$g$5, v$g$6); yyValue.setLocation(location(yyStart)); // Commit the state modification. yyState.commit(); return yyResult.createValue(yyValue, yyError); } } // End scope for v$g$5. } // End scope for v$g$4. } } else { yyError = yyError.select("'class' expected", yyBase); } // Nested alternative 2. yyBase = yyChoice1; yyResult = pJavaIdentifier$Word(yyBase); if (yyResult.hasValue("interface")) { yyResult = pJavaIdentifier$Identifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final String v$g$2 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = null; yyResult = pExtension(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyOption1 = yyResult.index; yyOpValue1 = v$el$1; } { // Start scope for v$g$4. final Node v$g$4 = yyOpValue1; yyResult = pClassBody(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$5 = yyResult.semanticValue(); yyValue = GNode.create("InterfaceDeclaration", v$g$1, v$g$2, null, v$g$4, v$g$5); yyValue.setLocation(location(yyStart)); // Commit the state modification. yyState.commit(); return yyResult.createValue(yyValue, yyError); } } // End scope for v$g$4. } } else { yyError = yyError.select("'interface' expected", yyBase); } } // Abort the state modification. yyState.abort(); // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.jeannie.JeannieJava.CDeclarations. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCDeclarations(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Pair<Node> yyRepValue1; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pCInJava(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("{")) { yyRepetition1 = yyResult.index; yyRepValue1 = Pair.empty(); while (true) { yyResult = pExternalDeclaration(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { final Node v$el$1 = yyResult.semanticValue(); yyRepetition1 = yyResult.index; yyRepValue1 = new Pair<Node>(v$el$1, yyRepValue1); continue; } break; } { // Start scope for v$g$1. final Pair<Node> v$g$1 = yyRepValue1.reverse(); yyResult = pAnnotations(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("}")) { yyValue = GNode.create("CDeclarations", v$g$1.size() + 1). addAll(v$g$1).add(v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'}' expected", yyBase); } } } // End scope for v$g$1. } else { yyError = yyError.select("'{' expected", yyBase); } } // Done. return yyError; } // ========================================================================= static { add(JAVA_KEYWORDS, new String[] { "abstract", "continue", "for", "new", "switch", "assert", "default", "if", "package", "synchronized", "boolean", "do", "goto", "private", "this", "break", "double", "implements", "protected", "throw", "byte", "else", "import", "public", "throws", "case", "instanceof", "return", "transient", "catch", "extends", "int", "short", "try", "char", "final", "interface", "static", "void", "class", "finally", "long", "strictfp", "volatile", "const", "float", "native", "super", "while" }); } static { add(C_KEYWORDS, new String[] { "_cancel", "_commit", "_with" }); } static { add(C_KEYWORDS, new String[] { "auto", "break", "case", "char", "const", "continue", "default", "do", "double", "else", "enum", "extern", "float", "for", "goto", "if", "int", "long", "register", "return", "short", "signed", "sizeof", "static", "struct", "switch", "typedef", "union", "unsigned", "void", "volatile", "while" }); if (C99) add(C_KEYWORDS, new String[] { "_Bool", "_Complex", "inline", "restrict" }); if (GCC) add(C_KEYWORDS, new String[] { "__alignof", "__alignof__", "asm", "__asm", "__asm__", "__attribute", "__attribute__", "__builtin_offsetof", "__builtin_types_compatible_p", "__builtin_va_arg", "__builtin_va_list", "__complex__", "__const", "__const__", "__extension__", "__inline", "__inline__", "__label__", "__restrict", "__restrict__", "__signed", "__signed__", "__thread", "typeof", "__typeof", "__typeof__", "__volatile", "__volatile__" }); } // ========================================================================= /** * Get the specified text. * * @param s The text. * @return The text. */ protected static final String toText(String s) { return s; } // ========================================================================= /** * Add the specified values to the specified set. * * @param set The set. * @param values The new values. */ protected static final <T> void add(Set<T> set, T[] values) { for (T v : values) set.add(v); } /** * Check whether the specified set contains the specified value. * * @param set The set. * @param value The value. * @return <code>true</code> if the set contains the value. */ protected static final <T> boolean contains(Set<T> set, T value) { return set.contains(value); } // ========================================================================= /** * Parse the specified files. * * @param args The file names. */ public static void main(String[] args) { if ((null == args) || (0 == args.length)) { System.err.println("Usage: <file-name>+"); } else { for (int i=0; i<args.length; i++) { System.err.println("Processing " + args[i] + " ..."); Reader in = null; try { in = new BufferedReader(new FileReader(args[i])); JeannieParser p = new JeannieParser(in, args[i], (int)new File(args[i]).length()); Result r = p.pFile(0); if (r.hasValue()) { SemanticValue v = (SemanticValue)r; if (v.value instanceof Node) { Printer ptr = new Printer(new BufferedWriter(new OutputStreamWriter(System.out))); ptr.format((Node)v.value).pln().flush(); } else { System.out.println(v.value.toString()); } } else { ParseError err = (ParseError)r; if (-1 == err.index) { System.err.println(" Parse error"); } else { System.err.println(" " + p.location(err.index) + ": " + err.msg); } } } catch (Throwable x) { while (null != x.getCause()) { x = x.getCause(); } x.printStackTrace(); } finally { try { in.close(); } catch (Throwable x) { /* Ignore. */ } } } } } }