ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libBASS/parse_tree.c
(Generate patch)

Comparing trunk/OOPSE/libBASS/parse_tree.c (file contents):
Revision 787 by mmeineke, Thu Sep 25 19:27:15 2003 UTC vs.
Revision 998 by gezelter, Thu Jan 29 23:01:17 2004 UTC

# Line 1 | Line 1
1   #include <stdlib.h>
2   #include <stdio.h>
3  
4 < #include <parse_tree.h>
5 < #include <simError.h>
4 > #include "parse_tree.h"
5 > #include "simError.h"
6  
7   #ifdef IS_MPI
8   #define __is_lex__
9 < #include <mpiBASS.h>
9 > #include "mpiBASS.h"
10   #endif
11  
12   void walk_down( struct node_tag* the_node, struct namespc the_namespc );
# Line 98 | Line 98 | void walk_down( struct node_tag* the_node, struct name
98          break;
99  
100        case ATOM_HEAD:
101 +        if( the_namespc.type != MOLECULE_HEAD && the_namespc.type != RIGIDBODY_HEAD ){
102 +             print_tree_error( the_node,
103 +                            "The atom block is not in a molecule or rigidBody namespace" );
104 +        }
105 +        else{
106 +          init_atom( the_node->index );
107 +          current_namespc.index = the_node->index;
108 +          current_namespc.type = the_node->type;
109 +          walk_down( the_node->stmt_list, current_namespc );
110 +        }
111 +        break;
112 +
113 +      case RIGIDBODY_HEAD:
114          if( the_namespc.type != MOLECULE_HEAD ){
115            print_tree_error( the_node,
116 <                            "The atom block is not in a molecule namespace" );
116 >                            "The rigid body block is not in a molecule namespace" );
117          }
118          else{
119 <          init_atom( the_node->index );
119 >          init_rigidbody( the_node->index );
120            current_namespc.index = the_node->index;
121            current_namespc.type = the_node->type;
122            walk_down( the_node->stmt_list, current_namespc );
# Line 175 | Line 188 | void walk_down( struct node_tag* the_node, struct name
188  
189        switch( the_node->type ){
190  
191 <      case MEMBER_STMT:
191 >      case MEMBERS_STMT:
192          switch( the_namespc.type ){
193          case BOND_HEAD: // fall through
194          case BEND_HEAD: // fall through
195          case TORSION_HEAD: // same for the first three
196 +        case RIGIDBODY_HEAD:
197            init_members( the_node, the_namespc );
198            break;
199  
200          default:
201            print_tree_error( the_node,
202 <                            "Member statement not in a bond, bend, "
203 <                            "or torsion" );
202 >                            "Members statement not in a bond, bend, "
203 >                            "torsion, or rigidBody." );
204            break;
205          }
206          break;
# Line 212 | Line 226 | void walk_down( struct node_tag* the_node, struct name
226          break;
227  
228        case POSITION_STMT:
229 <        if( the_namespc.type != ATOM_HEAD ){
229 >        if( the_namespc.type != ATOM_HEAD && the_namespc.type != RIGIDBODY_HEAD){
230            print_tree_error( the_node,
231                              "position statement is not located in an "
232 <                            "atom block" );
232 >                            "atom or rigidBody block" );
233          }
234          
235          init_position( the_node, the_namespc );
236          break;
237  
238        case ORIENTATION_STMT:
239 <        if( the_namespc.type != ATOM_HEAD ){
239 >        if( the_namespc.type != ATOM_HEAD && the_namespc.type != RIGIDBODY_HEAD){
240            print_tree_error( the_node,
241                              "orientation statement is not located in an "
242 <                            "atom block" );
242 >                            "atom or rigidBody block" );
243          }
244          
245          init_orientation( the_node, the_namespc );
# Line 277 | Line 291 | void print_tree_error( struct node_tag* err_node, char
291               err_msg );
292      break;
293  
294 +  case RIGIDBODY_HEAD:
295 +    sprintf( painCave.errMsg,
296 +             "Parse tree error: rigidBody head node error -> %s\n",
297 +             err_msg );
298 +    break;
299 +
300    case ATOM_HEAD:
301      sprintf( painCave.errMsg,
302               "Parse tree error: atom head node error [%d] -> %s\n",
# Line 297 | Line 317 | void print_tree_error( struct node_tag* err_node, char
317               err_node->index,
318               err_msg );
319      break;
320 <    
301 <  case TORSION_HEAD:
302 <    sprintf( painCave.errMsg,
303 <             "Parse tree error: torsion head node error [%d] -> %s\n",
304 <             err_node->index,
305 <             err_msg );
306 <    break;
307 <  
320 >      
321    case ZCONSTRAINT_HEAD:
322      sprintf( painCave.errMsg,
323               "Parse tree error: Zconstraint head node error [%d] -> %s\n",
# Line 312 | Line 325 | void print_tree_error( struct node_tag* err_node, char
325               err_msg );
326      break;
327  
328 <  case MEMBER_STMT:
328 >  case MEMBERS_STMT:
329      sprintf( painCave.errMsg,
330 <             "Parse tree error: member node error => ( %d, %d, %d, %d )\n"
330 >             "Parse tree error: members node error (nMembers = %d)\n"
331               "                  -> %s\n",
332 <             err_node->the_data.mbr.a,
320 <             err_node->the_data.mbr.b,
321 <             err_node->the_data.mbr.c,
322 <             err_node->the_data.mbr.d,
332 >             err_node->the_data.mbrs.nMembers,
333               err_msg );
334      break;
335  
# Line 378 | Line 388 | void print_tree_error( struct node_tag* err_node, char
388      sprintf( painCave.errMsg,
389               "Parse tree error: orientation node error => ( %lf, %lf, %lf )\n"
390               "                  -> %s\n",
391 <             err_node->the_data.ort.x,
392 <             err_node->the_data.ort.y,
393 <             err_node->the_data.ort.z,
391 >             err_node->the_data.ort.phi,
392 >             err_node->the_data.ort.theta,
393 >             err_node->the_data.ort.psi,
394               err_msg );
395      break;
396  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines