import net.sourceforge.phpdt.internal.compiler.parser.UnitParser;
public class Initializer extends FieldDeclaration {
-
+
public Block block;
+
public int lastFieldID;
+
public int bodyStart;
+
public Initializer(Block block, int modifiers) {
this.block = block;
this.modifiers = modifiers;
declarationSourceStart = sourceStart = bodyStart = block.sourceStart;
}
- public FlowInfo analyseCode(
- MethodScope currentScope,
- FlowContext flowContext,
- FlowInfo flowInfo) {
+ public FlowInfo analyseCode(MethodScope currentScope,
+ FlowContext flowContext, FlowInfo flowInfo) {
return block.analyseCode(currentScope, flowContext, flowInfo);
}
/**
- * Code generation for a non-static initializer:
- * standard block code gen
- *
- * @param currentScope net.sourceforge.phpdt.internal.compiler.lookup.BlockScope
- * @param codeStream net.sourceforge.phpdt.internal.compiler.codegen.CodeStream
+ * Code generation for a non-static initializer: standard block code gen
+ *
+ * @param currentScope
+ * net.sourceforge.phpdt.internal.compiler.lookup.BlockScope
+ * @param codeStream
+ * net.sourceforge.phpdt.internal.compiler.codegen.CodeStream
*/
-// public void generateCode(BlockScope currentScope, CodeStream codeStream) {
-//
-// if ((bits & IsReachableMASK) == 0) {
-// return;
-// }
-// int pc = codeStream.position;
-// block.generateCode(currentScope, codeStream);
-// codeStream.recordPositionsFrom(pc, this.sourceStart);
-// }
-
+ // public void generateCode(BlockScope currentScope, CodeStream codeStream)
+ // {
+ //
+ // if ((bits & IsReachableMASK) == 0) {
+ // return;
+ // }
+ // int pc = codeStream.position;
+ // block.generateCode(currentScope, codeStream);
+ // codeStream.recordPositionsFrom(pc, this.sourceStart);
+ // }
public boolean isField() {
return false;
return (modifiers & AccStatic) != 0;
}
- public void parseStatements(
- UnitParser parser,
- TypeDeclaration type,
- CompilationUnitDeclaration unit) {
+ public void parseStatements(UnitParser parser, TypeDeclaration type,
+ CompilationUnitDeclaration unit) {
- //fill up the method body with statement
+ // fill up the method body with statement
parser.parse(this, type, unit);
}
if (isStatic()) {
ReferenceBinding declaringType = scope.enclosingSourceType();
if (declaringType.isNestedType() && !declaringType.isStatic())
- scope.problemReporter().innerTypesCannotDeclareStaticInitializers(
- declaringType,
- this);
+ scope.problemReporter()
+ .innerTypesCannotDeclareStaticInitializers(
+ declaringType, this);
}
block.resolve(scope);
} finally {