--- trunk/OOPSE/libBASS/parse_tree.c 2004/01/18 19:10:32 956 +++ trunk/OOPSE/libBASS/parse_tree.c 2004/01/19 16:08:21 957 @@ -98,12 +98,25 @@ 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 ){ + print_tree_error( the_node, + "The atom block is not in a molecule or rigidBody namespace" ); + } + else{ + init_atom( 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 RIGIDBODY_HEAD: if( the_namespc.type != MOLECULE_HEAD ){ print_tree_error( the_node, - "The atom block is not in a molecule namespace" ); + "The rigid body block is not in a molecule namespace" ); } else{ - init_atom( the_node->index ); + 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 ); @@ -212,20 +225,20 @@ void walk_down( struct node_tag* the_node, struct name break; case POSITION_STMT: - if( the_namespc.type != ATOM_HEAD ){ + if( the_namespc.type != ATOM_HEAD && the_namespc.type != RIGIDBODY_HEAD){ print_tree_error( the_node, "position statement is not located in an " - "atom block" ); + "atom or rigidBody block" ); } init_position( the_node, the_namespc ); break; case ORIENTATION_STMT: - if( the_namespc.type != ATOM_HEAD ){ + if( the_namespc.type != ATOM_HEAD && the_namespc.type != RIGIDBODY_HEAD){ print_tree_error( the_node, "orientation statement is not located in an " - "atom block" ); + "atom or rigidBody block" ); } init_orientation( the_node, the_namespc ); @@ -277,6 +290,12 @@ 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 ATOM_HEAD: sprintf( painCave.errMsg, "Parse tree error: atom head node error [%d] -> %s\n",