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.compilationUnit.isPackageInfo()) { |
3488 |
this.compilationUnit.types = new TypeDeclaration[1]; |
3489 |
// create a fake interface declaration |
3490 |
TypeDeclaration declaration = new TypeDeclaration(compilationUnit.compilationResult); |
3491 |
declaration.name = TypeConstants.PACKAGE_INFO_NAME; |
3492 |
declaration.modifiers = AccDefault | AccInterface; |
3493 |
this.compilationUnit.types[0] = declaration; |
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) { |
3495 |
this.astPtr -= length; |
3504 |
if (this.compilationUnit.isPackageInfo()) { |
3496 |
System.arraycopy(this.astStack, this.astPtr + 1, this.compilationUnit.types = new TypeDeclaration[length], 0, length); |
3505 |
this.compilationUnit.types = new TypeDeclaration[length + 1]; |
|
|
3506 |
this.astPtr -= length; |
3507 |
System.arraycopy(this.astStack, this.astPtr + 1, this.compilationUnit.types, 1, length); |
3508 |
// create a fake interface declaration |
3509 |
TypeDeclaration declaration = new TypeDeclaration(compilationUnit.compilationResult); |
3510 |
declaration.name = TypeConstants.PACKAGE_INFO_NAME; |
3511 |
declaration.modifiers = AccDefault | AccInterface; |
3512 |
this.compilationUnit.types[0] = declaration; |
3513 |
} else { |
3514 |
this.compilationUnit.types = new TypeDeclaration[length]; |
3515 |
this.astPtr -= length; |
3516 |
System.arraycopy(this.astStack, this.astPtr + 1, this.compilationUnit.types, 0, length); |
3517 |
} |
3497 |
} |
3518 |
} |
3498 |
} |
3519 |
} |
3499 |
protected void consumeInvalidConstructorDeclaration() { |
3520 |
protected void consumeInvalidConstructorDeclaration() { |