--- trunk/OOPSE/libBASS/parse_tree.c 2004/01/29 23:01:17 998 +++ trunk/OOPSE/libBASS/parse_tree.c 2004/05/11 04:21:52 1153 @@ -98,9 +98,9 @@ void walk_down( struct node_tag* the_node, struct name break; case ATOM_HEAD: - if( the_namespc.type != MOLECULE_HEAD && the_namespc.type != RIGIDBODY_HEAD ){ + if( the_namespc.type != MOLECULE_HEAD ){ print_tree_error( the_node, - "The atom block is not in a molecule or rigidBody namespace" ); + "The atom block is not in a molecule namespace" ); } else{ init_atom( the_node->index ); @@ -113,7 +113,7 @@ void walk_down( struct node_tag* the_node, struct name case RIGIDBODY_HEAD: if( the_namespc.type != MOLECULE_HEAD ){ print_tree_error( the_node, - "The rigid body block is not in a molecule namespace" ); + "The RigidBody block is not in a Molecule namespace" ); } else{ init_rigidbody( the_node->index ); @@ -122,6 +122,19 @@ void walk_down( struct node_tag* the_node, struct name walk_down( the_node->stmt_list, current_namespc ); } break; + + case CUTOFFGROUP_HEAD: + if( the_namespc.type != CUTOFFGROUP_HEAD ){ + print_tree_error( the_node, + "The CutoffGroup block is not in a Molecule namespace" ); + } + else{ + init_cutoffgroup( the_node->index ); + current_namespc.index = the_node->index; + current_namespc.type = the_node->type; + walk_down( the_node->stmt_list, current_namespc ); + } + break; case BOND_HEAD: if( the_namespc.type != MOLECULE_HEAD ){ @@ -192,15 +205,16 @@ void walk_down( struct node_tag* the_node, struct name switch( the_namespc.type ){ case BOND_HEAD: // fall through case BEND_HEAD: // fall through - case TORSION_HEAD: // same for the first three + case TORSION_HEAD: case RIGIDBODY_HEAD: + case CUTOFFGROUP_HEAD: // same for the first four init_members( the_node, the_namespc ); break; default: print_tree_error( the_node, "Members statement not in a bond, bend, " - "torsion, or rigidBody." ); + "torsion, RigidBody, or CutoffGroup" ); break; } break; @@ -226,20 +240,20 @@ void walk_down( struct node_tag* the_node, struct name break; case POSITION_STMT: - if( the_namespc.type != ATOM_HEAD && the_namespc.type != RIGIDBODY_HEAD){ + if( the_namespc.type != ATOM_HEAD ){ print_tree_error( the_node, "position statement is not located in an " - "atom or rigidBody block" ); + "atom block" ); } init_position( the_node, the_namespc ); break; case ORIENTATION_STMT: - if( the_namespc.type != ATOM_HEAD && the_namespc.type != RIGIDBODY_HEAD){ + if( the_namespc.type != ATOM_HEAD ){ print_tree_error( the_node, "orientation statement is not located in an " - "atom or rigidBody block" ); + "atom block" ); } init_orientation( the_node, the_namespc ); @@ -296,6 +310,12 @@ void print_tree_error( struct node_tag* err_node, char "Parse tree error: rigidBody head node error -> %s\n", err_msg ); break; + + case CUTOFFGROUP_HEAD: + sprintf( painCave.errMsg, + "Parse tree error: CutoffGroup head node error -> %s\n", + err_msg ); + break; case ATOM_HEAD: sprintf( painCave.errMsg,