177 |
* which changes the instance tree is called. |
* which changes the instance tree is called. |
178 |
*/ |
*/ |
179 |
|
|
180 |
#define DEBUG_RELS |
/* #define DEBUG_RELS */ |
181 |
/* undef DEBUG_RELS if you want less spew in pass 2 */ |
/* undef DEBUG_RELS if you want less spew in pass 2 */ |
182 |
|
|
183 |
#ifdef DEBUG_RELS |
#ifdef DEBUG_RELS |
8114 |
switch(StatementType(statement)){ |
switch(StatementType(statement)){ |
8115 |
case REL: |
case REL: |
8116 |
#ifdef DEBUG_RELS |
#ifdef DEBUG_RELS |
8117 |
|
error_reporter_start(ASC_PROG_NOTE,NULL,0); |
8118 |
FPRINTF(stderr,"Pass2ExecuteCondStatements: case REL"); |
FPRINTF(stderr,"Pass2ExecuteCondStatements: case REL"); |
8119 |
WriteStatement(stderr, statement, 3); |
WriteStatement(stderr, statement, 3); |
8120 |
|
error_reporter_end_flush(); |
8121 |
#endif |
#endif |
8122 |
return ExecuteREL(inst,statement); |
return ExecuteREL(inst,statement); |
8123 |
case FOR: |
case FOR: |
8124 |
if ( ForContainsRelations(statement) ) { |
if ( ForContainsRelations(statement) ) { |
8125 |
#ifdef DEBUG_RELS |
#ifdef DEBUG_RELS |
8126 |
|
error_reporter_start(ASC_PROG_NOTE,NULL,0); |
8127 |
FPRINTF(stderr,"Pass2ExecuteCondStatements: case FOR"); |
FPRINTF(stderr,"Pass2ExecuteCondStatements: case FOR"); |
8128 |
WriteStatement(stderr, statement, 3); |
WriteStatement(stderr, statement, 3); |
8129 |
|
error_reporter_end_flush(); |
8130 |
#endif |
#endif |
8131 |
return Pass2ExecuteFOR(inst,statement); |
return Pass2ExecuteFOR(inst,statement); |
8132 |
} |
} |
9648 |
return_value = 1; |
return_value = 1; |
9649 |
if ( ForContainsRelations(statement) ) { |
if ( ForContainsRelations(statement) ) { |
9650 |
#ifdef DEBUG_RELS |
#ifdef DEBUG_RELS |
9651 |
|
error_reporter_start(ASC_PROG_NOTE,NULL,0); |
9652 |
WriteStatement(stderr, statement, 6); |
WriteStatement(stderr, statement, 6); |
9653 |
|
error_reporter_end_flush(); |
9654 |
#endif |
#endif |
9655 |
Pass2RealExecuteFOR(inst,statement); |
Pass2RealExecuteFOR(inst,statement); |
9656 |
/* p2ref expected to succeed or fail permanently. |
/* p2ref expected to succeed or fail permanently. |
9665 |
break; |
break; |
9666 |
case REL: |
case REL: |
9667 |
#ifdef DEBUG_RELS |
#ifdef DEBUG_RELS |
9668 |
|
error_reporter_start(ASC_PROG_NOTE,NULL,0); |
9669 |
WriteStatement(stderr, statement, 6); |
WriteStatement(stderr, statement, 6); |
9670 |
|
error_reporter_end_flush(); |
9671 |
#endif |
#endif |
9672 |
return_value = ExecuteREL(inst,statement); |
return_value = ExecuteREL(inst,statement); |
9673 |
/* ER expected to succeed or fail permanently,returning 1. |
/* ER expected to succeed or fail permanently,returning 1. |
10954 |
switch(StatementType(statement)){ /* should be an if relinstance */ |
switch(StatementType(statement)){ /* should be an if relinstance */ |
10955 |
case FOR: |
case FOR: |
10956 |
#ifdef DEBUG_RELS |
#ifdef DEBUG_RELS |
10957 |
|
error_reporter_start(ASC_PROG_NOTE,NULL,0); |
10958 |
WriteStatement(stderr, statement, 3); |
WriteStatement(stderr, statement, 3); |
10959 |
|
error_reporter_end_flush(); |
10960 |
#endif |
#endif |
10961 |
return Pass2ExecuteFOR(inst,statement); |
return Pass2ExecuteFOR(inst,statement); |
10962 |
case REL: |
case REL: |
10963 |
#ifdef DEBUG_RELS |
#ifdef DEBUG_RELS |
10964 |
|
error_reporter_start(ASC_PROG_NOTE,NULL,0); |
10965 |
WriteStatement(stderr, statement, 3); |
WriteStatement(stderr, statement, 3); |
10966 |
|
error_reporter_end_flush(); |
10967 |
#endif |
#endif |
10968 |
/* ER expected to succeed or fail permanently. this may change. */ |
/* ER expected to succeed or fail permanently. this may change. */ |
10969 |
return ExecuteREL(inst,statement); |
return ExecuteREL(inst,statement); |
10974 |
case LOGREL: |
case LOGREL: |
10975 |
case WHEN: |
case WHEN: |
10976 |
#ifdef DEBUG_RELS |
#ifdef DEBUG_RELS |
10977 |
|
error_reporter_start(ASC_PROG_NOTE,NULL,0); |
10978 |
FPRINTF(stderr,"-- IGNORING WHEN STAT\n"); |
FPRINTF(stderr,"-- IGNORING WHEN STAT\n"); |
10979 |
/* write statement */ |
/* write statement */ |
10980 |
WriteStatement(stderr, statement, 3); |
WriteStatement(stderr, statement, 3); |
10981 |
|
error_reporter_end_flush(); |
10982 |
#endif |
#endif |
10983 |
return 1; /* assumed done */ |
return 1; /* assumed done */ |
10984 |
case FNAME: |
case FNAME: |
11344 |
proto = Asc_GetAnonPrototype(at); |
proto = Asc_GetAnonPrototype(at); |
11345 |
if (InstanceKind(proto) == MODEL_INST && InstanceInList(proto)) { |
if (InstanceKind(proto) == MODEL_INST && InstanceInList(proto)) { |
11346 |
#ifdef DEBUG_RELS |
#ifdef DEBUG_RELS |
11347 |
FPRINTF(stderr,"Rels in model: "); |
error_reporter_start(ASC_PROG_NOTE,NULL,0); |
11348 |
|
FPRINTF(stderr,"Rels in model: "); |
11349 |
WriteInstanceName(stderr,proto,NULL); FPRINTF(stderr,"\n"); |
WriteInstanceName(stderr,proto,NULL); FPRINTF(stderr,"\n"); |
11350 |
|
error_reporter_end_flush(); |
11351 |
#endif |
#endif |
11352 |
blist = InstanceBitList(proto); |
blist = InstanceBitList(proto); |
11353 |
if ((blist!=NULL) && !BitListEmpty(blist)) { |
if ((blist!=NULL) && !BitListEmpty(blist)) { |
12010 |
if (inst != NULL && InstanceKind(inst)==MODEL_INST) { |
if (inst != NULL && InstanceKind(inst)==MODEL_INST) { |
12011 |
struct BitList *blist; |
struct BitList *blist; |
12012 |
#ifdef DEBUG_RELS |
#ifdef DEBUG_RELS |
12013 |
|
error_reporter_start(ASC_PROG_NOTE,NULL,0); |
12014 |
FPRINTF(stderr,"P2SRB: "); |
FPRINTF(stderr,"P2SRB: "); |
12015 |
WriteInstanceName(ASCERR,inst,debug_rels_work); |
WriteInstanceName(ASCERR,inst,debug_rels_work); |
12016 |
FPRINTF(stderr,"\n"); |
error_reporter_end_flush(); |
12017 |
#endif |
#endif |
12018 |
|
|
12019 |
blist = InstanceBitList(inst); |
blist = InstanceBitList(inst); |
12053 |
AddBelow(NULL,inst); |
AddBelow(NULL,inst); |
12054 |
/* add PENDING model */ |
/* add PENDING model */ |
12055 |
#ifdef DEBUG_RELS |
#ifdef DEBUG_RELS |
12056 |
|
error_reporter_start(ASC_PROG_NOTE,NULL,0); |
12057 |
FPRINTF(stderr,"Changed: "); |
FPRINTF(stderr,"Changed: "); |
12058 |
WriteInstanceName(ASCERR,inst,debug_rels_work); |
WriteInstanceName(ASCERR,inst,debug_rels_work); |
12059 |
FPRINTF(stderr,"\n"); |
error_reporter_end_flush(); |
12060 |
#endif |
#endif |
12061 |
} |
} |
12062 |
} |
} |