// =========================================================================== // This file has been generated by // Rats! Parser Generator, version 2.1.0, // (C) 2004-2011 Robert Grimm, // on Thursday, August 4, 2011 at 5:33:11 PM. // Edit at your own risk. // =========================================================================== package xtc.lang; import java.io.Reader; import java.io.IOException; import java.util.HashSet; import java.util.Set; import xtc.util.Pair; import xtc.parser.ParserBase; import xtc.parser.Column; import xtc.parser.Result; import xtc.parser.SemanticValue; import xtc.parser.ParseError; /** * Packrat parser for grammar <code>xtc.lang.Java</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 JavaRecognizer extends ParserBase { /** The JAVA_KEYWORDS set. */ public static final Set<String> JAVA_KEYWORDS = new HashSet<String>(); // ========================================================================= /** Chunk 1 of memoized results. */ static final class Chunk1 { Result fModifiers; Result fFormalParameters; Result fFormalParameters$$Star1; Result fDeclarators; Result fDeclarators$$Star1; Result fBlock; Result fBlock$$Star1; Result fParExpression; Result fCatchClause; Result fExpression; } /** Chunk 2 of memoized results. */ static final class Chunk2 { Result fConditionalExpression; Result fVariableInitializer; Result fResultType; Result fType; Result fTypeName; Result fPrimitiveType; Result fDimensions; Result fQualifiedIdentifier; Result fQualifiedIdentifier$$Star1; Result fIdentifier; } /** Chunk 3 of memoized results. */ static final class Chunk3 { Result fWord; Result fSymbol; } // ========================================================================= /** Memoization table column. */ static final class JavaRecognizerColumn extends Column { Chunk1 chunk1; Chunk2 chunk2; Chunk3 chunk3; } // ========================================================================= /** * Create a new packrat parser. * * @param reader The reader. * @param file The file name. */ public JavaRecognizer(final Reader reader, final String file) { super(reader, file); } /** * Create a new packrat parser. * * @param reader The file reader. * @param file The file name. * @param size The file size. */ public JavaRecognizer(final Reader reader, final String file, final int size) { super(reader, file, size); } // ========================================================================= protected Column newColumn() { return new JavaRecognizerColumn(); } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.CompilationUnit. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ public Result pCompilationUnit(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; int yyRepetition1; int yyOption1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSpacing(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pPackageDeclaration(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyRepetition1 = yyOption1; while (true) { yyResult = pImportDeclaration(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } break; } while (true) { yyResult = pDeclaration(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } break; } yyOption1 = yyRepetition1; yyC = character(yyOption1); if ('\u001a' == yyC) { yyIndex = yyOption1 + 1; yyOption1 = yyIndex; } yyResult = pEndOfFile(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("compilation unit expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Declaration>. yyResult = pWord(yyStart); if (yyResult.hasValue("package")) { yyResult = pQualifiedIdentifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; 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.Java.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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Declaration>. yyResult = pWord(yyStart); if (yyResult.hasValue("import")) { yyResult = pQualifiedIdentifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pDotStarTail(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } // Done. yyError = yyError.select("import declaration expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.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.Java.Modifiers. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pModifiers(final int yyStart) throws IOException { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fModifiers) yyColumn.chunk1.fModifiers = pModifiers$1(yyStart); return yyColumn.chunk1.fModifiers; } /** Actually parse xtc.lang.Java.Modifiers. */ private Result pModifiers$1(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyRepetition1 = yyStart; while (true) { yyResult = pModifier(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Public>. yyResult = pWord(yyStart); if (yyResult.hasValue("public")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Protected>. yyResult = pWord(yyStart); if (yyResult.hasValue("protected")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Private>. yyResult = pWord(yyStart); if (yyResult.hasValue("private")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Static>. yyResult = pWord(yyStart); if (yyResult.hasValue("static")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Abstract>. yyResult = pWord(yyStart); if (yyResult.hasValue("abstract")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Final>. yyResult = pWord(yyStart); if (yyResult.hasValue("final")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Native>. yyResult = pWord(yyStart); if (yyResult.hasValue("native")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Synchronized>. yyResult = pWord(yyStart); if (yyResult.hasValue("synchronized")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Transient>. yyResult = pWord(yyStart); if (yyResult.hasValue("transient")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Volatile>. yyResult = pWord(yyStart); if (yyResult.hasValue("volatile")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Strictfp>. yyResult = pWord(yyStart); if (yyResult.hasValue("strictfp")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("modifier expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Parameter>. yyResult = pVariableModifiers(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pType(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pIdentifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pDimensions(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyValue = null; return new SemanticValue(yyValue, yyOption1, yyError); } } } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Final>. yyResult = pFinalModifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Nonfinal>. yyValue = null; return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pWord(yyStart); if (yyResult.hasValue("final")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("final modifier expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.FormalParameters. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pFormalParameters(final int yyStart) throws IOException { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fFormalParameters) yyColumn.chunk1.fFormalParameters = pFormalParameters$1(yyStart); return yyColumn.chunk1.fFormalParameters; } /** Actually parse xtc.lang.Java.FormalParameters. */ private Result pFormalParameters$1(final int yyStart) throws IOException { 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. yyResult = pFormalParameter(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pFormalParameters$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } } // Nested alternative 2. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = null; 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.Java.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 { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fFormalParameters$$Star1) yyColumn.chunk1.fFormalParameters$$Star1 = pFormalParameters$$Star1$1(yyStart); return yyColumn.chunk1.fFormalParameters$$Star1; } /** Actually parse xtc.lang.Java.FormalParameters$$Star1. */ private Result pFormalParameters$$Star1$1(final int yyStart) throws IOException { Result yyResult; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue(",")) { yyResult = pFormalParameter(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pFormalParameters$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } } // Alternative 2. yyValue = null; return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.Declarator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDeclarator(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Declarator>. yyResult = pIdentifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pDimensions(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("=")) { yyResult = pVariableInitializer(yyResult.index); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } } else { yyError = yyError.select("'=' expected", yyBase); } yyValue = null; return new SemanticValue(yyValue, yyOption1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.Declarators. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDeclarators(final int yyStart) throws IOException { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fDeclarators) yyColumn.chunk1.fDeclarators = pDeclarators$1(yyStart); return yyColumn.chunk1.fDeclarators; } /** Actually parse xtc.lang.Java.Declarators. */ private Result pDeclarators$1(final int yyStart) throws IOException { Result yyResult; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pDeclarator(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pDeclarators$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal xtc.lang.Java.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 { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fDeclarators$$Star1) yyColumn.chunk1.fDeclarators$$Star1 = pDeclarators$$Star1$1(yyStart); return yyColumn.chunk1.fDeclarators$$Star1; } /** Actually parse xtc.lang.Java.Declarators$$Star1. */ private Result pDeclarators$$Star1$1(final int yyStart) throws IOException { Result yyResult; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue(",")) { yyResult = pDeclarator(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pDeclarators$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } } // Alternative 2. yyValue = null; return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Body>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("{")) { yyRepetition1 = yyResult.index; while (true) { yyResult = pDeclaration(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } break; } yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("}")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'}' expected", yyBase); } } // Done. yyError = yyError.select("class body expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.Declaration. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDeclaration(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pModifiers(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pType(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pDeclarators(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; 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()) { yyResult = pIdentifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pFormalParameters(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pDimensions(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyResult = pThrowsClause(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } final int yyChoice3 = yyOption1; // Nested alternative 1. yyResult = pBlock(yyChoice3); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Nested alternative 2. yyBase = yyChoice3; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } } // Nested alternative 2. yyResult = pIdentifier(yyChoice2); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pFormalParameters(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pThrowsClause(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyResult = pBlock(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } } } // End scope for nested choice. // Nested alternative 3. yyBase = yyChoice1; yyResult = pWord(yyBase); if (yyResult.hasValue("class")) { yyResult = pIdentifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pExtension(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyResult = pImplementation(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyResult = pClassBody(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } } else { yyError = yyError.select("'class' expected", yyBase); } // Nested alternative 4. yyBase = yyChoice1; yyResult = pWord(yyBase); if (yyResult.hasValue("interface")) { yyResult = pIdentifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pExtension(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyResult = pClassBody(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } } else { yyError = yyError.select("'interface' expected", yyBase); } } // Alternative 2. yyOption1 = yyStart; yyBase = yyOption1; yyResult = pWord(yyBase); if (yyResult.hasValue("static")) { yyOption1 = yyResult.index; } else { yyError = yyError.select("'static' expected", yyBase); } yyResult = pBlock(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative 3. yyResult = pSymbol(yyStart); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("declaration expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pWord(yyStart); if (yyResult.hasValue("throws")) { yyResult = pQualifiedIdentifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pQualifiedIdentifier(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } } // Done. yyError = yyError.select("throws clause expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pWord(yyStart); if (yyResult.hasValue("extends")) { yyResult = pType(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pType(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } } // Done. yyError = yyError.select("extension expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pWord(yyStart); if (yyResult.hasValue("implements")) { yyResult = pType(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pType(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } } // Done. yyError = yyError.select("implementation expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.Block. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pBlock(final int yyStart) throws IOException { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fBlock) yyColumn.chunk1.fBlock = pBlock$1(yyStart); return yyColumn.chunk1.fBlock; } /** Actually parse xtc.lang.Java.Block. */ private Result pBlock$1(final int yyStart) throws IOException { Result yyResult; int yyBase; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Block>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("{")) { yyResult = pBlock$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("}")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'}' expected", yyBase); } } } // Done. yyError = yyError.select("block expected", yyStart); return yyError; } // ========================================================================= /** * Parse synthetic nonterminal xtc.lang.Java.Block$$Star1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pBlock$$Star1(final int yyStart) throws IOException { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fBlock$$Star1) yyColumn.chunk1.fBlock$$Star1 = pBlock$$Star1$1(yyStart); return yyColumn.chunk1.fBlock$$Star1; } /** Actually parse xtc.lang.Java.Block$$Star1. */ private Result pBlock$$Star1$1(final int yyStart) throws IOException { Result yyResult; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pDeclarationOrStatement(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pBlock$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } // Alternative 2. yyValue = null; return new SemanticValue(yyValue, yyStart, yyError); } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.DeclarationOrStatement. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDeclarationOrStatement(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; boolean yyRepeated1; int yyOption1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Declaration>. yyResult = pVariableModifiers(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pType(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pDeclarators(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } } // Alternative 2. yyResult = pModifiers(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyBase = yyChoice1; yyResult = pWord(yyBase); if (yyResult.hasValue("class")) { yyResult = pIdentifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pExtension(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyResult = pImplementation(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyResult = pClassBody(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } } else { yyError = yyError.select("'class' expected", yyBase); } // Nested alternative 2. yyBase = yyChoice1; yyResult = pWord(yyBase); if (yyResult.hasValue("interface")) { yyResult = pIdentifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pExtension(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyResult = pClassBody(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } } else { yyError = yyError.select("'interface' expected", yyBase); } } // Alternative <Block>. yyResult = pBlock(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative 4. yyResult = pWord(yyStart); if (yyResult.hasValue("if")) { yyResult = pParExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pStatement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyBase = yyChoice1; yyResult = pWord(yyBase); if (yyResult.hasValue("else")) { yyResult = pStatement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("'else' expected", yyBase); } // Nested alternative 2. yyValue = null; return new SemanticValue(yyValue, yyChoice1, yyError); } } } // Alternative 5. yyResult = pWord(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()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pStatement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } } // Alternative 6. yyResult = pWord(yyStart); if (yyResult.hasValue("while")) { yyResult = pParExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pStatement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } } // Alternative 7. yyResult = pWord(yyStart); if (yyResult.hasValue("do")) { yyResult = pStatement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pWord(yyBase); if (yyResult.hasValue("while")) { yyResult = pParExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } else { yyError = yyError.select("'while' expected", yyBase); } } } // Alternative 8. yyResult = pWord(yyStart); if (yyResult.hasValue("try")) { yyResult = pBlock(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyRepetition1 = yyChoice1; while (true) { yyResult = pCatchClause(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } break; } yyBase = yyRepetition1; yyResult = pWord(yyBase); if (yyResult.hasValue("finally")) { yyResult = pBlock(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("'finally' expected", yyBase); } // Nested alternative 2. yyRepetition1 = yyChoice1; yyRepeated1 = false; while (true) { yyResult = pCatchClause(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; yyRepeated1 = true; continue; } break; } if (yyRepeated1) { yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } } } // Alternative 9. yyResult = pWord(yyStart); if (yyResult.hasValue("switch")) { yyResult = pParExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("{")) { yyRepetition1 = yyResult.index; while (true) { yyResult = pSwitchClause(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } break; } yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("}")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'}' expected", yyBase); } } else { yyError = yyError.select("'{' expected", yyBase); } } } // Alternative 10. yyResult = pWord(yyStart); if (yyResult.hasValue("synchronized")) { yyResult = pParExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pBlock(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } } // Alternative 11. yyResult = pWord(yyStart); if (yyResult.hasValue("return")) { yyOption1 = yyResult.index; yyResult = pExpression(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // Alternative 12. yyResult = pWord(yyStart); if (yyResult.hasValue("throw")) { yyResult = pExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } // Alternative 13. yyResult = pWord(yyStart); if (yyResult.hasValue("break")) { yyOption1 = yyResult.index; yyResult = pIdentifier(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // Alternative 14. yyResult = pWord(yyStart); if (yyResult.hasValue("continue")) { yyOption1 = yyResult.index; yyResult = pIdentifier(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // Alternative 15. yyResult = pIdentifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyResult = pStatement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("':' expected", yyBase); } } // Alternative 16. yyResult = pExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // Alternative 17. yyResult = pWord(yyStart); if (yyResult.hasValue("assert")) { yyResult = pExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyResult = pExpression(yyResult.index); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } } else { yyError = yyError.select("':' expected", yyBase); } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } // Alternative 18. yyResult = pSymbol(yyStart); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("declaration or statement expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.Statement. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pStatement(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; boolean yyRepeated1; int yyOption1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Block>. yyResult = pBlock(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative 2. yyResult = pWord(yyStart); if (yyResult.hasValue("if")) { yyResult = pParExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pStatement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyBase = yyChoice1; yyResult = pWord(yyBase); if (yyResult.hasValue("else")) { yyResult = pStatement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("'else' expected", yyBase); } // Nested alternative 2. yyValue = null; return new SemanticValue(yyValue, yyChoice1, yyError); } } } // Alternative 3. yyResult = pWord(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()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pStatement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("')' expected", yyBase); } } } else { yyError = yyError.select("'(' expected", yyBase); } } // Alternative 4. yyResult = pWord(yyStart); if (yyResult.hasValue("while")) { yyResult = pParExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pStatement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } } // Alternative 5. yyResult = pWord(yyStart); if (yyResult.hasValue("do")) { yyResult = pStatement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pWord(yyBase); if (yyResult.hasValue("while")) { yyResult = pParExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } else { yyError = yyError.select("'while' expected", yyBase); } } } // Alternative 6. yyResult = pWord(yyStart); if (yyResult.hasValue("try")) { yyResult = pBlock(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyRepetition1 = yyChoice1; while (true) { yyResult = pCatchClause(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } break; } yyBase = yyRepetition1; yyResult = pWord(yyBase); if (yyResult.hasValue("finally")) { yyResult = pBlock(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("'finally' expected", yyBase); } // Nested alternative 2. yyRepetition1 = yyChoice1; yyRepeated1 = false; while (true) { yyResult = pCatchClause(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; yyRepeated1 = true; continue; } break; } if (yyRepeated1) { yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } } } // Alternative 7. yyResult = pWord(yyStart); if (yyResult.hasValue("switch")) { yyResult = pParExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("{")) { yyRepetition1 = yyResult.index; while (true) { yyResult = pSwitchClause(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } break; } yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("}")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'}' expected", yyBase); } } else { yyError = yyError.select("'{' expected", yyBase); } } } // Alternative 8. yyResult = pWord(yyStart); if (yyResult.hasValue("synchronized")) { yyResult = pParExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pBlock(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } } // Alternative 9. yyResult = pWord(yyStart); if (yyResult.hasValue("return")) { yyOption1 = yyResult.index; yyResult = pExpression(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // Alternative 10. yyResult = pWord(yyStart); if (yyResult.hasValue("throw")) { yyResult = pExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } // Alternative 11. yyResult = pWord(yyStart); if (yyResult.hasValue("break")) { yyOption1 = yyResult.index; yyResult = pIdentifier(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // Alternative 12. yyResult = pWord(yyStart); if (yyResult.hasValue("continue")) { yyOption1 = yyResult.index; yyResult = pIdentifier(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // Alternative 13. yyResult = pIdentifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyResult = pStatement(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("':' expected", yyBase); } } // Alternative 14. yyResult = pExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } // Alternative 15. yyResult = pWord(yyStart); if (yyResult.hasValue("assert")) { yyResult = pExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyResult = pExpression(yyResult.index); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } } else { yyError = yyError.select("':' expected", yyBase); } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } } // Alternative 16. yyResult = pSymbol(yyStart); if (yyResult.hasValue(";")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("statement expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Declaration>. yyResult = pVariableModifiers(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pType(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pDeclarators(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyOption1 = yyResult.index; yyResult = pExpression(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyOption1 = yyResult.index; yyResult = pExpressionList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyValue = null; return new SemanticValue(yyValue, yyOption1, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } else { yyError = yyError.select("';' expected", yyBase); } } } } // Alternative <Initialization>. yyOption1 = yyStart; yyResult = pExpressionList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyOption1 = yyResult.index; yyResult = pExpression(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(";")) { yyOption1 = yyResult.index; yyResult = pExpressionList(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyValue = null; return new SemanticValue(yyValue, yyOption1, yyError); } else { yyError = yyError.select("';' expected", yyBase); } } else { yyError = yyError.select("';' expected", yyBase); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.ParExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pParExpression(final int yyStart) throws IOException { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fParExpression) yyColumn.chunk1.fParExpression = pParExpression$1(yyStart); return yyColumn.chunk1.fParExpression; } /** Actually parse xtc.lang.Java.ParExpression. */ private Result pParExpression$1(final int yyStart) throws IOException { Result yyResult; int yyBase; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { yyResult = pExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = null; 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.Java.CatchClause. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCatchClause(final int yyStart) throws IOException { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fCatchClause) yyColumn.chunk1.fCatchClause = pCatchClause$1(yyStart); return yyColumn.chunk1.fCatchClause; } /** Actually parse xtc.lang.Java.CatchClause. */ private Result pCatchClause$1(final int yyStart) throws IOException { Result yyResult; int yyBase; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Catch>. yyResult = pWord(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()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pBlock(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; 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.Java.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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pWord(yyStart); if (yyResult.hasValue("case")) { yyResult = pExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyRepetition1 = yyResult.index; while (true) { yyResult = pDeclarationOrStatement(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } else { yyError = yyError.select("':' expected", yyBase); } } } // Alternative 2. yyResult = pWord(yyStart); if (yyResult.hasValue("default")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyRepetition1 = yyResult.index; while (true) { yyResult = pDeclarationOrStatement(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } else { yyError = yyError.select("':' expected", yyBase); } } // Done. yyError = yyError.select("switch clause expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.ExpressionList. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pExpressionList(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pExpression(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.Expression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pExpression(final int yyStart) throws IOException { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fExpression) yyColumn.chunk1.fExpression = pExpression$1(yyStart); return yyColumn.chunk1.fExpression; } /** Actually parse xtc.lang.Java.Expression. */ private Result pExpression$1(final int yyStart) throws IOException { Result yyResult; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pConditionalExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pAssignmentOperator(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pExpression(yyResult.index); 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); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.AssignmentOperator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAssignmentOperator(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.Java.ConditionalExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pConditionalExpression(final int yyStart) throws IOException { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)column(yyStart); if (null == yyColumn.chunk2) yyColumn.chunk2 = new Chunk2(); if (null == yyColumn.chunk2.fConditionalExpression) yyColumn.chunk2.fConditionalExpression = pConditionalExpression$1(yyStart); return yyColumn.chunk2.fConditionalExpression; } /** Actually parse xtc.lang.Java.ConditionalExpression. */ private Result pConditionalExpression$1(final int yyStart) throws IOException { Result yyResult; int yyBase; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pLogicalOrExpression(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 = pExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(":")) { yyResult = pConditionalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("':' expected", yyBase); } } } else { yyError = yyError.select("'?' expected", yyBase); } // Nested alternative 2. yyValue = null; return new SemanticValue(yyValue, yyChoice1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.LogicalOrExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pLogicalOrExpression(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pLogicalAndExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("||")) { yyResult = pLogicalAndExpression(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } else { yyError = yyError.select("'||' expected", yyBase); } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.LogicalAndExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pLogicalAndExpression(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pBitwiseOrExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("&&")) { yyResult = pBitwiseOrExpression(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } else { yyError = yyError.select("'&&' expected", yyBase); } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.BitwiseOrExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pBitwiseOrExpression(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pBitwiseXorExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("|")) { yyResult = pBitwiseXorExpression(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } else { yyError = yyError.select("'|' expected", yyBase); } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.BitwiseXorExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pBitwiseXorExpression(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pBitwiseAndExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("^")) { yyResult = pBitwiseAndExpression(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } else { yyError = yyError.select("'^' expected", yyBase); } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.BitwiseAndExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pBitwiseAndExpression(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pEqualityExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("&")) { yyResult = pEqualityExpression(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } else { yyError = yyError.select("'&' expected", yyBase); } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.EqualityExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pEqualityExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pInstanceOfExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; while (true) { yyResult = pEqualityOperator(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyResult = pInstanceOfExpression(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.EqualityOperator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pEqualityOperator(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("equality operator expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pRelationalExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyBase = yyChoice1; yyResult = pWord(yyBase); if (yyResult.hasValue("instanceof")) { yyResult = pType(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("'instanceof' expected", yyBase); } // Nested alternative 2. yyValue = null; return new SemanticValue(yyValue, yyChoice1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.RelationalExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pRelationalExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pShiftExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; while (true) { yyResult = pRelationalOperator(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyResult = pShiftExpression(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.RelationalOperator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pRelationalOperator(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.Java.ShiftExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pShiftExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pAdditiveExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; while (true) { yyResult = pShiftOperator(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyResult = pAdditiveExpression(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.ShiftOperator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pShiftOperator(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.Java.AdditiveExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAdditiveExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pMultiplicativeExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; while (true) { yyResult = pAdditiveOperator(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyResult = pMultiplicativeExpression(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.AdditiveOperator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pAdditiveOperator(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("additive operator expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.MultiplicativeExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pMultiplicativeExpression(final int yyStart) throws IOException { Result yyResult; int yyRepetition1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Base>. yyResult = pUnaryExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; while (true) { yyResult = pMultiplicativeOperator(yyRepetition1); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyResult = pUnaryExpression(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.MultiplicativeOperator. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pMultiplicativeOperator(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("multiplicative operator expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.UnaryExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pUnaryExpression(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; int yyOption1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Plus>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("+")) { yyResult = pUnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } // Alternative <Minus>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("-")) { yyResult = pUnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } // Alternative <Increment>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("++")) { yyResult = pUnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } // Alternative <Decrement>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("--")) { yyResult = pUnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } // Alternative 5. yyResult = pSymbol(yyStart); if (yyResult.hasValue("~")) { yyResult = pUnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } // Alternative 6. yyResult = pSymbol(yyStart); if (yyResult.hasValue("!")) { yyResult = pUnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } // Alternative 7. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pPrimitiveType(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pDimensions(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pUnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("')' expected", yyBase); } } // Nested alternative 2. yyResult = pType(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pUnaryExpressionNotPlusMinus(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("')' expected", yyBase); } } } // Alternative <Base>. yyResult = pPrimaryExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; while (true) { final int yyChoice1 = yyRepetition1; // Nested alternative 1. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(".")) { final int yyChoice2 = yyResult.index; // Nested alternative 1. { // Start scope for nested choice. final int yyChoice3 = yyChoice2; // Nested alternative 1. yyResult = pIdentifier(yyChoice3); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyResult = pArguments(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } // Nested alternative 2. yyBase = yyChoice3; yyResult = pWord(yyBase); if (yyResult.hasValue("super")) { yyResult = pArguments(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } else { yyError = yyError.select("'super' expected", yyBase); } } // End scope for nested choice. // Nested alternative 2. yyBase = yyChoice2; yyResult = pWord(yyBase); if (yyResult.hasValue("super")) { yyRepetition1 = yyResult.index; continue; } else { yyError = yyError.select("'super' expected", yyBase); } // Nested alternative 3. yyResult = pIdentifier(yyChoice2); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } else { yyError = yyError.select("'.' expected", yyBase); } // Nested alternative 2. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("[")) { yyResult = pExpression(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyRepetition1 = yyResult.index; continue; } else { yyError = yyError.select("']' expected", yyBase); } } } else { yyError = yyError.select("'[' expected", yyBase); } // Nested alternative 3. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("++")) { yyRepetition1 = yyResult.index; continue; } else { yyError = yyError.select("'++' expected", yyBase); } // Nested alternative 4. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("--")) { yyRepetition1 = yyResult.index; continue; } else { yyError = yyError.select("'--' expected", yyBase); } // Nested alternative 5. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(".")) { yyBase = yyResult.index; yyResult = pWord(yyBase); if (yyResult.hasValue("new")) { yyResult = pTypeName(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyResult = pArguments(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pClassBody(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyRepetition1 = yyOption1; continue; } } } else { yyError = yyError.select("'new' expected", yyBase); } } else { yyError = yyError.select("'.' expected", yyBase); } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. yyError = yyError.select("unary expression expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.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 yyRepetition1; int yyOption1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("~")) { yyResult = pUnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } // Alternative 2. yyResult = pSymbol(yyStart); if (yyResult.hasValue("!")) { yyResult = pUnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } // Alternative 3. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pPrimitiveType(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pDimensions(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyBase = yyOption1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pUnaryExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("')' expected", yyBase); } } // Nested alternative 2. yyResult = pType(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyResult = pUnaryExpressionNotPlusMinus(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } else { yyError = yyError.select("')' expected", yyBase); } } } // Alternative <Base>. yyResult = pPrimaryExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; while (true) { final int yyChoice1 = yyRepetition1; // Nested alternative 1. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(".")) { final int yyChoice2 = yyResult.index; // Nested alternative 1. { // Start scope for nested choice. final int yyChoice3 = yyChoice2; // Nested alternative 1. yyResult = pIdentifier(yyChoice3); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyResult = pArguments(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } // Nested alternative 2. yyBase = yyChoice3; yyResult = pWord(yyBase); if (yyResult.hasValue("super")) { yyResult = pArguments(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } else { yyError = yyError.select("'super' expected", yyBase); } } // End scope for nested choice. // Nested alternative 2. yyBase = yyChoice2; yyResult = pWord(yyBase); if (yyResult.hasValue("super")) { yyRepetition1 = yyResult.index; continue; } else { yyError = yyError.select("'super' expected", yyBase); } // Nested alternative 3. yyResult = pIdentifier(yyChoice2); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } else { yyError = yyError.select("'.' expected", yyBase); } // Nested alternative 2. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("[")) { yyResult = pExpression(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyRepetition1 = yyResult.index; continue; } else { yyError = yyError.select("']' expected", yyBase); } } } else { yyError = yyError.select("'[' expected", yyBase); } // Nested alternative 3. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("++")) { yyRepetition1 = yyResult.index; continue; } else { yyError = yyError.select("'++' expected", yyBase); } // Nested alternative 4. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("--")) { yyRepetition1 = yyResult.index; continue; } else { yyError = yyError.select("'--' expected", yyBase); } // Nested alternative 5. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(".")) { yyBase = yyResult.index; yyResult = pWord(yyBase); if (yyResult.hasValue("new")) { yyResult = pTypeName(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyResult = pArguments(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pClassBody(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyRepetition1 = yyOption1; continue; } } } else { yyError = yyError.select("'new' expected", yyBase); } } else { yyError = yyError.select("'.' expected", yyBase); } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. yyError = yyError.select("unary expression not plus minus expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.PrimaryExpression. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pPrimaryExpression(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyOption1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <FloatingPoint>. yyResult = pFloatingPointString(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); } } // Alternative <Integer>. yyResult = pIntegerLiteral(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); } } // Alternative <Character>. yyResult = pCharacterConstant(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); } } // Alternative <String>. yyResult = pStringConstant(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); } } // Alternative <True>. yyResult = pWord(yyStart); if (yyResult.hasValue("true")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <False>. yyResult = pWord(yyStart); if (yyResult.hasValue("false")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Null>. yyResult = pWord(yyStart); if (yyResult.hasValue("null")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Expression>. yyResult = pIdentifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pArguments(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } // Alternative <Expression>. yyResult = pResultType(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(".")) { yyBase = yyResult.index; yyResult = pWord(yyBase); if (yyResult.hasValue("class")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'class' expected", yyBase); } } else { yyError = yyError.select("'.' expected", yyBase); } } // Alternative <Expression>. yyResult = pWord(yyStart); if (yyResult.hasValue("this")) { yyResult = pArguments(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } // Alternative <Expression>. yyOption1 = yyStart; yyResult = pQualifiedIdentifier(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(".")) { yyOption1 = yyResult.index; } else { yyError = yyError.select("'.' expected", yyBase); } } yyBase = yyOption1; yyResult = pWord(yyBase); if (yyResult.hasValue("this")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'this' expected", yyBase); } // Alternative 12. { // Start scope for nested choice. final int yyChoice1 = yyStart; // Nested alternative 1. yyResult = pWord(yyChoice1); if (yyResult.hasValue("super")) { yyResult = pArguments(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } // Nested alternative 2. yyBase = yyChoice1; yyResult = pWord(yyBase); if (yyResult.hasValue("super")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'super' expected", yyBase); } } // End scope for nested choice. // Alternative <PrimaryIdentifier>. yyResult = pIdentifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Expression>. yyResult = pWord(yyStart); if (yyResult.hasValue("new")) { yyResult = pTypeName(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pArguments(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pClassBody(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyValue = null; return new SemanticValue(yyValue, yyOption1, yyError); } } } // Alternative 15. yyResult = pWord(yyStart); if (yyResult.hasValue("new")) { yyResult = pTypeName(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pConcreteDimensions(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pDimensions(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyValue = null; return new SemanticValue(yyValue, yyOption1, yyError); } // Nested alternative 2. yyOption1 = yyChoice1; yyResult = pDimensions(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyResult = pArrayInitializer(yyOption1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } } // Alternative <Nested>. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { yyResult = pExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = null; 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.Java.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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyRepetition1 = yyStart; yyRepeated1 = false; while (true) { yyResult = pConcreteDimension(yyRepetition1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; yyRepeated1 = true; continue; } break; } if (yyRepeated1) { yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("[")) { yyResult = pExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyValue = null; 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.Java.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; int yyOption1; Void 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()) { yyRepetition1 = yyResult.index; while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pVariableInitializer(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } 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 = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'}' expected", yyBase); } } // 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 = null; 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.Java.VariableInitializer. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pVariableInitializer(final int yyStart) throws IOException { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)column(yyStart); if (null == yyColumn.chunk2) yyColumn.chunk2 = new Chunk2(); if (null == yyColumn.chunk2.fVariableInitializer) yyColumn.chunk2.fVariableInitializer = pVariableInitializer$1(yyStart); return yyColumn.chunk2.fVariableInitializer; } /** Actually parse xtc.lang.Java.VariableInitializer. */ private Result pVariableInitializer$1(final int yyStart) throws IOException { Result yyResult; int yyBase; int yyRepetition1; int yyOption1; Void 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()) { yyRepetition1 = yyResult.index; while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pVariableInitializer(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } 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 = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'}' expected", yyBase); } } // 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 = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("'}' expected", yyBase); } } // Alternative <Expression>. yyResult = pExpression(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("variable initializer expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.Java.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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("(")) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pExpression(yyChoice1); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; while (true) { yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(",")) { yyResult = pExpression(yyResult.index); yyError = yyResult.select(yyError, yyRepetition1); if (yyResult.hasValue()) { yyRepetition1 = yyResult.index; continue; } } else { yyError = yyError.select("',' expected", yyBase); } break; } yyBase = yyRepetition1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } // Nested alternative 2. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue(")")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("')' expected", yyBase); } } // Done. yyError = yyError.select("arguments expected", yyStart); return 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 { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Void>. yyResult = pWord(yyStart); if (yyResult.hasValue("void")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Regular>. yyResult = pType(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Done. yyError = yyError.select("result 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 { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Type>. yyResult = pTypeName(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pDimensions(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyValue = null; return new SemanticValue(yyValue, yyOption1, yyError); } // 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 pTypeName(final int yyStart) throws IOException { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)column(yyStart); if (null == yyColumn.chunk2) yyColumn.chunk2 = new Chunk2(); if (null == yyColumn.chunk2.fTypeName) yyColumn.chunk2.fTypeName = pTypeName$1(yyStart); return yyColumn.chunk2.fTypeName; } /** Actually parse xtc.lang.JavaType.TypeName. */ private Result pTypeName$1(final int yyStart) throws IOException { Result yyResult; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Basic>. yyResult = pPrimitiveType(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Class>. yyResult = pQualifiedIdentifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; 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 { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative <Byte>. yyResult = pWord(yyStart); if (yyResult.hasValue("byte")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Short>. yyResult = pWord(yyStart); if (yyResult.hasValue("short")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Char>. yyResult = pWord(yyStart); if (yyResult.hasValue("char")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Int>. yyResult = pWord(yyStart); if (yyResult.hasValue("int")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Long>. yyResult = pWord(yyStart); if (yyResult.hasValue("long")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Float>. yyResult = pWord(yyStart); if (yyResult.hasValue("float")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Double>. yyResult = pWord(yyStart); if (yyResult.hasValue("double")) { yyValue = null; return yyResult.createValue(yyValue, yyError); } // Alternative <Boolean>. yyResult = pWord(yyStart); if (yyResult.hasValue("boolean")) { yyValue = null; 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 { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)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; int yyBase; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("[")) { yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pDimensions(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); } else { yyError = yyError.select("']' expected", yyBase); } } // Done. yyError = yyError.select("dimensions 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 { int yyC; int yyIndex; Result yyResult; int yyOption1; Void 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 = null; return new SemanticValue(yyValue, yyOption1, yyError); } // Alternative 2. 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 = null; return new SemanticValue(yyValue, yyOption1, yyError); } // Alternative 3. 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 = null; return new SemanticValue(yyValue, yyOption1, yyError); } // Done. yyError = yyError.select("integer 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; Result yyResult; int yyOption1; 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': { yyOption1 = yyIndex; yyResult = pDigits(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyValue = null; return new SemanticValue(yyValue, yyOption1, yyError); } default: /* No match. */ } } // Done. yyError = yyError.select("decimal numeral expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.Digits. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pDigits(final int yyStart) throws IOException { int yyC; int yyIndex; int yyRepetition1; boolean yyRepeated1; Void 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) { yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. yyError = yyError.select("digits 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; Result yyResult; 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': { yyResult = pHexDigits(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } break; default: /* No match. */ } } } // Done. yyError = yyError.select("hex numeral expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.HexDigits. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pHexDigits(final int yyStart) throws IOException { int yyC; int yyIndex; int yyRepetition1; boolean yyRepeated1; Void 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': 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); } // Done. yyError = yyError.select("hex digits 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; Result yyResult; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if ('0' == yyC) { yyIndex = yyStart + 1; yyResult = pOctalDigits(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } // Done. yyError = yyError.select("octal numeral expected", yyStart); return yyError; } // ========================================================================= /** * Parse nonterminal xtc.lang.JavaConstant.OctalDigits. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pOctalDigits(final int yyStart) throws IOException { int yyC; int yyIndex; int yyRepetition1; boolean yyRepeated1; Void 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': { yyRepetition1 = yyIndex; yyRepeated1 = true; continue; } default: /* No match. */ } } break; } if (yyRepeated1) { yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // Done. yyError = yyError.select("octal digits expected", yyStart); 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 yyOption1; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pDigits(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyC = character(yyResult.index); if ('.' == yyC) { yyIndex = yyResult.index + 1; yyOption1 = yyIndex; yyResult = pDigits(yyOption1); yyError = yyResult.select(yyError, yyOption1); if (yyResult.hasValue()) { yyOption1 = yyResult.index; } yyResult = pExponent(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 = null; return new SemanticValue(yyValue, yyOption1, yyError); } } // Alternative 2. yyC = character(yyStart); if ('.' == yyC) { yyIndex = yyStart + 1; yyResult = pDigits(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyOption1 = yyResult.index; yyResult = pExponent(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 = null; return new SemanticValue(yyValue, yyOption1, yyError); } } // Alternative 3. yyResult = pDigits(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final int yyChoice1 = yyResult.index; // Nested alternative 1. yyResult = pExponent(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 = null; return new SemanticValue(yyValue, yyOption1, yyError); } // Nested alternative 2. yyOption1 = yyChoice1; yyResult = pExponent(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 = null; 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 pExponent(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 = pDigits(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 nonterminal xtc.lang.JavaConstant.CharacterConstant. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCharacterConstant(final int yyStart) throws IOException { int yyC; int yyIndex; Result yyResult; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyC = character(yyStart); if ('\'' == yyC) { yyIndex = yyStart + 1; yyResult = pCharacterConstant$$Choice1(yyIndex); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyC = character(yyResult.index); if ('\'' == yyC) { yyIndex = yyResult.index + 1; yyValue = null; return new SemanticValue(yyValue, yyIndex, yyError); } } } // Done. yyError = yyError.select("character constant expected", yyStart); return yyError; } // ========================================================================= /** * Parse synthetic nonterminal xtc.lang.Java.CharacterConstant$$Choice1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pCharacterConstant$$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 pStringConstant(final int yyStart) throws IOException { int yyC; int yyIndex; int yyRepetition1; Void 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 = null; 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 { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)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; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pIdentifier(yyStart); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pQualifiedIdentifier$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } // Done. return yyError; } // ========================================================================= /** * Parse synthetic nonterminal xtc.lang.Java.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 { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)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.Java.QualifiedIdentifier$$Star1. */ private Result pQualifiedIdentifier$$Star1$1(final int yyStart) throws IOException { Result yyResult; Void yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue(".")) { yyResult = pIdentifier(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyResult = pQualifiedIdentifier$$Star1(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { yyValue = null; return yyResult.createValue(yyValue, yyError); } } } // Alternative 2. yyValue = null; 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 pIdentifier(final int yyStart) throws IOException { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)column(yyStart); if (null == yyColumn.chunk2) yyColumn.chunk2 = new Chunk2(); if (null == yyColumn.chunk2.fIdentifier) yyColumn.chunk2.fIdentifier = pIdentifier$1(yyStart); return yyColumn.chunk2.fIdentifier; } /** Actually parse xtc.lang.JavaIdentifier.Identifier. */ private Result pIdentifier$1(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pWord(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 pWord(final int yyStart) throws IOException { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)column(yyStart); if (null == yyColumn.chunk3) yyColumn.chunk3 = new Chunk3(); if (null == yyColumn.chunk3.fWord) yyColumn.chunk3.fWord = pWord$1(yyStart); return yyColumn.chunk3.fWord; } /** Actually parse xtc.lang.JavaIdentifier.Word. */ private Result pWord$1(final int yyStart) throws IOException { Result yyResult; String yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pWordCharacters(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 pWordCharacters(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.JavaSymbol.Symbol. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */ private Result pSymbol(final int yyStart) throws IOException { JavaRecognizerColumn yyColumn = (JavaRecognizerColumn)column(yyStart); if (null == yyColumn.chunk3) yyColumn.chunk3 = new Chunk3(); if (null == yyColumn.chunk3.fSymbol) yyColumn.chunk3.fSymbol = pSymbol$1(yyStart); return yyColumn.chunk3.fSymbol; } /** Actually parse xtc.lang.JavaSymbol.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.JavaSymbol.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; 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); } 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.util.Spacing.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 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 '\r': { final int yyChoice2 = yyIndex; // Nested alternative 1. yyC = character(yyChoice2); if ('\n' == yyC) { yyIndex = yyChoice2 + 1; yyRepetition1 = yyIndex; continue; } // Nested alternative 2. yyRepetition1 = yyChoice2; continue; } case '\n': { 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; } final int yyChoice2 = yyRepetition2; // Nested alternative 1. yyC = character(yyChoice2); if (-1 != yyC) { yyIndex = yyChoice2 + 1; switch (yyC) { case '\r': { final int yyChoice3 = yyIndex; // Nested alternative 1. yyC = character(yyChoice3); if ('\n' == yyC) { yyIndex = yyChoice3 + 1; yyRepetition1 = yyIndex; continue; } // Nested alternative 2. yyRepetition1 = yyChoice3; continue; } case '\n': { yyRepetition1 = yyIndex; continue; } default: /* No match. */ } } // Nested alternative 2. yyPredResult = pEndOfFile(yyChoice2); yyError = yyPredResult.select(yyError); if (yyPredResult.hasValue()) { yyRepetition1 = yyChoice2; continue; } } break; default: /* No match. */ } } } break; default: /* No match. */ } } break; } yyValue = null; return new SemanticValue(yyValue, yyRepetition1, yyError); } // ========================================================================= /** * Parse nonterminal xtc.util.Spacing.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; } // ========================================================================= 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" }); } // ========================================================================= /** * 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); } }