Lines 31-36
Link Here
|
31 |
import org.eclipse.jdt.internal.compiler.impl.ReferenceContext; |
31 |
import org.eclipse.jdt.internal.compiler.impl.ReferenceContext; |
32 |
import org.eclipse.jdt.internal.compiler.lookup.Binding; |
32 |
import org.eclipse.jdt.internal.compiler.lookup.Binding; |
33 |
import org.eclipse.jdt.internal.compiler.lookup.CompilerModifiers; |
33 |
import org.eclipse.jdt.internal.compiler.lookup.CompilerModifiers; |
|
|
34 |
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; |
34 |
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; |
35 |
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; |
35 |
import org.eclipse.jdt.internal.compiler.parser.diagnose.DiagnoseParser; |
36 |
import org.eclipse.jdt.internal.compiler.parser.diagnose.DiagnoseParser; |
36 |
import org.eclipse.jdt.internal.compiler.problem.AbortCompilation; |
37 |
import org.eclipse.jdt.internal.compiler.problem.AbortCompilation; |
Lines 183-189
Link Here
|
183 |
public JavadocParser javadocParser; |
184 |
public JavadocParser javadocParser; |
184 |
// used for recovery |
185 |
// used for recovery |
185 |
protected int lastJavadocEnd; |
186 |
protected int lastJavadocEnd; |
186 |
|
187 |
|
187 |
static { |
188 |
static { |
188 |
try{ |
189 |
try{ |
189 |
initTables(); |
190 |
initTables(); |
Lines 3483-3488
Link Here
|
3483 |
// InternalCompilationUnit ::= PackageDeclaration |
3484 |
// InternalCompilationUnit ::= PackageDeclaration |
3484 |
// InternalCompilationUnit ::= PackageDeclaration ImportDeclarations ReduceImports |
3485 |
// InternalCompilationUnit ::= PackageDeclaration ImportDeclarations ReduceImports |
3485 |
// InternalCompilationUnit ::= ImportDeclarations ReduceImports |
3486 |
// InternalCompilationUnit ::= ImportDeclarations ReduceImports |
|
|
3487 |
if (this.astLengthPtr >= 0) { |
3488 |
int length; |
3489 |
if ((length = this.astLengthStack[this.astLengthPtr--]) != 0) { |
3490 |
this.compilationUnit.types = new TypeDeclaration[length]; |
3491 |
this.astPtr -= length; |
3492 |
System.arraycopy(this.astStack, this.astPtr + 1, this.compilationUnit.types, 0, length); |
3493 |
} |
3494 |
} |
3486 |
} |
3495 |
} |
3487 |
protected void consumeInternalCompilationUnitWithTypes() { |
3496 |
protected void consumeInternalCompilationUnitWithTypes() { |
3488 |
// InternalCompilationUnit ::= PackageDeclaration ImportDeclarations ReduceImports TypeDeclarations |
3497 |
// InternalCompilationUnit ::= PackageDeclaration ImportDeclarations ReduceImports TypeDeclarations |
Lines 3492-3499
Link Here
|
3492 |
// consume type declarations |
3501 |
// consume type declarations |
3493 |
int length; |
3502 |
int length; |
3494 |
if ((length = this.astLengthStack[this.astLengthPtr--]) != 0) { |
3503 |
if ((length = this.astLengthStack[this.astLengthPtr--]) != 0) { |
|
|
3504 |
if (this.astLengthPtr >= 0) { |
3505 |
// check for the fake type package-info |
3506 |
length += this.astLengthStack[this.astLengthPtr--]; |
3507 |
} |
3508 |
this.compilationUnit.types = new TypeDeclaration[length]; |
3495 |
this.astPtr -= length; |
3509 |
this.astPtr -= length; |
3496 |
System.arraycopy(this.astStack, this.astPtr + 1, this.compilationUnit.types = new TypeDeclaration[length], 0, length); |
3510 |
System.arraycopy(this.astStack, this.astPtr + 1, this.compilationUnit.types, 0, length); |
3497 |
} |
3511 |
} |
3498 |
} |
3512 |
} |
3499 |
protected void consumeInvalidConstructorDeclaration() { |
3513 |
protected void consumeInvalidConstructorDeclaration() { |
Lines 4221-4226
Link Here
|
4221 |
length); |
4235 |
length); |
4222 |
impt.declarationSourceStart = packageModifiersSourceStart; |
4236 |
impt.declarationSourceStart = packageModifiersSourceStart; |
4223 |
intPtr--; // we don't need the position of the 'package keyword |
4237 |
intPtr--; // we don't need the position of the 'package keyword |
|
|
4238 |
// create a fake interface declaration |
4239 |
TypeDeclaration declaration = new TypeDeclaration(compilationUnit.compilationResult); |
4240 |
declaration.name = TypeConstants.PACKAGE_INFO_NAME; |
4241 |
declaration.modifiers = AccDefault | AccInterface; |
4242 |
pushOnAstStack(declaration); |
4224 |
} else { |
4243 |
} else { |
4225 |
impt.declarationSourceStart = this.intStack[this.intPtr--]; |
4244 |
impt.declarationSourceStart = this.intStack[this.intPtr--]; |
4226 |
} |
4245 |
} |