| 1 |
< |
/* |
| 1 |
> |
/* |
| 2 |
|
* Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. |
| 3 |
|
* |
| 4 |
|
* The University of Notre Dame grants you ("Licensee") a |
| 51 |
|
#endif |
| 52 |
|
|
| 53 |
|
void walk_down( struct node_tag* the_node, struct namespc the_namespc ); |
| 54 |
< |
int mol_index; // keeps track of the number of molecules |
| 55 |
< |
int comp_index; // keeps track of the number of components. |
| 54 |
> |
int mol_index; /* keeps track of the number of molecules*/ |
| 55 |
> |
int comp_index; /* keeps track of the number of components.*/ |
| 56 |
|
|
| 57 |
|
/* |
| 58 |
|
* This is the parse tree function that is called by the yacc |
| 71 |
|
simError(); |
| 72 |
|
#ifdef IS_MPI |
| 73 |
|
mpiInterfaceExit(); |
| 74 |
< |
#endif //is_mpi |
| 74 |
> |
#endif /*is_mpi*/ |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
global_namespc.index = 0; |
| 80 |
|
mol_index = 0; |
| 81 |
|
comp_index = 0; |
| 82 |
|
walk_down( head_node->next_stmt, global_namespc ); |
| 83 |
< |
// closed global namespace and exit |
| 83 |
> |
/* closed global namespace and exit*/ |
| 84 |
|
|
| 85 |
|
} |
| 86 |
|
|
| 106 |
|
|
| 107 |
|
if( the_node->stmt_list != NULL ){ |
| 108 |
|
|
| 109 |
< |
// the statement is a block node of some sort |
| 109 |
> |
/* the statement is a block node of some sort*/ |
| 110 |
|
|
| 111 |
|
switch( the_node->type ){ |
| 112 |
|
|
| 140 |
|
|
| 141 |
|
case ATOM_HEAD: |
| 142 |
|
if( the_namespc.type != MOLECULE_HEAD ){ |
| 143 |
< |
print_tree_error( the_node, |
| 143 |
> |
print_tree_error( the_node, |
| 144 |
|
"The atom block is not in a molecule namespace" ); |
| 145 |
|
} |
| 146 |
|
else{ |
| 238 |
|
|
| 239 |
|
else{ |
| 240 |
|
|
| 241 |
< |
// the node is a statement |
| 241 |
> |
/* the node is a statement */ |
| 242 |
|
|
| 243 |
|
switch( the_node->type ){ |
| 244 |
|
|
| 245 |
|
case MEMBERS_STMT: |
| 246 |
|
switch( the_namespc.type ){ |
| 247 |
< |
case BOND_HEAD: // fall through |
| 248 |
< |
case BEND_HEAD: // fall through |
| 247 |
> |
case BOND_HEAD: /* fall through*/ |
| 248 |
> |
case BEND_HEAD: /* fall through*/ |
| 249 |
|
case TORSION_HEAD: |
| 250 |
|
case RIGIDBODY_HEAD: |
| 251 |
< |
case CUTOFFGROUP_HEAD: // same for the first four |
| 251 |
> |
case CUTOFFGROUP_HEAD: /* same for the first four*/ |
| 252 |
|
init_members( the_node, the_namespc ); |
| 253 |
|
break; |
| 254 |
|
|
| 262 |
|
|
| 263 |
|
case CONSTRAINT_STMT: |
| 264 |
|
switch( the_namespc.type ){ |
| 265 |
< |
case BOND_HEAD: // fall through |
| 266 |
< |
case BEND_HEAD: // fall through |
| 267 |
< |
case TORSION_HEAD: // same for the first three |
| 265 |
> |
case BOND_HEAD: /* fall through*/ |
| 266 |
> |
case BEND_HEAD: /* fall through*/ |
| 267 |
> |
case TORSION_HEAD: /* same for the first three*/ |
| 268 |
|
init_constraint( the_node, the_namespc ); |
| 269 |
|
break; |
| 270 |
|
|
| 306 |
|
} |
| 307 |
|
} |
| 308 |
|
|
| 309 |
< |
// recurse down to the next node |
| 309 |
> |
/* recurse down to the next node*/ |
| 310 |
|
|
| 311 |
|
walk_down( the_node->next_stmt, the_namespc ); |
| 312 |
|
} |
| 313 |
|
|
| 314 |
< |
// send an end of block signal |
| 314 |
> |
/* send an end of block signal*/ |
| 315 |
|
else end_of_block(); |
| 316 |
|
|
| 317 |
< |
// we're done |
| 317 |
> |
/* we're done*/ |
| 318 |
|
} |
| 319 |
|
|
| 320 |
|
|
| 396 |
|
|
| 397 |
|
case CONSTRAINT_STMT: |
| 398 |
|
sprintf( painCave.errMsg, |
| 399 |
< |
"Parse tree error: constraint node error => ( %lf )\n" |
| 400 |
< |
" -> %s\n", |
| 401 |
< |
err_node->the_data.cnstr.constraint_val, |
| 402 |
< |
err_msg ); |
| 399 |
> |
"Parse tree error: constraint node error => ( %lf )\n" |
| 400 |
> |
" -> %s\n", |
| 401 |
> |
err_node->the_data.cnstr.constraint_val, |
| 402 |
> |
err_msg ); |
| 403 |
|
break; |
| 404 |
|
|
| 405 |
|
case ASSIGNMENT_STMT: |
| 465 |
|
simError(); |
| 466 |
|
#ifdef IS_MPI |
| 467 |
|
mpiInterfaceExit(); |
| 468 |
< |
#endif //is_mpi |
| 468 |
> |
#endif /*is_mpi*/ |
| 469 |
|
|
| 470 |
|
} |
| 471 |
|
|
| 482 |
|
|
| 483 |
|
if( the_node->stmt_list != NULL ){ |
| 484 |
|
|
| 485 |
< |
// the statement is a block node of some sort |
| 485 |
> |
/* the statement is a block node of some sort*/ |
| 486 |
|
|
| 487 |
|
kill_tree( the_node->stmt_list ); |
| 488 |
|
} |
| 489 |
|
|
| 490 |
|
else{ |
| 491 |
|
|
| 492 |
< |
// the node is a statement |
| 492 |
> |
/* the node is a statement */ |
| 493 |
|
|
| 494 |
|
switch( the_node->type ){ |
| 495 |
|
|
| 501 |
|
free( the_node->the_data.asmt.identifier ); |
| 502 |
|
break; |
| 503 |
|
|
| 504 |
+ |
case MEMBERS_STMT: |
| 505 |
+ |
|
| 506 |
+ |
if (the_node->the_data.mbrs.nMembers >0 ){ |
| 507 |
+ |
free(the_node->the_data.mbrs.memberList); |
| 508 |
+ |
} |
| 509 |
+ |
break; |
| 510 |
+ |
|
| 511 |
|
default: |
| 512 |
< |
// nothing to do here, everyone else can be freed normally. |
| 512 |
> |
/* nothing to do here, everyone else can be freed normally.*/ |
| 513 |
|
break; |
| 514 |
|
} |
| 515 |
|
} |
| 516 |
|
|
| 517 |
< |
// recurse down to the next node |
| 517 |
> |
/* recurse down to the next node*/ |
| 518 |
|
|
| 519 |
|
kill_tree( the_node->next_stmt ); |
| 520 |
|
free( the_node ); |
| 521 |
|
} |
| 522 |
|
|
| 523 |
< |
// we're done |
| 523 |
> |
/* we're done*/ |
| 524 |
|
} |