1 11 package org.eclipse.jdt.internal.compiler.ast; 12 13 import org.eclipse.jdt.internal.compiler.lookup.BlockScope; 14 import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; 15 import org.eclipse.jdt.internal.compiler.codegen.CodeStream; 16 import org.eclipse.jdt.internal.compiler.flow.FlowContext; 17 import org.eclipse.jdt.internal.compiler.flow.FlowInfo; 18 import org.eclipse.jdt.internal.compiler.ASTVisitor; 19 20 public class EmptyStatement extends Statement { 21 22 public EmptyStatement(int startPosition, int endPosition) { 23 this.sourceStart = startPosition; 24 this.sourceEnd = endPosition; 25 } 26 27 public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) { 28 return flowInfo; 29 } 30 31 public boolean complainIfUnreachable(FlowInfo flowInfo, BlockScope scope, boolean didAlreadyComplain) { 33 34 if (scope.compilerOptions().complianceLevel < ClassFileConstants.JDK1_4) { 36 return false; 37 } 38 return super.complainIfUnreachable(flowInfo, scope, didAlreadyComplain); 39 } 40 41 public void generateCode(BlockScope currentScope, CodeStream codeStream){ 42 } 44 45 public StringBuffer printStatement(int tab, StringBuffer output) { 46 return printIndent(tab, output).append(';'); 47 } 48 49 public void resolve(BlockScope scope) { 50 if ((bits & IsUsefulEmptyStatement) == 0) { 51 scope.problemReporter().superfluousSemicolon(this.sourceStart, this.sourceEnd); 52 } else { 53 scope.problemReporter().emptyControlFlowStatement(this.sourceStart, this.sourceEnd); 54 } 55 } 56 57 public void traverse(ASTVisitor visitor, BlockScope scope) { 58 visitor.visit(this, scope); 59 visitor.endVisit(this, scope); 60 } 61 62 63 } 64 65 | Popular Tags |