Commit aa8b856aeb3e2aafd61486349fbb4f40899e682f

Authored by Georg Hopp
1 parent 5d97b206

some more fixes. Still some errors are left.

@@ -15,4 +15,5 @@ s_block * blockPrev (s_block *); @@ -15,4 +15,5 @@ s_block * blockPrev (s_block *);
15 s_stmtQueue * blockStmts (s_block *); 15 s_stmtQueue * blockStmts (s_block *);
16 s_identList * blockIdl (s_block *); 16 s_identList * blockIdl (s_block *);
17 17
  18 +s_identList * blockGetIdl (s_block *);
18 #endif /* _BLOCK_H_ */ 19 #endif /* _BLOCK_H_ */
  1 +#include <malloc.h>
  2 +
1 #include <identList.h> 3 #include <identList.h>
2 #include <stmtQueue.h> 4 #include <stmtQueue.h>
3 5
4 -typedef struct block s_block;  
5 -  
6 struct block /* a stack of used blocks. */ 6 struct block /* a stack of used blocks. */
7 { 7 {
8 s_stmtQueue * stmts; 8 s_stmtQueue * stmts;
@@ -12,6 +12,11 @@ struct block /* a stack of used blocks. */ @@ -12,6 +12,11 @@ struct block /* a stack of used blocks. */
12 }; 12 };
13 13
14 14
  15 +s_identList *
  16 +blockGetIdl (s_block * block)
  17 +{
  18 + return block->idl;
  19 +}
15 s_block * 20 s_block *
16 blockNew (s_stmtQueue * stmts) 21 blockNew (s_stmtQueue * stmts)
17 { 22 {
@@ -19,7 +24,8 @@ blockNew (s_stmtQueue * stmts) @@ -19,7 +24,8 @@ blockNew (s_stmtQueue * stmts)
19 24
20 new->stmts = stmts; 25 new->stmts = stmts;
21 new->prev = NULL; 26 new->prev = NULL;
22 - new->idl = identListNew (new); 27 + new->idl = identListNew (); /* !!!FIXME: i guess idl should know about
  28 + its block! (Give the block as arg) */
23 29
24 return new; 30 return new;
25 } 31 }
@@ -284,7 +284,7 @@ stmtBlock (s_stmt * stmt, s_block * actBlock) @@ -284,7 +284,7 @@ stmtBlock (s_stmt * stmt, s_block * actBlock)
284 if (id == NULL) 284 if (id == NULL)
285 exitError (0); 285 exitError (0);
286 286
287 - blockSetNonLocalId (args, id); 287 + blockSetNonLocalId (gBlock, id);
288 } 288 }
289 } 289 }
290 290
@@ -309,7 +309,7 @@ stmtIf (s_stmt * stmt, s_block * actBlock) @@ -309,7 +309,7 @@ stmtIf (s_stmt * stmt, s_block * actBlock)
309 _do = stmtQueueGet (args, 2); 309 _do = stmtQueueGet (args, 2);
310 310
311 if (_do != NULL) 311 if (_do != NULL)
312 - stmtDo (_do); 312 + stmtDo (_do, actBlock);
313 313
314 return (u_stmtType) 0; 314 return (u_stmtType) 0;
315 } 315 }
@@ -116,7 +116,7 @@ stmtQueueDo (s_stmtQueue * sQueue) @@ -116,7 +116,7 @@ stmtQueueDo (s_stmtQueue * sQueue)
116 return; 116 return;
117 117
118 for (i = 0; i < sQueue->maxIdx; i++) 118 for (i = 0; i < sQueue->maxIdx; i++)
119 - stmtDo (sQueue->stmts[i]); 119 + stmtDo (sQueue->stmts[i], NULL /* !!!FIXME: give me a sane value!!! */);
120 } 120 }
121 121
122 unsigned 122 unsigned
Please register or login to post a comment