ACT Library
|
Class for stepping through an array expression element-by-element. More...
#include <act_array.h>
Public Member Functions | |
AExprstep (AExpr *a) | |
construct an array expression stepper | |
~AExprstep () | |
void | step () |
advance by one element | |
int | isend () |
returns 1 on an end of array, 0 otherwise | |
unsigned long | getPInt () |
get the current pint value | |
long | getPInts () |
get the current signed pint(not used) | |
double | getPReal () |
get the current preal value | |
int | getPBool () |
get the current pbool value | |
InstType * | getPType () |
get the current ptype value | |
void | getID (ActId **id, int *idx, int *typesize) |
void | getsimpleID (ActId **id, int *idx, int *typesize) |
int | isSimpleID () |
Private Attributes | |
list_t * | stack |
stack of AExprs to be processed | |
AExpr * | cur |
current element being processed | |
union { | |
Expr * const_expr | |
current constant expression, or: More... | |
struct { | |
ActId * act_id | |
identifier More... | |
Arraystep * a | |
int issimple:1 | |
1 if this is a raw id More... | |
} id | |
struct { | |
ValueIdx * vx | |
base value idx More... | |
Scope * s | |
scope in which to evaluate More... | |
Arraystep * a | |
if it is an array or subrange More... | |
} vx | |
} | u |
unsigned int | type:2 |
Class for stepping through an array expression element-by-element.
The value accessor method depends on the type of the array expression. Only one of them will work correctly, and it is up to the user to call the correct one.
AExprstep::AExprstep | ( | AExpr * | a | ) |
construct an array expression stepper
AExprstep::~AExprstep | ( | ) |
void AExprstep::getID | ( | ActId ** | id, |
int * | idx, | ||
int * | typesize | ||
) |
get the current identifier. If the identifier is an array element, then *idx is used to return the linear offset within the array, and *typesize is used to return the size of the current range
id | used to return the ID |
idx | used to return the index |
typesize | used to return the size of the range |
int AExprstep::getPBool | ( | ) |
get the current pbool value
unsigned long AExprstep::getPInt | ( | ) |
get the current pint value
long AExprstep::getPInts | ( | ) |
get the current signed pint(not used)
double AExprstep::getPReal | ( | ) |
get the current preal value
InstType * AExprstep::getPType | ( | ) |
get the current ptype value
void AExprstep::getsimpleID | ( | ActId ** | id, |
int * | idx, | ||
int * | typesize | ||
) |
This permits a dense ID to be returned as a single simple ID. Otherwise it is similar to getID(). This is used to support array to array direct connections.
int AExprstep::isend | ( | ) |
returns 1 on an end of array, 0 otherwise
int AExprstep::isSimpleID | ( | ) |
void AExprstep::step | ( | ) |
advance by one element
Arraystep* AExprstep::a |
if it is an array or subrange
array deref within the id, in case it is an array
ActId* AExprstep::act_id |
identifier
Expr* AExprstep::const_expr |
current constant expression, or:
|
private |
current element being processed
struct { ... } AExprstep::id |
int AExprstep::issimple |
1 if this is a raw id
Scope* AExprstep::s |
scope in which to evaluate
|
private |
stack of AExprs to be processed
|
private |
0 = none, 1 = const, 2 = id, 3 = value array
union { ... } AExprstep::u |
ValueIdx* AExprstep::vx |
base value idx
struct { ... } AExprstep::vx |