List of usage examples for org.eclipse.jdt.internal.compiler.ast Expression Expression
public Expression()
From source file:org.eclipse.objectteams.otdt.internal.core.compiler.util.AstGenerator.java
License:Open Source License
/** * Assemble an ifstatement with negated condition, that hides the branch instruction from the debugger, * even when stepping into the condition. *///from www. j ava 2 s . c o m public IfStatement stealthIfNotStatement(final Expression condition, Statement thenStatement) { // mark step-over after the condition: Expression recordingCondition = new Expression() { public StringBuffer printExpression(int indent, StringBuffer output) { return condition.print(indent, output); } public TypeBinding resolveType(BlockScope scope) { return condition.resolveType(scope); } public void computeConversion(Scope scope, TypeBinding runtimeType, TypeBinding compileTimeType) { condition.computeConversion(scope, runtimeType, compileTimeType); this.constant = condition.constant; this.bits = condition.bits; } public Constant optimizedBooleanConstant() { this.constant = condition.optimizedBooleanConstant(); this.bits = condition.bits; return this.constant; } public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, boolean valueRequired) { return condition.analyseCode(currentScope, flowContext, flowInfo, valueRequired); } public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) { return condition.analyseCode(currentScope, flowContext, flowInfo); } public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) { condition.generateCode(currentScope, codeStream, valueRequired); // payload: codeStream.pcToSourceMap[codeStream.pcToSourceMapSize++] = codeStream.position; codeStream.pcToSourceMap[codeStream.pcToSourceMapSize++] = STEP_OVER_LINENUMBER; } }; return new IfStatement(new UnaryExpression( // NOT recordingCondition, OperatorIds.NOT), thenStatement, this.sourceStart, this.sourceEnd); }