Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members

CCM::ArrayExpr Class Reference

Inheritance diagram for CCM::ArrayExpr:

CCM::Expr List of all members.

Detailed Description

Array type expression.


Public Types

enum  Op {
  LITERAL, NEW, ID, ASSIGN,
  ELEMENT, SETELEMENT
}
 Possible operations. More...


Public Member Functions

 ArrayExpr (Ref id, Type elemType)
 Create a variable / stub property reference expression.

 ArrayExpr (Type elemType, IntExpr size)
 Create new expression: new elemType[size].

 ArrayExpr (Ref id, Expr e, Type elemType)
 Create assignment expression.

 ArrayExpr (List lit, Type elemType)
 Create a literal expression with given value.

 ArrayExpr (ArrayExpr array, IntExpr index)
 Create array element access expression to array[index].

 ArrayExpr (ArrayExpr array, IntExpr index, Expr value)
 Create array element assignment expression: array[index] = value.

override Type type ()
 Return the expression type.

Type elementType ()
 Return the type of contained elements.

Object getElement (int index)
 Return the value of thisarray[index].

void setElement (int index, Object value)
 Set the value of thisarray[index] = value.

override Object eval ()
 Evaluate expression and return its value.

override Expr makeElementAssign (Expr value)
 Return an expression that assigns value to the element if called on an array element access expression.

override string ToString ()

Private Attributes

Op op
List value
Type elemType


Member Enumeration Documentation

enum CCM::ArrayExpr::Op
 

Possible operations.

Enumeration values:
LITERAL 
NEW 
ID 
ASSIGN 
ELEMENT 
SETELEMENT 


Constructor & Destructor Documentation

CCM::ArrayExpr::ArrayExpr Ref  id,
Type  elemType
 

Create a variable / stub property reference expression.

CCM::ArrayExpr::ArrayExpr Type  elemType,
IntExpr  size
 

Create new expression: new elemType[size].

CCM::ArrayExpr::ArrayExpr Ref  id,
Expr  e,
Type  elemType
 

Create assignment expression.

Parameters:
id Reference to assign to
e Expression to assign to id
elemType Type of the contained elements

CCM::ArrayExpr::ArrayExpr List  lit,
Type  elemType
 

Create a literal expression with given value.

CCM::ArrayExpr::ArrayExpr ArrayExpr  array,
IntExpr  index
 

Create array element access expression to array[index].

CCM::ArrayExpr::ArrayExpr ArrayExpr  array,
IntExpr  index,
Expr  value
 

Create array element assignment expression: array[index] = value.


Member Function Documentation

Type CCM::ArrayExpr::elementType  ) 
 

Return the type of contained elements.

override Object CCM::ArrayExpr::eval  )  [virtual]
 

Evaluate expression and return its value.

Stub access expressions add transitions to the currently evaluated process.

Implements CCM::Expr.

Object CCM::ArrayExpr::getElement int  index  ) 
 

Return the value of thisarray[index].

See also:
Expr.doElemAccess

override Expr CCM::ArrayExpr::makeElementAssign Expr  value  )  [virtual]
 

Return an expression that assigns value to the element if called on an array element access expression.

Implements CCM::Expr.

void CCM::ArrayExpr::setElement int  index,
Object  value
 

Set the value of thisarray[index] = value.

See also:
Expr.doElemAssignment

override string CCM::ArrayExpr::ToString  ) 
 

override Type CCM::ArrayExpr::type  )  [virtual]
 

Return the expression type.

This is generally the type of the expression value, not of the Expr itself (e. g. "int", not "IntExpr").

Implements CCM::Expr.


Member Data Documentation

Type CCM::ArrayExpr::elemType [private]
 

Op CCM::ArrayExpr::op [private]
 

List CCM::ArrayExpr::value [private]
 


The documentation for this class was generated from the following file:
Generated on Mon Jun 21 01:20:50 2004 for cs2ccmb by doxygen 1.3.7