| java.lang.Object org.eclipse.jdt.internal.compiler.ast.ASTNode org.eclipse.jdt.internal.compiler.ast.Statement org.eclipse.jdt.internal.compiler.ast.Expression
All known Subclasses: org.eclipse.jdt.internal.compiler.ast.CastExpression, org.eclipse.jdt.internal.compiler.ast.TypeReference, org.eclipse.jdt.internal.compiler.ast.AllocationExpression, org.eclipse.jdt.internal.compiler.ast.ArrayInitializer, org.eclipse.jdt.internal.compiler.ast.JavadocArgumentExpression, org.eclipse.jdt.internal.compiler.ast.OperatorExpression, org.eclipse.jdt.internal.compiler.ast.Reference, org.eclipse.jdt.internal.compiler.ast.Literal, org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess, org.eclipse.jdt.internal.compiler.ast.Assignment, org.eclipse.jdt.internal.compiler.ast.MessageSend, org.eclipse.jdt.internal.compiler.ast.Annotation, org.eclipse.jdt.internal.compiler.ast.ArrayAllocationExpression,
Method Summary | |
public FlowInfo | analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) | public 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. | final public boolean | checkCastTypesCompatibility(Scope scope, TypeBinding castType, TypeBinding expressionType, Expression expression) Returns false if cast is not legal. | public 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. | public boolean | checkUnsafeCast(Scope scope, TypeBinding castType, TypeBinding expressionType, TypeBinding match, boolean isNarrowing) | public 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. | public void | generateCode(BlockScope currentScope, CodeStream codeStream) Expression statements are plain expressions, however they generate like
normal expressions with no value required. | public void | generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) Every expression is responsible for generating its implicit conversion when necessary. | public void | generateOptimizedBoolean(BlockScope currentScope, CodeStream codeStream, BranchLabel trueLabel, BranchLabel falseLabel, boolean 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) | final public static boolean | isConstantValueRepresentable(Constant constant, int constantTypeID, int targetTypeID) | public boolean | isTypeReference() | public LocalVariableBinding | localVariableBinding() Returns the local variable referenced by this node. | public void | markAsNonNull() Mark this expression as being non null, per a specific tag in the
source code. | public int | nullStatus(FlowInfo flowInfo) | public Constant | optimizedBooleanConstant() Constant usable for bytecode pattern optimizations, but cannot be inlined
since it is not strictly equivalent to the definition of constant expressions. | public TypeBinding | postConversionType(Scope scope) Returns the type of the expression after required implicit conversions. | public StringBuffer | print(int indent, StringBuffer output) | abstract public StringBuffer | printExpression(int indent, StringBuffer output) | public StringBuffer | printStatement(int indent, StringBuffer output) | public void | resolve(BlockScope scope) | public TypeBinding | resolveType(BlockScope scope) | public TypeBinding | resolveType(ClassScope scope) | public TypeBinding | resolveTypeExpecting(BlockScope scope, TypeBinding expectedType) | public Object | reusableJSRTarget() | public void | setExpectedType(TypeBinding expectedType) Record the type expectation before this expression is typechecked.
e.g. | public void | tagAsNeedCheckCast() | public void | tagAsUnnecessaryCast(Scope scope, TypeBinding castType) Record the fact a cast expression got detected as being unnecessary. | public Expression | toTypeReference() | public void | traverse(ASTVisitor visitor, BlockScope scope) | public void | traverse(ASTVisitor visitor, ClassScope scope) |
implicitConversion | public int implicitConversion(Code) | | |
statementEnd | public int statementEnd(Code) | | |
Expression | public Expression()(Code) | | |
analyseCode | public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, boolean valueRequired)(Code) | | 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.
Parameters: currentScope - Parameters: flowContext - Parameters: flowInfo - Parameters: valueRequired - The state of initialization after the analysis of the current expression |
checkNPE | public void checkNPE(BlockScope scope, FlowContext flowContext, FlowInfo flowInfo)(Code) | | Check the local variable of this expression, if any, against potential NPEs
given a flow context and an upstream flow info. If so, report the risk to
the context. Marks the local as checked, which affects the flow info.
Parameters: scope - the scope of the analysis Parameters: flowContext - the current flow context Parameters: flowInfo - the upstream flow info; caveat: may get modified |
computeConversion | public void computeConversion(Scope scope, TypeBinding runtimeType, TypeBinding compileTimeType)(Code) | | Base types need that the widening is explicitly done by the compiler using some bytecode like i2f.
Also check unsafe type operations.
|
generateCode | public void generateCode(BlockScope currentScope, CodeStream codeStream)(Code) | | Expression statements are plain expressions, however they generate like
normal expressions with no value required.
Parameters: currentScope - org.eclipse.jdt.internal.compiler.lookup.BlockScope Parameters: codeStream - org.eclipse.jdt.internal.compiler.codegen.CodeStream |
generateCode | public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired)(Code) | | Every expression is responsible for generating its implicit conversion when necessary.
Parameters: currentScope - org.eclipse.jdt.internal.compiler.lookup.BlockScope Parameters: codeStream - org.eclipse.jdt.internal.compiler.codegen.CodeStream Parameters: valueRequired - boolean |
generateOptimizedBoolean | public void generateOptimizedBoolean(BlockScope currentScope, CodeStream codeStream, BranchLabel trueLabel, BranchLabel falseLabel, boolean valueRequired)(Code) | | Default generation of a boolean value
Parameters: currentScope - Parameters: codeStream - Parameters: trueLabel - Parameters: falseLabel - Parameters: valueRequired - |
generateOptimizedStringConcatenation | public void generateOptimizedStringConcatenation(BlockScope blockScope, CodeStream codeStream, int typeID)(Code) | | |
generateOptimizedStringConcatenationCreation | public void generateOptimizedStringConcatenationCreation(BlockScope blockScope, CodeStream codeStream, int typeID)(Code) | | |
isCompactableOperation | public boolean isCompactableOperation()(Code) | | |
isConstantValueOfTypeAssignableToType | public boolean isConstantValueOfTypeAssignableToType(TypeBinding constantType, TypeBinding targetType)(Code) | | |
isConstantValueRepresentable | final public static boolean isConstantValueRepresentable(Constant constant, int constantTypeID, int targetTypeID)(Code) | | |
isTypeReference | public boolean isTypeReference()(Code) | | |
localVariableBinding | public LocalVariableBinding localVariableBinding()(Code) | | Returns the local variable referenced by this node. Can be a direct reference (SingleNameReference)
or thru a cast expression etc...
|
markAsNonNull | public void markAsNonNull()(Code) | | Mark this expression as being non null, per a specific tag in the
source code.
|
optimizedBooleanConstant | public Constant optimizedBooleanConstant()(Code) | | Constant usable for bytecode pattern optimizations, but cannot be inlined
since it is not strictly equivalent to the definition of constant expressions.
In particular, some side-effects may be required to occur (only the end value
is known).
Constant known to be of boolean type |
postConversionType | public TypeBinding postConversionType(Scope scope)(Code) | | Returns the type of the expression after required implicit conversions. When expression type gets promoted
or inserted a generic cast, the converted type will differ from the resolved type (surface side-effects from
#computeConversion(...)).
the type after implicit conversion |
resolveType | public TypeBinding resolveType(BlockScope scope)(Code) | | Resolve the type of this expression in the context of a blockScope
Parameters: scope - Return the actual type of this expression after resolution |
resolveType | public TypeBinding resolveType(ClassScope scope)(Code) | | Resolve the type of this expression in the context of a classScope
Parameters: scope - Return the actual type of this expression after resolution |
reusableJSRTarget | public Object reusableJSRTarget()(Code) | | Returns an object which can be used to identify identical JSR sequence targets
(see TryStatement subroutine codegen)
or null if not reusable
|
setExpectedType | public void setExpectedType(TypeBinding expectedType)(Code) | | Record the type expectation before this expression is typechecked.
e.g. String s = foo();, foo() will be tagged as being expected of type String
Used to trigger proper inference of generic method invocations.
Parameters: expectedType - The type denoting an expectation in the context of an assignment conversion |
tagAsNeedCheckCast | public void tagAsNeedCheckCast()(Code) | | |
tagAsUnnecessaryCast | public void tagAsUnnecessaryCast(Scope scope, TypeBinding castType)(Code) | | Record the fact a cast expression got detected as being unnecessary.
Parameters: scope - Parameters: castType - |
traverse | public void traverse(ASTVisitor visitor, BlockScope scope)(Code) | | Traverse an expression in the context of a blockScope
Parameters: visitor - Parameters: scope - |
traverse | public void traverse(ASTVisitor visitor, ClassScope scope)(Code) | | Traverse an expression in the context of a classScope
Parameters: visitor - Parameters: scope - |
Methods inherited from org.eclipse.jdt.internal.compiler.ast.Statement | abstract public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo)(Code)(Java Doc) public void branchChainTo(BranchLabel label)(Code)(Java Doc) public boolean complainIfUnreachable(FlowInfo flowInfo, BlockScope scope, boolean didAlreadyComplain)(Code)(Java Doc) public void generateArguments(MethodBinding binding, Expression[] arguments, BlockScope currentScope, CodeStream codeStream)(Code)(Java Doc) abstract public void generateCode(BlockScope currentScope, CodeStream codeStream)(Code)(Java Doc) public boolean isEmptyBlock()(Code)(Java Doc) public boolean isValidJavaStatement()(Code)(Java Doc) public StringBuffer print(int indent, StringBuffer output)(Code)(Java Doc) abstract public StringBuffer printStatement(int indent, StringBuffer output)(Code)(Java Doc) abstract public void resolve(BlockScope scope)(Code)(Java Doc) public Constant resolveCase(BlockScope scope, TypeBinding testType, SwitchStatement switchStatement)(Code)(Java Doc)
|
Methods inherited from org.eclipse.jdt.internal.compiler.ast.ASTNode | public static void checkInvocationArguments(BlockScope scope, Expression receiver, TypeBinding receiverType, MethodBinding method, Expression[] arguments, TypeBinding[] argumentTypes, boolean argsContainCast, InvocationSite invocationSite)(Code)(Java Doc) public ASTNode concreteStatement()(Code)(Java Doc) final public boolean isFieldUseDeprecated(FieldBinding field, Scope scope, boolean isStrictlyAssigned)(Code)(Java Doc) public boolean isImplicitThis()(Code)(Java Doc) final public boolean isMethodUseDeprecated(MethodBinding method, Scope scope, boolean isExplicitUse)(Code)(Java Doc) public boolean isSuper()(Code)(Java Doc) public boolean isThis()(Code)(Java Doc) final public boolean isTypeUseDeprecated(TypeBinding type, Scope scope)(Code)(Java Doc) abstract public StringBuffer print(int indent, StringBuffer output)(Code)(Java Doc) public static StringBuffer printAnnotations(Annotation[] annotations, StringBuffer output)(Code)(Java Doc) public static StringBuffer printIndent(int indent, StringBuffer output)(Code)(Java Doc) public static StringBuffer printModifiers(int modifiers, StringBuffer output)(Code)(Java Doc) public static void resolveAnnotations(BlockScope scope, Annotation[] annotations, Binding recipient)(Code)(Java Doc) public static void resolveDeprecatedAnnotations(BlockScope scope, Annotation[] annotations, Binding recipient)(Code)(Java Doc) public int sourceEnd()(Code)(Java Doc) public int sourceStart()(Code)(Java Doc) public String toString()(Code)(Java Doc) public void traverse(ASTVisitor visitor, BlockScope scope)(Code)(Java Doc)
|
|
|