From 8e61889ba0778848f796784d43cf454b7d51d0ae Mon Sep 17 00:00:00 2001 From: Tom Copeland Date: Thu, 11 Sep 2003 20:09:53 +0000 Subject: [PATCH] More assert lookahead stuff git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@2252 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd/etc/grammar/Java1.4-c.jjt | 18 +- .../net/sourceforge/pmd/ast/AssertTest.java | 50 ++- pmd/src/net/sourceforge/pmd/JLS1_1.java | 17 - pmd/src/net/sourceforge/pmd/PMD.java | 10 +- pmd/src/net/sourceforge/pmd/TargetJDK1_3.java | 21 ++ .../pmd/{JLS1_4.java => TargetJDK1_4.java} | 3 +- ...{JLSVersion.java => TargetJDKVersion.java} | 2 +- .../net/sourceforge/pmd/ast/JavaParser.java | 315 +++++++++--------- 8 files changed, 252 insertions(+), 184 deletions(-) delete mode 100644 pmd/src/net/sourceforge/pmd/JLS1_1.java create mode 100644 pmd/src/net/sourceforge/pmd/TargetJDK1_3.java rename pmd/src/net/sourceforge/pmd/{JLS1_4.java => TargetJDK1_4.java} (84%) rename pmd/src/net/sourceforge/pmd/{JLSVersion.java => TargetJDKVersion.java} (86%) diff --git a/pmd/etc/grammar/Java1.4-c.jjt b/pmd/etc/grammar/Java1.4-c.jjt index f2c933e43b..0ee9f95ec3 100644 --- a/pmd/etc/grammar/Java1.4-c.jjt +++ b/pmd/etc/grammar/Java1.4-c.jjt @@ -1,4 +1,9 @@ /** + * + * Added in support for assert as a name using lookaheads + * + * Tom Copeland, 09/03 + * =================================================================== * Copied over the changes made by Andrea Gini and Marco Savard to * support JDK 1.4 language constructs, i.e., asserts. * See the java1_4c.jj distributed in the javacc2.1/examples/JavaGrammers directory. @@ -60,6 +65,12 @@ PARSER_BEGIN(JavaParser) package net.sourceforge.pmd.ast; public class JavaParser { + private boolean usingAssertAsIdentifier; + + public void setAssertAsIdentifier() { + this.usingAssertAsIdentifier = true; + } + private boolean assertLookahead() { return getToken(1).image.equals("assert"); } @@ -976,7 +987,9 @@ void ArrayDimsAndInits() : void Statement() : {} { - LOOKAHEAD( { assertLookahead() } ) + LOOKAHEAD( { + assertLookahead() + } ) AssertStatement() | LOOKAHEAD(2) @@ -1193,6 +1206,9 @@ void TryStatement() : void AssertStatement() : { + if (usingAssertAsIdentifier) { + throw new ParseException("Can't use 'assert' as a keyword when running in JDK 1.3 mode!"); + } Token tok; } { diff --git a/pmd/regress/test/net/sourceforge/pmd/ast/AssertTest.java b/pmd/regress/test/net/sourceforge/pmd/ast/AssertTest.java index 5e9d659ab0..a8feccd454 100644 --- a/pmd/regress/test/net/sourceforge/pmd/ast/AssertTest.java +++ b/pmd/regress/test/net/sourceforge/pmd/ast/AssertTest.java @@ -3,20 +3,44 @@ package test.net.sourceforge.pmd.ast; import junit.framework.TestCase; import net.sourceforge.pmd.PMD; import net.sourceforge.pmd.ast.JavaParser; +import net.sourceforge.pmd.ast.ParseException; import java.io.StringReader; public class AssertTest extends TestCase { - public void testAssertAsKeyword() { - new JavaParser(new StringReader(TEST1)).CompilationUnit(); - new JavaParser(new StringReader(TEST1)).CompilationUnit(); - new JavaParser(new StringReader(TEST1)).CompilationUnit(); + public void testAssertAsKeywordVariantsSucceedWith1_4() { new JavaParser(new StringReader(TEST1)).CompilationUnit(); + new JavaParser(new StringReader(TEST2)).CompilationUnit(); + new JavaParser(new StringReader(TEST3)).CompilationUnit(); + new JavaParser(new StringReader(TEST4)).CompilationUnit(); } - public void testAssertAsName() { - new JavaParser(new StringReader(TEST5)).CompilationUnit(); +/* +TODO + public void testAssertAsIdentifierFailsWith1_4() { + try { + new JavaParser(new StringReader(TEST5)).CompilationUnit(); + throw new RuntimeException("Usage of assert as identifier should have failed with 1.4"); + } catch (ParseException pe) { + // cool + } + } +*/ + + public void testAssertAsIdentifierSucceedsWith1_3() { + new JavaParser(new StringReader(TEST6)).CompilationUnit(); + } + + public void testAssertAsKeywordFailsWith1_3() { + try { + JavaParser jp = new JavaParser(new StringReader(TEST7)); + jp.setAssertAsIdentifier(); + jp.CompilationUnit(); + throw new RuntimeException("Usage of assert as keyword should have failed with 1.3"); + } catch (ParseException pe) { + // cool + } } private static final String TEST1 = @@ -51,4 +75,18 @@ public class AssertTest extends TestCase { "public class Foo {" + PMD.EOL + " int assert = 2;" + PMD.EOL + "}"; + + private static final String TEST6 = + "public class Foo {" + PMD.EOL + + " int assert = 2;" + PMD.EOL + + "}"; + + private static final String TEST7 = + "public class Foo {" + PMD.EOL + + " void foo() {" + PMD.EOL + + " assert (x>2) : \"hi!\";" + PMD.EOL + + " }" + PMD.EOL + + "}"; + + } diff --git a/pmd/src/net/sourceforge/pmd/JLS1_1.java b/pmd/src/net/sourceforge/pmd/JLS1_1.java deleted file mode 100644 index 163a58c91f..0000000000 --- a/pmd/src/net/sourceforge/pmd/JLS1_1.java +++ /dev/null @@ -1,17 +0,0 @@ -package net.sourceforge.pmd; - -import net.sourceforge.pmd.ast.JavaParser; - -import java.io.InputStream; -import java.io.Reader; - -public class JLS1_1 implements JLSVersion { - - public JavaParser createParser(InputStream in) { - throw new RuntimeException("Not yet implemented"); - } - - public JavaParser createParser(Reader in) { - throw new RuntimeException("Not yet implemented"); - } -} diff --git a/pmd/src/net/sourceforge/pmd/PMD.java b/pmd/src/net/sourceforge/pmd/PMD.java index 9f3387e257..1003eea144 100644 --- a/pmd/src/net/sourceforge/pmd/PMD.java +++ b/pmd/src/net/sourceforge/pmd/PMD.java @@ -23,14 +23,14 @@ public class PMD { public static final String EOL = System.getProperty("line.separator", "\n"); - private JLSVersion jlsVersion; + private TargetJDKVersion targetJDKVersion; public PMD() { - jlsVersion = new JLS1_4(); + targetJDKVersion = new TargetJDK1_4(); } - public PMD(JLSVersion jlsVersion) { - this.jlsVersion = jlsVersion; + public PMD(TargetJDKVersion targetJDKVersion) { + this.targetJDKVersion = targetJDKVersion; } /** @@ -40,7 +40,7 @@ public class PMD { */ public void processFile(Reader reader, RuleSet ruleSet, RuleContext ctx) throws PMDException { try { - JavaParser parser = jlsVersion.createParser(reader); + JavaParser parser = targetJDKVersion.createParser(reader); ASTCompilationUnit c = parser.CompilationUnit(); Thread.yield(); SymbolFacade stb = new SymbolFacade(); diff --git a/pmd/src/net/sourceforge/pmd/TargetJDK1_3.java b/pmd/src/net/sourceforge/pmd/TargetJDK1_3.java new file mode 100644 index 0000000000..d8a6713344 --- /dev/null +++ b/pmd/src/net/sourceforge/pmd/TargetJDK1_3.java @@ -0,0 +1,21 @@ +package net.sourceforge.pmd; + +import net.sourceforge.pmd.ast.JavaParser; + +import java.io.InputStream; +import java.io.Reader; + +public class TargetJDK1_3 implements TargetJDKVersion { + + public JavaParser createParser(InputStream in) { + JavaParser jp = new JavaParser(in); + jp.setAssertAsIdentifier(); + return jp; + } + + public JavaParser createParser(Reader in) { + JavaParser jp = new JavaParser(in); + jp.setAssertAsIdentifier(); + return jp; + } +} diff --git a/pmd/src/net/sourceforge/pmd/JLS1_4.java b/pmd/src/net/sourceforge/pmd/TargetJDK1_4.java similarity index 84% rename from pmd/src/net/sourceforge/pmd/JLS1_4.java rename to pmd/src/net/sourceforge/pmd/TargetJDK1_4.java index c623cc9f79..9dd5fe83d7 100644 --- a/pmd/src/net/sourceforge/pmd/JLS1_4.java +++ b/pmd/src/net/sourceforge/pmd/TargetJDK1_4.java @@ -5,7 +5,8 @@ import net.sourceforge.pmd.ast.JavaParser; import java.io.InputStream; import java.io.Reader; -public class JLS1_4 implements JLSVersion { +public class TargetJDK1_4 implements TargetJDKVersion { + public JavaParser createParser(InputStream in) { return new JavaParser(in); } diff --git a/pmd/src/net/sourceforge/pmd/JLSVersion.java b/pmd/src/net/sourceforge/pmd/TargetJDKVersion.java similarity index 86% rename from pmd/src/net/sourceforge/pmd/JLSVersion.java rename to pmd/src/net/sourceforge/pmd/TargetJDKVersion.java index 2aa17366a6..9a94c1087a 100644 --- a/pmd/src/net/sourceforge/pmd/JLSVersion.java +++ b/pmd/src/net/sourceforge/pmd/TargetJDKVersion.java @@ -5,7 +5,7 @@ import net.sourceforge.pmd.ast.JavaParser; import java.io.InputStream; import java.io.Reader; -public interface JLSVersion { +public interface TargetJDKVersion { public JavaParser createParser(InputStream in); public JavaParser createParser(Reader in); } diff --git a/pmd/src/net/sourceforge/pmd/ast/JavaParser.java b/pmd/src/net/sourceforge/pmd/ast/JavaParser.java index f66a51d07d..89cafea541 100644 --- a/pmd/src/net/sourceforge/pmd/ast/JavaParser.java +++ b/pmd/src/net/sourceforge/pmd/ast/JavaParser.java @@ -2,6 +2,12 @@ package net.sourceforge.pmd.ast; public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, JavaParserConstants {/*@bgen(jjtree)*/ protected JJTJavaParserState jjtree = new JJTJavaParserState(); + private boolean usingAssertAsIdentifier; + + public void setAssertAsIdentifier() { + this.usingAssertAsIdentifier = true; + } + private boolean assertLookahead() { return getToken(1).image.equals("assert"); } @@ -4290,7 +4296,10 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; /*@bgen(jjtree) AssertStatement */ ASTAssertStatement jjtn000 = new ASTAssertStatement(this, JJTASSERTSTATEMENT); boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000);Token tok; + jjtree.openNodeScope(jjtn000);if (usingAssertAsIdentifier) { + throw new ParseException("Can't use 'assert' as a keyword when running in JDK 1.3 mode!"); + } + Token tok; try { tok = jj_consume_token(IDENTIFIER); @@ -4564,44 +4573,6 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return retval; } - final private boolean jj_3R_247() { - if (jj_3R_252()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_271()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } - return false; - } - - final private boolean jj_3R_246() { - if (jj_scan_token(BIT_AND)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_234()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - final private boolean jj_3R_228() { - if (jj_scan_token(RUNSIGNEDSHIFTASSIGN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - final private boolean jj_3R_243() { - if (jj_3R_247()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_264()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } - return false; - } - final private boolean jj_3R_238() { if (jj_scan_token(BIT_OR)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6058,6 +6029,14 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } + final private boolean jj_3R_376() { + if (jj_scan_token(COLON)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_61()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + final private boolean jj_3R_375() { Token xsp; while (true) { @@ -6076,14 +6055,6 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } - final private boolean jj_3R_376() { - if (jj_scan_token(COLON)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_61()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - final private boolean jj_3R_74() { if (jj_scan_token(ABSTRACT)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6264,6 +6235,20 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } + final private boolean jj_3R_181() { + if (jj_scan_token(IDENTIFIER)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_61()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_376()) jj_scanpos = xsp; + else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(SEMICOLON)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + final private boolean jj_3R_262() { if (jj_3R_270()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6288,32 +6273,12 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } - final private boolean jj_3R_181() { - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_61()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_376()) jj_scanpos = xsp; - else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(SEMICOLON)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - final private boolean jj_3R_260() { if (jj_3R_268()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - final private boolean jj_3R_259() { - if (jj_3R_267()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - final private boolean jj_3R_386() { if (jj_scan_token(FINALLY)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6336,6 +6301,12 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } + final private boolean jj_3R_259() { + if (jj_3R_267()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + final private boolean jj_3R_258() { if (jj_3R_266()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6405,26 +6376,14 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } - final private boolean jj_3R_306() { - if (jj_scan_token(PRIVATE)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - final private boolean jj_3R_305() { - if (jj_scan_token(PROTECTED)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - final private boolean jj_3R_381() { if (jj_3R_393()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - final private boolean jj_3R_304() { - if (jj_scan_token(PUBLIC)) return true; + final private boolean jj_3R_306() { + if (jj_scan_token(PRIVATE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } @@ -6449,6 +6408,18 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } + final private boolean jj_3R_305() { + if (jj_scan_token(PROTECTED)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + final private boolean jj_3R_304() { + if (jj_scan_token(PUBLIC)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + final private boolean jj_3R_303() { if (jj_scan_token(FINAL)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6467,6 +6438,12 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } + final private boolean jj_3R_383() { + if (jj_scan_token(IDENTIFIER)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + final private boolean jj_3R_301() { if (jj_scan_token(STATIC)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6499,8 +6476,12 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } - final private boolean jj_3R_383() { - if (jj_scan_token(IDENTIFIER)) return true; + final private boolean jj_3R_192() { + if (jj_scan_token(THROW)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_61()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(SEMICOLON)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } @@ -6523,30 +6504,6 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } - final private boolean jj_3R_192() { - if (jj_scan_token(THROW)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_61()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(SEMICOLON)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - final private boolean jj_3R_245() { - if (jj_scan_token(LBRACE)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_250()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } - if (jj_scan_token(RBRACE)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - final private boolean jj_3R_411() { if (jj_scan_token(COMMA)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6567,8 +6524,16 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } - final private boolean jj_3R_69() { - if (jj_scan_token(PUBLIC)) return true; + final private boolean jj_3R_245() { + if (jj_scan_token(LBRACE)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_250()) { jj_scanpos = xsp; break; } + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } + if (jj_scan_token(RBRACE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } @@ -6579,6 +6544,12 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } + final private boolean jj_3R_69() { + if (jj_scan_token(PUBLIC)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + final private boolean jj_3R_308() { if (jj_scan_token(EXTENDS)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6622,12 +6593,6 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } - final private boolean jj_3R_68() { - if (jj_scan_token(FINAL)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - final private boolean jj_3R_189() { if (jj_scan_token(BREAK)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6640,12 +6605,24 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } + final private boolean jj_3R_68() { + if (jj_scan_token(FINAL)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + final private boolean jj_3R_397() { if (jj_scan_token(STRICTFP)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } + final private boolean jj_3R_393() { + if (jj_3R_410()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + final private boolean jj_3R_396() { if (jj_scan_token(PUBLIC)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6658,8 +6635,8 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } - final private boolean jj_3R_393() { - if (jj_3R_410()) return true; + final private boolean jj_3R_66() { + if (jj_scan_token(FINAL)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } @@ -6687,24 +6664,6 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } - final private boolean jj_3R_66() { - if (jj_scan_token(FINAL)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - final private boolean jj_3R_374() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_387()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } - if (jj_3R_162()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - final private boolean jj_3R_378() { if (jj_scan_token(ELSE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6725,6 +6684,18 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } + final private boolean jj_3R_374() { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_387()) { jj_scanpos = xsp; break; } + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } + if (jj_3R_162()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + final private boolean jj_3R_410() { if (jj_3R_183()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6760,6 +6731,12 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } + final private boolean jj_3R_379() { + if (jj_3R_392()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + final private boolean jj_3_1() { Token xsp; while (true) { @@ -6772,24 +6749,12 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } - final private boolean jj_3R_379() { - if (jj_3R_392()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - final private boolean jj_3R_409() { if (jj_3R_410()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - final private boolean jj_3R_373() { - if (jj_scan_token(SEMICOLON)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - final private boolean jj_3R_408() { if (jj_3R_161()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6807,6 +6772,12 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } + final private boolean jj_3R_373() { + if (jj_scan_token(SEMICOLON)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + final private boolean jj_3R_372() { if (jj_3R_375()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -7217,16 +7188,16 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } - final private boolean jj_3_27() { - if (jj_scan_token(LBRACKET)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(RBRACKET)) return true; + final private boolean jj_3R_147() { + if (jj_3R_191()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - final private boolean jj_3R_147() { - if (jj_3R_191()) return true; + final private boolean jj_3_27() { + if (jj_scan_token(LBRACKET)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(RBRACKET)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } @@ -8331,6 +8302,44 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false; return false; } + final private boolean jj_3R_247() { + if (jj_3R_252()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_271()) { jj_scanpos = xsp; break; } + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } + return false; + } + + final private boolean jj_3R_246() { + if (jj_scan_token(BIT_AND)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_234()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + final private boolean jj_3R_228() { + if (jj_scan_token(RUNSIGNEDSHIFTASSIGN)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + final private boolean jj_3R_243() { + if (jj_3R_247()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_264()) { jj_scanpos = xsp; break; } + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } + return false; + } + public JavaParserTokenManager token_source; JavaCharStream jj_input_stream; public Token token, jj_nt;