--- trunk/OOPSE/libBASS/parse_tree.c 2004/01/19 16:08:21 957 +++ 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 ){ @@ -188,18 +201,20 @@ void walk_down( struct node_tag* the_node, struct name switch( the_node->type ){ - case MEMBER_STMT: + case MEMBERS_STMT: 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, - "Member statement not in a bond, bend, " - "or torsion" ); + "Members statement not in a bond, bend, " + "torsion, RigidBody, or CutoffGroup" ); break; } break; @@ -225,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 ); @@ -295,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, @@ -316,14 +337,7 @@ void print_tree_error( struct node_tag* err_node, char err_node->index, err_msg ); break; - - case TORSION_HEAD: - sprintf( painCave.errMsg, - "Parse tree error: torsion head node error [%d] -> %s\n", - err_node->index, - err_msg ); - break; - + case ZCONSTRAINT_HEAD: sprintf( painCave.errMsg, "Parse tree error: Zconstraint head node error [%d] -> %s\n", @@ -331,14 +345,11 @@ void print_tree_error( struct node_tag* err_node, char err_msg ); break; - case MEMBER_STMT: + case MEMBERS_STMT: sprintf( painCave.errMsg, - "Parse tree error: member node error => ( %d, %d, %d, %d )\n" + "Parse tree error: members node error (nMembers = %d)\n" " -> %s\n", - err_node->the_data.mbr.a, - err_node->the_data.mbr.b, - err_node->the_data.mbr.c, - err_node->the_data.mbr.d, + err_node->the_data.mbrs.nMembers, err_msg ); break; @@ -397,9 +408,9 @@ void print_tree_error( struct node_tag* err_node, char sprintf( painCave.errMsg, "Parse tree error: orientation node error => ( %lf, %lf, %lf )\n" " -> %s\n", - err_node->the_data.ort.x, - err_node->the_data.ort.y, - err_node->the_data.ort.z, + err_node->the_data.ort.phi, + err_node->the_data.ort.theta, + err_node->the_data.ort.psi, err_msg ); break;