--- trunk/OOPSE/libBASS/parse_tree.c 2003/09/25 19:27:15 787 +++ trunk/OOPSE/libBASS/parse_tree.c 2004/05/11 04:21:52 1153 @@ -1,12 +1,12 @@ #include #include -#include -#include +#include "parse_tree.h" +#include "simError.h" #ifdef IS_MPI #define __is_lex__ -#include +#include "mpiBASS.h" #endif void walk_down( struct node_tag* the_node, struct namespc the_namespc ); @@ -99,7 +99,7 @@ void walk_down( struct node_tag* the_node, struct name case ATOM_HEAD: if( the_namespc.type != MOLECULE_HEAD ){ - print_tree_error( the_node, + print_tree_error( the_node, "The atom block is not in a molecule namespace" ); } else{ @@ -109,6 +109,32 @@ void walk_down( struct node_tag* the_node, struct name walk_down( the_node->stmt_list, current_namespc ); } break; + + case RIGIDBODY_HEAD: + if( the_namespc.type != MOLECULE_HEAD ){ + print_tree_error( the_node, + "The RigidBody block is not in a Molecule namespace" ); + } + else{ + init_rigidbody( 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 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 ){ @@ -175,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; @@ -277,6 +305,18 @@ void print_tree_error( struct node_tag* err_node, char err_msg ); break; + case RIGIDBODY_HEAD: + sprintf( painCave.errMsg, + "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, "Parse tree error: atom head node error [%d] -> %s\n", @@ -297,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", @@ -312,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; @@ -378,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;