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

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
 
InstTypegetPType ()
 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
 
AExprcur
 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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AExprstep()

AExprstep::AExprstep ( AExpr a)

construct an array expression stepper

◆ ~AExprstep()

AExprstep::~AExprstep ( )

Member Function Documentation

◆ getID()

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

Parameters
idused to return the ID
idxused to return the index
typesizeused to return the size of the range

◆ getPBool()

int AExprstep::getPBool ( )

get the current pbool value

◆ getPInt()

unsigned long AExprstep::getPInt ( )

get the current pint value

◆ getPInts()

long AExprstep::getPInts ( )

get the current signed pint(not used)

◆ getPReal()

double AExprstep::getPReal ( )

get the current preal value

◆ getPType()

InstType * AExprstep::getPType ( )

get the current ptype value

◆ getsimpleID()

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.

◆ isend()

int AExprstep::isend ( )

returns 1 on an end of array, 0 otherwise

◆ isSimpleID()

int AExprstep::isSimpleID ( )
Returns
1 if this is a simple ID, 0 otherwise.

◆ step()

void AExprstep::step ( )

advance by one element

Member Data Documentation

◆ a

Arraystep* AExprstep::a

if it is an array or subrange

array deref within the id, in case it is an array

◆ act_id

ActId* AExprstep::act_id

identifier

◆ const_expr

Expr* AExprstep::const_expr

current constant expression, or:

◆ cur

AExpr* AExprstep::cur
private

current element being processed

◆ 

struct { ... } AExprstep::id

◆ issimple

int AExprstep::issimple

1 if this is a raw id

◆ s

Scope* AExprstep::s

scope in which to evaluate

◆ stack

list_t* AExprstep::stack
private

stack of AExprs to be processed

◆ type

unsigned int AExprstep::type
private

0 = none, 1 = const, 2 = id, 3 = value array

◆ 

union { ... } AExprstep::u

◆ vx [1/2]

ValueIdx* AExprstep::vx

base value idx

◆  [2/2]

struct { ... } AExprstep::vx

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