at.dms.kjc
Interface CInitializable

All Known Implementing Classes:
JClassFieldExpression, JLocalVariableExpression, JArrayAccessExpression

public interface CInitializable

Interface for all left-value expression.


Method Summary
 void genEndStoreCode(CodeSequence code, boolean discardValue)
          Generates a sequence of bytecodes that must be generated after the right-side expression, to complete the store operation that stores the right side of the assignment expression in this lvalue.
 void genStartStoreCode(CodeSequence code)
          Generates a sequence of bytecodes that must be generated before the right-side expression, to store the right side of the assignment expression in this lvalue.
 void initialize(CBodyContext ctxt)
          Initialize this object.
 boolean isInitialized(CExpressionContext context)
          Returns true if this expression is a variable that is already initialized.
 boolean isLValue(CExpressionContext context)
          Returns true if this expression is an LValue at call time.
 

Method Detail

isLValue

public boolean isLValue(CExpressionContext context)
Returns true if this expression is an LValue at call time.
Returns:
true if this expression is an LValue at call time. Note: a final variable is a lvalue until it is initialized.

initialize

public void initialize(CBodyContext ctxt)
                throws UnpositionedError
Initialize this object.
Throws:
UnpositionedError - An error if this object can't actually be assigned. This may happen with final variables.

isInitialized

public boolean isInitialized(CExpressionContext context)
Returns true if this expression is a variable that is already initialized.
Returns:
true if this expression is a variable that is already initialized.

genStartStoreCode

public void genStartStoreCode(CodeSequence code)
Generates a sequence of bytecodes that must be generated before the right-side expression, to store the right side of the assignment expression in this lvalue. Note: in the case of a compound assignment, some operation may be performed on the right side expression before storing.
Parameters:
code - The code list

genEndStoreCode

public void genEndStoreCode(CodeSequence code,
                            boolean discardValue)
Generates a sequence of bytecodes that must be generated after the right-side expression, to complete the store operation that stores the right side of the assignment expression in this lvalue. Note: in the case of a compound assignment, some operation may be performed on the right side expression before storing.
Parameters:
discardValue - Whether the value of the assignment expression is discarded. (The value of an assignment expression is the value that has been stored in the lvalue.)
code - The code list