ACT Library
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
AExpr Class Reference

Array expressions. More...

#include <act_array.h>

Public Types

enum  type { CONCAT , COMMA , EXPR }
 

Public Member Functions

 AExpr (ActId *e)
 
 AExpr (Expr *e)
 
 AExpr (type t, AExpr *l, AExpr *r)
 
 ~AExpr ()
 
int isEqual (AExpr *a)
 
AExprGetLeft ()
 access left component
 
AExprGetRight ()
 access right component
 
void SetRight (AExpr *a)
 assign right component to a
 
void Print (FILE *fp)
 print array expression
 
void sPrint (char *buf, int sz)
 print array expression to string
 
AExprClone ()
 deep copy of array expression
 
InstTypegetInstType (Scope *s, int *islocal, int expanded=0)
 
AExprExpand (ActNamespace *, Scope *, int is_lval=0)
 
ActIdtoid ()
 
int isBase ()
 
AExprstepstepper ()
 
InstTypeisType ()
 
int isArrayExpr ()
 

Private Attributes

enum type t
 simple/compound expression type
 
AExprl
 
AExprr
 

Friends

class AExprstep
 

Detailed Description

Array expressions.

This is used to hold the array expression syntax for ACT.

Member Enumeration Documentation

◆ type

An array expression is either a basic expression, a concatenation, or a comma

Enumerator
CONCAT 
COMMA 
EXPR 

Constructor & Destructor Documentation

◆ AExpr() [1/3]

AExpr::AExpr ( ActId e)

return an array expression corresponding to the ID

◆ AExpr() [2/3]

AExpr::AExpr ( Expr e)

return an array expression corresponding to an Expr

◆ AExpr() [3/3]

AExpr::AExpr ( type  t,
AExpr l,
AExpr r 
)

combine two array expressions into a new one based on the specified type

◆ ~AExpr()

AExpr::~AExpr ( )

Member Function Documentation

◆ Clone()

AExpr * AExpr::Clone ( )

deep copy of array expression

◆ Expand()

AExpr * AExpr::Expand ( ActNamespace ,
Scope ,
int  is_lval = 0 
)

expand out all parameters

◆ getInstType()

InstType * AExpr::getInstType ( Scope s,
int *  islocal,
int  expanded = 0 
)

Return an InstType corresponding to this array expression

Parameters
sis the scope
islocalif non-NULL, used to return 1 if this array expression only has local ID references, 0 otherwise
expandedis used if the instance type should expect expanded types. In this case the correct array dimensions are computed.
Returns
the newly allocated InstType corresponding to the type of the array expression.

◆ GetLeft()

AExpr * AExpr::GetLeft ( )
inline

access left component

◆ GetRight()

AExpr * AExpr::GetRight ( )
inline

access right component

◆ isArrayExpr()

int AExpr::isArrayExpr ( )

return 1 if this is an ID that evaluated to an array expression (E_ARRAY), 0 otherwise

◆ isBase()

int AExpr::isBase ( )
inline
Returns
1 if this is the "base case" for an array expression (i.e. a simple expression), 0 otherwise

◆ isEqual()

int AExpr::isEqual ( AExpr a)

Check if two array expressions are equal

◆ isType()

InstType * AExpr::isType ( )

return NULL if this is not a type (E_TYPE), the actual type otherwise.

◆ Print()

void AExpr::Print ( FILE *  fp)

print array expression

◆ SetRight()

void AExpr::SetRight ( AExpr a)
inline

assign right component to a

◆ sPrint()

void AExpr::sPrint ( char *  buf,
int  sz 
)

print array expression to string

◆ stepper()

AExprstep * AExpr::stepper ( )

Array expressions can be quite complex. This returns an array expression stepper (similar to Arraystep) that walks through the components of the array expression element by element.

Returns
the array expression stepper that can walk through this array expression.

◆ toid()

ActId * AExpr::toid ( )

For this to work, the array expression must correspond to a single ActId only.

Returns
the ActId corresponding to this array expression

Friends And Related Function Documentation

◆ AExprstep

friend class AExprstep
friend

Member Data Documentation

◆ l

AExpr* AExpr::l
private

an element of the expression for compound array expressions. l is also used as an Expr * for the base case

◆ r

AExpr * AExpr::r
private

an elements of the expression for compound array expressions

◆ t

enum type AExpr::t
private

simple/compound expression type


The documentation for this class was generated from the following file: