editing disabled
vivdesh
guest · Join · Help · Sign In · Wikispaces

Protected
Data Structures Used in Implementation
The properties of loop are stored in the data structure ‘loop’ such as upper bound lower bound, index pointer to first instruction in the loop and so on. The data structure is shown below,
typedef struct loop
{
char index[10];
int isnormal;
int depth; depth is equivalent to level
int rdepth;
int lB,uB,step_size;
struct stmnt_or_loop *stmnt_start;
struct loop *parent_loop;
}loop_t;

The properties of statement are stored in the data structure stmnt such as variable is scalar or array reference and so on.
typedef struct stmnt
{
int type; 0- arithmetic ; 2 - other
struct v_node *lhs; v_node ptr to a scalar or array variable
struct v_node *rhs; variables used in this statement
char *src_stat;
struct loop *parent_loop;
}stmnt_t;

A very useful v_node data structure is used to represent the elements of the statement in the form of tree which is shown below. This data strcture forms the elements in the tree. Such tree is formed for each element.
typedef struct v_node
 
{
 
int type; 0-leaf 1-non-leaf
int subtype; for leaf which type of operand ; //for non-leaf which operator
char sym[10]; if leaf, this is the variable
struct v_node *left;
struct v_node *right;
struct v_uode *scrpt_exprs[2]; //for arrays this is expr for max. 2 subscripts
double value;
}v_node_t;

Home
Loading...
Home Turn Off "Getting Started"
Loading...