|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jdt.internal.compiler.ast.ASTNode
org.eclipse.jdt.internal.compiler.ast.Statement
org.eclipse.jdt.internal.compiler.ast.Expression
public abstract class Expression
Field Summary | |
---|---|
Constant |
constant
|
int |
implicitConversion
|
TypeBinding |
resolvedType
|
int |
statementEnd
|
Constructor Summary | |
---|---|
Expression()
|
Method Summary | |
---|---|
FlowInfo |
analyseCode(BlockScope currentScope,
FlowContext flowContext,
FlowInfo flowInfo)
|
FlowInfo |
analyseCode(BlockScope currentScope,
FlowContext flowContext,
FlowInfo flowInfo,
boolean valueRequired)
More sophisticated for of the flow analysis used for analyzing expressions, and be able to optimize out portions of expressions where no actual value is required. |
boolean |
checkCastTypesCompatibility(Scope scope,
TypeBinding castType,
TypeBinding expressionType,
Expression expression)
Returns false if cast is not legal. |
void |
checkNPE(BlockScope scope,
FlowContext flowContext,
FlowInfo flowInfo)
Check the local variable of this expression, if any, against potential NPEs given a flow context and an upstream flow info. |
boolean |
checkUnsafeCast(Scope scope,
TypeBinding castType,
TypeBinding expressionType,
TypeBinding match,
boolean isNarrowing)
|
void |
computeConversion(Scope scope,
TypeBinding runtimeType,
TypeBinding compileTimeType)
Base types need that the widening is explicitly done by the compiler using some bytecode like i2f. |
void |
generateCode(BlockScope currentScope,
CodeStream codeStream)
Expression statements are plain expressions, however they generate like normal expressions with no value required. |
void |
generateCode(BlockScope currentScope,
CodeStream codeStream,
boolean valueRequired)
Every expression is responsible for generating its implicit conversion when necessary. |
void |
generateOptimizedBoolean(BlockScope currentScope,
CodeStream codeStream,
BranchLabel trueLabel,
BranchLabel falseLabel,
boolean valueRequired)
Default generation of a boolean value |
void |
generateOptimizedStringConcatenation(BlockScope blockScope,
CodeStream codeStream,
int typeID)
|
void |
generateOptimizedStringConcatenationCreation(BlockScope blockScope,
CodeStream codeStream,
int typeID)
|
boolean |
isCompactableOperation()
|
boolean |
isConstantValueOfTypeAssignableToType(TypeBinding constantType,
TypeBinding targetType)
|
static boolean |
isConstantValueRepresentable(Constant constant,
int constantTypeID,
int targetTypeID)
|
boolean |
isDeclaredMonoNonNull()
|
boolean |
isDeclaredNonNull()
|
boolean |
isTypeReference()
|
LocalVariableBinding |
localVariableBinding()
Returns the local variable referenced by this node. |
void |
markAsNonNull()
Mark this expression as being non null, per a specific tag in the source code. |
int |
nullStatus(FlowInfo flowInfo)
|
Constant |
optimizedBooleanConstant()
Constant usable for bytecode pattern optimizations, but cannot be inlined since it is not strictly equivalent to the definition of constant expressions. |
TypeBinding |
postConversionType(Scope scope)
Returns the type of the expression after required implicit conversions. |
java.lang.StringBuffer |
print(int indent,
java.lang.StringBuffer output)
|
abstract java.lang.StringBuffer |
printExpression(int indent,
java.lang.StringBuffer output)
|
java.lang.StringBuffer |
printStatement(int indent,
java.lang.StringBuffer output)
|
void |
resolve(BlockScope scope)
|
TypeBinding |
resolveType(BlockScope scope)
Resolve the type of this expression in the context of a blockScope |
TypeBinding |
resolveType(ClassScope scope)
Resolve the type of this expression in the context of a classScope |
TypeBinding |
resolveTypeExpecting(BlockScope scope,
TypeBinding expectedType)
|
java.lang.Object |
reusableJSRTarget()
Returns an object which can be used to identify identical JSR sequence targets (see TryStatement subroutine codegen) or null if not reusable |
void |
setExpectedType(TypeBinding expectedType)
Record the type expectation before this expression is typechecked. |
void |
tagAsNeedCheckCast()
|
void |
tagAsUnnecessaryCast(Scope scope,
TypeBinding castType)
Record the fact a cast expression got detected as being unnecessary. |
Expression |
toTypeReference()
|
void |
traverse(ASTVisitor visitor,
BlockScope scope)
Traverse an expression in the context of a blockScope |
void |
traverse(ASTVisitor visitor,
ClassScope scope)
Traverse an expression in the context of a classScope |
Methods inherited from class org.eclipse.jdt.internal.compiler.ast.Statement |
---|
branchChainTo, complainIfUnreachable, generateArguments, isEmptyBlock, isValidJavaStatement, resolveCase |
Methods inherited from class org.eclipse.jdt.internal.compiler.ast.ASTNode |
---|
checkInvocationArguments, concreteStatement, isFieldUseDeprecated, isImplicitThis, isMethodUseDeprecated, isSuper, isThis, isTypeUseDeprecated, printAnnotations, printIndent, printModifiers, resolveAnnotations, resolveDeprecatedAnnotations, sourceEnd, sourceStart, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Constant constant
public int statementEnd
public int implicitConversion
public TypeBinding resolvedType
Constructor Detail |
---|
public Expression()
Method Detail |
---|
public static final boolean isConstantValueRepresentable(Constant constant, int constantTypeID, int targetTypeID)
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo)
analyseCode
in class Statement
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, boolean valueRequired)
currentScope
- flowContext
- flowInfo
- valueRequired
-
public final boolean checkCastTypesCompatibility(Scope scope, TypeBinding castType, TypeBinding expressionType, Expression expression)
public void checkNPE(BlockScope scope, FlowContext flowContext, FlowInfo flowInfo)
scope
- the scope of the analysisflowContext
- the current flow contextflowInfo
- the upstream flow info; caveat: may get modifiedpublic boolean checkUnsafeCast(Scope scope, TypeBinding castType, TypeBinding expressionType, TypeBinding match, boolean isNarrowing)
public void computeConversion(Scope scope, TypeBinding runtimeType, TypeBinding compileTimeType)
public void generateCode(BlockScope currentScope, CodeStream codeStream)
generateCode
in class Statement
currentScope
- org.eclipse.jdt.internal.compiler.lookup.BlockScopecodeStream
- org.eclipse.jdt.internal.compiler.codegen.CodeStreampublic void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired)
currentScope
- org.eclipse.jdt.internal.compiler.lookup.BlockScopecodeStream
- org.eclipse.jdt.internal.compiler.codegen.CodeStreamvalueRequired
- booleanpublic void generateOptimizedBoolean(BlockScope currentScope, CodeStream codeStream, BranchLabel trueLabel, BranchLabel falseLabel, boolean valueRequired)
currentScope
- codeStream
- trueLabel
- falseLabel
- valueRequired
- public void generateOptimizedStringConcatenation(BlockScope blockScope, CodeStream codeStream, int typeID)
public void generateOptimizedStringConcatenationCreation(BlockScope blockScope, CodeStream codeStream, int typeID)
public boolean isCompactableOperation()
public boolean isConstantValueOfTypeAssignableToType(TypeBinding constantType, TypeBinding targetType)
public boolean isTypeReference()
public LocalVariableBinding localVariableBinding()
public void markAsNonNull()
public int nullStatus(FlowInfo flowInfo)
public Constant optimizedBooleanConstant()
public TypeBinding postConversionType(Scope scope)
public java.lang.StringBuffer print(int indent, java.lang.StringBuffer output)
print
in class Statement
public abstract java.lang.StringBuffer printExpression(int indent, java.lang.StringBuffer output)
public java.lang.StringBuffer printStatement(int indent, java.lang.StringBuffer output)
printStatement
in class Statement
public void resolve(BlockScope scope)
resolve
in class Statement
public TypeBinding resolveType(BlockScope scope)
scope
-
public TypeBinding resolveType(ClassScope scope)
scope
-
public TypeBinding resolveTypeExpecting(BlockScope scope, TypeBinding expectedType)
public java.lang.Object reusableJSRTarget()
null if not reusable
public void setExpectedType(TypeBinding expectedType)
expectedType
- The type denoting an expectation in the context of an assignment conversionpublic void tagAsNeedCheckCast()
public void tagAsUnnecessaryCast(Scope scope, TypeBinding castType)
scope
- castType
- public Expression toTypeReference()
public void traverse(ASTVisitor visitor, BlockScope scope)
traverse
in class ASTNode
visitor
- scope
- public void traverse(ASTVisitor visitor, ClassScope scope)
visitor
- scope
- public boolean isDeclaredNonNull()
public boolean isDeclaredMonoNonNull()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |