24#ifndef __ACT_ARRAY_H__
25#define __ACT_ARRAY_H__
28#include <common/list.h>
219 void Print (FILE *fp,
int style = 0);
228 void sPrint (
char *buf,
int sz,
int style = 0);
509 void Print (FILE *fp,
int style = 0);
Array expressions.
Definition: act_array.h:529
AExpr * GetLeft()
access left component
Definition: act_array.h:554
enum type t
simple/compound expression type
Definition: act_array.h:609
InstType * getInstType(Scope *s, int *islocal, int expanded=0)
void sPrint(char *buf, int sz)
print array expression to string
AExpr(type t, AExpr *l, AExpr *r)
AExpr * r
Definition: act_array.h:615
int isBase()
Definition: act_array.h:591
void Print(FILE *fp)
print array expression
AExpr * GetRight()
access right component
Definition: act_array.h:555
AExpr * l
Definition: act_array.h:615
type
Definition: act_array.h:535
@ EXPR
Definition: act_array.h:536
@ COMMA
Definition: act_array.h:536
@ CONCAT
Definition: act_array.h:536
void SetRight(AExpr *a)
assign right component to a
Definition: act_array.h:557
AExpr * Clone()
deep copy of array expression
AExpr * Expand(ActNamespace *, Scope *, int is_lval=0)
Class for stepping through an array expression element-by-element.
Definition: act_array.h:631
list_t * stack
stack of AExprs to be processed
Definition: act_array.h:669
void getID(ActId **id, int *idx, int *typesize)
Expr * const_expr
current constant expression, or:
Definition: act_array.h:673
Scope * s
scope in which to evaluate
Definition: act_array.h:684
ValueIdx * vx
base value idx
Definition: act_array.h:683
AExprstep(AExpr *a)
construct an array expression stepper
Arraystep * a
if it is an array or subrange
Definition: act_array.h:677
unsigned long getPInt()
get the current pint value
int isend()
returns 1 on an end of array, 0 otherwise
InstType * getPType()
get the current ptype value
long getPInts()
get the current signed pint(not used)
double getPReal()
get the current preal value
AExpr * cur
current element being processed
Definition: act_array.h:670
struct AExprstep::@3::@4 id
int getPBool()
get the current pbool value
void step()
advance by one element
int issimple
1 if this is a raw id
Definition: act_array.h:679
unsigned int type
Definition: act_array.h:688
ActId * act_id
identifier
Definition: act_array.h:676
void getsimpleID(ActId **id, int *idx, int *typesize)
This class is used to store Act identifiers that correspond to instances. Identifiers have an optiona...
Definition: act_id.h:56
The ActNamespace class holds all the information about a namespace.
Definition: namespaces.h:469
Dense arrays, sparse arrays, and array dereferences.
Definition: act_array.h:65
int overlapping(struct range *a, struct range *b)
void sPrint(char *buf, int sz, int style=0)
unsigned int expanded
Definition: act_array.h:440
Expr * lo(int d)
Definition: act_array.h:288
int isEqual(Array *a, int strict)
int isrange(int d)
Definition: act_array.h:281
int isDeref()
Definition: act_array.h:122
int in_range(Array *a)
offset within a range, -1 if missing
Array * CloneOne()
only return a deep copy of the current dense range
void mkArray()
Definition: act_array.h:128
int in_range(int *a)
offset within a range, -1 if missing
Array(Expr *e, Expr *f=NULL)
void PrintOne(FILE *fp, int style=0)
void dumprange(struct range *r)
void Print(FILE *fp, int style=0)
int isSparse()
Definition: act_array.h:116
Array * Expand(ActNamespace *ns, Scope *s, int is_ref=0)
unsigned int range_sz
Definition: act_array.h:430
int sPrintOne(char *buf, int sz, int style=0)
int nDims()
Definition: act_array.h:133
unsigned int deref
Definition: act_array.h:437
int isExpanded()
Definition: act_array.h:260
void update_range(int d, int lo, int hi)
Array * unOffset(int offset)
Array * next
Definition: act_array.h:433
Arraystep * stepper(Array *sub=NULL)
int dims
Definition: act_array.h:395
Array * ExpandRefCHP(ActNamespace *ns, Scope *s)
int isDimCompatible(Array *a)
Expr * hi(int d)
Definition: act_array.h:295
Array * Clone()
returns a deep copy of the entire array
Array * Next()
Definition: act_array.h:251
Array * ExpandRef(ActNamespace *ns, Scope *s)
Definition: act_array.h:313
void _merge_range(int idx, Array *prev, struct range *m)
Class for stepping through an array.
Definition: act_array.h:470
void step()
advance to the next element in the array
Arraystep(Array *a, Array *sub=NULL)
void Print(FILE *fp, int style=0)
Array * insubrange
part of subrange walker state
Definition: act_array.h:516
int index(Array *b)
Definition: act_array.h:487
int index()
Definition: act_array.h:484
int idx
used to track the current index
Definition: act_array.h:512
char * string(int style=0)
int typesize()
Definition: act_array.h:494
int * deref
used to track the current array de-reference
Definition: act_array.h:513
Array * subrange
the subrange, if any
Definition: act_array.h:515
Array * base
the base array
Definition: act_array.h:514
An instance type.
Definition: inst.h:92
This is the data structure that holds all instances and their associated types within a scope....
Definition: namespaces.h:77
This class is used to create an instance in a scope. The name comes from the fact that this is used t...
Definition: value.h:342
A range specifier that can include parameters/etc. This is used during parsing, prior to expansion.
Definition: act_array.h:80
Expr * lo
Definition: act_array.h:81
Expr * hi
Definition: act_array.h:81
A range specifier post expansion where all parameters/etc. are substituted, resulting in a constant r...
Definition: act_array.h:94
long lo
Definition: act_array.h:95
long hi
Definition: act_array.h:95
Used to hold the result of an expanded array range reference.
Definition: act_array.h:102
Expr * deref
for case 2, dynamic de-reference
Definition: act_array.h:107
unsigned int isrange
Definition: act_array.h:103
struct _act_array_exprex_pair idx
for case 0 and 1
Definition: act_array.h:106
Definition: act_array.h:401
struct _act_array_expr_pair ue
unexanded range
Definition: act_array.h:403
struct _act_array_internal ex
expanded range
Definition: act_array.h:404