diff options
author | acolyer <acolyer> | 2004-01-13 11:27:59 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2004-01-13 11:27:59 +0000 |
commit | 19ed0a21b822004f6f2c688518c4230965a3b512 (patch) | |
tree | 5680a8ccc55b3d2bbe634b38717d08dc6328f214 | |
parent | 346fd1c4acfa5360e1a71aa171da283251ef99bf (diff) | |
download | aspectj-19ed0a21b822004f6f2c688518c4230965a3b512.tar.gz aspectj-19ed0a21b822004f6f2c688518c4230965a3b512.zip |
move to Eclipse 3.0 M6 JDT core (v_396). Also makes 1.4 the
default mode (inherited behaviour from JDT).
89 files changed, 1991 insertions, 1767 deletions
diff --git a/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java b/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java index d7db8e849..1b09aee8e 100644 --- a/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java +++ b/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java @@ -149,9 +149,9 @@ public class CompilerAdapter { String[] args = new String[] { "@" + configFile.getAbsolutePath() }; CountingMessageHandler handler = CountingMessageHandler.makeCountingMessageHandler(messageHandler); - BuildArgParser parser = new BuildArgParser(); + BuildArgParser parser = new BuildArgParser(handler); - AjBuildConfig config = parser.genBuildConfig(args, handler, false, configFile); + AjBuildConfig config = parser.genBuildConfig(args, false, configFile); configureProjectOptions(config, Ajde.getDefault().getProjectProperties()); // !!! not what the API intended // -- get globals, treat as defaults used if no local values @@ -312,10 +312,11 @@ public class CompilerAdapter { if (lineNo) javaOptions.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.GENERATE); } - if ( options.getNoImportError() ) { - javaOptions.put( CompilerOptions.OPTION_ReportInvalidImport, - CompilerOptions.WARNING); - } + //XXX we can't turn off import errors in 3.0 stream +// if ( options.getNoImportError() ) { +// javaOptions.put( CompilerOptions.OPTION_ReportInvalidImport, +// CompilerOptions.WARNING); +// } if ( options.getPreserveAllLocals() ) { javaOptions.put( CompilerOptions.OPTION_PreserveUnusedLocal, diff --git a/ajde/testdata/LstBuildConfigManagerTest/bad-injar.lst b/ajde/testdata/LstBuildConfigManagerTest/bad-injar.lst index 36a40acb5..8b43dde50 100644 --- a/ajde/testdata/LstBuildConfigManagerTest/bad-injar.lst +++ b/ajde/testdata/LstBuildConfigManagerTest/bad-injar.lst @@ -1 +1,2 @@ --injars foo.jar
+-inpath
+foo.jar
diff --git a/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java b/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java index 9fa4659d6..f08fe199b 100644 --- a/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java +++ b/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java @@ -350,9 +350,9 @@ public class BuildConfigurationTests extends AjdeTestCase { buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); Map options = buildConfig.getJavaOptions(); - String noImport = (String) options.get( CompilerOptions.OPTION_ReportInvalidImport ); - assertEquals( "no import", CompilerOptions.WARNING, noImport ); - buildOptions.setNoImportError( false ); +// String noImport = (String) options.get( CompilerOptions.OPTION_ReportInvalidImport ); +// assertEquals( "no import", CompilerOptions.WARNING, noImport ); +// buildOptions.setNoImportError( false ); } public void testPreserveAllLocals() { diff --git a/ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java b/ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java index c68cb9d15..3d1a04cf3 100644 --- a/ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java +++ b/ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java @@ -54,7 +54,7 @@ public class LstBuildConfigManagerTest extends AjdeTestCase { doSynchronousBuild("bad-injar.lst"); messages = NullIdeManager.getIdeManager().getCompilationSourceLineTasks(); message = (NullIdeTaskListManager.SourceLineTask)messages.get(0); - assertTrue(message.getContainedMessage().getMessage().indexOf("invalid") != -1); + assertTrue(message.getContainedMessage().getMessage().indexOf("bad inpath") != -1); } public void testErrorMessages() throws IOException { @@ -63,7 +63,7 @@ public class LstBuildConfigManagerTest extends AjdeTestCase { List messages = NullIdeManager.getIdeManager().getCompilationSourceLineTasks(); SourceLineTask message = (SourceLineTask)messages.get(0); - assertEquals("invalid option: aaa.bbb", message.getContainedMessage().getMessage()); + assertTrue(message.getContainedMessage().getMessage(), message.getContainedMessage().getMessage().indexOf("aaa.bbb") != -1); } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/AjdtCommand.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/AjdtCommand.java index fd160d31d..9527d635c 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/AjdtCommand.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/AjdtCommand.java @@ -87,6 +87,9 @@ public class AjdtCommand implements ICommand { } // regenerate configuration b/c world might have changed (?) AjBuildConfig config = genBuildConfig(savedArgs, counter); + if (!config.shouldProceed()) { + return true; + } if (!config.hasSources()) { MessageUtil.error(counter, "no sources specified"); } @@ -127,8 +130,8 @@ public class AjdtCommand implements ICommand { * a source location context for locating the error. */ public static AjBuildConfig genBuildConfig(String[] args, CountingMessageHandler handler) { - BuildArgParser parser = new BuildArgParser(); - AjBuildConfig config = parser.genBuildConfig(args, handler); + BuildArgParser parser = new BuildArgParser(handler); + AjBuildConfig config = parser.genBuildConfig(args); ISourceLocation location = null; if (config.getConfigFile() != null) { diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java index 7f08a1f9d..aa40a8242 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java @@ -29,6 +29,13 @@ public class BuildArgParser extends Main { private static final String BUNDLE_NAME = "org.aspectj.ajdt.ajc.messages"; private static boolean LOADED_BUNDLE = false; + static { + bundle = ResourceBundle.getBundle(BUNDLE_NAME); + if (!LOADED_BUNDLE) { + LOADED_BUNDLE = true; + } + } + /** to initialize super's PrintWriter but refer to underlying StringWriter */ private static class StringPrintWriter extends PrintWriter { public final StringWriter stringWriter; @@ -39,11 +46,8 @@ public class BuildArgParser extends Main { } /** @return multi-line String usage for the compiler */ - public static String getUsage() { - if (!LOADED_BUNDLE) { // get eclipse usage unless bundle loaded... - new BuildArgParser(); - } - return Main.bind("misc.usage", Main.bind("compiler.version")); + public static String getUsage() { + return Main.bind("misc.usage"); } /** @@ -55,50 +59,48 @@ public class BuildArgParser extends Main { */ private final StringBuffer errorSink; + private IMessageHandler handler; + /** * Overrides super's bundle. */ - public BuildArgParser(PrintWriter writer) { + public BuildArgParser(PrintWriter writer, IMessageHandler handler) { super(writer, writer, false); - bundle = ResourceBundle.getBundle(BUNDLE_NAME); - if (!LOADED_BUNDLE) { - LOADED_BUNDLE = true; - } + if (writer instanceof StringPrintWriter) { errorSink = ((StringPrintWriter) writer).stringWriter.getBuffer(); } else { errorSink = null; } + this.handler = handler; } /** Set up to capture messages using getOtherMessages(boolean) */ - public BuildArgParser() { - this(new StringPrintWriter(new StringWriter())); + public BuildArgParser(IMessageHandler handler) { + this(new StringPrintWriter(new StringWriter()),handler); } /** * Generate build configuration for the input args, * passing to handler any error messages. * @param args the String[] arguments for the build configuration - * @param handler the IMessageHandler handler for any errors * @return AjBuildConfig per args, * which will be invalid unless there are no handler errors. */ - public AjBuildConfig genBuildConfig(String[] args, IMessageHandler handler) { - return genBuildConfig(args, handler, true, null); + public AjBuildConfig genBuildConfig(String[] args) { + return genBuildConfig(args, true, null); } /** * Generate build configuration for the input args, * passing to handler any error messages. * @param args the String[] arguments for the build configuration - * @param handler the IMessageHandler handler for any errors * @param setClasspath determines if the classpath should be parsed and set on the build configuration * @param configFile can be null * @return AjBuildConfig per args, * which will be invalid unless there are no handler errors. */ - public AjBuildConfig genBuildConfig(String[] args, IMessageHandler handler, boolean setClasspath, File configFile) { + public AjBuildConfig genBuildConfig(String[] args, boolean setClasspath, File configFile) { AjBuildConfig buildConfig = new AjBuildConfig(); buildConfig.setConfigFile(configFile); try { @@ -135,6 +137,11 @@ public class BuildArgParser extends Main { javaArgList.addAll(parser.getUnparsedArgs()); super.configure((String[])javaArgList.toArray(new String[javaArgList.size()])); + if (!proceed) { + buildConfig.doNotProceed(); + return buildConfig; + } + if (buildConfig.getSourceRoots() != null) { for (Iterator i = buildConfig.getSourceRoots().iterator(); i.hasNext(); ) { fileList.addAll(collectSourceRootFiles((File)i.next())); @@ -168,6 +175,18 @@ public class BuildArgParser extends Main { return buildConfig; } + + // from super... + public void printVersion() { + System.err.println("AspectJ Compiler " + Version.text + " built on " + Version.time_text); //$NON-NLS-1$ + System.err.flush(); + } + + public void printUsage() { + System.out.println(bind("misc.usage")); //$NON-NLS-1$ + System.out.flush(); + } + /** * Get messages not dumped to handler or any PrintWriter. * @param flush if true, empty errors diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties index cb6f71434..ac2113113 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties @@ -4,11 +4,15 @@ The -Xlintfile:lint.properties allows fine-grained control. In tools.jar, see org/aspectj/weaver/XlintDefault.properties for the default behavior and a template to copy. ### AspectJ-specific messages -configure.version = AspectJ Compiler 1.1 +compiler.name = AspectJ Compiler + +## this next one superceded by above... +## configure.version = AspectJ Compiler 1.1 + configure.directoryNotExist = invalid option: {0} ## 3456789012345678901234567890123456789012345678901234567890123456789012345 ### miscellaneous -misc.usage = AspectJ Compiler 1.1\n\ +misc.usage = {compiler.name}\n\ \n\ \tUsage: <options> <source file | @argfile>..\n\ \n\ @@ -33,61 +37,103 @@ AspectJ-specific options:\n\ \t (cf org/aspectj/weaver/XlintDefault.properties)\n\ \n\ Standard Eclipse compiler options:\n\ -\t-help emit this help message and quit\n\ -\t-version emit compiler version number and quit\n\ -\t-classpath <list> directories and zip files for the classpath\n\ -\t (<list> uses platform-specific path delimiter)\n\ -\t-bootclasspath <list> override bootclasspath for finding compile types\n\ -\t (<list> uses platform-specific path delimiter)\n\ -\t-extdirs <list> override extension dirs for finding compile types\n\ -\t (<list> uses platform-specific path delimiter)\n\ -\t-d <dir> destination directory for output classes \n\ -\t-target <ver> classfile setting (1.1 or 1.2, default is 1.1)\n\ -\t-1.3 set compliance level to 1.3 (default)\n\ -\t-1.4 set compliance level to 1.4\n\ -\t-source <ver> assertions toggle (1.3 or 1.4, default is 1.3\n\ -\t in -1.3 mode and 1.4 in -1.4 mode)\n\ -\t-nowarn emit no warnings (same as ''-warn:none'')\n\ -\t-warn:<list> emit warnings specified by comma-delimited list\n\ -\t (eg ''-warn:unusedLocals,deprecation'')\n\ -\t constructorName method with constructor name\n\ -\t packageDefaultMethod attempt to override package-default method\n\ -\t deprecation usage of deprecated type or member\n\ -\t maskedCatchBlocks hidden catch block\n\ -\t unusedLocals unused local variable (never read)\n\ -\t unusedArguments unused method argument (never read)\n\ -\t unusedImports unused imports\n\ -\t syntheticAccess performing synthetic access for inner classes\n\ -\t assertIdentifier ''assert'' used as identifier\n\ -\t-deprecation same as ''-warn:deprecation''\n\ -\t-noImportError emit no errors for unresolved imports\n\ -\t-proceedOnError keep compiling after errors, dumping class files\n\ -\t with problem methods\n\ -\t-g[:<level>] debug attributes level\n\ -\t -g all debug info (same as ''-g:lines,vars,source'')\n\ -\t -g:none no debug info\n\ -\t -g:<items> debug info for any/all of [lines, vars, source]\n\ -\t-preserveAllLocals code gen preserve all local variables (for debug)\n\ -\t-referenceInfo compute reference info\n\ -\t-encoding <name> specify default source encoding format\n\ -\t (Specify encoding for any source file/folder by\n\ -\t suffixing each input name with '[encoding]')\n\ -\t-verbose emit accessed/processed compilation units \n\ -\t-log <filename> specify a log file for compile messages\n\ -\t-progress show progress (requires -log mode)\n\ -\t-time display speed information\n\ -\t-noExit do not call System.exit(n) at end of compilation\n\ -\t (n=0 if no error)\n\ -\t-repeat <n> repeat compilation process <n> times (perf analysis)\n +\ Options enabled by default are prefixed with ''+''\n\ +\ \n\ +\ Classpath options:\n\ +\ -cp -classpath <directories and zip/jar files separated by ;>\n\ +\ specify location for application classes and sources\n\ +\ -bootclasspath <directories and zip/jar files separated by ;>\n\ +\ specify location for system classes\n\ +\ -d <dir> destination directory (if omitted, no directory is created)\n\ +\ -d none generate no .class files\n\ +\ -encoding <enc> specify custom encoding for all sources. Each file/directory can override it\n\ +\ when suffixed with ''[''<enc>'']'' (e.g. X.java[utf8])\n\ +\ \n\ +\ Compliance options:\n\ +\ -1.3 use 1.3 compliance level (implicit -source 1.3 -target 1.1)\n\ +\ -1.4 + use 1.4 compliance level (implicit -source 1.3 -target 1.2)\n\ +\ -source <version> set source level (1.3 or 1.4)\n\ +\ -target <version> set classfile target (1.1 to 1.4)\n\ +\ \n\ +\ Warning options:\n\ +\ -deprecation + deprecation outside deprecated code\n\ +\ -nowarn disable all warnings\n\ +\ -warn:none disable all warnings\n\ +\ -warn:<warnings separated by ,> enable exactly the listed warnings\n\ +\ -warn:+<warnings separated by ,> enable additional warnings\n\ +\ -warn:-<warnings separated by ,> disable specific warnings\n\ +\ allDeprecation deprecation including inside deprecated code\n\ +\ allJavadoc invalid or missing javadoc\n\ +\ assertIdentifier + ''assert'' used as identifier\n\ +\ charConcat + char[] in String concat\n\ +\ conditionAssign possible accidental boolean assignment\n\ +\ constructorName + method with constructor name\n\ +\ deprecation + deprecation outside deprecated code\n\ +\ emptyBlock undocumented empty block\n\ +\ fieldHiding field hiding another variable\n\ +\ finally + finally block not completing normally\n\ +\ indirectStatic indirect reference to static member\n\ +\ intfNonInherited + interface non-inherited method compatibility\n\ +\ javadoc invalid javadoc\n\ +\ localHiding local variable hiding another variable\n\ +\ maskedCatchBlock + hidden catch block\n\ +\ nls string literal lacking non-nls tag //$NON-NLS-<n>$\n\ +\ noEffectAssign + assignment without effect\n\ +\ pkgDefaultMethod + attempt to override package-default method\n\ +\ semicolon superfluous semicolon\n\ +\ unqualifiedField unqualified reference to field\n\ +\ unusedImport + unused import declaration\n\ +\ unusedLocal unread local variable\n\ +\ unusedPrivate unused private member declaration\n\ +\ unusedThrown unused declared thrown exception\n\ +\ uselessTypeCheck unnecessary cast/instanceof operation\n\ +\ specialParamHiding constructor or setter parameter hiding another field\n\ +\ staticReceiver + non-static reference to static member\n\ +\ syntheticAccess synthetic access for innerclass\n\ +\ tasks(<tags separated by |>) tasks identified by tags inside comments\n\ +\ \n\ +\ Debug options:\n\ +\ -g[:lines,vars,source] custom debug info\n\ +\ -g:lines,source + both lines table and source debug info\n\ +\ -g all debug info\n\ +\ -g:none no debug info\n\ +\ -preserveAllLocals preserve unused local vars for debug purpose\n\ +\ \n\ +\ Advanced options:\n\ +\ -log <file> log to a file\n\ +\ -proceedOnError do not stop at first error, dumping class files with problem methods\n\ +\ -verbose enable verbose output\n\ +\ -referenceInfo compute reference info\n\ +\ -progress show progress (only in -log mode)\n\ +\ -time display speed information \n\ +\ -noExit do not call System.exit(n) at end of compilation (n==0 if no error)\n\ +\ -repeat <n> repeat compilation process <n> times for perf analysis\n\ +\ @<file> read command line arguments from file\n\ +\ \n\ +\ -? -help print this help message\n\ +\ -v -version print compiler version\n\ +\ -showversion print compiler version and continue\n ## options not documented above (per ..ajdt.ajc.BuildArgParser.java): # -XincrementalFile, -XnoWeave, -XserializableAspects, -XnoInline -########################################## +############################################################################### +# Copyright (c) 2000, 2004 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Common Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/cpl-v10.html +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### ### JavaBatchCompiler messages. -### compiler version id -compiler.version = 0.265 +### compiler +#compiler.name = Eclipse Java Compiler +#compiler.version = 0.396 +#compiler.copyright = Copyright IBM Corp 2000, 2003. All rights reserved. + ### scanning scanning.start = Collecting source files inside {0} @@ -108,16 +154,14 @@ compile.oneClassFileGenerated = 1 .class file generated compile.severalClassFilesGenerated = {0} .class files generated ### configure -configure.noSourceFile = no source file specified +configure.requiresJDK1.2orAbove = Need to use a JVM >= 1.2 configure.duplicateLog = duplicate log specification: {0} configure.duplicateRepeat = duplicate repeat specification: {0} configure.duplicateCompliance = duplicate compliance setting specification: {0} configure.source = invalid source option, source is either ''1.3'' or ''1.4'': {0} -configure.jck = invalid jck option, jck compliance level is either ''1.3'' or ''1.4'': {0} configure.duplicateOutputPath = duplicate output path specification: {0} -configure.duplicateClasspath = duplicate classpath specification: {0} +configure.duplicateBootClasspath = duplicate bootclasspath specification: {0} configure.invalidDebugOption = invalid debug option: {0} -configure.duplicateWarningConfiguration = duplicate usage of warning configuration configure.invalidWarningConfiguration = invalid warning configuration: {0} configure.invalidWarning = invalid warning: {0} configure.invalidWarningOption = invalid warning option: {0} @@ -125,15 +169,18 @@ configure.targetJDK = target JDK should be comprised in between ''1.1'' and ''1. configure.incompatibleTargetForSource14 = ''1.4'' source mode requires ''-target 1.4'' : {0} configure.incompatibleComplianceForSource14 = ''1.4'' source mode requires ''-1.4'' compliance mode: {0} configure.incompatibleComplianceForTarget14 = ''1.4'' target mode requires ''-1.4'' compliance mode: {0} +configure.incompatibleComplianceForTarget11 = ''1.1'' target mode requires ''-1.3'' compliance mode: {0} configure.repetition = repetition must be a positive integer: {0} +configure.directoryNotExist = directory does not exist: {0} configure.IOError = i/o error : unable to retrieve .JAVA files in directory: {0} -configure.noClasspath = +configure.noClasspath = no classpath defined, using default directory instead configure.incorrectClasspath = incorrect classpath: {0} -configure.noSource = no source file specified +configure.invalidexpansionargumentname = expansion argument file {0} doesn't exist or cannot be read configure.cannotOpenLog = cannot open .log file configure.unexpectedCustomEncoding = unexpected custom encoding specification: {0}[{1}] configure.unsupportedEncoding = unsupported encoding format: {0} configure.duplicateDefaultEncoding = duplicate default encoding format specification: {0} +configure.invalidTaskTag ={0} is an invalid task tag ### requestor requestor.error = ERROR @@ -147,3 +194,6 @@ unit.missing = File {0} is missing ### output output.noClassFileCreated = No .class file created for file named {0} because of an IOException. + +### miscellaneous +misc.version = {compiler.name} diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java index c692d1b4c..6580e6e21 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java @@ -23,7 +23,8 @@ import org.aspectj.ajdt.internal.compiler.lookup.PrivilegedFieldBinding; import org.aspectj.ajdt.internal.compiler.lookup.PrivilegedHandler; import org.aspectj.weaver.AjcMemberMaker; import org.aspectj.weaver.ResolvedMember; -import org.eclipse.jdt.internal.compiler.AbstractSyntaxTreeVisitorAdapter; +import org.eclipse.jdt.internal.compiler.ASTVisitor; +//import org.eclipse.jdt.internal.compiler.AbstractSyntaxTreeVisitorAdapter; import org.eclipse.jdt.internal.compiler.ast.AllocationExpression; import org.eclipse.jdt.internal.compiler.ast.AssertStatement; import org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess; @@ -56,7 +57,7 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; * @author Jim Hugunin */ -public class AccessForInlineVisitor extends AbstractSyntaxTreeVisitorAdapter { +public class AccessForInlineVisitor extends ASTVisitor { PrivilegedHandler handler; AspectDeclaration inAspect; EclipseFactory world; // alias for inAspect.world @@ -104,8 +105,8 @@ public class AccessForInlineVisitor extends AbstractSyntaxTreeVisitorAdapter { if (send.isSuperAccess() && !send.binding.isStatic()) { send.receiver = new ThisReference(send.sourceStart, send.sourceEnd); - send.binding = send.codegenBinding = - getSuperAccessMethod((MethodBinding)send.binding); + MethodBinding superAccessBinding = getSuperAccessMethod((MethodBinding)send.binding); + AstUtil.replaceMethodBinding(send, superAccessBinding); } else if (!isPublic(send.binding)) { send.syntheticAccessor = getAccessibleMethod((MethodBinding)send.binding); } @@ -175,13 +176,23 @@ public class AccessForInlineVisitor extends AbstractSyntaxTreeVisitorAdapter { return ret; } + static class SuperAccessMethodPair { + public ResolvedMember originalMethod; + public MethodBinding accessMethod; + public SuperAccessMethodPair(ResolvedMember originalMethod, MethodBinding accessMethod) { + this.originalMethod = originalMethod; + this.accessMethod = accessMethod; + } + } + private MethodBinding getSuperAccessMethod(MethodBinding binding) { ResolvedMember m = world.makeResolvedMember(binding); - if (inAspect.superAccessForInline.containsKey(m)) return (MethodBinding)inAspect.superAccessForInline.get(m); - MethodBinding ret = world.makeMethodBinding( - AjcMemberMaker.superAccessMethod(inAspect.typeX, m) - ); - inAspect.superAccessForInline.put(m, ret); + ResolvedMember superAccessMember = AjcMemberMaker.superAccessMethod(inAspect.typeX, m); + if (inAspect.superAccessForInline.containsKey(superAccessMember)) { + return ((SuperAccessMethodPair)inAspect.superAccessForInline.get(superAccessMember)).accessMethod; + } + MethodBinding ret = world.makeMethodBinding(superAccessMember); + inAspect.superAccessForInline.put(superAccessMember, new SuperAccessMethodPair(m, ret)); return ret; } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java index 94a026aa0..40955af6b 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java @@ -38,7 +38,7 @@ import org.eclipse.jdt.internal.compiler.lookup.ClassScope; import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; -import org.eclipse.jdt.internal.core.util.CharArrayOps; +import org.eclipse.jdt.core.compiler.CharOperation; /** * Represents before, after and around advice in an aspect. @@ -123,7 +123,7 @@ public class AdviceDeclaration extends MethodDeclaration { resize(baseArgumentCount+1, binding.parameters), exceptions, binding.declaringClass); proceedMethodBinding.selector = - CharArrayOps.concat(selector, proceedMethodBinding.selector); + CharOperation.concat(selector, proceedMethodBinding.selector); } super.resolveStatements(); //upperScope); @@ -340,47 +340,62 @@ public class AdviceDeclaration extends MethodDeclaration { } - public String toString(int tab) { - String s = tabString(tab); - if (modifiers != AccDefault) { - s += modifiersString(modifiers); - } - - if (kind == AdviceKind.Around) { - s += returnTypeToString(0); - } +// public String toString(int tab) { +// String s = tabString(tab); +// if (modifiers != AccDefault) { +// s += modifiersString(modifiers); +// } +// +// if (kind == AdviceKind.Around) { +// s += returnTypeToString(0); +// } +// +// s += new String(selector) + "("; //$NON-NLS-1$ +// if (arguments != null) { +// for (int i = 0; i < arguments.length; i++) { +// s += arguments[i].toString(0); +// if (i != (arguments.length - 1)) +// s = s + ", "; //$NON-NLS-1$ +// }; +// }; +// s += ")"; //$NON-NLS-1$ +// +// if (extraArgument != null) { +// s += "(" + extraArgument.toString(0) + ")"; +// } +// +// +// +// if (thrownExceptions != null) { +// s += " throws "; //$NON-NLS-1$ +// for (int i = 0; i < thrownExceptions.length; i++) { +// s += thrownExceptions[i].toString(0); +// if (i != (thrownExceptions.length - 1)) +// s = s + ", "; //$NON-NLS-1$ +// }; +// }; +// +// s += ": "; +// if (pointcutDesignator != null) { +// s += pointcutDesignator.toString(0); +// } +// +// s += toStringStatements(tab + 1); +// return s; +// } - s += new String(selector) + "("; //$NON-NLS-1$ - if (arguments != null) { - for (int i = 0; i < arguments.length; i++) { - s += arguments[i].toString(0); - if (i != (arguments.length - 1)) - s = s + ", "; //$NON-NLS-1$ - }; - }; - s += ")"; //$NON-NLS-1$ - - if (extraArgument != null) { - s += "(" + extraArgument.toString(0) + ")"; - } - - - - if (thrownExceptions != null) { - s += " throws "; //$NON-NLS-1$ - for (int i = 0; i < thrownExceptions.length; i++) { - s += thrownExceptions[i].toString(0); - if (i != (thrownExceptions.length - 1)) - s = s + ", "; //$NON-NLS-1$ - }; - }; - - s += ": "; + public StringBuffer printBody(int indent, StringBuffer output) { + output.append(": "); if (pointcutDesignator != null) { - s += pointcutDesignator.toString(0); + output.append(pointcutDesignator.toString()); } + return super.printBody(indent,output); + } - s += toStringStatements(tab + 1); - return s; + public StringBuffer printReturnType(int indent, StringBuffer output) { + if (this.kind == AdviceKind.Around) { + return super.printReturnType(indent,output); + } + return output; } } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java index e30a1fa16..6fd3dd5f3 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java @@ -21,15 +21,19 @@ import org.aspectj.weaver.*; import org.aspectj.weaver.patterns.*; import org.eclipse.jdt.internal.compiler.ClassFile; import org.eclipse.jdt.internal.compiler.CompilationResult; +import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.Clinit; -import org.eclipse.jdt.internal.compiler.ast.MemberTypeDeclaration; +import org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration; +import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; import org.eclipse.jdt.internal.compiler.codegen.CodeStream; import org.eclipse.jdt.internal.compiler.codegen.Label; import org.eclipse.jdt.internal.compiler.lookup.*; +import org.eclipse.jdt.internal.compiler.parser.Parser; -// making all aspects member types avoids a nasty hierarchy pain -public class AspectDeclaration extends MemberTypeDeclaration { +// (we used to...) making all aspects member types avoids a nasty hierarchy pain +// switched from MemberTypeDeclaration to TypeDeclaration +public class AspectDeclaration extends TypeDeclaration { //public IAjDeclaration[] ajDeclarations; private AjAttribute.Aspect aspectAttribute; @@ -188,7 +192,7 @@ public class AspectDeclaration extends MemberTypeDeclaration { } } - if (EclipseFactory.DEBUG) System.out.println(toString(0)); + if (EclipseFactory.DEBUG) System.out.println(toString()); super.generateCode(enclosingClassFile); } @@ -222,9 +226,9 @@ public class AspectDeclaration extends MemberTypeDeclaration { } private void generateInlineAccessMembers(ClassFile classFile) { - for (Iterator i = superAccessForInline.entrySet().iterator(); i.hasNext(); ) { - Map.Entry e = (Map.Entry)i.next(); - generateSuperAccessMethod(classFile, (MethodBinding)e.getValue(), (ResolvedMember)e.getKey()); + for (Iterator i = superAccessForInline.values().iterator(); i.hasNext(); ) { + AccessForInlineVisitor.SuperAccessMethodPair pair = (AccessForInlineVisitor.SuperAccessMethodPair)i.next(); + generateSuperAccessMethod(classFile, pair.accessMethod, pair.originalMethod); } for (Iterator i = accessForInline.entrySet().iterator(); i.hasNext(); ) { Map.Entry e = (Map.Entry)i.next(); @@ -752,62 +756,59 @@ public class AspectDeclaration extends MemberTypeDeclaration { } - public String toString(int tab) { - return tabString(tab) + toStringHeader() + toStringBody(tab); - } - - public String toStringBody(int tab) { - - String s = " {"; //$NON-NLS-1$ - - - if (memberTypes != null) { - for (int i = 0; i < memberTypes.length; i++) { - if (memberTypes[i] != null) { - s += "\n" + memberTypes[i].toString(tab + 1); //$NON-NLS-1$ - } - } - } - if (fields != null) { - for (int fieldI = 0; fieldI < fields.length; fieldI++) { - if (fields[fieldI] != null) { - s += "\n" + fields[fieldI].toString(tab + 1); //$NON-NLS-1$ - if (fields[fieldI].isField()) - s += ";"; //$NON-NLS-1$ - } - } - } - if (methods != null) { - for (int i = 0; i < methods.length; i++) { - if (methods[i] != null) { - s += "\n" + methods[i].toString(tab + 1); //$NON-NLS-1$ - } - } - } - s += "\n" + tabString(tab) + "}"; //$NON-NLS-2$ //$NON-NLS-1$ - return s; - } - - public String toStringHeader() { - - String s = ""; //$NON-NLS-1$ - if (modifiers != AccDefault) { - s += modifiersString(modifiers); +// public String toString(int tab) { +// return tabString(tab) + toStringHeader() + toStringBody(tab); +// } +// +// public String toStringBody(int tab) { +// +// String s = " {"; //$NON-NLS-1$ +// +// +// if (memberTypes != null) { +// for (int i = 0; i < memberTypes.length; i++) { +// if (memberTypes[i] != null) { +// s += "\n" + memberTypes[i].toString(tab + 1); //$NON-NLS-1$ +// } +// } +// } +// if (fields != null) { +// for (int fieldI = 0; fieldI < fields.length; fieldI++) { +// if (fields[fieldI] != null) { +// s += "\n" + fields[fieldI].toString(tab + 1); //$NON-NLS-1$ +// if (fields[fieldI].isField()) +// s += ";"; //$NON-NLS-1$ +// } +// } +// } +// if (methods != null) { +// for (int i = 0; i < methods.length; i++) { +// if (methods[i] != null) { +// s += "\n" + methods[i].toString(tab + 1); //$NON-NLS-1$ +// } +// } +// } +// s += "\n" + tabString(tab) + "}"; //$NON-NLS-2$ //$NON-NLS-1$ +// return s; +// } + + public StringBuffer printHeader(int indent, StringBuffer output) { + printModifiers(this.modifiers, output); + output.append("aspect " ); + output.append(name); + if (superclass != null) { + output.append(" extends "); //$NON-NLS-1$ + superclass.print(0, output); } - s += "aspect " + new String(name);//$NON-NLS-1$ //$NON-NLS-2$ - if (superclass != null) - s += " extends " + superclass.toString(0); //$NON-NLS-1$ if (superInterfaces != null && superInterfaces.length > 0) { - s += (isInterface() ? " extends " : " implements ");//$NON-NLS-2$ //$NON-NLS-1$ + output.append(isInterface() ? " extends " : " implements ");//$NON-NLS-2$ //$NON-NLS-1$ for (int i = 0; i < superInterfaces.length; i++) { - s += superInterfaces[i].toString(0); - if (i != superInterfaces.length - 1) - s += ", "; //$NON-NLS-1$ - }; - }; - return s; + if (i > 0) output.append( ", "); //$NON-NLS-1$ + superInterfaces[i].print(0, output); + } + } + return output; + //XXX we should append the per-clause } - - } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AstUtil.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AstUtil.java index 1e33a7af0..0b76be8c7 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AstUtil.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AstUtil.java @@ -21,8 +21,9 @@ import org.aspectj.weaver.AjAttribute; import org.aspectj.weaver.patterns.WildTypePattern; import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.Argument; -import org.eclipse.jdt.internal.compiler.ast.AstNode; +import org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.eclipse.jdt.internal.compiler.ast.Expression; +import org.eclipse.jdt.internal.compiler.ast.MessageSend; import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.NameReference; import org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference; @@ -89,8 +90,11 @@ public class AstUtil { public static NameReference makeNameReference(TypeBinding binding) { + + char[][] name = new char[][] {binding.sourceName()}; + long[] dummyPositions = new long[name.length]; QualifiedNameReference ref = - new QualifiedNameReference(new char[][] {binding.sourceName()}, 0, 0); + new QualifiedNameReference(name, dummyPositions, 0, 0); ref.binding = binding; ref.constant = Constant.NotAConstant; return ref; } @@ -130,8 +134,8 @@ public class AstUtil { SingleNameReference ret = new SingleNameReference(binding.name, 0); ret.binding = binding; ret.codegenBinding = binding; - ret.constant = AstNode.NotAConstant; - ret.bits &= ~AstNode.RestrictiveFlagMASK; // clear bits + ret.constant = ASTNode.NotAConstant; + ret.bits &= ~ASTNode.RestrictiveFlagMASK; // clear bits ret.bits |= BindingIds.VARIABLE; return ret; } @@ -142,8 +146,8 @@ public class AstUtil { SingleNameReference ret = new SingleNameReference(binding.name, 0); ret.binding = binding; ret.codegenBinding = binding; - ret.constant = AstNode.NotAConstant; - ret.bits &= ~AstNode.RestrictiveFlagMASK; // clear bits + ret.constant = ASTNode.NotAConstant; + ret.bits &= ~ASTNode.RestrictiveFlagMASK; // clear bits ret.bits |= BindingIds.LOCAL; return ret; } @@ -284,5 +288,10 @@ public class AstUtil { if (type == BaseTypes.DoubleBinding || type == BaseTypes.LongBinding) return 2; else return 1; } - + + public static void replaceMethodBinding(MessageSend send, MethodBinding newBinding) { + send.binding = send.codegenBinding = newBinding; + send.setActualReceiverType(newBinding.declaringClass); + + } } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java index a1c325870..34791014d 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java @@ -89,12 +89,14 @@ public class DeclareDeclaration extends MethodDeclaration { } + public StringBuffer print(int tab, StringBuffer output) { + printIndent(tab, output); + if (declareDecl == null) { + output.append("<declare>"); + } else { + output.append(declareDecl.toString()); + } + return output; + } - - - - public String toString(int tab) { - if (declareDecl == null) return tabString(tab) + "<declare>"; - else return tabString(tab) + declareDecl.toString(); - } } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterSuperFixerVisitor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterSuperFixerVisitor.java index bde3fd4e3..cd5681038 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterSuperFixerVisitor.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterSuperFixerVisitor.java @@ -17,7 +17,7 @@ import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory; import org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceLocation; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.ISourceLocation; -import org.eclipse.jdt.internal.compiler.AbstractSyntaxTreeVisitorAdapter; +import org.eclipse.jdt.internal.compiler.ASTVisitor; import org.eclipse.jdt.internal.compiler.ast.Expression; import org.eclipse.jdt.internal.compiler.ast.FieldReference; import org.eclipse.jdt.internal.compiler.ast.MessageSend; @@ -33,7 +33,7 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; * @author Jim Hugunin */ -public class InterSuperFixerVisitor extends AbstractSyntaxTreeVisitorAdapter { +public class InterSuperFixerVisitor extends ASTVisitor { InterTypeDeclaration dec; ReferenceBinding onType; TypeBinding superType; diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java index a1c8c8e02..59d139121 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java @@ -41,7 +41,7 @@ public class InterTypeConstructorDeclaration extends InterTypeDeclaration { public void parseStatements(Parser parser, CompilationUnitDeclaration unit) { if (ignoreFurtherInvestigation) return; - parser.parseAsConstructor(this, unit); + parser.parse(this, unit); } public void resolve(ClassScope upperScope) { @@ -262,5 +262,5 @@ public class InterTypeConstructorDeclaration extends InterTypeDeclaration { protected Shadow.Kind getShadowKindForBody() { return Shadow.ConstructorExecution; } - + } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/KnownFieldReference.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/KnownFieldReference.java index 17fbf776c..3b8edfad6 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/KnownFieldReference.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/KnownFieldReference.java @@ -23,7 +23,7 @@ public class KnownFieldReference extends QualifiedNameReference { //XXX handle source locations public KnownFieldReference(FieldBinding binding, long pos) { - super(new char[][] {binding.name}, 0, 0); + super(new char[][] {binding.name},new long[1], 0, 0); this.binding = this.codegenBinding = binding; this.constant = Constant.NotAConstant; this.receiverType = this.actualReceiverType = diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/MakeDeclsPublicVisitor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/MakeDeclsPublicVisitor.java index bd661a6de..c3b6b8c27 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/MakeDeclsPublicVisitor.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/MakeDeclsPublicVisitor.java @@ -13,11 +13,12 @@ package org.aspectj.ajdt.internal.compiler.ast; -import org.eclipse.jdt.internal.compiler.AbstractSyntaxTreeVisitorAdapter; -import org.eclipse.jdt.internal.compiler.ast.AnonymousLocalTypeDeclaration; +import org.eclipse.jdt.internal.compiler.ASTVisitor; +//import org.eclipse.jdt.internal.compiler.ast.AnonymousLocalTypeDeclaration; import org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration; import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration; -import org.eclipse.jdt.internal.compiler.ast.LocalTypeDeclaration; +import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; +//import org.eclipse.jdt.internal.compiler.ast.LocalTypeDeclaration; import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration; import org.eclipse.jdt.internal.compiler.lookup.BlockScope; import org.eclipse.jdt.internal.compiler.lookup.ClassScope; @@ -28,18 +29,7 @@ import org.eclipse.jdt.internal.compiler.lookup.MethodScope; * thisJoinPointStaticPart, thisJoinPoint and thisEnclosingJoinPointStaticPart */ -public class MakeDeclsPublicVisitor extends AbstractSyntaxTreeVisitorAdapter { - - public void endVisit( - AnonymousLocalTypeDeclaration decl, - BlockScope scope) { - decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers); - } - - public void endVisit(LocalTypeDeclaration decl, BlockScope scope) { - decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers); - } - +public class MakeDeclsPublicVisitor extends ASTVisitor { public void endVisit(ConstructorDeclaration decl, ClassScope scope) { decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers); @@ -54,4 +44,22 @@ public class MakeDeclsPublicVisitor extends AbstractSyntaxTreeVisitorAdapter { decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers); } + /* (non-Javadoc) + * @see org.eclipse.jdt.internal.compiler.ASTVisitor#endVisit(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration, org.eclipse.jdt.internal.compiler.lookup.BlockScope) + */ + public void endVisit( + TypeDeclaration localTypeDeclaration, + BlockScope scope) { + localTypeDeclaration.binding.modifiers = AstUtil.makePublic(localTypeDeclaration.binding.modifiers); + } + + /* (non-Javadoc) + * @see org.eclipse.jdt.internal.compiler.ASTVisitor#endVisit(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration, org.eclipse.jdt.internal.compiler.lookup.ClassScope) + */ + public void endVisit( + TypeDeclaration memberTypeDeclaration, + ClassScope scope) { + memberTypeDeclaration.binding.modifiers = AstUtil.makePublic(memberTypeDeclaration.binding.modifiers); + } + } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java index b93d984cd..b55d3188f 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java @@ -158,27 +158,18 @@ public class PointcutDeclaration extends MethodDeclaration { return; } - public String toString(int tab) { - StringBuffer buf = new StringBuffer(); - buf.append(tabString(tab)); - if (modifiers != 0) { - buf.append(modifiersString(modifiers)); - } + public StringBuffer printReturnType(int indent, StringBuffer output) { + return output.append("pointcut"); + } - buf.append("pointcut "); - buf.append(new String(selector)); - buf.append("("); - if (arguments != null) { - for (int i = 0; i < arguments.length; i++) { - if (i > 0) buf.append(", "); - buf.append(arguments[i].toString(0)); - }; - }; - buf.append("): "); - - buf.append(getPointcut()); - - buf.append(";"); - return buf.toString(); + /* (non-Javadoc) + * @see org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration#printBody(int, java.lang.StringBuffer) + */ + public StringBuffer printBody(int indent, StringBuffer output) { + output.append(": "); + output.append(getPointcut()); + output.append(";"); + return output; } + } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDesignator.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDesignator.java index 55f88e825..fd0967e08 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDesignator.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDesignator.java @@ -20,7 +20,7 @@ import org.aspectj.weaver.patterns.FormalBinding; import org.aspectj.weaver.patterns.Pointcut; import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.Argument; -import org.eclipse.jdt.internal.compiler.ast.AstNode; +import org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; @@ -28,7 +28,7 @@ import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding; import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; import org.eclipse.jdt.internal.compiler.parser.Parser; -public class PointcutDesignator extends AstNode { +public class PointcutDesignator extends ASTNode { private Pointcut pointcut; private PseudoTokens tokens; //XXX redundant private boolean isError = false; @@ -51,12 +51,6 @@ public class PointcutDesignator extends AstNode { } - - public String toString(int tab) { - if (pointcut == null) return "<pcd>"; - return pointcut.toString(); - } - public boolean finishResolveTypes(final AbstractMethodDeclaration dec, MethodBinding method, final int baseArgumentCount, SourceTypeBinding sourceTypeBinding) { //System.err.println("resolving: " + this); //Thread.currentThread().dumpStack(); @@ -91,4 +85,12 @@ public class PointcutDesignator extends AstNode { return isError; } + /* (non-Javadoc) + * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#print(int, java.lang.StringBuffer) + */ + public StringBuffer print(int indent, StringBuffer output) { + if (pointcut == null) return output.append("<pcd>"); + return output.append(pointcut.toString()); + } + } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ProceedVisitor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ProceedVisitor.java index 397cb68c5..4c0d2bc9d 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ProceedVisitor.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ProceedVisitor.java @@ -14,7 +14,7 @@ package org.aspectj.ajdt.internal.compiler.ast; import org.aspectj.weaver.Advice; -import org.eclipse.jdt.internal.compiler.AbstractSyntaxTreeVisitorAdapter; +import org.eclipse.jdt.internal.compiler.ASTVisitor; import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.Expression; import org.eclipse.jdt.internal.compiler.ast.MessageSend; @@ -33,7 +33,7 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; * thisJoinPointStaticPart, thisJoinPoint and thisEnclosingJoinPointStaticPart */ -public class ProceedVisitor extends AbstractSyntaxTreeVisitorAdapter { +public class ProceedVisitor extends ASTVisitor { boolean needsDynamic = false; boolean needsStatic = false; boolean needsStaticEnclosing = false; diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PseudoToken.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PseudoToken.java index 22aa8a395..e57f2295c 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PseudoToken.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PseudoToken.java @@ -15,14 +15,14 @@ package org.aspectj.ajdt.internal.compiler.ast; import org.aspectj.weaver.patterns.IToken; import org.aspectj.weaver.patterns.Pointcut; -import org.eclipse.jdt.internal.compiler.ast.AstNode; +import org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; import org.eclipse.jdt.internal.compiler.parser.Parser; /** */ -public class PseudoToken extends AstNode implements IToken { +public class PseudoToken extends ASTNode implements IToken { public String value; public boolean isIdentifier; public String literalKind = null; @@ -84,4 +84,12 @@ public class PseudoToken extends AstNode implements IToken { // nothing to do typically } + /* (non-Javadoc) + * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#print(int, java.lang.StringBuffer) + */ + public StringBuffer print(int indent, StringBuffer output) { + output.append("PseudoToken<" + getString() + ">"); + return output; + } + } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PseudoTokens.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PseudoTokens.java index 07ac6b9d9..5d4e0bb41 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PseudoTokens.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PseudoTokens.java @@ -24,13 +24,14 @@ import org.aspectj.weaver.patterns.PerClause; import org.aspectj.weaver.patterns.PerSingleton; import org.aspectj.weaver.patterns.Pointcut; import org.aspectj.weaver.patterns.TypePattern; -import org.eclipse.jdt.internal.compiler.ast.AstNode; +import org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; import org.eclipse.jdt.internal.compiler.parser.Parser; +import org.eclipse.jdt.internal.compiler.parser.TerminalTokens; -public class PseudoTokens extends AstNode { +public class PseudoTokens extends ASTNode { BasicTokenSource tokenSource; PseudoToken[] tokens; //XXX this is redundant with the field above String endToken; @@ -61,6 +62,7 @@ public class PseudoTokens extends AstNode { IToken last = tokenSource.next(); if (tokenSource.next() != IToken.EOF) { parser.problemReporter().parseError(last.getStart(), last.getEnd(), + TerminalTokens.TokenNameIdentifier, last.getString().toCharArray(), last.getString(), new String[] {endToken}); @@ -84,6 +86,7 @@ public class PseudoTokens extends AstNode { } parser.problemReporter().parseError(start, end, + TerminalTokens.TokenNameIdentifier, found.toCharArray(), found, new String[] {pe.getMessage()}); @@ -143,8 +146,12 @@ public class PseudoTokens extends AstNode { } } - - public String toString(int tab) { - return tokenSource.toString(); + /* (non-Javadoc) + * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#print(int, java.lang.StringBuffer) + */ + public StringBuffer print(int indent, StringBuffer output) { + output.append(tokenSource.toString()); + return output; } + } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/SuperFixerVisitor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/SuperFixerVisitor.java index ce0a7cead..41612be69 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/SuperFixerVisitor.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/SuperFixerVisitor.java @@ -20,9 +20,9 @@ import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory; import org.aspectj.ajdt.internal.compiler.lookup.InterTypeMethodBinding; import org.aspectj.weaver.NameMangler; import org.aspectj.weaver.ResolvedMember; -import org.eclipse.jdt.internal.compiler.AbstractSyntaxTreeVisitorAdapter; +import org.eclipse.jdt.internal.compiler.ASTVisitor; import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; -import org.eclipse.jdt.internal.compiler.ast.AstNode; +import org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.eclipse.jdt.internal.compiler.ast.MessageSend; import org.eclipse.jdt.internal.compiler.ast.ThisReference; import org.eclipse.jdt.internal.compiler.lookup.BlockScope; @@ -35,7 +35,7 @@ import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; * thisJoinPointStaticPart, thisJoinPoint and thisEnclosingJoinPointStaticPart */ -public class SuperFixerVisitor extends AbstractSyntaxTreeVisitorAdapter { +public class SuperFixerVisitor extends ASTVisitor { Set superMethodsCalled = new HashSet(); AbstractMethodDeclaration method; ReferenceBinding targetClass; @@ -90,11 +90,11 @@ public class SuperFixerVisitor extends AbstractSyntaxTreeVisitorAdapter { //??? do we want these to be unique MethodBinding superAccessBinding = - new MethodBinding(AstNode.AccPublic, accessName, + new MethodBinding(ASTNode.AccPublic, accessName, superBinding.returnType, superBinding.parameters, superBinding.thrownExceptions, targetClass); - - call.codegenBinding = superAccessBinding; + + AstUtil.replaceMethodBinding(call, superAccessBinding); ResolvedMember targetMember = EclipseFactory.makeResolvedMember(superBinding); superMethodsCalled.add(targetMember); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java index 8e5ef3837..7cfbc8ea3 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java @@ -14,7 +14,7 @@ package org.aspectj.ajdt.internal.compiler.ast; import org.aspectj.weaver.Advice; -import org.eclipse.jdt.internal.compiler.AbstractSyntaxTreeVisitorAdapter; +import org.eclipse.jdt.internal.compiler.ASTVisitor; import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.Expression; import org.eclipse.jdt.internal.compiler.ast.MessageSend; @@ -33,7 +33,7 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; * thisJoinPointStaticPart, thisJoinPoint and thisEnclosingJoinPointStaticPart */ -public class ThisJoinPointVisitor extends AbstractSyntaxTreeVisitorAdapter { +public class ThisJoinPointVisitor extends ASTVisitor { boolean needsDynamic = false; boolean needsStatic = false; boolean needsStaticEnclosing = false; @@ -170,7 +170,7 @@ public class ThisJoinPointVisitor extends AbstractSyntaxTreeVisitorAdapter { call.setActualReceiverType(thisJoinPointStaticPartType); - call.binding = call.codegenBinding = getEquivalentStaticBinding(call.binding); + AstUtil.replaceMethodBinding(call, getEquivalentStaticBinding(call.binding)); } private MethodBinding getEquivalentStaticBinding(MethodBinding template) { diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java index 244ab288c..ba6d39ce9 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java @@ -126,7 +126,7 @@ public class EclipseFactory { return ret; } - public static AstNode astForLocation(IHasPosition location) { + public static ASTNode astForLocation(IHasPosition location) { return new EmptyStatement(location.getStart(), location.getEnd()); } @@ -307,12 +307,12 @@ public class EclipseFactory { } - public Shadow makeShadow(AstNode location, ReferenceContext context) { + public Shadow makeShadow(ASTNode location, ReferenceContext context) { return EclipseShadow.makeShadow(this, location, context); } public Shadow makeShadow(ReferenceContext context) { - return EclipseShadow.makeShadow(this, (AstNode) context, context); + return EclipseShadow.makeShadow(this, (ASTNode) context, context); } public void addSourceTypeBinding(SourceTypeBinding binding) { diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseShadow.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseShadow.java index a8b5d3d40..99abeedf9 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseShadow.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseShadow.java @@ -30,11 +30,11 @@ import org.eclipse.jdt.internal.compiler.impl.ReferenceContext; */ public class EclipseShadow extends Shadow { EclipseFactory world; - AstNode astNode; + ASTNode astNode; ReferenceContext context; //AbstractMethodDeclaration enclosingMethod; - public EclipseShadow(EclipseFactory world, Kind kind, Member signature, AstNode astNode, + public EclipseShadow(EclipseFactory world, Kind kind, Member signature, ASTNode astNode, ReferenceContext context) { super(kind, signature, null); @@ -103,7 +103,7 @@ public class EclipseShadow extends Shadow { // --- factory methods - public static EclipseShadow makeShadow(EclipseFactory world, AstNode astNode, + public static EclipseShadow makeShadow(EclipseFactory world, ASTNode astNode, ReferenceContext context) { //XXX make sure we're getting the correct declaring type at call-site diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InlineAccessFieldBinding.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InlineAccessFieldBinding.java index 13e91184f..d1f3b730f 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InlineAccessFieldBinding.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InlineAccessFieldBinding.java @@ -15,7 +15,7 @@ package org.aspectj.ajdt.internal.compiler.lookup; import org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration; import org.aspectj.weaver.AjcMemberMaker; -import org.eclipse.jdt.internal.compiler.ast.AstNode; +import org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.eclipse.jdt.internal.compiler.lookup.FieldBinding; import org.eclipse.jdt.internal.compiler.lookup.InvocationSite; import org.eclipse.jdt.internal.compiler.lookup.Scope; @@ -53,7 +53,7 @@ public class InlineAccessFieldBinding extends FieldBinding { inAspect.typeX, inAspect.factory.makeResolvedMember(baseField) ))); - this.constant = AstNode.NotAConstant; + this.constant = ASTNode.NotAConstant; this.baseField = baseField; } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java index 1461b9839..ae7da9032 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java @@ -41,7 +41,7 @@ public class InterTypeMemberFinder implements IMemberFinder { InvocationSite site, Scope scope) { - FieldBinding retField = sourceTypeBinding.getFieldBase(fieldName); + FieldBinding retField = sourceTypeBinding.getFieldBase(fieldName, false); // XXX may need to get the correct value for second parameter in the future if (interTypeFields.isEmpty()) return retField; int fieldLength = fieldName.length; @@ -63,8 +63,10 @@ public class InterTypeMemberFinder implements IMemberFinder { Scope scope) { if (retField == null) return field; - if (!field.canBeSeenBy(sourceTypeBinding, site, scope)) return retField; - if (!retField.canBeSeenBy(sourceTypeBinding, site, scope)) return field; + if (site != null) { + if (!field.canBeSeenBy(sourceTypeBinding, site, scope)) return retField; + if (!retField.canBeSeenBy(sourceTypeBinding, site, scope)) return field; + } //XXX need dominates check on aspects return new ProblemFieldBinding(retField.declaringClass, retField.name, ProblemReporter.Ambiguous); } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedFieldBinding.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedFieldBinding.java index c053cab08..adedd1dbb 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedFieldBinding.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedFieldBinding.java @@ -15,7 +15,7 @@ package org.aspectj.ajdt.internal.compiler.lookup; import org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration; import org.aspectj.weaver.AjcMemberMaker; -import org.eclipse.jdt.internal.compiler.ast.AstNode; +import org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.eclipse.jdt.internal.compiler.lookup.FieldBinding; import org.eclipse.jdt.internal.compiler.lookup.InvocationSite; import org.eclipse.jdt.internal.compiler.lookup.Scope; @@ -42,7 +42,7 @@ public class PrivilegedFieldBinding extends FieldBinding { inAspect.typeX, inAspect.factory.makeResolvedMember(baseField) ))); - this.constant = AstNode.NotAConstant; + this.constant = ASTNode.NotAConstant; this.baseField = baseField; } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java index ac410b896..6ee798eb8 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java @@ -28,7 +28,7 @@ import org.aspectj.weaver.ResolvedMember; import org.aspectj.weaver.ResolvedTypeX; import org.aspectj.weaver.TypeX; import org.aspectj.weaver.World; -import org.eclipse.jdt.internal.compiler.ast.AstNode; +import org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.eclipse.jdt.internal.compiler.lookup.FieldBinding; import org.eclipse.jdt.internal.compiler.lookup.IPrivilegedHandler; import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; @@ -44,7 +44,7 @@ public class PrivilegedHandler implements IPrivilegedHandler { this.inAspect = inAspect; } - public FieldBinding getPrivilegedAccessField(FieldBinding baseField, AstNode location) { + public FieldBinding getPrivilegedAccessField(FieldBinding baseField, ASTNode location) { ResolvedMember key = inAspect.factory.makeResolvedMember(baseField); if (accessors.containsKey(key)) return (FieldBinding)accessors.get(key); FieldBinding ret = new PrivilegedFieldBinding(inAspect, baseField); @@ -53,7 +53,7 @@ public class PrivilegedHandler implements IPrivilegedHandler { return ret; } - public MethodBinding getPrivilegedAccessMethod(MethodBinding baseMethod, AstNode location) { + public MethodBinding getPrivilegedAccessMethod(MethodBinding baseMethod, ASTNode location) { if (baseMethod.alwaysNeedsAccessMethod()) return baseMethod; ResolvedMember key = EclipseFactory.makeResolvedMember(baseMethod); @@ -75,7 +75,7 @@ public class PrivilegedHandler implements IPrivilegedHandler { return ret; } - public void notePrivilegedTypeAccess(ReferenceBinding type, AstNode location) { + public void notePrivilegedTypeAccess(ReferenceBinding type, ASTNode location) { ResolvedMember key = new ResolvedMember(Member.STATIC_INITIALIZATION, inAspect.factory.fromEclipse(type), 0, ResolvedTypeX.VOID, "", TypeX.NONE); @@ -84,7 +84,7 @@ public class PrivilegedHandler implements IPrivilegedHandler { accessors.put(key, key); } - private void checkWeaveAccess(TypeX typeX, AstNode location) { + private void checkWeaveAccess(TypeX typeX, ASTNode location) { World world = inAspect.factory.getWorld(); Lint.Kind check = world.getLint().typeNotExposedToWeaver; if (check.isEnabled()) { diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/AjParser.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/AjParser.java index 819de5523..1b1512d28 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/AjParser.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/AjParser.java @@ -35,12 +35,13 @@ import org.aspectj.weaver.ISourceContext; import org.aspectj.weaver.patterns.Declare; import org.eclipse.jdt.internal.compiler.CompilationResult; import org.eclipse.jdt.internal.compiler.ast.Argument; -import org.eclipse.jdt.internal.compiler.ast.AstNode; +import org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall; import org.eclipse.jdt.internal.compiler.ast.Expression; import org.eclipse.jdt.internal.compiler.ast.Literal; import org.eclipse.jdt.internal.compiler.ast.MessageSend; import org.eclipse.jdt.internal.compiler.ast.OperatorExpression; +import org.eclipse.jdt.internal.compiler.ast.OperatorIds; import org.eclipse.jdt.internal.compiler.ast.TypeReference; import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import org.eclipse.jdt.internal.compiler.parser.Parser; @@ -48,366 +49,44 @@ import org.eclipse.jdt.internal.compiler.parser.RecoveredType; import org.eclipse.jdt.internal.compiler.problem.ProblemReporter; import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities; import org.eclipse.jdt.core.compiler.CharOperation; -import org.eclipse.jdt.internal.core.util.CharArrayOps; public class AjParser extends Parser { - //===DATA===DATA===DATA===DATA===DATA===DATA===// - public final static byte rhs[] = {0, - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, - 2,2,2,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,2,2,1,1,1,1,1,1,1,1,1, - 1,1,1,1,3,1,1,1,3,4,0,1,2,1,1, - 1,1,1,1,1,1,1,5,1,2,1,2,2,2,1, - 1,2,2,2,4,1,1,1,1,2,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,2,4,3,5,0,2,1,3,1,2,0,2, - 1,3,5,4,1,1,2,5,4,2,6,3,3,4,3, - 1,0,1,3,1,1,1,1,2,4,6,2,2,3,5, - 7,0,4,1,3,3,1,2,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,4,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,2,3,3,2,2,1,3,1,3,1,2,1, - 1,1,3,0,3,1,1,1,1,1,1,1,4,1,3, - 3,7,0,0,0,0,0,2,1,1,1,2,2,4,4, - 5,4,4,2,1,2,3,3,3,1,3,3,1,3,1, - 4,0,2,1,2,2,4,1,1,2,5,5,7,7,7, - 7,2,2,3,2,2,3,1,2,1,2,1,1,2,2, - 1,1,1,1,1,3,3,4,1,3,4,0,1,2,1, - 1,1,1,2,3,4,0,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,3,3,2,1,1,1,1,1,1,1,5,7,7,6, - 2,3,3,4,1,2,2,1,2,3,2,5,5,7,9, - 9,1,1,1,1,3,3,5,2,3,2,3,3,3,5, - 1,3,4,1,2,5,2,1,1,1,1,1,1,1,3, - 1,1,3,3,3,3,3,1,1,5,6,8,7,2,0, - 2,0,1,3,3,4,3,4,1,2,3,2,1,1,2, - 2,3,3,4,6,6,4,4,4,1,1,1,1,2,2, - 0,1,1,3,3,1,3,3,1,3,3,1,6,6,5, - 0,0,1,3,3,3,1,3,3,1,3,3,3,1,3, - 3,3,3,3,1,3,3,1,3,1,3,1,3,1,3, - 1,3,1,5,1,1,3,3,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,0,1,0,1,0,1,0, - 1,0,1,0,1,0,2,0,1,0,1,0,1,0,1, - 0,1,0,1,0,1,0,2,0,0,1,0,1,0,1, - 0,1 - }; - - - public static char asbStatic[] = null; - public static char asrStatic[] = null; - public static char symbol_indexStatic[] = null; - public final static String name[] = { null, - "++", - "--", - "==", - "<=", - ">=", - "!=", - "<<", - ">>", - ">>>", - "+=", - "-=", - "*=", - "/=", - "&=", - "|=", - "^=", - "%=", - "<<=", - ">>=", - ">>>=", - "||", - "&&", - "+", - "-", - "!", - "%", - "^", - "&", - "*", - "|", - "~", - "/", - ">", - "<", - "(", - ")", - "{", - "}", - "[", - "]", - ";", - "?", - ":", - ",", - ".", - "=", - "", - "$empty", - "Identifier", - "abstract", - "assert", - "boolean", - "break", - "byte", - "case", - "catch", - "char", - "class", - "continue", - "default", - "do", - "double", - "else", - "extends", - "false", - "final", - "finally", - "float", - "for", - "if", - "implements", - "import", - "instanceof", - "int", - "interface", - "long", - "native", - "new", - "null", - "package", - "private", - "protected", - "public", - "return", - "short", - "static", - "strictfp", - "super", - "switch", - "synchronized", - "this", - "throw", - "throws", - "transient", - "true", - "try", - "void", - "volatile", - "while", - "aspect", - "pointcut", - "around", - "before", - "after", - "declare", - "privileged", - "IntegerLiteral", - "LongLiteral", - "FloatingPointLiteral", - "DoubleLiteral", - "CharacterLiteral", - "StringLiteral", - UNEXPECTED_EOF, - "Invalid Character", - "Goal", - "MethodBody", - "ConstructorBody", - "StaticInitializer", - "Initializer", - "Headers", - "BlockStatements", - "MethodPushModifiersHeader", - "CatchHeader", - "FieldDeclaration", - "ImportDeclaration", - "PackageDeclaration", - "TypeDeclaration", - "GenericMethodDeclaration", - "ClassBodyDeclaration", - "Expression", - "JavaIdentifier", - "AjSimpleName", - "JavaIdentifierNoAround", - "AjSimpleNameNoAround", - "Type", - "PrimitiveType", - "ReferenceType", - "ClassOrInterfaceType", - "ArrayType", - "Name", - "Dims", - "ClassType", - "NameOrAj", - "AjName", - "SimpleName", - "Header", - "ClassHeader", - "InterfaceHeader", - "MethodHeader", - "ConstructorHeader", - "FormalParameter", - "ImportDeclarations", - "TypeDeclarations", - "PackageDeclarationName", - "SingleTypeImportDeclarationNam" + - "e", - "TypeImportOnDemandDeclarationN" + - "ame", - "Modifiers", - "Modifier", - "InterfaceMemberDeclaration", - "AspectHeader", - "AspectBody", - "AspectHeaderName", - "AspectHeaderRestStart", - "PseudoTokens", - "AspectBodyDeclarations", - "AspectBodyDeclaration", - "PointcutHeader", - "MethodHeaderParameters", - "AroundHeader", - "AroundHeaderName", - "BasicAdviceHeader", - "BasicAdviceHeaderName", - "OnType", - "InterTypeMethodHeader", - "InterTypeMethodHeaderName", - "InterTypeConstructorHeader", - "InterTypeConstructorHeaderName", - "VariableInitializer", - "DeclareHeader", - "PseudoToken", - "ClassBody", - "ClassHeaderName", - "InterfaceTypeList", - "InterfaceType", - "ClassBodyDeclarations", - "Block", - "VariableDeclarators", - "VariableDeclarator", - "VariableDeclaratorId", - "ArrayInitializer", - "MethodHeaderName", - "MethodPushModifiersHeaderName", - "ClassTypeList", - "ConstructorHeaderName", - "FormalParameterList", - "ClassTypeElt", - "StaticOnly", - "ExplicitConstructorInvocation", - "Primary", - "InterfaceBody", - "InterfaceHeaderName", - "InterfaceMemberDeclarations", - "VariableInitializers", - "BlockStatement", - "Statement", - "LocalVariableDeclaration", - "StatementWithoutTrailingSubsta" + - "tement", - "StatementNoShortIf", - "StatementExpression", - "PostIncrementExpression", - "PostDecrementExpression", - "MethodInvocation", - "ClassInstanceCreationExpressio" + - "n", - "SwitchBlock", - "SwitchBlockStatements", - "SwitchLabels", - "SwitchBlockStatement", - "SwitchLabel", - "ConstantExpression", - "StatementExpressionList", - "OnlySynchronized", - "Catches", - "Finally", - "CatchClause", - "PushLPAREN", - "PushRPAREN", - "PrimaryNoNewArray", - "ArrayCreationWithArrayInitiali" + - "zer", - "ClassInstanceCreationExpressio" + - "nName", - "ArgumentList", - "DimWithOrWithOutExprs", - "DimWithOrWithOutExpr", - "DimsLoop", - "OneDimLoop", - "PostfixExpression", - "UnaryExpression", - "UnaryExpressionNotPlusMinus", - "MultiplicativeExpression", - "AdditiveExpression", - "ShiftExpression", - "RelationalExpression", - "EqualityExpression", - "AndExpression", - "ExclusiveOrExpression", - "InclusiveOrExpression", - "ConditionalAndExpression", - "ConditionalOrExpression", - "ConditionalExpression", - "AssignmentExpression", - "AssignmentOperator" - }; - - public static short check_tableStatic[] = null; - public static char lhsStatic[] = null; - public static char actionStatic[] = lhsStatic; - - protected void initData() { - rhsInst = rhs; - asb = asbStatic; - asr = asrStatic; - symbol_index = symbol_indexStatic; - nameInst = name; - check_table = check_tableStatic; - lhs = lhsStatic; - action = actionStatic; - } - static { try{ - initAjTables(AjParser.class); + initTables(AjParser.class); } catch(java.io.IOException ex){ throw new ExceptionInInitializerError(ex.getMessage()); } } - public final static void initAjTables(Class parserClass) - throws java.io.IOException { - - final String prefix = FILEPREFIX; - int i = 0; - lhsStatic = readTable(parserClass, prefix + (++i) + ".rsc"); //$NON-NLS-1$ - char[] chars = readTable(parserClass, prefix + (++i) + ".rsc"); //$NON-NLS-1$ - check_tableStatic = new short[chars.length]; - for (int c = chars.length; c-- > 0;) { - check_tableStatic[c] = (short) (chars[c] - 32768); - } - asbStatic = readTable(parserClass, prefix + (++i) + ".rsc"); //$NON-NLS-1$ - asrStatic = readTable(parserClass, prefix + (++i) + ".rsc"); //$NON-NLS-1$ - symbol_indexStatic = readTable(parserClass, prefix + (++i) + ".rsc"); //$NON-NLS-1$ - actionStatic = lhsStatic; - } +// public final static void initAjTables(Class parserClass) +// throws java.io.IOException { +// +// final String prefix = FILEPREFIX; +// int i = 0; +// lhsStatic = readTable(parserClass, prefix + (++i) + ".rsc"); //$NON-NLS-1$ +// char[] chars = readTable(parserClass, prefix + (++i) + ".rsc"); //$NON-NLS-1$ +// check_tableStatic = new short[chars.length]; +// for (int c = chars.length; c-- > 0;) { +// check_tableStatic[c] = (short) (chars[c] - 32768); +// } +// asbStatic = readTable(parserClass, prefix + (++i) + ".rsc"); //$NON-NLS-1$ +// asrStatic = readTable(parserClass, prefix + (++i) + ".rsc"); //$NON-NLS-1$ +// symbol_indexStatic = readTable(parserClass, prefix + (++i) + ".rsc"); //$NON-NLS-1$ +// actionStatic = lhsStatic; +// } public void initializeScanner(){ - CompilerOptions options = this.problemReporter.options; this.scanner = new AjScanner( false /*comment*/, false /*whitespace*/, - options.getSeverity(CompilerOptions.NonExternalizedString) != ProblemSeverities.Ignore /*nls*/, - this.assertMode /*assert*/, - options.taskTags/*taskTags*/, - options.taskPriorites/*taskPriorities*/); + this.options.getSeverity(CompilerOptions.NonExternalizedString) != ProblemSeverities.Ignore /*nls*/, + this.options.sourceLevel /*sourceLevel*/, + this.options.taskTags/*taskTags*/, + this.options.taskPriorites/*taskPriorities*/); } @@ -486,7 +165,7 @@ public class AjParser extends Parser { super.consumeMethodInvocationName(); MessageSend m = (MessageSend)expressionStack[expressionPtr]; - if (CharArrayOps.equals(m.selector, "proceed".toCharArray())) { + if (CharOperation.equals(m.selector, "proceed".toCharArray())) { expressionStack[expressionPtr] = new Proceed(m); } } @@ -633,6 +312,7 @@ public class AjParser extends Parser { protected void consumeAroundHeader() { consumePointcutDesignatorOnAdvice(); + consumeMethodHeader(); } protected void consumeAroundHeaderName() { @@ -683,6 +363,8 @@ public class AjParser extends Parser { protected void consumeBasicAdviceHeader() { // BasicAdviceHeader ::= BasicAdviceHeaderName MethodHeaderParameters ExtraParamopt MethodHeaderThrowsClauseopt ':' PseudoTokens consumePointcutDesignatorOnAdvice(); + + consumeMethodHeader(); } @@ -740,6 +422,7 @@ public class AjParser extends Parser { problemReporter().parseError( start, end, + currentToken, name, String.valueOf(name), new String[] {"throwing", "returning", ":"}); @@ -1057,8 +740,8 @@ public class AjParser extends Parser { private void swapAstStack() { - AstNode top = astStack[astPtr]; - AstNode next = astStack[astPtr-1]; + ASTNode top = astStack[astPtr]; + ASTNode next = astStack[astPtr-1]; astStack[astPtr] = next; astStack[astPtr-1] = top; } @@ -1066,1226 +749,1232 @@ public class AjParser extends Parser { // This method is part of an automatic generation : do NOT edit-modify - // This method is part of an automatic generation : do NOT edit-modify -protected void consumeRule(int act) { - switch ( act ) { - case 33 : // System.out.println("Type ::= PrimitiveType"); - consumePrimitiveType(); - break ; + protected void consumeRule(int act) { + switch ( act ) { + case 30 : // System.out.println("Type ::= PrimitiveType"); //$NON-NLS-1$ + consumePrimitiveType(); + break ; - case 47 : // System.out.println("ReferenceType ::= ClassOrInterfaceType"); - consumeReferenceType(); - break ; + case 44 : // System.out.println("ReferenceType ::= ClassOrInterfaceType"); //$NON-NLS-1$ + consumeReferenceType(); + break ; - case 65 : // System.out.println("AjQualifiedName ::= AjName DOT SimpleName"); - consumeQualifiedName(); - break ; + case 62 : // System.out.println("AjQualifiedName ::= AjName DOT SimpleName"); //$NON-NLS-1$ + consumeQualifiedName(); + break ; - case 69 : // System.out.println("QualifiedName ::= Name DOT JavaIdentifier"); - consumeQualifiedName(); - break ; + case 66 : // System.out.println("QualifiedName ::= Name DOT JavaIdentifier"); //$NON-NLS-1$ + consumeQualifiedName(); + break ; - case 70 : // System.out.println("CompilationUnit ::= EnterCompilationUnit PackageDeclarationopt ImportDeclarationsopt"); - consumeCompilationUnit(); - break ; + case 67 : // System.out.println("CompilationUnit ::= EnterCompilationUnit PackageDeclarationopt..."); //$NON-NLS-1$ + consumeCompilationUnit(); + break ; - case 71 : // System.out.println("EnterCompilationUnit ::="); - consumeEnterCompilationUnit(); - break ; + case 68 : // System.out.println("EnterCompilationUnit ::="); //$NON-NLS-1$ + consumeEnterCompilationUnit(); + break ; - case 83 : // System.out.println("CatchHeader ::= catch LPAREN FormalParameter RPAREN LBRACE"); - consumeCatchHeader(); - break ; + case 81 : // System.out.println("CatchHeader ::= catch LPAREN FormalParameter RPAREN LBRACE"); //$NON-NLS-1$ + consumeCatchHeader(); + break ; - case 85 : // System.out.println("ImportDeclarations ::= ImportDeclarations ImportDeclaration"); - consumeImportDeclarations(); - break ; + case 83 : // System.out.println("ImportDeclarations ::= ImportDeclarations ImportDeclaration"); //$NON-NLS-1$ + consumeImportDeclarations(); + break ; - case 87 : // System.out.println("TypeDeclarations ::= TypeDeclarations TypeDeclaration"); - consumeTypeDeclarations(); - break ; + case 85 : // System.out.println("TypeDeclarations ::= TypeDeclarations TypeDeclaration"); //$NON-NLS-1$ + consumeTypeDeclarations(); + break ; - case 88 : // System.out.println("PackageDeclaration ::= PackageDeclarationName SEMICOLON"); - consumePackageDeclaration(); - break ; + case 86 : // System.out.println("PackageDeclaration ::= PackageDeclarationName SEMICOLON"); //$NON-NLS-1$ + consumePackageDeclaration(); + break ; - case 89 : // System.out.println("PackageDeclarationName ::= package Name"); - consumePackageDeclarationName(); - break ; + case 87 : // System.out.println("PackageDeclarationName ::= package Name"); //$NON-NLS-1$ + consumePackageDeclarationName(); + break ; - case 92 : // System.out.println("SingleTypeImportDeclaration ::= SingleTypeImportDeclarationName SEMICOLON"); - consumeSingleTypeImportDeclaration(); - break ; + case 90 : // System.out.println("SingleTypeImportDeclaration ::= SingleTypeImportDeclarationName..."); //$NON-NLS-1$ + consumeSingleTypeImportDeclaration(); + break ; - case 93 : // System.out.println("SingleTypeImportDeclarationName ::= import Name"); - consumeSingleTypeImportDeclarationName(); - break ; + case 91 : // System.out.println("SingleTypeImportDeclarationName ::= import Name"); //$NON-NLS-1$ + consumeSingleTypeImportDeclarationName(); + break ; - case 94 : // System.out.println("TypeImportOnDemandDeclaration ::= TypeImportOnDemandDeclarationName SEMICOLON"); - consumeTypeImportOnDemandDeclaration(); - break ; + case 92 : // System.out.println("TypeImportOnDemandDeclaration ::= TypeImportOnDemandDeclarationName"); //$NON-NLS-1$ + consumeTypeImportOnDemandDeclaration(); + break ; - case 95 : // System.out.println("TypeImportOnDemandDeclarationName ::= import Name DOT MULTIPLY"); - consumeTypeImportOnDemandDeclarationName(); - break ; + case 93 : // System.out.println("TypeImportOnDemandDeclarationName ::= import Name DOT MULTIPLY"); //$NON-NLS-1$ + consumeTypeImportOnDemandDeclarationName(); + break ; - case 98 : // System.out.println("TypeDeclaration ::= SEMICOLON"); - consumeEmptyTypeDeclaration(); - break ; - - case 124 : // System.out.println("AspectDeclaration ::= AspectHeader AspectBody"); - consumeAspectDeclaration(); - break ; - - case 125 : // System.out.println("AspectHeader ::= AspectHeaderName ClassHeaderExtendsopt ClassHeaderImplementsopt..."); - consumeAspectHeader(); - break ; - - case 126 : // System.out.println("AspectHeaderName ::= Modifiersopt aspect Identifier"); - consumeAspectHeaderName(false); - break ; - - case 127 : // System.out.println("AspectHeaderName ::= Modifiersopt privileged Modifiersopt aspect Identifier"); - consumeAspectHeaderName(true); - break ; - - case 129 : // System.out.println("AspectHeaderRest ::= AspectHeaderRestStart PseudoTokens"); - consumeAspectHeaderRest(); - break ; - - case 130 : // System.out.println("AspectHeaderRestStart ::= Identifier"); - consumePseudoTokenIdentifier(); - break ; - - case 133 : // System.out.println("AspectBodyDeclarations ::= AspectBodyDeclarations AspectBodyDeclaration"); - consumeClassBodyDeclarations(); - break ; - - case 134 : // System.out.println("AspectBodyDeclarationsopt ::="); - consumeEmptyClassBodyDeclarationsopt(); - break ; - - case 135 : // System.out.println("AspectBodyDeclarationsopt ::= NestedType AspectBodyDeclarations"); - consumeClassBodyDeclarationsopt(); - break ; - - case 136 : // System.out.println("AspectBodyDeclaration ::= ClassBodyDeclaration"); - consumeClassBodyDeclarationInAspect(); - break ; + case 96 : // System.out.println("TypeDeclaration ::= SEMICOLON"); //$NON-NLS-1$ + consumeEmptyTypeDeclaration(); + break ; + + case 122 : // System.out.println("AspectDeclaration ::= AspectHeader AspectBody"); //$NON-NLS-1$ + consumeAspectDeclaration(); + break ; + + case 123 : // System.out.println("AspectHeader ::= AspectHeaderName ClassHeaderExtendsopt..."); //$NON-NLS-1$ + consumeAspectHeader(); + break ; + + case 124 : // System.out.println("AspectHeaderName ::= Modifiersopt aspect Identifier"); //$NON-NLS-1$ + consumeAspectHeaderName(false); + break ; + + case 125 : // System.out.println("AspectHeaderName ::= Modifiersopt privileged Modifiersopt aspect..."); //$NON-NLS-1$ + consumeAspectHeaderName(true); + break ; + + case 127 : // System.out.println("AspectHeaderRest ::= AspectHeaderRestStart PseudoTokens"); //$NON-NLS-1$ + consumeAspectHeaderRest(); + break ; + + case 128 : // System.out.println("AspectHeaderRestStart ::= Identifier"); //$NON-NLS-1$ + consumePseudoTokenIdentifier(); + break ; + + case 131 : // System.out.println("AspectBodyDeclarations ::= AspectBodyDeclarations..."); //$NON-NLS-1$ + consumeClassBodyDeclarations(); + break ; + + case 132 : // System.out.println("AspectBodyDeclarationsopt ::="); //$NON-NLS-1$ + consumeEmptyClassBodyDeclarationsopt(); + break ; + + case 133 : // System.out.println("AspectBodyDeclarationsopt ::= NestedType AspectBodyDeclarations"); //$NON-NLS-1$ + consumeClassBodyDeclarationsopt(); + break ; + + case 134 : // System.out.println("AspectBodyDeclaration ::= ClassBodyDeclaration"); //$NON-NLS-1$ + consumeClassBodyDeclarationInAspect(); + break ; - case 137 : // System.out.println("PointcutDeclaration ::= PointcutHeader MethodHeaderParameters SEMICOLON"); - consumeEmptyPointcutDeclaration(); - break ; + case 135 : // System.out.println("PointcutDeclaration ::= PointcutHeader MethodHeaderParameters..."); //$NON-NLS-1$ + consumeEmptyPointcutDeclaration(); + break ; - case 138 : // System.out.println("PointcutDeclaration ::= PointcutHeader MethodHeaderParameters COLON PseudoTokens..."); - consumePointcutDeclaration(); - break ; + case 136 : // System.out.println("PointcutDeclaration ::= PointcutHeader MethodHeaderParameters COLON"); //$NON-NLS-1$ + consumePointcutDeclaration(); + break ; - case 139 : // System.out.println("PointcutHeader ::= Modifiersopt pointcut JavaIdentifier LPAREN"); - consumePointcutHeader(); - break ; + case 137 : // System.out.println("PointcutHeader ::= Modifiersopt pointcut JavaIdentifier LPAREN"); //$NON-NLS-1$ + consumePointcutHeader(); + break ; - case 142 : // System.out.println("AroundDeclaration ::= AroundHeader MethodBody"); - consumeAroundDeclaration(); - break ; + case 140 : // System.out.println("AroundDeclaration ::= AroundHeader MethodBody"); //$NON-NLS-1$ + consumeAroundDeclaration(); + break ; - case 143 : // System.out.println("AroundHeader ::= AroundHeaderName MethodHeaderParameters..."); - consumeAroundHeader(); - break ; + case 141 : // System.out.println("AroundHeader ::= AroundHeaderName MethodHeaderParameters..."); //$NON-NLS-1$ + consumeAroundHeader(); + break ; - case 144 : // System.out.println("AroundHeaderName ::= Modifiersopt Type around LPAREN"); - consumeAroundHeaderName(); - break ; + case 142 : // System.out.println("AroundHeaderName ::= Modifiersopt Type around LPAREN"); //$NON-NLS-1$ + consumeAroundHeaderName(); + break ; - case 145 : // System.out.println("BasicAdviceDeclaration ::= BasicAdviceHeader MethodBody"); - consumeBasicAdviceDeclaration(); - break ; + case 143 : // System.out.println("BasicAdviceDeclaration ::= BasicAdviceHeader MethodBody"); //$NON-NLS-1$ + consumeBasicAdviceDeclaration(); + break ; - case 146 : // System.out.println("BasicAdviceHeader ::= BasicAdviceHeaderName MethodHeaderParameters ExtraParamopt..."); - consumeBasicAdviceHeader(); - break ; + case 144 : // System.out.println("BasicAdviceHeader ::= BasicAdviceHeaderName MethodHeaderParameters"); //$NON-NLS-1$ + consumeBasicAdviceHeader(); + break ; - case 147 : // System.out.println("BasicAdviceHeaderName ::= Modifiersopt before LPAREN"); - consumeBasicAdviceHeaderName(false); - break ; + case 145 : // System.out.println("BasicAdviceHeaderName ::= Modifiersopt before LPAREN"); //$NON-NLS-1$ + consumeBasicAdviceHeaderName(false); + break ; - case 148 : // System.out.println("BasicAdviceHeaderName ::= Modifiersopt after LPAREN"); - consumeBasicAdviceHeaderName(true); - break ; + case 146 : // System.out.println("BasicAdviceHeaderName ::= Modifiersopt after LPAREN"); //$NON-NLS-1$ + consumeBasicAdviceHeaderName(true); + break ; - case 149 : // System.out.println("ExtraParamopt ::= Identifier LPAREN FormalParameter RPAREN"); - consumeExtraParameterWithFormal(); - break ; + case 147 : // System.out.println("ExtraParamopt ::= Identifier LPAREN FormalParameter RPAREN"); //$NON-NLS-1$ + consumeExtraParameterWithFormal(); + break ; - case 150 : // System.out.println("ExtraParamopt ::= Identifier LPAREN RPAREN"); - consumeExtraParameterNoFormal(); - break ; + case 148 : // System.out.println("ExtraParamopt ::= Identifier LPAREN RPAREN"); //$NON-NLS-1$ + consumeExtraParameterNoFormal(); + break ; - case 151 : // System.out.println("ExtraParamopt ::= Identifier"); - consumeExtraParameterNoFormal(); - break ; + case 149 : // System.out.println("ExtraParamopt ::= Identifier"); //$NON-NLS-1$ + consumeExtraParameterNoFormal(); + break ; - case 154 : // System.out.println("OnType ::= OnType DOT JavaIdentifier"); - consumeQualifiedName(); - break ; + case 152 : // System.out.println("OnType ::= OnType DOT JavaIdentifier"); //$NON-NLS-1$ + consumeQualifiedName(); + break ; - case 159 : // System.out.println("InterTypeMethodDeclaration ::= InterTypeMethodHeader MethodBody"); - // set to true to consume a method with a body - consumeInterTypeMethodDeclaration(true); - break ; - - case 160 : // System.out.println("InterTypeMethodHeader ::= InterTypeMethodHeaderName MethodHeaderParameters..."); - consumeInterTypeMethodHeader(); - break ; - - case 161 : // System.out.println("InterTypeMethodHeaderName ::= Modifiersopt Type OnType DOT JavaIdentifier LPAREN"); - consumeInterTypeMethodHeaderName(); - break ; - - case 162 : // System.out.println("AbstractInterTypeMethodDeclaration ::= InterTypeMethodHeader SEMICOLON"); - // set to false to consume a method without body - consumeInterTypeMethodDeclaration(false); - break ; - - case 163 : // System.out.println("InterTypeConstructorDeclaration ::= InterTypeConstructorHeader ConstructorBody"); - // set to true to consume a method with a body - consumeInterTypeConstructorDeclaration(); - break ; + case 157 : // System.out.println("InterTypeMethodDeclaration ::= InterTypeMethodHeader MethodBody"); //$NON-NLS-1$ + // set to true to consume a method with a body + consumeInterTypeMethodDeclaration(true); + break ; + + case 158 : // System.out.println("InterTypeMethodHeader ::= InterTypeMethodHeaderName..."); //$NON-NLS-1$ + consumeInterTypeMethodHeader(); + break ; + + case 159 : // System.out.println("InterTypeMethodHeaderName ::= Modifiersopt Type OnType DOT..."); //$NON-NLS-1$ + consumeInterTypeMethodHeaderName(); + break ; + + case 160 : // System.out.println("AbstractInterTypeMethodDeclaration ::= InterTypeMethodHeader..."); //$NON-NLS-1$ + // set to false to consume a method without body + consumeInterTypeMethodDeclaration(false); + break ; + + case 161 : // System.out.println("InterTypeConstructorDeclaration ::= InterTypeConstructorHeader..."); //$NON-NLS-1$ + // set to true to consume a method with a body + consumeInterTypeConstructorDeclaration(); + break ; - case 164 : // System.out.println("InterTypeConstructorHeader ::= InterTypeConstructorHeaderName..."); - consumeInterTypeConstructorHeader(); - break ; + case 162 : // System.out.println("InterTypeConstructorHeader ::= InterTypeConstructorHeaderName..."); //$NON-NLS-1$ + consumeInterTypeConstructorHeader(); + break ; - case 165 : // System.out.println("InterTypeConstructorHeaderName ::= Modifiersopt Name DOT new LPAREN"); - consumeInterTypeConstructorHeaderName(); - break ; + case 163 : // System.out.println("InterTypeConstructorHeaderName ::= Modifiersopt Name DOT new LPAREN"); //$NON-NLS-1$ + consumeInterTypeConstructorHeaderName(); + break ; - case 166 : // System.out.println("InterTypeFieldDeclaration ::= Modifiersopt Type OnType DOT JavaIdentifier..."); - consumeInterTypeFieldDeclaration(); - break ; + case 164 : // System.out.println("InterTypeFieldDeclaration ::= Modifiersopt Type OnType DOT..."); //$NON-NLS-1$ + consumeInterTypeFieldDeclaration(); + break ; - case 170 : // System.out.println("DeclareDeclaration ::= DeclareHeader PseudoTokens SEMICOLON"); - consumeDeclareDeclaration(); - break ; + case 168 : // System.out.println("DeclareDeclaration ::= DeclareHeader PseudoTokens SEMICOLON"); //$NON-NLS-1$ + consumeDeclareDeclaration(); + break ; - case 171 : // System.out.println("DeclareHeader ::= declare Identifier COLON"); - consumeDeclareHeader(); - break ; + case 169 : // System.out.println("DeclareHeader ::= declare Identifier COLON"); //$NON-NLS-1$ + consumeDeclareHeader(); + break ; - case 173 : // System.out.println("PseudoTokens ::= PseudoTokens PseudoToken"); - consumePseudoTokens(); - break ; + case 171 : // System.out.println("PseudoTokens ::= PseudoTokens PseudoToken"); //$NON-NLS-1$ + consumePseudoTokens(); + break ; - case 174 : // System.out.println("PseudoToken ::= JavaIdentifier"); - consumePseudoTokenIdentifier(); - break ; + case 172 : // System.out.println("PseudoToken ::= JavaIdentifier"); //$NON-NLS-1$ + consumePseudoTokenIdentifier(); + break ; - case 175 : // System.out.println("PseudoToken ::= LPAREN"); - consumePseudoToken("("); - break ; + case 173 : // System.out.println("PseudoToken ::= LPAREN"); //$NON-NLS-1$ + consumePseudoToken("("); + break ; - case 176 : // System.out.println("PseudoToken ::= RPAREN"); - consumePseudoToken(")"); - break ; + case 174 : // System.out.println("PseudoToken ::= RPAREN"); //$NON-NLS-1$ + consumePseudoToken(")"); + break ; - case 177 : // System.out.println("PseudoToken ::= DOT"); - consumePseudoToken("."); - break ; + case 175 : // System.out.println("PseudoToken ::= DOT"); //$NON-NLS-1$ + consumePseudoToken("."); + break ; - case 178 : // System.out.println("PseudoToken ::= MULTIPLY"); - consumePseudoToken("*"); - break ; + case 176 : // System.out.println("PseudoToken ::= MULTIPLY"); //$NON-NLS-1$ + consumePseudoToken("*"); + break ; - case 179 : // System.out.println("PseudoToken ::= PLUS"); - consumePseudoToken("+"); - break ; + case 177 : // System.out.println("PseudoToken ::= PLUS"); //$NON-NLS-1$ + consumePseudoToken("+"); + break ; - case 180 : // System.out.println("PseudoToken ::= AND_AND"); - consumePseudoToken("&&"); - break ; + case 178 : // System.out.println("PseudoToken ::= AND_AND"); //$NON-NLS-1$ + consumePseudoToken("&&"); + break ; - case 181 : // System.out.println("PseudoToken ::= OR_OR"); - consumePseudoToken("||"); - break ; + case 179 : // System.out.println("PseudoToken ::= OR_OR"); //$NON-NLS-1$ + consumePseudoToken("||"); + break ; - case 182 : // System.out.println("PseudoToken ::= NOT"); - consumePseudoToken("!"); - break ; + case 180 : // System.out.println("PseudoToken ::= NOT"); //$NON-NLS-1$ + consumePseudoToken("!"); + break ; - case 183 : // System.out.println("PseudoToken ::= COLON"); - consumePseudoToken(":"); - break ; + case 181 : // System.out.println("PseudoToken ::= COLON"); //$NON-NLS-1$ + consumePseudoToken(":"); + break ; - case 184 : // System.out.println("PseudoToken ::= COMMA"); - consumePseudoToken(","); - break ; + case 182 : // System.out.println("PseudoToken ::= COMMA"); //$NON-NLS-1$ + consumePseudoToken(","); + break ; - case 185 : // System.out.println("PseudoToken ::= LBRACKET"); - consumePseudoToken("["); - break ; + case 183 : // System.out.println("PseudoToken ::= LBRACKET"); //$NON-NLS-1$ + consumePseudoToken("["); + break ; - case 186 : // System.out.println("PseudoToken ::= RBRACKET"); - consumePseudoToken("]"); - break ; + case 184 : // System.out.println("PseudoToken ::= RBRACKET"); //$NON-NLS-1$ + consumePseudoToken("]"); + break ; - case 187 : // System.out.println("PseudoToken ::= PrimitiveType"); - consumePseudoTokenPrimitiveType(); - break ; + case 185 : // System.out.println("PseudoToken ::= PrimitiveType"); //$NON-NLS-1$ + consumePseudoTokenPrimitiveType(); + break ; - case 188 : // System.out.println("PseudoToken ::= Modifier"); - consumePseudoTokenModifier(); - break ; + case 186 : // System.out.println("PseudoToken ::= Modifier"); //$NON-NLS-1$ + consumePseudoTokenModifier(); + break ; - case 189 : // System.out.println("PseudoToken ::= Literal"); - consumePseudoTokenLiteral(); - break ; + case 187 : // System.out.println("PseudoToken ::= Literal"); //$NON-NLS-1$ + consumePseudoTokenLiteral(); + break ; - case 190 : // System.out.println("PseudoToken ::= this"); - consumePseudoToken("this", 1, true); - break ; + case 188 : // System.out.println("PseudoToken ::= this"); //$NON-NLS-1$ + consumePseudoToken("this", 1, true); + break ; - case 191 : // System.out.println("PseudoToken ::= super"); - consumePseudoToken("super", 1, true); - break ; + case 189 : // System.out.println("PseudoToken ::= super"); //$NON-NLS-1$ + consumePseudoToken("super", 1, true); + break ; - case 192 : // System.out.println("PseudoToken ::= if LPAREN Expression RPAREN"); - consumePseudoTokenIf(); - break ; + case 190 : // System.out.println("PseudoToken ::= if LPAREN Expression RPAREN"); //$NON-NLS-1$ + consumePseudoTokenIf(); + break ; - case 193 : // System.out.println("PseudoToken ::= assert"); - consumePseudoToken("assert", 1, true); - break ; + case 191 : // System.out.println("PseudoToken ::= assert"); //$NON-NLS-1$ + consumePseudoToken("assert", 1, true); + break ; - case 194 : // System.out.println("PseudoToken ::= import"); - consumePseudoToken("import", 1, true); - break ; + case 192 : // System.out.println("PseudoToken ::= import"); //$NON-NLS-1$ + consumePseudoToken("import", 1, true); + break ; - case 195 : // System.out.println("PseudoToken ::= package"); - consumePseudoToken("package", 1, true); - break ; + case 193 : // System.out.println("PseudoToken ::= package"); //$NON-NLS-1$ + consumePseudoToken("package", 1, true); + break ; - case 196 : // System.out.println("PseudoToken ::= throw"); - consumePseudoToken("throw", 1, true); - break ; + case 194 : // System.out.println("PseudoToken ::= throw"); //$NON-NLS-1$ + consumePseudoToken("throw", 1, true); + break ; - case 197 : // System.out.println("PseudoToken ::= new"); - consumePseudoToken("new", 1, true); - break ; + case 195 : // System.out.println("PseudoToken ::= new"); //$NON-NLS-1$ + consumePseudoToken("new", 1, true); + break ; - case 198 : // System.out.println("PseudoToken ::= do"); - consumePseudoToken("do", 1, true); - break ; + case 196 : // System.out.println("PseudoToken ::= do"); //$NON-NLS-1$ + consumePseudoToken("do", 1, true); + break ; - case 199 : // System.out.println("PseudoToken ::= for"); - consumePseudoToken("for", 1, true); - break ; + case 197 : // System.out.println("PseudoToken ::= for"); //$NON-NLS-1$ + consumePseudoToken("for", 1, true); + break ; - case 200 : // System.out.println("PseudoToken ::= switch"); - consumePseudoToken("switch", 1, true); - break ; + case 198 : // System.out.println("PseudoToken ::= switch"); //$NON-NLS-1$ + consumePseudoToken("switch", 1, true); + break ; - case 201 : // System.out.println("PseudoToken ::= try"); - consumePseudoToken("try", 1, true); - break ; + case 199 : // System.out.println("PseudoToken ::= try"); //$NON-NLS-1$ + consumePseudoToken("try", 1, true); + break ; - case 202 : // System.out.println("PseudoToken ::= while"); - consumePseudoToken("while", 1, true); - break ; + case 200 : // System.out.println("PseudoToken ::= while"); //$NON-NLS-1$ + consumePseudoToken("while", 1, true); + break ; - case 203 : // System.out.println("PseudoToken ::= break"); - consumePseudoToken("break", 1, true); - break ; + case 201 : // System.out.println("PseudoToken ::= break"); //$NON-NLS-1$ + consumePseudoToken("break", 1, true); + break ; - case 204 : // System.out.println("PseudoToken ::= continue"); - consumePseudoToken("continue", 1, true); - break ; + case 202 : // System.out.println("PseudoToken ::= continue"); //$NON-NLS-1$ + consumePseudoToken("continue", 1, true); + break ; - case 205 : // System.out.println("PseudoToken ::= return"); - consumePseudoToken("return", 1, true); - break ; + case 203 : // System.out.println("PseudoToken ::= return"); //$NON-NLS-1$ + consumePseudoToken("return", 1, true); + break ; - case 206 : // System.out.println("PseudoToken ::= case"); - consumePseudoToken("case", 1, true); - break ; + case 204 : // System.out.println("PseudoToken ::= case"); //$NON-NLS-1$ + consumePseudoToken("case", 1, true); + break ; - case 207 : // System.out.println("PseudoToken ::= catch"); - consumePseudoToken("catch", 0, true); - break ; + case 205 : // System.out.println("PseudoToken ::= catch"); //$NON-NLS-1$ + consumePseudoToken("catch", 0, true); + break ; - case 208 : // System.out.println("PseudoToken ::= instanceof"); - consumePseudoToken("instanceof", 0, true); - break ; + case 206 : // System.out.println("PseudoToken ::= instanceof"); //$NON-NLS-1$ + consumePseudoToken("instanceof", 0, true); + break ; - case 209 : // System.out.println("PseudoToken ::= else"); - consumePseudoToken("else", 0, true); - break ; + case 207 : // System.out.println("PseudoToken ::= else"); //$NON-NLS-1$ + consumePseudoToken("else", 0, true); + break ; - case 210 : // System.out.println("PseudoToken ::= extends"); - consumePseudoToken("extends", 0, true); - break ; + case 208 : // System.out.println("PseudoToken ::= extends"); //$NON-NLS-1$ + consumePseudoToken("extends", 0, true); + break ; - case 211 : // System.out.println("PseudoToken ::= finally"); - consumePseudoToken("finally", 0, true); - break ; + case 209 : // System.out.println("PseudoToken ::= finally"); //$NON-NLS-1$ + consumePseudoToken("finally", 0, true); + break ; - case 212 : // System.out.println("PseudoToken ::= implements"); - consumePseudoToken("implements", 0, true); - break ; + case 210 : // System.out.println("PseudoToken ::= implements"); //$NON-NLS-1$ + consumePseudoToken("implements", 0, true); + break ; - case 213 : // System.out.println("PseudoToken ::= throws"); - consumePseudoToken("throws", 0, true); - break ; + case 211 : // System.out.println("PseudoToken ::= throws"); //$NON-NLS-1$ + consumePseudoToken("throws", 0, true); + break ; - case 214 : // System.out.println("ClassDeclaration ::= ClassHeader ClassBody"); - consumeClassDeclaration(); - break ; + case 212 : // System.out.println("ClassDeclaration ::= ClassHeader ClassBody"); //$NON-NLS-1$ + consumeClassDeclaration(); + break ; - case 215 : // System.out.println("ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt ClassHeaderImplementsopt"); - consumeClassHeader(); - break ; + case 213 : // System.out.println("ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt..."); //$NON-NLS-1$ + consumeClassHeader(); + break ; - case 216 : // System.out.println("ClassHeaderName ::= Modifiersopt class JavaIdentifier"); - consumeClassHeaderName(); - break ; + case 214 : // System.out.println("ClassHeaderName ::= Modifiersopt class JavaIdentifier"); //$NON-NLS-1$ + consumeClassHeaderName(); + break ; - case 217 : // System.out.println("ClassHeaderExtends ::= extends ClassType"); - consumeClassHeaderExtends(); - break ; + case 215 : // System.out.println("ClassHeaderExtends ::= extends ClassType"); //$NON-NLS-1$ + consumeClassHeaderExtends(); + break ; - case 218 : // System.out.println("ClassHeaderImplements ::= implements InterfaceTypeList"); - consumeClassHeaderImplements(); - break ; + case 216 : // System.out.println("ClassHeaderImplements ::= implements InterfaceTypeList"); //$NON-NLS-1$ + consumeClassHeaderImplements(); + break ; - case 220 : // System.out.println("InterfaceTypeList ::= InterfaceTypeList COMMA InterfaceType"); - consumeInterfaceTypeList(); - break ; + case 218 : // System.out.println("InterfaceTypeList ::= InterfaceTypeList COMMA InterfaceType"); //$NON-NLS-1$ + consumeInterfaceTypeList(); + break ; - case 221 : // System.out.println("InterfaceType ::= ClassOrInterfaceType"); - consumeInterfaceType(); - break ; + case 219 : // System.out.println("InterfaceType ::= ClassOrInterfaceType"); //$NON-NLS-1$ + consumeInterfaceType(); + break ; - case 224 : // System.out.println("ClassBodyDeclarations ::= ClassBodyDeclarations ClassBodyDeclaration"); - consumeClassBodyDeclarations(); - break ; + case 222 : // System.out.println("ClassBodyDeclarations ::= ClassBodyDeclarations ClassBodyDeclaration"); //$NON-NLS-1$ + consumeClassBodyDeclarations(); + break ; - case 228 : // System.out.println("ClassBodyDeclaration ::= Diet NestedMethod Block"); - consumeClassBodyDeclaration(); - break ; + case 226 : // System.out.println("ClassBodyDeclaration ::= Diet NestedMethod Block"); //$NON-NLS-1$ + consumeClassBodyDeclaration(); + break ; - case 229 : // System.out.println("Diet ::="); - consumeDiet(); - break ; + case 227 : // System.out.println("Diet ::="); //$NON-NLS-1$ + consumeDiet(); + break ; - case 230 : // System.out.println("Initializer ::= Diet NestedMethod Block"); - consumeClassBodyDeclaration(); - break ; + case 228 : // System.out.println("Initializer ::= Diet NestedMethod Block"); //$NON-NLS-1$ + consumeClassBodyDeclaration(); + break ; - case 237 : // System.out.println("ClassMemberDeclaration ::= SEMICOLON"); - consumeEmptyClassMemberDeclaration(); - break ; + case 235 : // System.out.println("ClassMemberDeclaration ::= SEMICOLON"); //$NON-NLS-1$ + consumeEmptyClassMemberDeclaration(); + break ; - case 238 : // System.out.println("FieldDeclaration ::= Modifiersopt Type VariableDeclarators SEMICOLON"); - consumeFieldDeclaration(); - break ; + case 236 : // System.out.println("FieldDeclaration ::= Modifiersopt Type VariableDeclarators SEMICOLON"); //$NON-NLS-1$ + consumeFieldDeclaration(); + break ; - case 240 : // System.out.println("VariableDeclarators ::= VariableDeclarators COMMA VariableDeclarator"); - consumeVariableDeclarators(); - break ; + case 238 : // System.out.println("VariableDeclarators ::= VariableDeclarators COMMA VariableDeclarator"); //$NON-NLS-1$ + consumeVariableDeclarators(); + break ; - case 243 : // System.out.println("EnterVariable ::="); - consumeEnterVariable(); - break ; + case 241 : // System.out.println("EnterVariable ::="); //$NON-NLS-1$ + consumeEnterVariable(); + break ; - case 244 : // System.out.println("ExitVariableWithInitialization ::="); - consumeExitVariableWithInitialization(); - break ; + case 242 : // System.out.println("ExitVariableWithInitialization ::="); //$NON-NLS-1$ + consumeExitVariableWithInitialization(); + break ; - case 245 : // System.out.println("ExitVariableWithoutInitialization ::="); - consumeExitVariableWithoutInitialization(); - break ; + case 243 : // System.out.println("ExitVariableWithoutInitialization ::="); //$NON-NLS-1$ + consumeExitVariableWithoutInitialization(); + break ; - case 246 : // System.out.println("ForceNoDiet ::="); - consumeForceNoDiet(); - break ; + case 244 : // System.out.println("ForceNoDiet ::="); //$NON-NLS-1$ + consumeForceNoDiet(); + break ; - case 247 : // System.out.println("RestoreDiet ::="); - consumeRestoreDiet(); - break ; + case 245 : // System.out.println("RestoreDiet ::="); //$NON-NLS-1$ + consumeRestoreDiet(); + break ; - case 252 : // System.out.println("MethodDeclaration ::= MethodHeader MethodBody"); - // set to true to consume a method with a body - consumeMethodDeclaration(true); - break ; - - case 253 : // System.out.println("AbstractMethodDeclaration ::= MethodHeader SEMICOLON"); - // set to false to consume a method without body - consumeMethodDeclaration(false); - break ; - - case 254 : // System.out.println("MethodHeader ::= MethodHeaderName MethodHeaderParameters MethodHeaderExtendedDims"); - consumeMethodHeader(); - break ; - - case 255 : // System.out.println("MethodPushModifiersHeader ::= MethodPushModifiersHeaderName MethodHeaderParameters"); - consumeMethodHeader(); - break ; - - case 256 : // System.out.println("MethodPushModifiersHeaderName ::= Modifiers Type PushModifiers..."); - consumeMethodPushModifiersHeaderName(); - break ; - - case 257 : // System.out.println("MethodPushModifiersHeaderName ::= Type PushModifiers JavaIdentifierNoAround LPAREN"); - consumeMethodPushModifiersHeaderName(); - break ; - - case 258 : // System.out.println("MethodHeaderName ::= Modifiersopt Type JavaIdentifierNoAround LPAREN"); - consumeMethodHeaderName(); - break ; - - case 259 : // System.out.println("MethodHeaderParameters ::= FormalParameterListopt RPAREN"); - consumeMethodHeaderParameters(); - break ; - - case 260 : // System.out.println("MethodHeaderExtendedDims ::= Dimsopt"); - consumeMethodHeaderExtendedDims(); - break ; - - case 261 : // System.out.println("MethodHeaderThrowsClause ::= throws ClassTypeList"); - consumeMethodHeaderThrowsClause(); - break ; - - case 262 : // System.out.println("ConstructorHeader ::= ConstructorHeaderName MethodHeaderParameters..."); - consumeConstructorHeader(); - break ; - - case 263 : // System.out.println("ConstructorHeaderName ::= Modifiersopt Identifier LPAREN"); - consumeConstructorHeaderName(); - break ; - - case 264 : // System.out.println("ConstructorHeaderName ::= Modifiersopt aspect LPAREN"); - consumeConstructorHeaderName(); - break ; - - case 266 : // System.out.println("FormalParameterList ::= FormalParameterList COMMA FormalParameter"); - consumeFormalParameterList(); - break ; - - case 267 : // System.out.println("FormalParameter ::= Modifiersopt Type VariableDeclaratorId"); - // the boolean is used to know if the modifiers should be reset - consumeFormalParameter(); - break ; + case 250 : // System.out.println("MethodDeclaration ::= MethodHeader MethodBody"); //$NON-NLS-1$ + // set to true to consume a method with a body + consumeMethodDeclaration(true); + break ; + + case 251 : // System.out.println("AbstractMethodDeclaration ::= MethodHeader SEMICOLON"); //$NON-NLS-1$ + // set to false to consume a method without body + consumeMethodDeclaration(false); + break ; + + case 252 : // System.out.println("MethodHeader ::= MethodHeaderName MethodHeaderParameters..."); //$NON-NLS-1$ + consumeMethodHeader(); + break ; + + case 253 : // System.out.println("MethodHeaderName ::= Modifiersopt Type JavaIdentifierNoAround LPAREN"); //$NON-NLS-1$ + consumeMethodHeaderName(); + break ; + + case 254 : // System.out.println("MethodHeaderParameters ::= FormalParameterListopt RPAREN"); //$NON-NLS-1$ + consumeMethodHeaderParameters(); + break ; + + case 255 : // System.out.println("MethodHeaderExtendedDims ::= Dimsopt"); //$NON-NLS-1$ + consumeMethodHeaderExtendedDims(); + break ; + + case 256 : // System.out.println("MethodHeaderThrowsClause ::= throws ClassTypeList"); //$NON-NLS-1$ + consumeMethodHeaderThrowsClause(); + break ; + + case 257 : // System.out.println("ConstructorHeader ::= ConstructorHeaderName MethodHeaderParameters"); //$NON-NLS-1$ + consumeConstructorHeader(); + break ; + + case 258 : // System.out.println("ConstructorHeaderName ::= Modifiersopt Identifier LPAREN"); //$NON-NLS-1$ + consumeConstructorHeaderName(); + break ; + + case 259 : // System.out.println("ConstructorHeaderName ::= Modifiersopt aspect LPAREN"); //$NON-NLS-1$ + consumeConstructorHeaderName(); + break ; + + case 261 : // System.out.println("FormalParameterList ::= FormalParameterList COMMA FormalParameter"); //$NON-NLS-1$ + consumeFormalParameterList(); + break ; + + case 262 : // System.out.println("FormalParameter ::= Modifiersopt Type VariableDeclaratorId"); //$NON-NLS-1$ + // the boolean is used to know if the modifiers should be reset + consumeFormalParameter(); + break ; - case 269 : // System.out.println("ClassTypeList ::= ClassTypeList COMMA ClassTypeElt"); - consumeClassTypeList(); - break ; + case 264 : // System.out.println("ClassTypeList ::= ClassTypeList COMMA ClassTypeElt"); //$NON-NLS-1$ + consumeClassTypeList(); + break ; - case 270 : // System.out.println("ClassTypeElt ::= ClassType"); - consumeClassTypeElt(); - break ; + case 265 : // System.out.println("ClassTypeElt ::= ClassType"); //$NON-NLS-1$ + consumeClassTypeElt(); + break ; - case 271 : // System.out.println("MethodBody ::= NestedMethod LBRACE BlockStatementsopt RBRACE"); - consumeMethodBody(); - break ; + case 266 : // System.out.println("MethodBody ::= NestedMethod LBRACE BlockStatementsopt RBRACE"); //$NON-NLS-1$ + consumeMethodBody(); + break ; - case 272 : // System.out.println("NestedMethod ::="); - consumeNestedMethod(); - break ; + case 267 : // System.out.println("NestedMethod ::="); //$NON-NLS-1$ + consumeNestedMethod(); + break ; - case 273 : // System.out.println("StaticInitializer ::= StaticOnly Block"); - consumeStaticInitializer(); - break ; + case 268 : // System.out.println("StaticInitializer ::= StaticOnly Block"); //$NON-NLS-1$ + consumeStaticInitializer(); + break ; - case 274 : // System.out.println("StaticOnly ::= static"); - consumeStaticOnly(); - break ; + case 269 : // System.out.println("StaticOnly ::= static"); //$NON-NLS-1$ + consumeStaticOnly(); + break ; + + case 270 : // System.out.println("ConstructorDeclaration ::= ConstructorHeader MethodBody"); //$NON-NLS-1$ + consumeConstructorDeclaration() ; + break ; - case 275 : // System.out.println("ConstructorDeclaration ::= ConstructorHeader ConstructorBody"); - consumeConstructorDeclaration() ; - break ; + case 271 : // System.out.println("ConstructorDeclaration ::= ConstructorHeader SEMICOLON"); //$NON-NLS-1$ + consumeInvalidConstructorDeclaration() ; + break ; - case 276 : // System.out.println("ConstructorDeclaration ::= ConstructorHeader SEMICOLON"); - consumeInvalidConstructorDeclaration() ; - break ; + case 272 : // System.out.println("ExplicitConstructorInvocation ::= this LPAREN ArgumentListopt RPAREN"); //$NON-NLS-1$ + consumeExplicitConstructorInvocation(0,ExplicitConstructorCall.This); + break ; - case 277 : // System.out.println("ConstructorBody ::= NestedMethod LBRACE ConstructorBlockStatementsopt RBRACE"); - consumeConstructorBody(); - break ; + case 273 : // System.out.println("ExplicitConstructorInvocation ::= super LPAREN ArgumentListopt..."); //$NON-NLS-1$ + consumeExplicitConstructorInvocation(0,ExplicitConstructorCall.Super); + break ; - case 280 : // System.out.println("ConstructorBlockStatementsopt ::= ExplicitConstructorInvocation BlockStatements"); - consumeConstructorBlockStatements(); - break ; + case 274 : // System.out.println("ExplicitConstructorInvocation ::= Primary DOT super LPAREN..."); //$NON-NLS-1$ + consumeExplicitConstructorInvocation(1, ExplicitConstructorCall.Super); + break ; - case 281 : // System.out.println("ExplicitConstructorInvocation ::= this LPAREN ArgumentListopt RPAREN SEMICOLON"); - consumeExplicitConstructorInvocation(0,ExplicitConstructorCall.This); - break ; + case 275 : // System.out.println("ExplicitConstructorInvocation ::= Name DOT super LPAREN..."); //$NON-NLS-1$ + consumeExplicitConstructorInvocation(2, ExplicitConstructorCall.Super); + break ; - case 282 : // System.out.println("ExplicitConstructorInvocation ::= super LPAREN ArgumentListopt RPAREN SEMICOLON"); - consumeExplicitConstructorInvocation(0,ExplicitConstructorCall.Super); - break ; + case 276 : // System.out.println("ExplicitConstructorInvocation ::= Primary DOT this LPAREN..."); //$NON-NLS-1$ + consumeExplicitConstructorInvocation(1, ExplicitConstructorCall.This); + break ; - case 283 : // System.out.println("ExplicitConstructorInvocation ::= Primary DOT super LPAREN ArgumentListopt RPAREN"); - consumeExplicitConstructorInvocation(1, ExplicitConstructorCall.Super); - break ; + case 277 : // System.out.println("ExplicitConstructorInvocation ::= Name DOT this LPAREN..."); //$NON-NLS-1$ + consumeExplicitConstructorInvocation(2, ExplicitConstructorCall.This); + break ; - case 284 : // System.out.println("ExplicitConstructorInvocation ::= Name DOT super LPAREN ArgumentListopt RPAREN..."); - consumeExplicitConstructorInvocation(2, ExplicitConstructorCall.Super); - break ; + case 278 : // System.out.println("InterfaceDeclaration ::= InterfaceHeader InterfaceBody"); //$NON-NLS-1$ + consumeInterfaceDeclaration(); + break ; - case 285 : // System.out.println("ExplicitConstructorInvocation ::= Primary DOT this LPAREN ArgumentListopt RPAREN..."); - consumeExplicitConstructorInvocation(1, ExplicitConstructorCall.This); - break ; + case 279 : // System.out.println("InterfaceHeader ::= InterfaceHeaderName InterfaceHeaderExtendsopt"); //$NON-NLS-1$ + consumeInterfaceHeader(); + break ; - case 286 : // System.out.println("ExplicitConstructorInvocation ::= Name DOT this LPAREN ArgumentListopt RPAREN..."); - consumeExplicitConstructorInvocation(2, ExplicitConstructorCall.This); - break ; + case 280 : // System.out.println("InterfaceHeaderName ::= Modifiersopt interface JavaIdentifier"); //$NON-NLS-1$ + consumeInterfaceHeaderName(); + break ; - case 287 : // System.out.println("InterfaceDeclaration ::= InterfaceHeader InterfaceBody"); - consumeInterfaceDeclaration(); - break ; + case 282 : // System.out.println("InterfaceHeaderExtends ::= extends InterfaceTypeList"); //$NON-NLS-1$ + consumeInterfaceHeaderExtends(); + break ; - case 288 : // System.out.println("InterfaceHeader ::= InterfaceHeaderName InterfaceHeaderExtendsopt"); - consumeInterfaceHeader(); - break ; + case 285 : // System.out.println("InterfaceMemberDeclarations ::= InterfaceMemberDeclarations..."); //$NON-NLS-1$ + consumeInterfaceMemberDeclarations(); + break ; - case 289 : // System.out.println("InterfaceHeaderName ::= Modifiersopt interface JavaIdentifier"); - consumeInterfaceHeaderName(); - break ; + case 286 : // System.out.println("InterfaceMemberDeclaration ::= SEMICOLON"); //$NON-NLS-1$ + consumeEmptyInterfaceMemberDeclaration(); + break ; - case 291 : // System.out.println("InterfaceHeaderExtends ::= extends InterfaceTypeList"); - consumeInterfaceHeaderExtends(); - break ; + case 289 : // System.out.println("InterfaceMemberDeclaration ::= InvalidMethodDeclaration"); //$NON-NLS-1$ + ignoreMethodBody(); + break ; - case 294 : // System.out.println("InterfaceMemberDeclarations ::= InterfaceMemberDeclarations..."); - consumeInterfaceMemberDeclarations(); - break ; + case 290 : // System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader MethodBody"); //$NON-NLS-1$ + ignoreInvalidConstructorDeclaration(true); + break ; - case 295 : // System.out.println("InterfaceMemberDeclaration ::= SEMICOLON"); - consumeEmptyInterfaceMemberDeclaration(); - break ; + case 291 : // System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader SEMICOLON"); //$NON-NLS-1$ + ignoreInvalidConstructorDeclaration(false); + break ; - case 298 : // System.out.println("InterfaceMemberDeclaration ::= InvalidMethodDeclaration"); - ignoreMethodBody(); - break ; + case 297 : // System.out.println("ArrayInitializer ::= LBRACE ,opt RBRACE"); //$NON-NLS-1$ + consumeEmptyArrayInitializer(); + break ; - case 299 : // System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader ConstructorBody"); - ignoreInvalidConstructorDeclaration(true); - break ; + case 298 : // System.out.println("ArrayInitializer ::= LBRACE VariableInitializers RBRACE"); //$NON-NLS-1$ + consumeArrayInitializer(); + break ; - case 300 : // System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader SEMICOLON"); - ignoreInvalidConstructorDeclaration(false); - break ; + case 299 : // System.out.println("ArrayInitializer ::= LBRACE VariableInitializers COMMA RBRACE"); //$NON-NLS-1$ + consumeArrayInitializer(); + break ; - case 306 : // System.out.println("ArrayInitializer ::= LBRACE ,opt RBRACE"); - consumeEmptyArrayInitializer(); - break ; + case 301 : // System.out.println("VariableInitializers ::= VariableInitializers COMMA..."); //$NON-NLS-1$ + consumeVariableInitializers(); + break ; - case 307 : // System.out.println("ArrayInitializer ::= LBRACE VariableInitializers RBRACE"); - consumeArrayInitializer(); - break ; + case 302 : // System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE"); //$NON-NLS-1$ + consumeBlock(); + break ; - case 308 : // System.out.println("ArrayInitializer ::= LBRACE VariableInitializers COMMA RBRACE"); - consumeArrayInitializer(); - break ; + case 303 : // System.out.println("OpenBlock ::="); //$NON-NLS-1$ + consumeOpenBlock() ; + break ; - case 310 : // System.out.println("VariableInitializers ::= VariableInitializers COMMA VariableInitializer"); - consumeVariableInitializers(); - break ; + case 305 : // System.out.println("BlockStatements ::= BlockStatements BlockStatement"); //$NON-NLS-1$ + consumeBlockStatements() ; + break ; - case 311 : // System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE"); - consumeBlock(); - break ; + case 309 : // System.out.println("BlockStatement ::= InvalidInterfaceDeclaration"); //$NON-NLS-1$ + ignoreInterfaceDeclaration(); + break ; - case 312 : // System.out.println("OpenBlock ::="); - consumeOpenBlock() ; - break ; + case 310 : // System.out.println("LocalVariableDeclarationStatement ::= LocalVariableDeclaration..."); //$NON-NLS-1$ + consumeLocalVariableDeclarationStatement(); + break ; - case 314 : // System.out.println("BlockStatements ::= BlockStatements BlockStatement"); - consumeBlockStatements() ; - break ; + case 311 : // System.out.println("LocalVariableDeclaration ::= Type PushModifiers VariableDeclarators"); //$NON-NLS-1$ + consumeLocalVariableDeclaration(); + break ; - case 318 : // System.out.println("BlockStatement ::= InvalidInterfaceDeclaration"); - ignoreInterfaceDeclaration(); - break ; + case 312 : // System.out.println("LocalVariableDeclaration ::= Modifiers Type PushModifiers..."); //$NON-NLS-1$ + consumeLocalVariableDeclaration(); + break ; - case 319 : // System.out.println("LocalVariableDeclarationStatement ::= LocalVariableDeclaration SEMICOLON"); - consumeLocalVariableDeclarationStatement(); - break ; + case 313 : // System.out.println("PushModifiers ::="); //$NON-NLS-1$ + consumePushModifiers(); + break ; - case 320 : // System.out.println("LocalVariableDeclaration ::= Type PushModifiers VariableDeclarators"); - consumeLocalVariableDeclaration(); - break ; + case 337 : // System.out.println("EmptyStatement ::= SEMICOLON"); //$NON-NLS-1$ + consumeEmptyStatement(); + break ; - case 321 : // System.out.println("LocalVariableDeclaration ::= Modifiers Type PushModifiers VariableDeclarators"); - consumeLocalVariableDeclaration(); - break ; + case 338 : // System.out.println("LabeledStatement ::= JavaIdentifier COLON Statement"); //$NON-NLS-1$ + consumeStatementLabel() ; + break ; - case 322 : // System.out.println("PushModifiers ::="); - consumePushModifiers(); - break ; + case 339 : // System.out.println("LabeledStatementNoShortIf ::= JavaIdentifier COLON..."); //$NON-NLS-1$ + consumeStatementLabel() ; + break ; - case 346 : // System.out.println("EmptyStatement ::= SEMICOLON"); - consumeEmptyStatement(); - break ; + case 340 : // System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON"); //$NON-NLS-1$ + consumeExpressionStatement(); + break ; - case 347 : // System.out.println("LabeledStatement ::= JavaIdentifier COLON Statement"); - consumeStatementLabel() ; - break ; + case 349 : // System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN Statement"); //$NON-NLS-1$ + consumeStatementIfNoElse(); + break ; - case 348 : // System.out.println("LabeledStatementNoShortIf ::= JavaIdentifier COLON StatementNoShortIf"); - consumeStatementLabel() ; - break ; + case 350 : // System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN..."); //$NON-NLS-1$ + consumeStatementIfWithElse(); + break ; - case 349 : // System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON"); - consumeExpressionStatement(); - break ; + case 351 : // System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression RPAREN..."); //$NON-NLS-1$ + consumeStatementIfWithElse(); + break ; - case 357 : // System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN Statement"); - consumeStatementIfNoElse(); - break ; + case 352 : // System.out.println("SwitchStatement ::= switch LPAREN Expression RPAREN OpenBlock..."); //$NON-NLS-1$ + consumeStatementSwitch() ; + break ; - case 358 : // System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN StatementNoShortIf else..."); - consumeStatementIfWithElse(); - break ; + case 353 : // System.out.println("SwitchBlock ::= LBRACE RBRACE"); //$NON-NLS-1$ + consumeEmptySwitchBlock() ; + break ; - case 359 : // System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression RPAREN StatementNoShortIf..."); - consumeStatementIfWithElse(); - break ; + case 356 : // System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements SwitchLabels RBRACE"); //$NON-NLS-1$ + consumeSwitchBlock() ; + break ; - case 360 : // System.out.println("SwitchStatement ::= switch OpenBlock LPAREN Expression RPAREN SwitchBlock"); - consumeStatementSwitch() ; - break ; + case 358 : // System.out.println("SwitchBlockStatements ::= SwitchBlockStatements SwitchBlockStatement"); //$NON-NLS-1$ + consumeSwitchBlockStatements() ; + break ; - case 361 : // System.out.println("SwitchBlock ::= LBRACE RBRACE"); - consumeEmptySwitchBlock() ; - break ; + case 359 : // System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements"); //$NON-NLS-1$ + consumeSwitchBlockStatement() ; + break ; - case 364 : // System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements SwitchLabels RBRACE"); - consumeSwitchBlock() ; - break ; + case 361 : // System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel"); //$NON-NLS-1$ + consumeSwitchLabels() ; + break ; - case 366 : // System.out.println("SwitchBlockStatements ::= SwitchBlockStatements SwitchBlockStatement"); - consumeSwitchBlockStatements() ; - break ; + case 362 : // System.out.println("SwitchLabel ::= case ConstantExpression COLON"); //$NON-NLS-1$ + consumeCaseLabel(); + break ; - case 367 : // System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements"); - consumeSwitchBlockStatement() ; - break ; + case 363 : // System.out.println("SwitchLabel ::= default COLON"); //$NON-NLS-1$ + consumeDefaultLabel(); + break ; - case 369 : // System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel"); - consumeSwitchLabels() ; - break ; + case 364 : // System.out.println("WhileStatement ::= while LPAREN Expression RPAREN Statement"); //$NON-NLS-1$ + consumeStatementWhile() ; + break ; - case 370 : // System.out.println("SwitchLabel ::= case ConstantExpression COLON"); - consumeCaseLabel(); - break ; + case 365 : // System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression RPAREN..."); //$NON-NLS-1$ + consumeStatementWhile() ; + break ; - case 371 : // System.out.println("SwitchLabel ::= default COLON"); - consumeDefaultLabel(); - break ; + case 366 : // System.out.println("DoStatement ::= do Statement while LPAREN Expression RPAREN..."); //$NON-NLS-1$ + consumeStatementDo() ; + break ; - case 372 : // System.out.println("WhileStatement ::= while LPAREN Expression RPAREN Statement"); - consumeStatementWhile() ; - break ; + case 367 : // System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON Expressionopt..."); //$NON-NLS-1$ + consumeStatementFor() ; + break ; - case 373 : // System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression RPAREN StatementNoShortIf"); - consumeStatementWhile() ; - break ; + case 368 : // System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt SEMICOLON..."); //$NON-NLS-1$ + consumeStatementFor() ; + break ; - case 374 : // System.out.println("DoStatement ::= do Statement while LPAREN Expression RPAREN SEMICOLON"); - consumeStatementDo() ; - break ; + case 369 : // System.out.println("ForInit ::= StatementExpressionList"); //$NON-NLS-1$ + consumeForInit() ; + break ; - case 375 : // System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON Expressionopt SEMICOLON..."); - consumeStatementFor() ; - break ; + case 373 : // System.out.println("StatementExpressionList ::= StatementExpressionList COMMA..."); //$NON-NLS-1$ + consumeStatementExpressionList() ; + break ; - case 376 : // System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt SEMICOLON Expressionopt SEMICOLON"); - consumeStatementFor() ; - break ; + case 374 : // System.out.println("AssertStatement ::= assert Expression SEMICOLON"); //$NON-NLS-1$ + consumeSimpleAssertStatement() ; + break ; - case 377 : // System.out.println("ForInit ::= StatementExpressionList"); - consumeForInit() ; - break ; + case 375 : // System.out.println("AssertStatement ::= assert Expression COLON Expression SEMICOLON"); //$NON-NLS-1$ + consumeAssertStatement() ; + break ; - case 381 : // System.out.println("StatementExpressionList ::= StatementExpressionList COMMA StatementExpression"); - consumeStatementExpressionList() ; - break ; + case 376 : // System.out.println("BreakStatement ::= break SEMICOLON"); //$NON-NLS-1$ + consumeStatementBreak() ; + break ; - case 382 : // System.out.println("AssertStatement ::= assert Expression SEMICOLON"); - consumeSimpleAssertStatement() ; - break ; + case 377 : // System.out.println("BreakStatement ::= break Identifier SEMICOLON"); //$NON-NLS-1$ + consumeStatementBreakWithLabel() ; + break ; - case 383 : // System.out.println("AssertStatement ::= assert Expression COLON Expression SEMICOLON"); - consumeAssertStatement() ; - break ; + case 378 : // System.out.println("ContinueStatement ::= continue SEMICOLON"); //$NON-NLS-1$ + consumeStatementContinue() ; + break ; - case 384 : // System.out.println("BreakStatement ::= break SEMICOLON"); - consumeStatementBreak() ; - break ; + case 379 : // System.out.println("ContinueStatement ::= continue Identifier SEMICOLON"); //$NON-NLS-1$ + consumeStatementContinueWithLabel() ; + break ; - case 385 : // System.out.println("BreakStatement ::= break Identifier SEMICOLON"); - consumeStatementBreakWithLabel() ; - break ; + case 380 : // System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON"); //$NON-NLS-1$ + consumeStatementReturn() ; + break ; - case 386 : // System.out.println("ContinueStatement ::= continue SEMICOLON"); - consumeStatementContinue() ; - break ; + case 381 : // System.out.println("ThrowStatement ::= throw Expression SEMICOLON"); //$NON-NLS-1$ + consumeStatementThrow(); - case 387 : // System.out.println("ContinueStatement ::= continue Identifier SEMICOLON"); - consumeStatementContinueWithLabel() ; - break ; + break ; - case 388 : // System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON"); - consumeStatementReturn() ; - break ; + case 382 : // System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN Expression RPAREN"); //$NON-NLS-1$ + consumeStatementSynchronized(); + break ; - case 389 : // System.out.println("ThrowStatement ::= throw Expression SEMICOLON"); - consumeStatementThrow(); + case 383 : // System.out.println("OnlySynchronized ::= synchronized"); //$NON-NLS-1$ + consumeOnlySynchronized(); + break ; - break ; + case 384 : // System.out.println("TryStatement ::= try TryBlock Catches"); //$NON-NLS-1$ + consumeStatementTry(false); + break ; - case 390 : // System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN Expression RPAREN Block"); - consumeStatementSynchronized(); - break ; + case 385 : // System.out.println("TryStatement ::= try TryBlock Catchesopt Finally"); //$NON-NLS-1$ + consumeStatementTry(true); + break ; - case 391 : // System.out.println("OnlySynchronized ::= synchronized"); - consumeOnlySynchronized(); - break ; + case 387 : // System.out.println("ExitTryBlock ::="); //$NON-NLS-1$ + consumeExitTryBlock(); + break ; - case 392 : // System.out.println("TryStatement ::= try Block Catches"); - consumeStatementTry(false); - break ; + case 389 : // System.out.println("Catches ::= Catches CatchClause"); //$NON-NLS-1$ + consumeCatches(); + break ; - case 393 : // System.out.println("TryStatement ::= try Block Catchesopt Finally"); - consumeStatementTry(true); - break ; + case 390 : // System.out.println("CatchClause ::= catch LPAREN FormalParameter RPAREN Block"); //$NON-NLS-1$ + consumeStatementCatch() ; + break ; - case 395 : // System.out.println("Catches ::= Catches CatchClause"); - consumeCatches(); - break ; + case 392 : // System.out.println("PushLPAREN ::= LPAREN"); //$NON-NLS-1$ + consumeLeftParen(); + break ; - case 396 : // System.out.println("CatchClause ::= catch LPAREN FormalParameter RPAREN Block"); - consumeStatementCatch() ; - break ; + case 393 : // System.out.println("PushRPAREN ::= RPAREN"); //$NON-NLS-1$ + consumeRightParen(); + break ; - case 398 : // System.out.println("PushLPAREN ::= LPAREN"); - consumeLeftParen(); - break ; + case 398 : // System.out.println("PrimaryNoNewArray ::= this"); //$NON-NLS-1$ + consumePrimaryNoNewArrayThis(); + break ; - case 399 : // System.out.println("PushRPAREN ::= RPAREN"); - consumeRightParen(); - break ; + case 399 : // System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression PushRPAREN"); //$NON-NLS-1$ + consumePrimaryNoNewArray(); + break ; - case 404 : // System.out.println("PrimaryNoNewArray ::= this"); - consumePrimaryNoNewArrayThis(); - break ; + case 402 : // System.out.println("PrimaryNoNewArray ::= Name DOT this"); //$NON-NLS-1$ + consumePrimaryNoNewArrayNameThis(); + break ; - case 405 : // System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression PushRPAREN"); - consumePrimaryNoNewArray(); - break ; + case 403 : // System.out.println("PrimaryNoNewArray ::= Name DOT super"); //$NON-NLS-1$ + consumePrimaryNoNewArrayNameSuper(); + break ; - case 408 : // System.out.println("PrimaryNoNewArray ::= Name DOT this"); - consumePrimaryNoNewArrayNameThis(); - break ; + case 404 : // System.out.println("PrimaryNoNewArray ::= Name DOT class"); //$NON-NLS-1$ + consumePrimaryNoNewArrayName(); + break ; - case 409 : // System.out.println("PrimaryNoNewArray ::= Name DOT super"); - consumePrimaryNoNewArrayNameSuper(); - break ; + case 405 : // System.out.println("PrimaryNoNewArray ::= ArrayType DOT class"); //$NON-NLS-1$ + consumePrimaryNoNewArrayArrayType(); + break ; - case 410 : // System.out.println("PrimaryNoNewArray ::= Name DOT class"); - consumePrimaryNoNewArrayName(); - break ; + case 406 : // System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class"); //$NON-NLS-1$ + consumePrimaryNoNewArrayPrimitiveType(); + break ; - case 411 : // System.out.println("PrimaryNoNewArray ::= ArrayType DOT class"); - consumePrimaryNoNewArrayArrayType(); - break ; + case 409 : // System.out.println("AllocationHeader ::= new ClassType LPAREN ArgumentListopt RPAREN"); //$NON-NLS-1$ + consumeAllocationHeader(); + break ; - case 412 : // System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class"); - consumePrimaryNoNewArrayPrimitiveType(); - break ; + case 410 : // System.out.println("ClassInstanceCreationExpression ::= new ClassType LPAREN..."); //$NON-NLS-1$ + consumeClassInstanceCreationExpression(); + break ; - case 415 : // System.out.println("AllocationHeader ::= new ClassType LPAREN ArgumentListopt RPAREN"); - consumeAllocationHeader(); - break ; + case 411 : // System.out.println("ClassInstanceCreationExpression ::= Primary DOT new SimpleName..."); //$NON-NLS-1$ + consumeClassInstanceCreationExpressionQualified() ; + break ; - case 416 : // System.out.println("ClassInstanceCreationExpression ::= new ClassType LPAREN ArgumentListopt RPAREN..."); - consumeClassInstanceCreationExpression(); - break ; + case 412 : // System.out.println("ClassInstanceCreationExpression ::=..."); //$NON-NLS-1$ + consumeClassInstanceCreationExpressionQualified() ; + break ; - case 417 : // System.out.println("ClassInstanceCreationExpression ::= Primary DOT new SimpleName LPAREN..."); - consumeClassInstanceCreationExpressionQualified() ; - break ; + case 413 : // System.out.println("ClassInstanceCreationExpressionName ::= Name DOT"); //$NON-NLS-1$ + consumeClassInstanceCreationExpressionName() ; + break ; - case 418 : // System.out.println("ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName new..."); - consumeClassInstanceCreationExpressionQualified() ; - break ; + case 414 : // System.out.println("ClassBodyopt ::="); //$NON-NLS-1$ + consumeClassBodyopt(); + break ; - case 419 : // System.out.println("ClassInstanceCreationExpressionName ::= Name DOT"); - consumeClassInstanceCreationExpressionName() ; - break ; + case 416 : // System.out.println("EnterAnonymousClassBody ::="); //$NON-NLS-1$ + consumeEnterAnonymousClassBody(); + break ; - case 420 : // System.out.println("ClassBodyopt ::="); - consumeClassBodyopt(); - break ; + case 418 : // System.out.println("ArgumentList ::= ArgumentList COMMA Expression"); //$NON-NLS-1$ + consumeArgumentList(); + break ; - case 422 : // System.out.println("EnterAnonymousClassBody ::="); - consumeEnterAnonymousClassBody(); - break ; + case 419 : // System.out.println("ArrayCreationHeader ::= new PrimitiveType DimWithOrWithOutExprs"); //$NON-NLS-1$ + consumeArrayCreationHeader(); + break ; - case 424 : // System.out.println("ArgumentList ::= ArgumentList COMMA Expression"); - consumeArgumentList(); - break ; + case 420 : // System.out.println("ArrayCreationHeader ::= new ClassOrInterfaceType..."); //$NON-NLS-1$ + consumeArrayCreationHeader(); + break ; - case 425 : // System.out.println("ArrayCreationWithoutArrayInitializer ::= new PrimitiveType DimWithOrWithOutExprs"); - consumeArrayCreationExpressionWithoutInitializer(); - break ; + case 421 : // System.out.println("ArrayCreationWithoutArrayInitializer ::= new PrimitiveType..."); //$NON-NLS-1$ + consumeArrayCreationExpressionWithoutInitializer(); + break ; - case 426 : // System.out.println("ArrayCreationWithArrayInitializer ::= new PrimitiveType DimWithOrWithOutExprs..."); - consumeArrayCreationExpressionWithInitializer(); - break ; + case 422 : // System.out.println("ArrayCreationWithArrayInitializer ::= new PrimitiveType..."); //$NON-NLS-1$ + consumeArrayCreationExpressionWithInitializer(); + break ; - case 427 : // System.out.println("ArrayCreationWithoutArrayInitializer ::= new ClassOrInterfaceType..."); - consumeArrayCreationExpressionWithoutInitializer(); - break ; + case 423 : // System.out.println("ArrayCreationWithoutArrayInitializer ::= new ClassOrInterfaceType..."); //$NON-NLS-1$ + consumeArrayCreationExpressionWithoutInitializer(); + break ; - case 428 : // System.out.println("ArrayCreationWithArrayInitializer ::= new ClassOrInterfaceType..."); - consumeArrayCreationExpressionWithInitializer(); - break ; + case 424 : // System.out.println("ArrayCreationWithArrayInitializer ::= new ClassOrInterfaceType..."); //$NON-NLS-1$ + consumeArrayCreationExpressionWithInitializer(); + break ; - case 430 : // System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs DimWithOrWithOutExpr"); - consumeDimWithOrWithOutExprs(); - break ; + case 426 : // System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs DimWithOrWithOutExpr"); //$NON-NLS-1$ + consumeDimWithOrWithOutExprs(); + break ; - case 432 : // System.out.println("DimWithOrWithOutExpr ::= LBRACKET RBRACKET"); - consumeDimWithOrWithOutExpr(); - break ; + case 428 : // System.out.println("DimWithOrWithOutExpr ::= LBRACKET RBRACKET"); //$NON-NLS-1$ + consumeDimWithOrWithOutExpr(); + break ; - case 433 : // System.out.println("Dims ::= DimsLoop"); - consumeDims(); - break ; + case 429 : // System.out.println("Dims ::= DimsLoop"); //$NON-NLS-1$ + consumeDims(); + break ; - case 436 : // System.out.println("OneDimLoop ::= LBRACKET RBRACKET"); - consumeOneDimLoop(); - break ; + case 432 : // System.out.println("OneDimLoop ::= LBRACKET RBRACKET"); //$NON-NLS-1$ + consumeOneDimLoop(); + break ; - case 437 : // System.out.println("FieldAccess ::= Primary DOT JavaIdentifier"); - consumeFieldAccess(false); - break ; + case 433 : // System.out.println("FieldAccess ::= Primary DOT JavaIdentifier"); //$NON-NLS-1$ + consumeFieldAccess(false); + break ; - case 438 : // System.out.println("FieldAccess ::= super DOT JavaIdentifier"); - consumeFieldAccess(true); - break ; + case 434 : // System.out.println("FieldAccess ::= super DOT JavaIdentifier"); //$NON-NLS-1$ + consumeFieldAccess(true); + break ; - case 439 : // System.out.println("MethodInvocation ::= NameOrAj LPAREN ArgumentListopt RPAREN"); - consumeMethodInvocationName(); - break ; + case 435 : // System.out.println("MethodInvocation ::= NameOrAj LPAREN ArgumentListopt RPAREN"); //$NON-NLS-1$ + consumeMethodInvocationName(); + break ; - case 440 : // System.out.println("MethodInvocation ::= Primary DOT JavaIdentifier LPAREN ArgumentListopt RPAREN"); - consumeMethodInvocationPrimary(); - break ; + case 436 : // System.out.println("MethodInvocation ::= Primary DOT JavaIdentifier LPAREN..."); //$NON-NLS-1$ + consumeMethodInvocationPrimary(); + break ; - case 441 : // System.out.println("MethodInvocation ::= super DOT JavaIdentifier LPAREN ArgumentListopt RPAREN"); - consumeMethodInvocationSuper(); - break ; + case 437 : // System.out.println("MethodInvocation ::= super DOT JavaIdentifier LPAREN ArgumentListopt"); //$NON-NLS-1$ + consumeMethodInvocationSuper(); + break ; - case 442 : // System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET"); - consumeArrayAccess(true); - break ; + case 438 : // System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET"); //$NON-NLS-1$ + consumeArrayAccess(true); + break ; - case 443 : // System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression RBRACKET"); - consumeArrayAccess(false); - break ; + case 439 : // System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression RBRACKET"); //$NON-NLS-1$ + consumeArrayAccess(false); + break ; - case 444 : // System.out.println("ArrayAccess ::= ArrayCreationWithArrayInitializer LBRACKET Expression RBRACKET"); - consumeArrayAccess(false); - break ; + case 440 : // System.out.println("ArrayAccess ::= ArrayCreationWithArrayInitializer LBRACKET..."); //$NON-NLS-1$ + consumeArrayAccess(false); + break ; - case 446 : // System.out.println("PostfixExpression ::= NameOrAj"); - consumePostfixExpression(); - break ; + case 442 : // System.out.println("PostfixExpression ::= NameOrAj"); //$NON-NLS-1$ + consumePostfixExpression(); + break ; - case 449 : // System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS"); - consumeUnaryExpression(OperatorExpression.PLUS,true); - break ; + case 445 : // System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS"); //$NON-NLS-1$ + consumeUnaryExpression(OperatorIds.PLUS,true); + break ; - case 450 : // System.out.println("PostDecrementExpression ::= PostfixExpression MINUS_MINUS"); - consumeUnaryExpression(OperatorExpression.MINUS,true); - break ; + case 446 : // System.out.println("PostDecrementExpression ::= PostfixExpression MINUS_MINUS"); //$NON-NLS-1$ + consumeUnaryExpression(OperatorIds.MINUS,true); + break ; - case 451 : // System.out.println("PushPosition ::="); - consumePushPosition(); - break ; + case 447 : // System.out.println("PushPosition ::="); //$NON-NLS-1$ + consumePushPosition(); + break ; - case 454 : // System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression"); - consumeUnaryExpression(OperatorExpression.PLUS); - break ; + case 450 : // System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression"); //$NON-NLS-1$ + consumeUnaryExpression(OperatorIds.PLUS); + break ; - case 455 : // System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression"); - consumeUnaryExpression(OperatorExpression.MINUS); - break ; + case 451 : // System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression"); //$NON-NLS-1$ + consumeUnaryExpression(OperatorIds.MINUS); + break ; - case 457 : // System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition UnaryExpression"); - consumeUnaryExpression(OperatorExpression.PLUS,false); - break ; + case 453 : // System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition UnaryExpression"); //$NON-NLS-1$ + consumeUnaryExpression(OperatorIds.PLUS,false); + break ; - case 458 : // System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition UnaryExpression"); - consumeUnaryExpression(OperatorExpression.MINUS,false); - break ; + case 454 : // System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition UnaryExpression"); //$NON-NLS-1$ + consumeUnaryExpression(OperatorIds.MINUS,false); + break ; - case 460 : // System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition UnaryExpression"); - consumeUnaryExpression(OperatorExpression.TWIDDLE); - break ; + case 456 : // System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition UnaryExpression"); //$NON-NLS-1$ + consumeUnaryExpression(OperatorIds.TWIDDLE); + break ; - case 461 : // System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition UnaryExpression"); - consumeUnaryExpression(OperatorExpression.NOT); - break ; + case 457 : // System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition UnaryExpression"); //$NON-NLS-1$ + consumeUnaryExpression(OperatorIds.NOT); + break ; - case 463 : // System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN InsideCastExpression"); - consumeCastExpression(); - break ; + case 459 : // System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN..."); //$NON-NLS-1$ + consumeCastExpression(); + break ; - case 464 : // System.out.println("CastExpression ::= PushLPAREN Name Dims PushRPAREN InsideCastExpression..."); - consumeCastExpression(); - break ; + case 460 : // System.out.println("CastExpression ::= PushLPAREN Name Dims PushRPAREN..."); //$NON-NLS-1$ + consumeCastExpression(); + break ; - case 465 : // System.out.println("CastExpression ::= PushLPAREN Expression PushRPAREN InsideCastExpressionLL1..."); - consumeCastExpressionLL1(); - break ; + case 461 : // System.out.println("CastExpression ::= PushLPAREN Expression PushRPAREN..."); //$NON-NLS-1$ + consumeCastExpressionLL1(); + break ; - case 466 : // System.out.println("InsideCastExpression ::="); - consumeInsideCastExpression(); - break ; + case 462 : // System.out.println("InsideCastExpression ::="); //$NON-NLS-1$ + consumeInsideCastExpression(); + break ; - case 467 : // System.out.println("InsideCastExpressionLL1 ::="); - consumeInsideCastExpressionLL1(); - break ; + case 463 : // System.out.println("InsideCastExpressionLL1 ::="); //$NON-NLS-1$ + consumeInsideCastExpressionLL1(); + break ; - case 469 : // System.out.println("MultiplicativeExpression ::= MultiplicativeExpression MULTIPLY UnaryExpression"); - consumeBinaryExpression(OperatorExpression.MULTIPLY); - break ; + case 465 : // System.out.println("MultiplicativeExpression ::= MultiplicativeExpression MULTIPLY..."); //$NON-NLS-1$ + consumeBinaryExpression(OperatorIds.MULTIPLY); + break ; - case 470 : // System.out.println("MultiplicativeExpression ::= MultiplicativeExpression DIVIDE UnaryExpression"); - consumeBinaryExpression(OperatorExpression.DIVIDE); - break ; + case 466 : // System.out.println("MultiplicativeExpression ::= MultiplicativeExpression DIVIDE..."); //$NON-NLS-1$ + consumeBinaryExpression(OperatorIds.DIVIDE); + break ; - case 471 : // System.out.println("MultiplicativeExpression ::= MultiplicativeExpression REMAINDER UnaryExpression"); - consumeBinaryExpression(OperatorExpression.REMAINDER); - break ; + case 467 : // System.out.println("MultiplicativeExpression ::= MultiplicativeExpression REMAINDER..."); //$NON-NLS-1$ + consumeBinaryExpression(OperatorIds.REMAINDER); + break ; - case 473 : // System.out.println("AdditiveExpression ::= AdditiveExpression PLUS MultiplicativeExpression"); - consumeBinaryExpression(OperatorExpression.PLUS); - break ; + case 469 : // System.out.println("AdditiveExpression ::= AdditiveExpression PLUS..."); //$NON-NLS-1$ + consumeBinaryExpression(OperatorIds.PLUS); + break ; - case 474 : // System.out.println("AdditiveExpression ::= AdditiveExpression MINUS MultiplicativeExpression"); - consumeBinaryExpression(OperatorExpression.MINUS); - break ; + case 470 : // System.out.println("AdditiveExpression ::= AdditiveExpression MINUS..."); //$NON-NLS-1$ + consumeBinaryExpression(OperatorIds.MINUS); + break ; - case 476 : // System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT AdditiveExpression"); - consumeBinaryExpression(OperatorExpression.LEFT_SHIFT); - break ; + case 472 : // System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT AdditiveExpression"); //$NON-NLS-1$ + consumeBinaryExpression(OperatorIds.LEFT_SHIFT); + break ; - case 477 : // System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT AdditiveExpression"); - consumeBinaryExpression(OperatorExpression.RIGHT_SHIFT); - break ; + case 473 : // System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT AdditiveExpression"); //$NON-NLS-1$ + consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); + break ; - case 478 : // System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT AdditiveExpression"); - consumeBinaryExpression(OperatorExpression.UNSIGNED_RIGHT_SHIFT); - break ; + case 474 : // System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT..."); //$NON-NLS-1$ + consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); + break ; - case 480 : // System.out.println("RelationalExpression ::= RelationalExpression LESS ShiftExpression"); - consumeBinaryExpression(OperatorExpression.LESS); - break ; + case 476 : // System.out.println("RelationalExpression ::= RelationalExpression LESS ShiftExpression"); //$NON-NLS-1$ + consumeBinaryExpression(OperatorIds.LESS); + break ; - case 481 : // System.out.println("RelationalExpression ::= RelationalExpression GREATER ShiftExpression"); - consumeBinaryExpression(OperatorExpression.GREATER); - break ; + case 477 : // System.out.println("RelationalExpression ::= RelationalExpression GREATER..."); //$NON-NLS-1$ + consumeBinaryExpression(OperatorIds.GREATER); + break ; - case 482 : // System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL ShiftExpression"); - consumeBinaryExpression(OperatorExpression.LESS_EQUAL); - break ; + case 478 : // System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL..."); //$NON-NLS-1$ + consumeBinaryExpression(OperatorIds.LESS_EQUAL); + break ; - case 483 : // System.out.println("RelationalExpression ::= RelationalExpression GREATER_EQUAL ShiftExpression"); - consumeBinaryExpression(OperatorExpression.GREATER_EQUAL); - break ; + case 479 : // System.out.println("RelationalExpression ::= RelationalExpression GREATER_EQUAL..."); //$NON-NLS-1$ + consumeBinaryExpression(OperatorIds.GREATER_EQUAL); + break ; - case 484 : // System.out.println("RelationalExpression ::= RelationalExpression instanceof ReferenceType"); - consumeInstanceOfExpression(OperatorExpression.INSTANCEOF); - break ; + case 480 : // System.out.println("RelationalExpression ::= RelationalExpression instanceof..."); //$NON-NLS-1$ + consumeInstanceOfExpression(OperatorIds.INSTANCEOF); + break ; - case 486 : // System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL RelationalExpression"); - consumeEqualityExpression(OperatorExpression.EQUAL_EQUAL); - break ; + case 482 : // System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); //$NON-NLS-1$ + consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); + break ; - case 487 : // System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL RelationalExpression"); - consumeEqualityExpression(OperatorExpression.NOT_EQUAL); - break ; + case 483 : // System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL..."); //$NON-NLS-1$ + consumeEqualityExpression(OperatorIds.NOT_EQUAL); + break ; - case 489 : // System.out.println("AndExpression ::= AndExpression AND EqualityExpression"); - consumeBinaryExpression(OperatorExpression.AND); - break ; + case 485 : // System.out.println("AndExpression ::= AndExpression AND EqualityExpression"); //$NON-NLS-1$ + consumeBinaryExpression(OperatorIds.AND); + break ; - case 491 : // System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR AndExpression"); - consumeBinaryExpression(OperatorExpression.XOR); - break ; + case 487 : // System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR AndExpression"); //$NON-NLS-1$ + consumeBinaryExpression(OperatorIds.XOR); + break ; - case 493 : // System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR ExclusiveOrExpression"); - consumeBinaryExpression(OperatorExpression.OR); - break ; + case 489 : // System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR..."); //$NON-NLS-1$ + consumeBinaryExpression(OperatorIds.OR); + break ; - case 495 : // System.out.println("ConditionalAndExpression ::= ConditionalAndExpression AND_AND InclusiveOrExpression"); - consumeBinaryExpression(OperatorExpression.AND_AND); - break ; + case 491 : // System.out.println("ConditionalAndExpression ::= ConditionalAndExpression AND_AND..."); //$NON-NLS-1$ + consumeBinaryExpression(OperatorIds.AND_AND); + break ; - case 497 : // System.out.println("ConditionalOrExpression ::= ConditionalOrExpression OR_OR ConditionalAndExpression"); - consumeBinaryExpression(OperatorExpression.OR_OR); - break ; + case 493 : // System.out.println("ConditionalOrExpression ::= ConditionalOrExpression OR_OR..."); //$NON-NLS-1$ + consumeBinaryExpression(OperatorIds.OR_OR); + break ; - case 499 : // System.out.println("ConditionalExpression ::= ConditionalOrExpression QUESTION Expression COLON..."); - consumeConditionalExpression(OperatorExpression.QUESTIONCOLON) ; - break ; + case 495 : // System.out.println("ConditionalExpression ::= ConditionalOrExpression QUESTION..."); //$NON-NLS-1$ + consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; + break ; - case 502 : // System.out.println("Assignment ::= PostfixExpression AssignmentOperator AssignmentExpression"); - consumeAssignment(); - break ; + case 498 : // System.out.println("Assignment ::= PostfixExpression AssignmentOperator..."); //$NON-NLS-1$ + consumeAssignment(); + break ; - case 504 : // System.out.println("Assignment ::= InvalidArrayInitializerAssignement"); - ignoreExpressionAssignment(); - break ; + case 500 : // System.out.println("Assignment ::= InvalidArrayInitializerAssignement"); //$NON-NLS-1$ + ignoreExpressionAssignment(); + break ; - case 505 : // System.out.println("AssignmentOperator ::= EQUAL"); - consumeAssignmentOperator(EQUAL); - break ; + case 501 : // System.out.println("AssignmentOperator ::= EQUAL"); //$NON-NLS-1$ + consumeAssignmentOperator(EQUAL); + break ; - case 506 : // System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL"); - consumeAssignmentOperator(MULTIPLY); - break ; + case 502 : // System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL"); //$NON-NLS-1$ + consumeAssignmentOperator(MULTIPLY); + break ; - case 507 : // System.out.println("AssignmentOperator ::= DIVIDE_EQUAL"); - consumeAssignmentOperator(DIVIDE); - break ; + case 503 : // System.out.println("AssignmentOperator ::= DIVIDE_EQUAL"); //$NON-NLS-1$ + consumeAssignmentOperator(DIVIDE); + break ; - case 508 : // System.out.println("AssignmentOperator ::= REMAINDER_EQUAL"); - consumeAssignmentOperator(REMAINDER); - break ; + case 504 : // System.out.println("AssignmentOperator ::= REMAINDER_EQUAL"); //$NON-NLS-1$ + consumeAssignmentOperator(REMAINDER); + break ; - case 509 : // System.out.println("AssignmentOperator ::= PLUS_EQUAL"); - consumeAssignmentOperator(PLUS); - break ; + case 505 : // System.out.println("AssignmentOperator ::= PLUS_EQUAL"); //$NON-NLS-1$ + consumeAssignmentOperator(PLUS); + break ; - case 510 : // System.out.println("AssignmentOperator ::= MINUS_EQUAL"); - consumeAssignmentOperator(MINUS); - break ; + case 506 : // System.out.println("AssignmentOperator ::= MINUS_EQUAL"); //$NON-NLS-1$ + consumeAssignmentOperator(MINUS); + break ; - case 511 : // System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL"); - consumeAssignmentOperator(LEFT_SHIFT); - break ; + case 507 : // System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL"); //$NON-NLS-1$ + consumeAssignmentOperator(LEFT_SHIFT); + break ; - case 512 : // System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL"); - consumeAssignmentOperator(RIGHT_SHIFT); - break ; + case 508 : // System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL"); //$NON-NLS-1$ + consumeAssignmentOperator(RIGHT_SHIFT); + break ; - case 513 : // System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL"); - consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT); - break ; + case 509 : // System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL"); //$NON-NLS-1$ + consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT); + break ; - case 514 : // System.out.println("AssignmentOperator ::= AND_EQUAL"); - consumeAssignmentOperator(AND); - break ; + case 510 : // System.out.println("AssignmentOperator ::= AND_EQUAL"); //$NON-NLS-1$ + consumeAssignmentOperator(AND); + break ; - case 515 : // System.out.println("AssignmentOperator ::= XOR_EQUAL"); - consumeAssignmentOperator(XOR); - break ; + case 511 : // System.out.println("AssignmentOperator ::= XOR_EQUAL"); //$NON-NLS-1$ + consumeAssignmentOperator(XOR); + break ; - case 516 : // System.out.println("AssignmentOperator ::= OR_EQUAL"); - consumeAssignmentOperator(OR); - break ; + case 512 : // System.out.println("AssignmentOperator ::= OR_EQUAL"); //$NON-NLS-1$ + consumeAssignmentOperator(OR); + break ; - case 523 : // System.out.println("Expressionopt ::="); - consumeEmptyExpression(); - break ; + case 519 : // System.out.println("Expressionopt ::="); //$NON-NLS-1$ + consumeEmptyExpression(); + break ; - case 527 : // System.out.println("ImportDeclarationsopt ::="); - consumeEmptyImportDeclarationsopt(); - break ; + case 523 : // System.out.println("ImportDeclarationsopt ::="); //$NON-NLS-1$ + consumeEmptyImportDeclarationsopt(); + break ; - case 528 : // System.out.println("ImportDeclarationsopt ::= ImportDeclarations"); - consumeImportDeclarationsopt(); - break ; + case 524 : // System.out.println("ImportDeclarationsopt ::= ImportDeclarations"); //$NON-NLS-1$ + consumeImportDeclarationsopt(); + break ; - case 529 : // System.out.println("TypeDeclarationsopt ::="); - consumeEmptyTypeDeclarationsopt(); - break ; + case 525 : // System.out.println("TypeDeclarationsopt ::="); //$NON-NLS-1$ + consumeEmptyTypeDeclarationsopt(); + break ; - case 530 : // System.out.println("TypeDeclarationsopt ::= TypeDeclarations"); - consumeTypeDeclarationsopt(); - break ; + case 526 : // System.out.println("TypeDeclarationsopt ::= TypeDeclarations"); //$NON-NLS-1$ + consumeTypeDeclarationsopt(); + break ; - case 531 : // System.out.println("ClassBodyDeclarationsopt ::="); - consumeEmptyClassBodyDeclarationsopt(); - break ; + case 527 : // System.out.println("ClassBodyDeclarationsopt ::="); //$NON-NLS-1$ + consumeEmptyClassBodyDeclarationsopt(); + break ; - case 532 : // System.out.println("ClassBodyDeclarationsopt ::= NestedType ClassBodyDeclarations"); - consumeClassBodyDeclarationsopt(); - break ; + case 528 : // System.out.println("ClassBodyDeclarationsopt ::= NestedType ClassBodyDeclarations"); //$NON-NLS-1$ + consumeClassBodyDeclarationsopt(); + break ; - case 533 : // System.out.println("Modifiersopt ::="); - consumeDefaultModifiers(); - break ; + case 529 : // System.out.println("Modifiersopt ::="); //$NON-NLS-1$ + consumeDefaultModifiers(); + break ; - case 534 : // System.out.println("Modifiersopt ::= Modifiers"); - consumeModifiers(); - break ; + case 530 : // System.out.println("Modifiersopt ::= Modifiers"); //$NON-NLS-1$ + consumeModifiers(); + break ; - case 535 : // System.out.println("BlockStatementsopt ::="); - consumeEmptyBlockStatementsopt(); - break ; + case 531 : // System.out.println("BlockStatementsopt ::="); //$NON-NLS-1$ + consumeEmptyBlockStatementsopt(); + break ; - case 537 : // System.out.println("Dimsopt ::="); - consumeEmptyDimsopt(); - break ; + case 533 : // System.out.println("Dimsopt ::="); //$NON-NLS-1$ + consumeEmptyDimsopt(); + break ; - case 539 : // System.out.println("ArgumentListopt ::="); - consumeEmptyArgumentListopt(); - break ; + case 535 : // System.out.println("ArgumentListopt ::="); //$NON-NLS-1$ + consumeEmptyArgumentListopt(); + break ; - case 543 : // System.out.println("FormalParameterListopt ::="); - consumeFormalParameterListopt(); - break ; + case 539 : // System.out.println("FormalParameterListopt ::="); //$NON-NLS-1$ + consumeFormalParameterListopt(); + break ; - case 547 : // System.out.println("InterfaceMemberDeclarationsopt ::="); - consumeEmptyInterfaceMemberDeclarationsopt(); - break ; + case 543 : // System.out.println("InterfaceMemberDeclarationsopt ::="); //$NON-NLS-1$ + consumeEmptyInterfaceMemberDeclarationsopt(); + break ; - case 548 : // System.out.println("InterfaceMemberDeclarationsopt ::= NestedType InterfaceMemberDeclarations"); - consumeInterfaceMemberDeclarationsopt(); - break ; + case 544 : // System.out.println("InterfaceMemberDeclarationsopt ::= NestedType..."); //$NON-NLS-1$ + consumeInterfaceMemberDeclarationsopt(); + break ; - case 549 : // System.out.println("NestedType ::="); - consumeNestedType(); - break ; + case 545 : // System.out.println("NestedType ::="); //$NON-NLS-1$ + consumeNestedType(); + break ; - case 550 : // System.out.println("ForInitopt ::="); - consumeEmptyForInitopt(); - break ; + case 546 : // System.out.println("ForInitopt ::="); //$NON-NLS-1$ + consumeEmptyForInitopt(); + break ; - case 552 : // System.out.println("ForUpdateopt ::="); - consumeEmptyForUpdateopt(); - break ; + case 548 : // System.out.println("ForUpdateopt ::="); //$NON-NLS-1$ + consumeEmptyForUpdateopt(); + break ; - case 556 : // System.out.println("Catchesopt ::="); - consumeEmptyCatchesopt(); - break ; + case 552 : // System.out.println("Catchesopt ::="); //$NON-NLS-1$ + consumeEmptyCatchesopt(); + break ; - } -} + } + } + + protected void consumeSimpleAssertStatement() { super.consumeSimpleAssertStatement(); } public AjParser( ProblemReporter problemReporter, - boolean optimizeStringLiterals, - boolean assertMode) { - super(problemReporter, optimizeStringLiterals, assertMode); + boolean optimizeStringLiterals) { + super(problemReporter, optimizeStringLiterals); + } + + // don't try to recover if we're parsing AspectJ constructs + protected boolean shouldTryToRecover() { + int index = 0; + ASTNode node; + while (index < astStack.length && (node = astStack[index++]) != null) { + if (node instanceof AspectDeclaration || + node instanceof PointcutDeclaration || + node instanceof AdviceDeclaration) { + return false; + } + } + return true; } } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/AjScanner.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/AjScanner.java index d23a5bb17..ff4103c5b 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/AjScanner.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/AjScanner.java @@ -15,25 +15,24 @@ package org.aspectj.ajdt.internal.compiler.parser; import org.aspectj.ajdt.compiler.IAjTerminalSymbols; -import org.eclipse.jdt.core.compiler.IScanner; -import org.eclipse.jdt.core.compiler.InvalidInputException; -import org.eclipse.jdt.internal.compiler.parser.Scanner; import org.eclipse.jdt.core.compiler.CharOperation; +import org.eclipse.jdt.internal.compiler.parser.Scanner; +import org.eclipse.jdt.internal.compiler.parser.TerminalTokens; -public class AjScanner extends Scanner implements IScanner { +public class AjScanner extends Scanner implements TerminalTokens { public AjScanner( boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean checkNonExternalizedStringLiterals, - boolean assertMode, + long sourceLevel, char[][] taskTags, char[][] taskPriorities) { super( tokenizeComments, tokenizeWhiteSpace, checkNonExternalizedStringLiterals, - assertMode, + sourceLevel, taskTags, taskPriorities); } @@ -55,7 +54,7 @@ public class AjScanner extends Scanner implements IScanner { - public int scanIdentifierOrKeyword() throws InvalidInputException { + public int scanIdentifierOrKeyword() { int kind = super.scanIdentifierOrKeyword(); if (kind != IAjTerminalSymbols.TokenNameIdentifier) return kind; diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser1.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser1.rsc Binary files differindex a88743e2b..2ab81a64b 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser1.rsc +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser1.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser10.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser10.rsc Binary files differnew file mode 100644 index 000000000..6c119b53c --- /dev/null +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser10.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser11.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser11.rsc Binary files differnew file mode 100644 index 000000000..84d2080b9 --- /dev/null +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser11.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser12.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser12.rsc Binary files differnew file mode 100644 index 000000000..922bbfb23 --- /dev/null +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser12.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser13.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser13.rsc Binary files differnew file mode 100644 index 000000000..b5eec3624 --- /dev/null +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser13.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser14.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser14.rsc Binary files differnew file mode 100644 index 000000000..4dbb94f95 --- /dev/null +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser14.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser15.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser15.rsc Binary files differnew file mode 100644 index 000000000..b2c68dc5d --- /dev/null +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser15.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser16.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser16.rsc Binary files differnew file mode 100644 index 000000000..6a2e47766 --- /dev/null +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser16.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser17.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser17.rsc Binary files differnew file mode 100644 index 000000000..4593e0ad1 --- /dev/null +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser17.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser18.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser18.rsc Binary files differnew file mode 100644 index 000000000..a783457da --- /dev/null +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser18.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser19.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser19.rsc new file mode 100644 index 000000000..5c4e24f58 --- /dev/null +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser19.rsc @@ -0,0 +1 @@ +]]IIIJJ^0003I[3000000Y!3M'Jdd
\ No newline at end of file diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser2.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser2.rsc Binary files differindex 78b64a43f..e4744a8ba 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser2.rsc +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser2.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser20.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser20.rsc Binary files differnew file mode 100644 index 000000000..cfcbbef9f --- /dev/null +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser20.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser3.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser3.rsc Binary files differindex 0594e4ba4..fb48102d0 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser3.rsc +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser3.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser4.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser4.rsc Binary files differindex cf6c6bbd1..344c25c4d 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser4.rsc +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser4.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser5.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser5.rsc Binary files differindex e4500cdfa..a9070dcea 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser5.rsc +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser5.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser6.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser6.rsc Binary files differnew file mode 100644 index 000000000..915d79c35 --- /dev/null +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser6.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser7.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser7.rsc Binary files differnew file mode 100644 index 000000000..580a08c52 --- /dev/null +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser7.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser8.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser8.rsc Binary files differnew file mode 100644 index 000000000..12b6cfbd7 --- /dev/null +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser8.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser9.rsc b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser9.rsc Binary files differnew file mode 100644 index 000000000..596dd6b38 --- /dev/null +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/parser9.rsc diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/readableNames.properties b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/readableNames.properties new file mode 100644 index 000000000..ecc98bf1f --- /dev/null +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/parser/readableNames.properties @@ -0,0 +1,202 @@ +,opt=, +AbstractMethodDeclaration=AbstractMethodDeclaration +AdditiveExpression=Expression +AllocationHeader=AllocationHeader +AndExpression=Expression +ArgumentList=ArgumentList +ArgumentListopt=ArgumentList +ArrayAccess=ArrayAccess +ArrayCreationHeader=ArrayCreationHeader +ArrayCreationWithArrayInitializer=ArrayCreationWithArrayInitializer +ArrayCreationWithoutArrayInitializer=ArrayCreationWithoutArrayInitializer +ArrayInitializer=ArrayInitializer +ArrayType=ArrayType +AssertStatement=AssertStatement +Assignment=Assignment +AssignmentExpression=Expression +AssignmentOperator=AssignmentOperator +Block=Block +BlockStatement=BlockStatement +BlockStatements=BlockStatements +BlockStatementsopt=BlockStatements +BooleanLiteral=BooleanLiteral +BreakStatement=BreakStatement +CastExpression=CastExpression +CatchClause=CatchClause +CatchHeader=CatchHeader +Catches=Catches +Catchesopt=Catches +ClassBody=ClassBody +ClassBodyDeclaration=ClassBodyDeclaration +ClassBodyDeclarations=ClassBodyDeclarations +ClassBodyDeclarationsopt=ClassBodyDeclarations +ClassBodyopt=ClassBody +ClassDeclaration=ClassDeclaration +ClassHeader=ClassHeader +ClassHeaderExtends=ClassHeaderExtends +ClassHeaderExtendsopt=ClassHeaderExtends +ClassHeaderImplements=ClassHeaderImplements +ClassHeaderImplementsopt=ClassHeaderImplements +ClassHeaderName=ClassHeaderName +ClassInstanceCreationExpression=ClassInstanceCreationExpression +ClassInstanceCreationExpressionName=ClassInstanceCreationExpressionName +ClassMemberDeclaration=ClassMemberDeclaration +ClassOrInterfaceType=Type +ClassType=ClassType +ClassTypeElt=ClassType +ClassTypeList=ClassTypeList +CompilationUnit=CompilationUnit +ConditionalAndExpression=Expression +ConditionalExpression=Expression +ConditionalOrExpression=Expression +ConstantDeclaration=ConstantDeclaration +ConstantExpression=ConstantExpression +ConstructorDeclaration=ConstructorDeclaration +ConstructorHeader=ConstructorHeader +ConstructorHeaderName=ConstructorHeaderName +ContinueStatement=ContinueStatement +Diet=Diet +DimWithOrWithOutExpr=Dimension +DimWithOrWithOutExprs=Dimensions +Dims=Dimensions +DimsLoop=Dimensions +Dimsopt=Dimensions +DoStatement=DoStatement +EmptyStatement=EmptyStatement +EnterAnonymousClassBody=EnterAnonymousClassBody +EnterCompilationUnit=EnterCompilationUnit +EnterVariable=EnterVariable +EqualityExpression=Expression +ExclusiveOrExpression=Expression +ExitTryBlock=ExitTryBlock +ExitVariableWithInitialization=ExitVariableWithInitialization +ExitVariableWithoutInitialization=ExitVariableWithoutInitialization +ExplicitConstructorInvocation=ExplicitConstructorInvocation +Expression=Expression +ExpressionStatement=Statement +Expressionopt=Expression +FieldAccess=FieldAccess +FieldDeclaration=FieldDeclaration +Finally=Finally +FloatingPointType=FloatingPointType +ForInit=ForInit +ForInitopt=ForInit +ForStatement=ForStatement +ForStatementNoShortIf=ForStatement +ForUpdate=ForUpdate +ForUpdateopt=ForUpdate +ForceNoDiet=ForceNoDiet +FormalParameter=FormalParameter +FormalParameterList=FormalParameterList +FormalParameterListopt=FormalParameterList +GenericMethodDeclaration=GenericMethodDeclaration +Goal=Goal +Header=Header +Headers=Headers +IfThenElseStatement=IfStatement +IfThenElseStatementNoShortIf=IfStatement +IfThenStatement=IfStatement +ImportDeclaration=ImportDeclaration +ImportDeclarations=ImportDeclarations +ImportDeclarationsopt=ImportDeclarations +InclusiveOrExpression=Expression +Initializer=Initializer +InsideCastExpression=InsideCastExpression +InsideCastExpressionLL1=InsideCastExpression +IntegralType=IntegralType +InterfaceBody=InterfaceBody +InterfaceDeclaration=InterfaceDeclaration +InterfaceHeader=InterfaceHeader +InterfaceHeaderExtends=InterfaceHeaderExtends +InterfaceHeaderExtendsopt=InterfaceHeaderExtends +InterfaceHeaderName=InterfaceHeaderName +InterfaceMemberDeclaration=InterfaceMemberDeclaration +InterfaceMemberDeclarations=InterfaceMemberDeclarations +InterfaceMemberDeclarationsopt=InterfaceMemberDeclarations +InterfaceType=InterfaceType +InterfaceTypeList=InterfaceTypeList +InvalidArrayInitializerAssignement=ArrayInitializerAssignement +InvalidConstructorDeclaration=InvalidConstructorDeclaration +InvalidInterfaceDeclaration=InvalidInterfaceDeclaration +InvalidMethodDeclaration=InvalidMethodDeclaration +LabeledStatement=LabeledStatement +LabeledStatementNoShortIf=LabeledStatement +Literal=Literal +LocalVariableDeclaration=LocalVariableDeclaration +LocalVariableDeclarationStatement=LocalVariableDeclarationStatement +MethodBody=MethodBody +MethodDeclaration=MethodDeclaration +MethodHeader=MethodHeader +MethodHeaderExtendedDims=MethodHeaderExtendedDims +MethodHeaderName=MethodHeaderName +MethodHeaderParameters=MethodHeaderParameters +MethodHeaderThrowsClause=MethodHeaderThrowsClause +MethodHeaderThrowsClauseopt=MethodHeaderThrowsClause +MethodInvocation=MethodInvocation +Modifier=Modifier +Modifiers=Modifiers +Modifiersopt=Modifiers +MultiplicativeExpression=Expression +Name=Name +NestedMethod=NestedMethod +NestedType=NestedType +NumericType=NumericType +OneDimLoop=Dimension +OnlySynchronized=OnlySynchronized +OpenBlock=OpenBlock +PackageDeclaration=PackageDeclaration +PackageDeclarationName=PackageDeclarationName +PackageDeclarationopt=PackageDeclaration +PostDecrementExpression=PostDecrementExpression +PostIncrementExpression=PostIncrementExpression +PostfixExpression=Expression +PreDecrementExpression=PreDecrementExpression +PreIncrementExpression=PreIncrementExpression +Primary=Expression +PrimaryNoNewArray=Expression +PrimitiveType=PrimitiveType +PushLPAREN=( +PushModifiers=PushModifiers +PushPosition=PushPosition +PushRPAREN=) +QualifiedName=QualifiedName +ReferenceType=ReferenceType +RelationalExpression=Expression +RestoreDiet=RestoreDiet +ReturnStatement=ReturnStatement +ShiftExpression=Expression +SimpleName=SimpleName +SingleTypeImportDeclaration=SingleTypeImportDeclaration +SingleTypeImportDeclarationName=SingleTypeImportDeclarationName +Statement=Statement +StatementExpression=Expression +StatementExpressionList=StatementExpressionList +StatementNoShortIf=Statement +StatementWithoutTrailingSubstatement=Statement +StaticInitializer=StaticInitializer +StaticOnly=StaticOnly +SwitchBlock=SwitchBlock +SwitchBlockStatement=SwitchBlockStatement +SwitchBlockStatements=SwitchBlockStatements +SwitchLabel=SwitchLabel +SwitchLabels=SwitchLabels +SwitchStatement=SwitchStatement +SynchronizedStatement=SynchronizedStatement +ThrowStatement=ThrowStatement +TryBlock=Block +TryStatement=TryStatement +Type=Type +TypeDeclaration=TypeDeclaration +TypeDeclarations=TypeDeclarations +TypeDeclarationsopt=TypeDeclarations +TypeImportOnDemandDeclaration=TypeImportOnDemandDeclaration +TypeImportOnDemandDeclarationName=TypeImportOnDemandDeclarationName +UnaryExpression=Expression +UnaryExpressionNotPlusMinus=Expression +VariableDeclarator=VariableDeclarator +VariableDeclaratorId=VariableDeclaratorId +VariableDeclarators=VariableDeclarators +VariableInitializer=VariableInitializer +VariableInitializers=VariableInitializers +WhileStatement=WhileStatement +WhileStatementNoShortIf=WhileStatement diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java index 49b726db2..8d9146a00 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java @@ -28,7 +28,7 @@ import org.aspectj.weaver.patterns.DeclareSoft; import org.eclipse.jdt.internal.compiler.CompilationResult; import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; import org.eclipse.jdt.internal.compiler.IProblemFactory; -import org.eclipse.jdt.internal.compiler.ast.AstNode; +import org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import org.eclipse.jdt.internal.compiler.impl.ReferenceContext; import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; @@ -62,7 +62,7 @@ public class AjProblemReporter extends ProblemReporter { public void unhandledException( TypeBinding exceptionType, - AstNode location) + ASTNode location) { if (!world.getWorld().getDeclareSoft().isEmpty()) { Shadow callSite = world.makeShadow(location, referenceContext); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java index 029e7fd43..a106f1424 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java @@ -31,6 +31,8 @@ import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; */ public class AjBuildConfig { // XXX needs bootclasspath? + private boolean shouldProceed = true; + public static final String AJLINT_IGNORE = "ignore"; public static final String AJLINT_WARN = "warn"; public static final String AJLINT_ERROR = "error"; @@ -88,12 +90,12 @@ public class AjBuildConfig { // XXX needs bootclasspath? javaOptions.put( CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT); - javaOptions.put( - CompilerOptions.OPTION_ReportUnreachableCode, - CompilerOptions.IGNORE); - javaOptions.put( - CompilerOptions.OPTION_ReportInvalidImport, - CompilerOptions.ERROR); +// javaOptions.put( +// CompilerOptions.OPTION_ReportUnreachableCode, +// CompilerOptions.IGNORE); +// javaOptions.put( +// CompilerOptions.OPTION_ReportInvalidImport, +// CompilerOptions.ERROR); javaOptions.put( CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, CompilerOptions.WARNING); @@ -440,4 +442,14 @@ public class AjBuildConfig { // XXX needs bootclasspath? sourcePathResources = map; } + /** + * used to indicate whether to proceed after parsing config + */ + public boolean shouldProceed() { + return shouldProceed; + } + + public void doNotProceed() { + shouldProceed = false; + } } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java index 79ba22f5f..9ab6abd65 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java @@ -374,8 +374,7 @@ public class AjBuildManager { compiler.parser = new AjParser( pr, - compiler.options.parseLiteralExpressionsAsConstants, - compiler.options.sourceLevel >= CompilerOptions.JDK1_4); + compiler.options.parseLiteralExpressionsAsConstants); CompilerOptions options = compiler.options; diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java index 040d0e6c8..db7ea2ab0 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java @@ -29,6 +29,7 @@ import org.eclipse.jdt.internal.compiler.CompilationResult; import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader; import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException; import org.eclipse.jdt.internal.core.builder.ReferenceCollection; +import org.eclipse.jdt.internal.core.builder.StringSet; /** @@ -239,16 +240,26 @@ public class AjState { return cf; } + private static StringSet makeStringSet(List strings) { + StringSet ret = new StringSet(strings.size()); + for (Iterator iter = strings.iterator(); iter.hasNext();) { + String element = (String) iter.next(); + ret.add(element); + } + return ret; + } + + protected void addAffectedSourceFiles(List sourceFiles) { if (qualifiedStrings.isEmpty() && simpleStrings.isEmpty()) return; // the qualifiedStrings are of the form 'p1/p2' & the simpleStrings are just 'X' - char[][][] qualifiedNames = ReferenceCollection.internQualifiedNames(qualifiedStrings); + char[][][] qualifiedNames = ReferenceCollection.internQualifiedNames(makeStringSet(qualifiedStrings)); // if a well known qualified name was found then we can skip over these if (qualifiedNames.length < qualifiedStrings.size()) qualifiedNames = null; - char[][] simpleNames = ReferenceCollection.internSimpleNames(simpleStrings); + char[][] simpleNames = ReferenceCollection.internSimpleNames(makeStringSet(simpleStrings)); // if a well known name was found then we can skip over these if (simpleNames.length < simpleStrings.size()) simpleNames = null; diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java index 99996f74b..d6e02a1df 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java @@ -38,7 +38,7 @@ public class AsmElementFormatter { node.setKind(IProgramElement.Kind.ADVICE); if (ad.kind == AdviceKind.Around) { - node.setReturnType(ad.returnTypeToString(0)); + node.setReturnType(ad.returnType.toString()); //returnTypeToString(0)); } String details = ""; diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java index d6268ec82..a594a9a56 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java @@ -29,7 +29,7 @@ import org.eclipse.jdt.internal.compiler.ast.*; import org.eclipse.jdt.internal.compiler.lookup.*; import org.eclipse.jdt.internal.compiler.problem.ProblemHandler; -public class AsmHierarchyBuilder extends AbstractSyntaxTreeVisitorAdapter { +public class AsmHierarchyBuilder extends ASTVisitor { public static void build( CompilationUnitDeclaration unit, @@ -193,7 +193,7 @@ public class AsmHierarchyBuilder extends AbstractSyntaxTreeVisitorAdapter { } // ??? share impl with visit(TypeDeclaration, ..) ? - public boolean visit(MemberTypeDeclaration memberTypeDeclaration, ClassScope scope) { + public boolean visit(TypeDeclaration memberTypeDeclaration, ClassScope scope) { String name = new String(memberTypeDeclaration.name); //System.err.println("member type with name: " + name); @@ -213,11 +213,11 @@ public class AsmHierarchyBuilder extends AbstractSyntaxTreeVisitorAdapter { stack.push(peNode); return true; } - public void endVisit(MemberTypeDeclaration memberTypeDeclaration, ClassScope scope) { + public void endVisit(TypeDeclaration memberTypeDeclaration, ClassScope scope) { stack.pop(); } - public boolean visit(LocalTypeDeclaration memberTypeDeclaration, BlockScope scope) { + public boolean visit(TypeDeclaration memberTypeDeclaration, BlockScope scope) { String name = new String(memberTypeDeclaration.name); String fullName = "<undefined>"; @@ -248,17 +248,10 @@ public class AsmHierarchyBuilder extends AbstractSyntaxTreeVisitorAdapter { stack.push(peNode); return true; } - public void endVisit(LocalTypeDeclaration memberTypeDeclaration, BlockScope scope) { + public void endVisit(TypeDeclaration memberTypeDeclaration, BlockScope scope) { stack.pop(); } - public boolean visit(AnonymousLocalTypeDeclaration memberTypeDeclaration, BlockScope scope) { - return visit((LocalTypeDeclaration)memberTypeDeclaration, scope); - } - - public void endVisit(AnonymousLocalTypeDeclaration memberTypeDeclaration, BlockScope scope) { - stack.pop(); - } private IProgramElement findEnclosingClass(Stack stack) { for (int i = stack.size()-1; i >= 0; i--) { @@ -442,7 +435,7 @@ public class AsmHierarchyBuilder extends AbstractSyntaxTreeVisitorAdapter { } // ??? handle non-existant files - private ISourceLocation makeLocation(AstNode node) { + private ISourceLocation makeLocation(ASTNode node) { String fileName = ""; if (currCompilationResult.getFileName() != null) { fileName = new String(currCompilationResult.getFileName()); @@ -464,7 +457,7 @@ public class AsmHierarchyBuilder extends AbstractSyntaxTreeVisitorAdapter { // AMC - overloaded set of methods to get start and end lines for // various ASTNode types. They have no common ancestor in the // hierarchy!! - private int getStartLine( AstNode n){ + private int getStartLine( ASTNode n){ // if ( n instanceof AbstractVariableDeclaration ) return getStartLine( (AbstractVariableDeclaration)n); // if ( n instanceof AbstractMethodDeclaration ) return getStartLine( (AbstractMethodDeclaration)n); // if ( n instanceof TypeDeclaration ) return getStartLine( (TypeDeclaration)n); @@ -476,7 +469,7 @@ public class AsmHierarchyBuilder extends AbstractSyntaxTreeVisitorAdapter { // AMC - overloaded set of methods to get start and end lines for // various ASTNode types. They have no common ancestor in the // hierarchy!! - private int getEndLine( AstNode n){ + private int getEndLine( ASTNode n){ if ( n instanceof AbstractVariableDeclaration ) return getEndLine( (AbstractVariableDeclaration)n); if ( n instanceof AbstractMethodDeclaration ) return getEndLine( (AbstractMethodDeclaration)n); if ( n instanceof TypeDeclaration ) return getEndLine( (TypeDeclaration)n); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java b/org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java index 44f730a42..287508440 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java @@ -20,6 +20,7 @@ import java.io.PrintStream; import java.util.Arrays; import java.util.List; +import org.aspectj.ajdt.ajc.BuildArgParser; import org.aspectj.bridge.AbortException; import org.aspectj.bridge.ICommand; import org.aspectj.bridge.IMessage; @@ -194,11 +195,7 @@ public class Main { public void run(String[] args, IMessageHolder holder) { if (LangUtil.isEmpty(args)) { args = new String[] { "-help" }; - } else if (Arrays.asList(args).contains("-version")) { - System.out.println("AspectJ Compiler " + Version.text); - System.out.println(); - return; - } else if (controller.running()) { + } else if (controller.running()) { fail(holder, "already running with controller: " + controller, null); return; } diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java index 8ae075bd1..19bdb1cf1 100644 --- a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java +++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java @@ -160,25 +160,54 @@ public class AjdtCommandTestCase extends TestCase { } public void testHelpUsagePrinting() { + String[] args = new String[] { "-help" }; + + PrintStream saveOut = System.out; + ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream(); + PrintStream newOut = new PrintStream(byteArrayOut); + System.setOut(newOut); + try { - command.genBuildConfig( - new String[] { "-help" }, - counter); - } catch (AbortException ae) { } + try { + + command.genBuildConfig( + args, + counter); + } catch (AbortException ae) { } + } finally { + System.setOut(saveOut); + } + + String text = byteArrayOut.toString(); assertTrue( - outputWriter.getContents() + " contains? " + "Usage", - outputWriter.getContents().indexOf("Usage") != -1); + text + " contains? " + "Usage", + text.indexOf("Usage") != -1); } public void testVersionOutput() throws InvalidInputException { + String[] args = new String[] { "-version" }; + + PrintStream saveOut = System.err; + ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream(); + PrintStream newOut = new PrintStream(byteArrayOut); + System.setErr(newOut); + try { - command.genBuildConfig( - new String[] { "-version" }, - counter); - } catch (AbortException ae) { } + try { + + command.genBuildConfig( + args, + counter); + } catch (AbortException ae) { } + } finally { + System.setErr(saveOut); + } + + String text = byteArrayOut.toString(); + assertTrue( "version output", - outputWriter.getContents().indexOf("AspectJ Compiler") != -1); + text.indexOf("AspectJ Compiler") != -1); } public void testNonExistingLstFile() { diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java index 3ad2a7166..2259e3808 100644 --- a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java +++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java @@ -20,6 +20,7 @@ import junit.framework.TestCase; import org.aspectj.ajdt.internal.core.builder.*; import org.aspectj.bridge.CountingMessageHandler; import org.aspectj.bridge.IMessage; +import org.aspectj.bridge.IMessageHandler; import org.aspectj.bridge.MessageWriter; import org.aspectj.testing.util.TestUtil; import org.eclipse.jdt.core.compiler.InvalidInputException; @@ -30,20 +31,24 @@ import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; */ public class BuildArgParserTestCase extends TestCase { - private BuildArgParser parser = new BuildArgParser(); private static final String TEST_DIR = AjdtAjcTests.TESTDATA_PATH + File.separator + "ajc" + File.separator; private MessageWriter messageWriter = new MessageWriter(new PrintWriter(System.out), false); public BuildArgParserTestCase(String name) { super(name); } + + private AjBuildConfig genBuildConfig(String[] args, IMessageHandler handler) { + return new BuildArgParser(handler).genBuildConfig(args); + } public void testDefaultClasspathAndTargetCombo() throws InvalidInputException { String ENTRY = "1.jar;2.jar"; final String classpath = System.getProperty("java.class.path"); try { System.setProperty("java.class.path", ENTRY); // see finally below - AjBuildConfig config = parser.genBuildConfig(new String[] { }, messageWriter); + BuildArgParser parser = new BuildArgParser(messageWriter); + AjBuildConfig config = parser.genBuildConfig(new String[] { }); String err = parser.getOtherMessages(true); //!!!assertTrue(err, null == err); assertTrue( @@ -53,7 +58,7 @@ public class BuildArgParserTestCase extends TestCase { config.getClasspath().toString(), config.getClasspath().contains("2.jar")); - config = parser.genBuildConfig(new String[] { "-1.3" }, messageWriter); + config = genBuildConfig(new String[] { "-1.3" }, messageWriter); // these errors are deffered to the compiler now //err = parser.getOtherMessages(true); //!!!assertTrue(err, null == err); @@ -64,7 +69,8 @@ public class BuildArgParserTestCase extends TestCase { config.getClasspath().toString(), config.getClasspath().contains("2.jar")); - config = parser.genBuildConfig(new String[] { "-1.3" }, messageWriter); + parser = new BuildArgParser(messageWriter); + config = parser.genBuildConfig(new String[] { "-1.3" }); err = parser.getOtherMessages(true); //!!!assertTrue(err, null == err); assertTrue( @@ -74,7 +80,7 @@ public class BuildArgParserTestCase extends TestCase { config.getClasspath().toString(), config.getClasspath().contains("2.jar")); - config = parser.genBuildConfig(new String[] { + config = genBuildConfig(new String[] { "-classpath", ENTRY, "-1.4" }, messageWriter); // these errors are deffered to the compiler now //err = parser.getOtherMessages(true); @@ -96,7 +102,7 @@ public class BuildArgParserTestCase extends TestCase { } public void testAjOptions() throws InvalidInputException { - AjBuildConfig config = parser.genBuildConfig(new String[] { "-Xlint" }, messageWriter); + AjBuildConfig config = genBuildConfig(new String[] { "-Xlint" }, messageWriter); assertTrue( "default options", @@ -109,13 +115,13 @@ public class BuildArgParserTestCase extends TestCase { final String SOURCE_JARS = AjdtAjcTests.TESTDATA_PATH + "/testclasses.jar" + File.pathSeparator + "../weaver/testdata/tracing.jar" + File.pathSeparator + "../weaver/testdata/dummyAspect.jar"; - AjBuildConfig config = parser.genBuildConfig(new String[] { + AjBuildConfig config = genBuildConfig(new String[] { "-aspectpath", SOURCE_JAR }, messageWriter); assertTrue(((File)config.getAspectpath().get(0)).getName(), ((File)config.getAspectpath().get(0)).getName().equals("testclasses.jar")); - config = parser.genBuildConfig(new String[] { + config = genBuildConfig(new String[] { "-aspectpath", SOURCE_JARS }, messageWriter); assertTrue("size", + config.getAspectpath().size() == 3); @@ -126,7 +132,7 @@ public class BuildArgParserTestCase extends TestCase { final String SOURCE_JARS = AjdtAjcTests.TESTDATA_PATH + "/testclasses.jar" + File.pathSeparator + "../weaver/testdata/tracing.jar" + File.pathSeparator + "../weaver/testdata/dummyAspect.jar"; - AjBuildConfig config = parser.genBuildConfig(new String[] { + AjBuildConfig config = genBuildConfig(new String[] { "-injars", SOURCE_JAR }, messageWriter); //XXX don't let this remain in both places in beta1 @@ -135,7 +141,7 @@ public class BuildArgParserTestCase extends TestCase { config.getAjOptions().get(AjCompilerOptions.OPTION_InJARs).equals(CompilerOptions.PRESERVE)); assertTrue(((File)config.getInJars().get(0)).getName(), ((File)config.getInJars().get(0)).getName().equals("testclasses.jar")); - config = parser.genBuildConfig(new String[] { + config = genBuildConfig(new String[] { "-injars", SOURCE_JARS }, messageWriter); assertTrue("size", + config.getInJars().size() == 3); @@ -143,7 +149,7 @@ public class BuildArgParserTestCase extends TestCase { public void testBadInJars() throws InvalidInputException { final String SOURCE_JARS = AjdtAjcTests.TESTDATA_PATH + "/testclasses.jar" + File.pathSeparator + "b.far" + File.pathSeparator + "c.jar"; - AjBuildConfig config = parser.genBuildConfig(new String[] { + AjBuildConfig config = genBuildConfig(new String[] { "-injars", SOURCE_JARS }, messageWriter); assertTrue("size: " + config.getInJars().size(), config.getInJars().size() == 1); @@ -151,14 +157,14 @@ public class BuildArgParserTestCase extends TestCase { public void testBadPathToSourceFiles() { CountingMessageHandler countingHandler = new CountingMessageHandler(messageWriter); - AjBuildConfig config = parser.genBuildConfig(new String[]{ "inventedDir/doesntexist/*.java"},countingHandler); + AjBuildConfig config = genBuildConfig(new String[]{ "inventedDir/doesntexist/*.java"},countingHandler); assertTrue("Expected an error for the invalid path.",countingHandler.numMessages(IMessage.ERROR,false)==1); } public void testMultipleSourceRoots() throws InvalidInputException, IOException { final String SRCROOT_1 = AjdtAjcTests.TESTDATA_PATH + "/src1/p1"; final String SRCROOT_2 = AjdtAjcTests.TESTDATA_PATH + "/ajc"; - AjBuildConfig config = parser.genBuildConfig(new String[] { + AjBuildConfig config = genBuildConfig(new String[] { "-sourceroots", SRCROOT_1 + File.pathSeparator + SRCROOT_2 }, messageWriter); @@ -195,7 +201,7 @@ public class BuildArgParserTestCase extends TestCase { public void testSourceRootDir() throws InvalidInputException, IOException { final String SRCROOT = AjdtAjcTests.TESTDATA_PATH + "/ajc"; - AjBuildConfig config = parser.genBuildConfig(new String[] { + AjBuildConfig config = genBuildConfig(new String[] { "-sourceroots", SRCROOT }, messageWriter); @@ -215,7 +221,7 @@ public class BuildArgParserTestCase extends TestCase { } public void testBadSourceRootDir() throws InvalidInputException { - AjBuildConfig config = parser.genBuildConfig(new String[] { + AjBuildConfig config = genBuildConfig(new String[] { "-sourceroots", AjdtAjcTests.TESTDATA_PATH + "/mumbleDoesNotExist;" + AjdtAjcTests.TESTDATA_PATH + "/ajc" }, @@ -223,7 +229,7 @@ public class BuildArgParserTestCase extends TestCase { assertTrue(config.getSourceRoots().toString(), config.getSourceRoots().size() == 1); - config = parser.genBuildConfig(new String[] { + config = genBuildConfig(new String[] { "-sourceroots" }, messageWriter); @@ -234,7 +240,7 @@ public class BuildArgParserTestCase extends TestCase { //??? we've decided not to make this an error public void testSourceRootDirWithFiles() throws InvalidInputException, IOException { final String SRCROOT = AjdtAjcTests.TESTDATA_PATH + "/ajc/pkg"; - AjBuildConfig config = parser.genBuildConfig(new String[] { + AjBuildConfig config = genBuildConfig(new String[] { "-sourceroots", SRCROOT, AjdtAjcTests.TESTDATA_PATH + "/src1/A.java"}, messageWriter); @@ -251,7 +257,7 @@ public class BuildArgParserTestCase extends TestCase { public void testExtDirs() throws InvalidInputException { final String DIR = AjdtAjcTests.TESTDATA_PATH; - AjBuildConfig config = parser.genBuildConfig(new String[] { + AjBuildConfig config = genBuildConfig(new String[] { "-extdirs", DIR }, messageWriter); assertTrue(config.getClasspath().toString(), config.getClasspath().contains( @@ -261,12 +267,12 @@ public class BuildArgParserTestCase extends TestCase { public void testBootclasspath() throws InvalidInputException { final String PATH = "mumble/rt.jar"; - AjBuildConfig config = parser.genBuildConfig(new String[] { + AjBuildConfig config = genBuildConfig(new String[] { "-bootclasspath", PATH }, messageWriter); assertTrue(config.getClasspath().toString(), config.getClasspath().get(0).equals(PATH)); - config = parser.genBuildConfig(new String[] { + config = genBuildConfig(new String[] { }, messageWriter); assertTrue(config.getClasspath().toString(), !config.getClasspath().get(0).equals(PATH)); @@ -275,7 +281,7 @@ public class BuildArgParserTestCase extends TestCase { public void testOutputJar() throws InvalidInputException { final String OUT_JAR = AjdtAjcTests.TESTDATA_PATH + "/testclasses.jar"; - AjBuildConfig config = parser.genBuildConfig(new String[] { + AjBuildConfig config = genBuildConfig(new String[] { "-outjar", OUT_JAR }, messageWriter); @@ -287,7 +293,7 @@ public class BuildArgParserTestCase extends TestCase { getCanonicalPath(new File(OUT_JAR)),config.getOutputJar().getAbsolutePath()); File nonExistingJar = new File(AjdtAjcTests.TESTDATA_PATH + "/mumbleDoesNotExist.jar"); - config = parser.genBuildConfig(new String[] { + config = genBuildConfig(new String[] { "-outjar", nonExistingJar.getAbsolutePath() }, messageWriter); assertEquals( @@ -299,7 +305,7 @@ public class BuildArgParserTestCase extends TestCase { //XXX shouldn't need -1.4 to get this to pass public void testCombinedOptions() throws InvalidInputException { - AjBuildConfig config = parser.genBuildConfig(new String[] { "-Xlint", "-target", "1.4", "-1.4" }, messageWriter); + AjBuildConfig config = genBuildConfig(new String[] { "-Xlint", "-target", "1.4", "-1.4" }, messageWriter); String TARGET = "1.4"; assertTrue( "target set", @@ -312,7 +318,7 @@ public class BuildArgParserTestCase extends TestCase { } public void testOutputDirectorySetting() throws InvalidInputException { - AjBuildConfig config = parser.genBuildConfig(new String[] { "-d", TEST_DIR }, messageWriter); + AjBuildConfig config = genBuildConfig(new String[] { "-d", TEST_DIR }, messageWriter); assertTrue( new File(config.getOutputDir().getPath()).getAbsolutePath() + " ?= " + @@ -322,7 +328,7 @@ public class BuildArgParserTestCase extends TestCase { public void testClasspathSetting() throws InvalidInputException { String ENTRY = "1.jar;2.jar"; - AjBuildConfig config = parser.genBuildConfig(new String[] { "-classpath", ENTRY }, messageWriter); + AjBuildConfig config = genBuildConfig(new String[] { "-classpath", ENTRY }, messageWriter); assertTrue( config.getClasspath().toString(), @@ -336,7 +342,7 @@ public class BuildArgParserTestCase extends TestCase { public void testArgInConfigFile() throws InvalidInputException { String FILE_PATH = "@" + TEST_DIR + "configWithArgs.lst"; String OUT_PATH = "bin"; - AjBuildConfig config = parser.genBuildConfig(new String[] { FILE_PATH }, messageWriter); + AjBuildConfig config = genBuildConfig(new String[] { FILE_PATH }, messageWriter); assertNotNull(config); File outputDir = config.getOutputDir(); @@ -346,7 +352,7 @@ public class BuildArgParserTestCase extends TestCase { public void testNonExistentConfigFile() throws IOException { String FILE_PATH = "@" + TEST_DIR + "../bug-40257/d1/test.lst"; - AjBuildConfig config = parser.genBuildConfig(new String[] { FILE_PATH }, messageWriter); + AjBuildConfig config = genBuildConfig(new String[] { FILE_PATH }, messageWriter); String a = new File(TEST_DIR + "../bug-40257/d1/A.java").getCanonicalPath(); String b = new File(TEST_DIR + "../bug-40257/d1/d2/B.java").getCanonicalPath(); @@ -363,20 +369,20 @@ public class BuildArgParserTestCase extends TestCase { public void testXlint() throws InvalidInputException { AjdtCommand command = new AjdtCommand(); - AjBuildConfig config = parser.genBuildConfig(new String[] {"-Xlint"}, messageWriter); + AjBuildConfig config = genBuildConfig(new String[] {"-Xlint"}, messageWriter); assertTrue("", config.getLintMode().equals(AjBuildConfig.AJLINT_DEFAULT)); - config = parser.genBuildConfig(new String[] {"-Xlint:warn"}, messageWriter); + config = genBuildConfig(new String[] {"-Xlint:warn"}, messageWriter); assertTrue("", config.getLintMode().equals(AjBuildConfig.AJLINT_WARN)); - config = parser.genBuildConfig(new String[] {"-Xlint:error"}, messageWriter); + config = genBuildConfig(new String[] {"-Xlint:error"}, messageWriter); assertTrue("", config.getLintMode().equals(AjBuildConfig.AJLINT_ERROR)); - config = parser.genBuildConfig(new String[] {"-Xlint:ignore"}, messageWriter); + config = genBuildConfig(new String[] {"-Xlint:ignore"}, messageWriter); assertTrue("", config.getLintMode().equals(AjBuildConfig.AJLINT_IGNORE)); } public void testXlintfile() throws InvalidInputException { String lintFile = AjdtAjcTests.TESTDATA_PATH + "/lintspec.properties"; String badLintFile = "lint.props"; - AjBuildConfig config = parser.genBuildConfig(new String[] {"-Xlintfile", lintFile}, messageWriter); + AjBuildConfig config = genBuildConfig(new String[] {"-Xlintfile", lintFile}, messageWriter); assertTrue(new File(lintFile).exists()); assertEquals(getCanonicalPath(new File(lintFile)),config.getLintSpecFile().getAbsolutePath()); } @@ -384,7 +390,7 @@ public class BuildArgParserTestCase extends TestCase { public void testOptions() throws InvalidInputException { AjdtCommand command = new AjdtCommand(); String TARGET = "1.4"; - AjBuildConfig config = parser.genBuildConfig(new String[] {"-target", TARGET, "-source", TARGET}, messageWriter); + AjBuildConfig config = genBuildConfig(new String[] {"-target", TARGET, "-source", TARGET}, messageWriter); assertTrue( "target set", config.getJavaOptions().get(CompilerOptions.OPTION_TargetPlatform).equals(TARGET)); @@ -400,7 +406,7 @@ public class BuildArgParserTestCase extends TestCase { File f = new File(FILE_PATH); - AjBuildConfig config = parser.genBuildConfig(new String[] { "@" + FILE_PATH }, messageWriter); + AjBuildConfig config = genBuildConfig(new String[] { "@" + FILE_PATH }, messageWriter); List resultList = config.getFiles(); assertTrue("correct number of files", resultList.size() == 2); @@ -415,7 +421,7 @@ public class BuildArgParserTestCase extends TestCase { // public void testArgInConfigFileAndRelativizingPathParam() throws InvalidInputException { // String FILE_PATH = "@" + TEST_DIR + "configWithArgs.lst"; // String OUT_PATH = TEST_DIR + "bin"; -// AjBuildConfig config = parser.genBuildConfig(new String[] { FILE_PATH }); +// AjBuildConfig config = genBuildConfig(new String[] { FILE_PATH }); // // assertTrue( // config.getOutputDir().getPath() + " ?= " + OUT_PATH, @@ -423,7 +429,7 @@ public class BuildArgParserTestCase extends TestCase { // } public void testAjFileInclusion() throws InvalidInputException { - parser.genBuildConfig(new String[] { TEST_DIR + "X.aj", TEST_DIR + "Y.aj"}, messageWriter); + genBuildConfig(new String[] { TEST_DIR + "X.aj", TEST_DIR + "Y.aj"}, messageWriter); } protected void setUp() throws Exception { diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/core/builder/AjBuildManagerTest.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/core/builder/AjBuildManagerTest.java index bff2efd74..f602539c0 100644 --- a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/core/builder/AjBuildManagerTest.java +++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/core/builder/AjBuildManagerTest.java @@ -62,7 +62,7 @@ public class AjBuildManagerTest extends TestCase { public void testSimpleStructure() throws IOException, CoreException { AjBuildManager manager = new AjBuildManager(messageWriter); - BuildArgParser parser = new BuildArgParser(); + BuildArgParser parser = new BuildArgParser(messageWriter); String javaClassPath = System.getProperty("java.class.path"); AjBuildConfig buildConfig = parser.genBuildConfig(new String[] { @@ -72,7 +72,7 @@ public class AjBuildManagerTest extends TestCase { AjdtAjcTests.TESTDATA_PATH + "/src1/A.java", // EajcModuleTests.TESTDATA_PATH + "/src1/Hello.java", - }, messageWriter); + }); String err = parser.getOtherMessages(true); assertTrue(err, null == err); manager.setStructureModel(AsmManager.getDefault().getHierarchy()); diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/core/builder/AsmBuilderTest.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/core/builder/AsmBuilderTest.java index 983f69f96..43160e832 100644 --- a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/core/builder/AsmBuilderTest.java +++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/core/builder/AsmBuilderTest.java @@ -19,7 +19,7 @@ import java.util.EmptyStackException; import junit.framework.*; import org.eclipse.jdt.internal.compiler.CompilationResult; -import org.eclipse.jdt.internal.compiler.ast.LocalTypeDeclaration; +import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; import org.eclipse.jdt.internal.compiler.env.*; import org.eclipse.jdt.internal.compiler.lookup.BlockScope; @@ -55,7 +55,7 @@ public class AsmBuilderTest extends TestCase { } }; - LocalTypeDeclaration local = new LocalTypeDeclaration(new CompilationResult(cu, 0, 0, 0)); + TypeDeclaration local = new TypeDeclaration(new CompilationResult(cu, 0, 0, 0)); local.name = new char[2]; BlockScope scope = null; diff --git a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip Binary files differindex 460c2c3b0..ab93027ba 100644 --- a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip +++ b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip diff --git a/org.eclipse.jdt.core/jdtcore-for-aspectj.jar b/org.eclipse.jdt.core/jdtcore-for-aspectj.jar Binary files differindex 2ed578e25..b63c775e8 100644 --- a/org.eclipse.jdt.core/jdtcore-for-aspectj.jar +++ b/org.eclipse.jdt.core/jdtcore-for-aspectj.jar diff --git a/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java b/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java index 81c31cf66..5d24dfd25 100644 --- a/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java +++ b/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java @@ -505,7 +505,7 @@ public class AjcTask extends MatchingTask { } public void setNoImportError(boolean noImportError) { - cmd.addFlag("-noImportError", noImportError); + cmd.addFlag("-warn:-unusedImport", noImportError); } public void setEncoding(String encoding) { diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml index 4df86dcec..a7e0c270c 100644 --- a/tests/ajcTests.xml +++ b/tests/ajcTests.xml @@ -30,6 +30,9 @@ knownLimitation-ajdeCompiler Accepted limitation of the AJDE CompileCommand wrapper + poorErrorMessages test case passes but errors produced by compiler could do with + improvement + Test titles: Titles should be unique and not change, and related tests should have the @@ -1088,7 +1091,7 @@ </ajc-test> <ajc-test dir="new" title="Error expected for constructor in interfaces" - keywords="from-java"> + keywords="from-java,purejava"> <compile files="InterfaceConstructor.java"> <message kind="error" line="2"/> <message kind="error" line="6"/> @@ -1572,7 +1575,6 @@ keywords="from-errors"> <compile files="MismatchedParens.java"> <message kind="error" line="16"/> - <message kind="error" line="17"/> </compile> </ajc-test> @@ -1585,7 +1587,7 @@ <ajc-test dir="errors" pr="218" title="import statement within class body crashes compiler" - keywords="from-errors"> + keywords="from-errors,purejava"> <compile files="ImportWithinClassBody.java"> <message kind="error" line="8"/> </compile> @@ -1594,8 +1596,7 @@ <ajc-test dir="errors" pr="219" title="extra closing brace" keywords="from-errors"> <compile files="ExtraClosingBrace.java"> - <message kind="error" line="9"/> - <message kind="error" line="10"/> + <message kind="error" line="8"/> </compile> </ajc-test> @@ -1642,7 +1643,7 @@ <ajc-test dir="errors" pr="280" title="wildcard used for returns clause" keywords="from-errors"> <compile files="WildcardForReturns.java"> - <message kind="error" line="17"/> + <message kind="error" line="17"/> </compile> </ajc-test> @@ -1776,7 +1777,7 @@ title="pre 0.7 introduction form outside aspect body causes an EmptyStackException" keywords="from-errors"> <compile files="BadIntroduction.java"> - <message kind="error" line="10"/> + <message kind="error" line="3"/> </compile> </ajc-test> @@ -1791,7 +1792,7 @@ title="a before() clause at the class-level causes an EmptyStackException" keywords="from-errors"> <compile files="TopLevelBefore.java"> - <message kind="error" line="9"/> + <message kind="error" line="3"/> </compile> </ajc-test> @@ -1799,7 +1800,7 @@ title="an after() clause at the class-level causes an EmptyStackException" keywords="from-errors"> <compile files="TopLevelAfter.java"> - <message kind="error" line="9"/> + <message kind="error" line="3"/> </compile> </ajc-test> @@ -1807,7 +1808,7 @@ title="an around() clause at the class-level causes an EmptyStackException" keywords="from-errors"> <compile files="TopLevelAround.java"> - <message kind="error" line="9"/> + <message kind="error" line="3"/> </compile> </ajc-test> @@ -2288,11 +2289,14 @@ <ajc-test dir="new" pr="457" title="Compiler should suggest using aspect when advice, pointcuts, or introduction is in a class" - keywords="from-errors"> + keywords="from-errors,poorErrorMessages"> <compile files="RecognizeAspectCE.java"> + <message kind="error" line="3" + file="RecognizeAspectCE.java" + text="Syntax error"/> <message kind="error" line="6" file="RecognizeAspectCE.java" - text="Syntax error on token"/> + text="Syntax error"/> </compile> </ajc-test> @@ -3115,7 +3119,8 @@ <run class="NewAnonymous"/> </ajc-test> - <ajc-test dir="new" title="Cannot bind a name." keywords="from-resolved_10x"> + <ajc-test dir="new" + title="Cannot bind a name." keywords="from-resolved_10x,purejava"> <compile files="CannotReferenceSuper.java"/> <run class="CannotReferenceSuper"/> </ajc-test> @@ -3298,10 +3303,17 @@ <ajc-test dir="new" title="around advice on calls within inner classes (including protected method calls)" keywords="from-resolved_10x"> - <compile files="AroundInnerCalls.java"/> - <run class="AroundInnerCalls"/> + <compile files="AroundInnerCalls13.java" options="-1.3"/> + <run class="AroundInnerCalls13"/> </ajc-test> + <ajc-test dir="new" + title="around advice on calls within inner classes (including protected method calls)" + keywords="from-resolved_10x"> + <compile files="AroundInnerCalls.java" options="-1.4"/> + <run class="AroundInnerCalls"/> + </ajc-test> + <ajc-test dir="new" title="Arguments to runNext should be final when needed" keywords="from-resolved_10x"> <compile files="Finals.java"/> @@ -3380,13 +3392,13 @@ <run class="EmptyStack"/> </ajc-test> - <ajc-test dir="new" - title="check that MightHaveAspect interface is created correctly for an aspect in deep package" - keywords="from-resolved_10x"> - <compile files="EachObjectTarget.java,EachObjectInDeepPackage.java"/> - <run class="EachObjectTarget"/> - </ajc-test> - + <ajc-test dir="new/perThis" + title="check that MightHaveAspect interface is created correctly for an aspect in deep package" + keywords="from-resolved_10x"> + <compile files="p/EachObjectTarget.java,the/deep/pkg/EachObjectInDeepPackage.java"/> + <run class="p.EachObjectTarget"/> + </ajc-test> + <ajc-test dir="new" title="Defines clfow$ajc0 more once. [eachcflow]" keywords="from-resolved_10x"> <compile files="Binkley.java"/> @@ -4433,7 +4445,7 @@ <ajc-test dir="new" title="changing this in around's proceed reported by Rich Price" keywords="from-resolved_104"> - <compile files="AroundChangeThis.java"/> + <compile files="AroundChangeThis.java" options="-1.4"/> <run class="AroundChangeThis"/> </ajc-test> @@ -5213,17 +5225,17 @@ <!-- .................................... option tests --> <!-- .................................... -warn tests --> - <ajc-test dir="options" + <ajc-test dir="options/deprecated" title="options -warn:deprecation"> - <compile files="WarnDeprecated.java" + <compile files="WarnDeprecated.java,OldStuff.java" options="!eclipse,-warn:deprecation"> <message kind="warning" line="10"/> </compile> </ajc-test> - <ajc-test dir="options" + <ajc-test dir="options/deprecated" title="options -warn:deprecation not enabled"> - <compile files="WarnDeprecated.java" + <compile files="WarnDeprecated.java,OldStuff.java" options="!eclipse"> </compile> </ajc-test> @@ -5350,7 +5362,7 @@ <ajc-test dir="new" title="expect CE for unterminated declare error"> <compile files="UnterminatedDeclareErrorCE.java"> - <message kind="error" line="5"/> + <message kind="error" line="4"/> </compile> </ajc-test> @@ -6777,13 +6789,18 @@ </ajc-test> <ajc-test dir="bugs/concretizeNpe" pr="43033" - title="NPE in concretization error path"> + title="NPE in concretization error path" + keywords="poorErrorMessages"> <compile files="base/ExceptionHandling.java,model/ModelExceptionHandling.java"> + <!-- <message line="5" kind="error" text="pointcut base.ExceptionHandling.scope() is abstract"/> <message line="4" kind="error" text="inherited abstract pointcut base.ExceptionHandling.scope() is not made concrete"/> <message line="8" kind="error" text="inherited abstract pointcut base.ExceptionHandling.scope() is not made concrete"/> - <message line="12" kind="error" text="Unmatched bracket"/> - <message line="13" kind="error" text="Syntax error on token"/> + <message line="12" kind="error" /> + <message line="13" kind="error" /> + --> + <message line="12" kind="error" /> + <message line="13" kind="error" /> </compile> </ajc-test> @@ -6862,7 +6879,8 @@ pr="41952" > <compile - files="DeclaringTypeWarning.java" > + files="DeclaringTypeWarning.java" + options="-1.3" > <message kind="warning" line="6" text="declaring type"> <source line="12" file="DeclaringTypeWarning.java" /> </message> @@ -6872,16 +6890,27 @@ </compile> </ajc-test> + <ajc-test dir="bugs" + title="XLint warning for call PCD's using subtype of defining type (-1.3 -Xlint:ignore)" + pr="41952" + > + <compile + options="-Xlint:ignore,-1.3" + files="DeclaringTypeWarning.java" > + </compile> + </ajc-test> + <ajc-test dir="bugs" - title="XLint warning for call PCD's using subtype of defining type (-Xlint:ignore)" + title="XLint warning for call PCD's using subtype of defining type (-1.4 -Xlint:ignore)" pr="41952" > <compile - options="-Xlint:ignore" + options="-Xlint:ignore,-1.4" files="DeclaringTypeWarning.java" > + <message kind="warning" line="12"/> </compile> </ajc-test> - + <ajc-test dir="bugs" title="XLint warning for call PCD's using subtype of defining type (-1.4)" pr="41952" @@ -6920,4 +6949,19 @@ <compile files="TestSoftening.java"> </compile> </ajc-test> + + <ajc-test dir="bugs" pr="45663" + title="Bad parser error recovery in advice"> + <compile files="ParserRecoveryTest.java"> + <message kind="error" line="7"/> + </compile> + </ajc-test> + + <ajc-test dir="bugs" pr="45663" + title="Bad parser error recovery in java source"> + <compile files="ParserRecoveryTestPureJava.java"> + <message kind="error" line="6"/> + <message kind="error" line="8"/> + </compile> + </ajc-test> </suite> diff --git a/tests/bugs/ParserRecoveryTest.java b/tests/bugs/ParserRecoveryTest.java new file mode 100644 index 000000000..0969b3ea1 --- /dev/null +++ b/tests/bugs/ParserRecoveryTest.java @@ -0,0 +1,8 @@ +// pr 45663 +aspect ParserRecoveryTest1 +{ + pointcut s(int x): + execution(* fred(x)); + + after(int xxx x x x x): this(*) {} +}
\ No newline at end of file diff --git a/tests/bugs/ParserRecoveryTestPureJava.java b/tests/bugs/ParserRecoveryTestPureJava.java new file mode 100644 index 000000000..811d1fb55 --- /dev/null +++ b/tests/bugs/ParserRecoveryTestPureJava.java @@ -0,0 +1,9 @@ +// pr 45663 +abstract class ParserRecoveryTestPureJava +{ + abstract int s(int x); + + void after(int xxx x x x x) {} + + void m() { return 2;} +}
\ No newline at end of file diff --git a/tests/errors/BadIntroduction.java b/tests/errors/BadIntroduction.java index b4bdf5740..7939f702d 100644 --- a/tests/errors/BadIntroduction.java +++ b/tests/errors/BadIntroduction.java @@ -1,5 +1,7 @@ import org.aspectj.testing.Tester; +introduction (String) {} + public class BadIntroduction { public static void main(String[] args) { String s; @@ -7,5 +9,4 @@ public class BadIntroduction { } } -introduction (String) { -} + diff --git a/tests/errors/BadIntroductionDesignator.java b/tests/errors/BadIntroductionDesignator.java index 9b97d4aae..ecd8fba57 100644 --- a/tests/errors/BadIntroductionDesignator.java +++ b/tests/errors/BadIntroductionDesignator.java @@ -2,10 +2,8 @@ package errors; // PR#129 -public class BadIntroductionDesignator { - introduction (M||) { - public boolean m_foo; - } +public aspect BadIntroductionDesignator { + public boolean (M||).m_foo; } class M {} diff --git a/tests/errors/ExtraClosingBrace.java b/tests/errors/ExtraClosingBrace.java index 0a46739af..c0991be40 100644 --- a/tests/errors/ExtraClosingBrace.java +++ b/tests/errors/ExtraClosingBrace.java @@ -5,6 +5,4 @@ package errors; public aspect ExtraClosingBrace { public void doIt() { - }} -} -} + }}}} diff --git a/tests/errors/NoAspect.java b/tests/errors/NoAspect.java index c735fd27a..14099bd6a 100644 --- a/tests/errors/NoAspect.java +++ b/tests/errors/NoAspect.java @@ -7,8 +7,7 @@ public class NoAspect { } } -class A { - static pointcut p(): target(*) && call(* go(..)); - before(): p() { - } + +class A +{ before(): target(*) && call(* go(..)) {} } diff --git a/tests/errors/NoSource.java b/tests/errors/NoSource.java index 31549fd77..6a7c52281 100644 --- a/tests/errors/NoSource.java +++ b/tests/errors/NoSource.java @@ -1,7 +1,5 @@ import org.aspectj.testing.Tester; class NoSource { - introduction String { - public void foo() {} - } + public void String.foo() {} } diff --git a/tests/errors/TopLevelAfter.java b/tests/errors/TopLevelAfter.java index 7db612660..b8186446a 100644 --- a/tests/errors/TopLevelAfter.java +++ b/tests/errors/TopLevelAfter.java @@ -1,9 +1,10 @@ import org.aspectj.testing.Tester; +after(): call(void main(..)) {} // CE 3 + public class TopLevelAfter { public static void main(String[] args) { Tester.check(false, "should not have compiled"); } } -after(): {} diff --git a/tests/errors/TopLevelAround.java b/tests/errors/TopLevelAround.java index 52beae80e..89e99cfd2 100644 --- a/tests/errors/TopLevelAround.java +++ b/tests/errors/TopLevelAround.java @@ -1,9 +1,10 @@ import org.aspectj.testing.Tester; -public class TopLevelAround { +void around(): call(void main(..)) {} // CE 3 + +public aspect TopLevelAround { public static void main(String[] args) { Tester.check(false, "should not have compiled"); } } -around(): {} // CE 9 diff --git a/tests/errors/TopLevelBefore.java b/tests/errors/TopLevelBefore.java index 4341e6941..8fdca0a0c 100644 --- a/tests/errors/TopLevelBefore.java +++ b/tests/errors/TopLevelBefore.java @@ -1,9 +1,9 @@ import org.aspectj.testing.Tester; +before(): call(void main(..)) {} // CE 3 + public class TopLevelBefore { public static void main(String[] args) { Tester.check(false, "should not have compiled"); } } - -before(): {} diff --git a/tests/errors/WildcardForReturns.java b/tests/errors/WildcardForReturns.java index e330b474f..2235c3cbc 100644 --- a/tests/errors/WildcardForReturns.java +++ b/tests/errors/WildcardForReturns.java @@ -11,11 +11,10 @@ public class WildcardForReturns { new WildcardForReturns().m(); } - public void m() { } - - static aspect A { - * around (WildcardForReturns t): this(t) && call(* m()) { // CE 17 - // bad test - return null; //return proceed(t); - } - } + public void m() { } +} +aspect A { + * around (WildcardForReturns t): this(t) && call(* m()) { // CE 17 + // bad test - return null; //return proceed(t); + } } diff --git a/tests/new/AroundChangeThis.java b/tests/new/AroundChangeThis.java index bf96cdd9b..826e95b52 100644 --- a/tests/new/AroundChangeThis.java +++ b/tests/new/AroundChangeThis.java @@ -12,15 +12,23 @@ public class AroundChangeThis { c1.m(sc); Tester.checkAndClearEvents(new String[] { "c1.m(sc)", "sc.m(c1)" }); - sc.m(c1); - Tester.checkAndClearEvents(new String[] { "sc.m(c1)", "c1.m(sc)" }); - +// this is the 1.3 behaviour +// sc.m(c1); +// Tester.checkAndClearEvents(new String[] { "sc.m(c1)", "c1.m(sc)" }); + + try { + // the 1.4 behaviour is.... + // in byte code we have a call to SubC.m + sc.m(c1); + Tester.checkFailed("Expected ClassCastException"); + } catch (ClassCastException e) { + } + try { sc.m1(c1); + Tester.checkFailed("Expected ClassCastException"); } catch (ClassCastException e) { - Tester.event("ClassCastException"); } - Tester.checkAndClearEvents(new String[] { "ClassCastException" }); Tester.printEvents(); } diff --git a/tests/new/AroundInnerCalls.java b/tests/new/AroundInnerCalls.java index 6cdd966a1..64a55caf8 100644 --- a/tests/new/AroundInnerCalls.java +++ b/tests/new/AroundInnerCalls.java @@ -6,11 +6,11 @@ public class AroundInnerCalls { Tester.check("Outer.foo() calls Outer.Inner.mi()"); Tester.check("Outer.foo() calls Outer.InnerRandom.nextHook(..)"); - Tester.check("Outer.InnerRandom.nextHook(..) calls Random.next(..)"); + Tester.check("Outer.InnerRandom.nextHook(..) calls Outer.InnerRandom.next(..)"); Tester.check("Outer.Inner.mi() calls PrintStream.println(..)"); Tester.check("X.toString()"); - Tester.check("Outer.foo() calls Random.nextInt(..)"); + Tester.check("Outer.foo() calls Outer.1.nextInt(..)"); } } @@ -37,7 +37,7 @@ class Outer { aspect A { Object around(): call(* *(..)) && !within(A) { - //System.out.println +// System.out.println Tester.note (thisEnclosingJoinPointStaticPart.getSignature().toShortString() + " calls " + thisJoinPointStaticPart.getSignature().toShortString()); diff --git a/tests/new/AroundInnerCalls13.java b/tests/new/AroundInnerCalls13.java new file mode 100644 index 000000000..0903eae27 --- /dev/null +++ b/tests/new/AroundInnerCalls13.java @@ -0,0 +1,56 @@ +import org.aspectj.testing.Tester; + +public class AroundInnerCalls13 { + public static void main(String[] args) { + new Outer().foo(); + + Tester.check("Outer.foo() calls Outer.Inner.mi()"); + Tester.check("Outer.foo() calls Outer.InnerRandom.nextHook(..)"); + Tester.check("Outer.InnerRandom.nextHook(..) calls Random.next(..)"); + Tester.check("Outer.Inner.mi() calls PrintStream.println(..)"); + + Tester.check("X.toString()"); + Tester.check("Outer.foo() calls Random.nextInt(..)"); + } +} + +class Outer { + private class Inner extends Object { + public void mi() { + System.out.println("."); + } + } + + public void foo() { + new Inner().mi(); + new InnerRandom().nextHook(2); + + new java.util.Random() { public String toString() { Tester.note("X.toString()"); return "X"; } }.nextInt(2); + } + + private class InnerRandom extends java.util.Random { + public int nextHook(int bits) { + return next(bits); + } + } +} + +aspect A { + Object around(): call(* *(..)) && !within(A) { +// System.out.println + Tester.note + (thisEnclosingJoinPointStaticPart.getSignature().toShortString() + + " calls " + thisJoinPointStaticPart.getSignature().toShortString()); + return proceed(); + } + + before(Object caller, Object callee): + this(caller) && target(callee) && call(* *(..)) && !within(A) + { + System.out.println(thisEnclosingJoinPointStaticPart.getSignature().toShortString() + + " calls " + thisJoinPointStaticPart.getSignature().toShortString()); + System.out.println + (caller + "." + thisEnclosingJoinPointStaticPart.getSignature().getName() + + " calls " + callee + "." + thisJoinPoint.getSignature().getName()); + } +} diff --git a/tests/new/DeclareMethodCE.java b/tests/new/DeclareMethodCE.java index ded55022f..bad23e569 100644 --- a/tests/new/DeclareMethodCE.java +++ b/tests/new/DeclareMethodCE.java @@ -5,7 +5,6 @@ class B {} aspect A { void B.n() { - void n() { // CE 8 method declared in method - } + void n() { } // CE 8 method declared in method } } diff --git a/tests/new/InterfaceConstructor.java b/tests/new/InterfaceConstructor.java index 080e4406b..49a6ded3c 100644 --- a/tests/new/InterfaceConstructor.java +++ b/tests/new/InterfaceConstructor.java @@ -3,7 +3,7 @@ interface i { } class c { - c(); //ERR: constructors must have bodies + c(); //ERR: constructors must have bodies abstract c(int i) { } //ERR: constructors can't be abstract } diff --git a/tests/new/RecognizeAspectCE.java b/tests/new/RecognizeAspectCE.java index a84effb04..92fb6df1c 100644 --- a/tests/new/RecognizeAspectCE.java +++ b/tests/new/RecognizeAspectCE.java @@ -1,7 +1,7 @@ // PR#457 class RecognizeAspectCE { public static void main(String[] ignore) { } - pointcut mumble() // would like error here: "pointcuts not allowed in classes - use aspect" - : execution(public static void RecognizeAspectCE.main(String[])); - before(): mumble() { } // ok: get error here: constructor has the wrong name +// pointcut mumble() +// : execution(public static void RecognizeAspectCE.main(String[])); + before(): this(*) { } // ok: get error here: constructor has the wrong name } diff --git a/tests/new/perThis/p/EachObjectTarget.java b/tests/new/perThis/p/EachObjectTarget.java new file mode 100644 index 000000000..bf9c364af --- /dev/null +++ b/tests/new/perThis/p/EachObjectTarget.java @@ -0,0 +1,13 @@ +package p; +import org.aspectj.testing.Tester; + +public class EachObjectTarget { + public static void main(String[] args) { + EachObjectTarget o = new EachObjectTarget(); + o.foo(); + } + + void foo() { + Tester.check(true, "Dummy test"); + } +} diff --git a/tests/new/perThis/the/deep/pkg/EachObjectInDeepPackage.java b/tests/new/perThis/the/deep/pkg/EachObjectInDeepPackage.java new file mode 100644 index 000000000..8b862e451 --- /dev/null +++ b/tests/new/perThis/the/deep/pkg/EachObjectInDeepPackage.java @@ -0,0 +1,11 @@ +package the.deep.pkg; + +import org.aspectj.testing.Tester; +import p.EachObjectTarget; + +aspect Aspect pertarget(target(EachObjectTarget)) { + before(): call(void foo(..)) { + EachObjectTarget t = null; + Tester.check(true, "Dummy test"); + } +} diff --git a/tests/options/WarnDeprecated.java b/tests/options/WarnDeprecated.java deleted file mode 100644 index e86b79522..000000000 --- a/tests/options/WarnDeprecated.java +++ /dev/null @@ -1,13 +0,0 @@ - - - - -public class WarnDeprecated { - - /** */ - public static void main(String[] args) { - if (null == args) { - String s = new String(new byte[] {}, 0); // CE 10 deprecated if warn:deprecated - } - } -} diff --git a/tests/options/deprecated/OldStuff.java b/tests/options/deprecated/OldStuff.java new file mode 100644 index 000000000..4179ebf26 --- /dev/null +++ b/tests/options/deprecated/OldStuff.java @@ -0,0 +1,8 @@ +class OldStuff { + + /** + * @deprecated + */ + public static void foo() {} + +}
\ No newline at end of file diff --git a/tests/options/deprecated/WarnDeprecated.java b/tests/options/deprecated/WarnDeprecated.java new file mode 100644 index 000000000..ac2a02226 --- /dev/null +++ b/tests/options/deprecated/WarnDeprecated.java @@ -0,0 +1,18 @@ + + + + +public class WarnDeprecated { + + /** */ + public static void main(String[] args) { + if (null == args) { + OldStuff.foo(); // CE 10 deprecated if warn:deprecated + + // This is only picked up as a deprecation error when compiling against developer + // libraries, it will be ignored if compiling against the user jre libraries. + // We're not going to include this in the test suite for robustness of the suite. + //"hello".getBytes(0, 1, new byte[10], 0); + } + } +} |