15 |
|
// Globals ************************************************ |
16 |
|
|
17 |
|
typedef enum { GLOBAL_BLK, MOLECULE_BLK, ATOM_BLK, BOND_BLK, BEND_BLK, |
18 |
< |
TORSION_BLK, COMPONENT_BLK } block_type; |
18 |
> |
TORSION_BLK, COMPONENT_BLK, ZCONSTRAINT_BLK } block_type; |
19 |
|
|
20 |
|
block_type current_block = GLOBAL_BLK; |
21 |
|
#define MAX_NEST 20 // the max number of nested blocks |
41 |
|
|
42 |
|
int handled = 0; |
43 |
|
|
44 |
+ |
if( the_event->event_type == ASSIGNMENT){ |
45 |
+ |
fprintf( stderr, |
46 |
+ |
"global assign %s\n", |
47 |
+ |
the_event->evt.asmt.lhs ); |
48 |
+ |
} |
49 |
+ |
|
50 |
+ |
|
51 |
+ |
the_globals->printIC(); |
52 |
+ |
|
53 |
|
switch( current_block ){ |
54 |
|
|
55 |
|
case GLOBAL_BLK: |
59 |
|
incr_block( MOLECULE_BLK ); |
60 |
|
handled = the_stamps->newMolecule( the_event ); |
61 |
|
break; |
62 |
+ |
|
63 |
+ |
case ZCONSTRAINT: |
64 |
+ |
incr_block( ZCONSTRAINT_BLK ); |
65 |
+ |
handled = the_globals->newZconstraint( the_event ); |
66 |
+ |
break; |
67 |
|
|
68 |
|
case COMPONENT: |
69 |
|
incr_block( COMPONENT_BLK ); |
233 |
|
default: |
234 |
|
the_event->err_msg = |
235 |
|
strdup( "not a valid torsion event\n" ); |
236 |
+ |
return 0; |
237 |
+ |
} |
238 |
+ |
break; |
239 |
+ |
|
240 |
+ |
case ZCONSTRAINT_BLK: |
241 |
+ |
|
242 |
+ |
switch( the_event->event_type ){ |
243 |
+ |
|
244 |
+ |
case ASSIGNMENT: |
245 |
+ |
handled = the_globals->zConstraintAssign( the_event ); |
246 |
+ |
break; |
247 |
+ |
|
248 |
+ |
case BLOCK_END: |
249 |
+ |
decr_block(); |
250 |
+ |
handled = the_globals->zConstraintEnd( the_event ); |
251 |
+ |
break; |
252 |
+ |
|
253 |
+ |
default: |
254 |
+ |
the_event->err_msg = |
255 |
+ |
strdup( "not a valid zConstraint event\n" ); |
256 |
|
return 0; |
257 |
|
} |
258 |
|
break; |
265 |
|
handled = the_globals->componentAssign( the_event ); |
266 |
|
break; |
267 |
|
|
234 |
– |
case START_INDEX: |
235 |
– |
handled = the_globals->componentStartIndex( the_event ); |
236 |
– |
break; |
237 |
– |
|
268 |
|
case BLOCK_END: |
269 |
|
decr_block(); |
270 |
|
handled = the_globals->componentEnd(the_event ); |