X-Git-Url: https://www.kengrimes.com/gitweb/?p=henge%2Fapc.git;a=blobdiff_plain;f=src%2Fir.c;h=316486dfb7ff370fc71d529327707f7936cf4d6a;hp=8652ddca2b733d21d6e9a3e7cc5d6281308e2e61;hb=19d01f115230c63000ccb312866016f63c5e1e23;hpb=4f883c6be14a9721cd1793373b522dcf6a57f878 diff --git a/src/ir.c b/src/ir.c index 8652ddc..316486d 100644 --- a/src/ir.c +++ b/src/ir.c @@ -152,14 +152,14 @@ insert_framesheet(struct name*, int, int, int, int, uint8_t*); -/* Dynamically allocate memory for a class data structure, - or cdat, after a class has been identified in a grammar. - We also create a stack of class pointers so that - we can access the cdat during processing of that - cdats sets and elements, a requirement because the - nature of recursive classes prevents us from accessing - the cdat based on the previous index into cdat_buf, - which is a list of all allocated cdats +/* Dynamically allocate memory for a class data structure, */ +/* or cdat, after a class has been identified in a grammar. */ +/* We also create a stack of class pointers so that */ +/* we can access the cdat during processing of that */ +/* cdats sets and elements, a requirement because the */ +/* nature of recursive classes prevents us from accessing */ +/* the cdat based on the previous index into cdat_buf, */ +/* which is a list of all allocated cdats */ /* Cdats: A cdat is a class data structure. Cdats serve as the central */ /* data types of the IR. Cdats contain pointers to their subclasses so that the relationship between */ /* classes can be determined, but the subclasses are not represented inside */ @@ -385,7 +385,6 @@ ir_init() u8_stpncpy(name.name, root, 4); pagesize = sysconf(_SC_PAGESIZE); - printf("pagesize is %l\n", pagesize); INIT_CDAT(); *cdat_stackp = CURRENT_CDAT(); @@ -736,8 +735,6 @@ insert_set_namelist } } - done: - ; } /*. We create new odats for each map variant that are children of the current odat/set @@ -791,7 +788,7 @@ insert_map insert_ref(curr_mem_odatp, refid); /* If current odatp on stack has a link, then we need to make our own link. just set the vdat_idx */ - if(CURR_SS_ODATP()->vdat_idx = 0) + if(CURR_SS_ODATP()->vdat_idx == 0) { //alloc a link linkp = alloc_link(); linkp->type = CURR_SS_ODATP()->linkp->type; @@ -968,17 +965,18 @@ insert_ref void insert_vdat () -{ struct odat* curr_ss_odatp; - struct vdat* curr_vdatp; +{ struct vdat* curr_vdatp; + + curr_vdatp = curr_vdat(); - curr_vdatp->creator = curr_ss_odatp; - curr_ss_odatp->vdat_idx = num_vdats; - curr_ss_odatp->vdatp = curr_vdatp; + curr_vdatp->creator = CURR_SS_ODATP(); + CURR_SS_ODATP()->vdat_idx = num_vdats; + CURR_SS_ODATP()->vdatp = curr_vdatp; alloc_vdat(); } void -insert_refid_statement +insert_statement ( refid ) int refid; { CURR_SS_ODATP()->refid = refid;