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 988 by gezelter, Tue Jan 27 19:37:48 2004 UTC vs.
Revision 1153 by gezelter, Tue May 11 04:21:52 2004 UTC

# 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 ){
101 >        if( the_namespc.type != MOLECULE_HEAD ){
102               print_tree_error( the_node,
103 <                            "The atom block is not in a molecule or rigidBody namespace" );
103 >                            "The atom block is not in a molecule namespace" );
104          }
105          else{
106            init_atom( the_node->index );
# Line 113 | Line 113 | void walk_down( struct node_tag* the_node, struct name
113        case RIGIDBODY_HEAD:
114          if( the_namespc.type != MOLECULE_HEAD ){
115            print_tree_error( the_node,
116 <                            "The rigid body block is not in a molecule namespace" );
116 >                            "The RigidBody block is not in a Molecule namespace" );
117          }
118          else{
119            init_rigidbody( the_node->index );
# Line 122 | Line 122 | void walk_down( struct node_tag* the_node, struct name
122            walk_down( the_node->stmt_list, current_namespc );
123          }
124          break;
125 +
126 +      case CUTOFFGROUP_HEAD:
127 +        if( the_namespc.type != CUTOFFGROUP_HEAD ){
128 +          print_tree_error( the_node,
129 +                            "The CutoffGroup block is not in a Molecule namespace" );
130 +        }
131 +        else{
132 +          init_cutoffgroup( the_node->index );
133 +          current_namespc.index = the_node->index;
134 +          current_namespc.type = the_node->type;
135 +          walk_down( the_node->stmt_list, current_namespc );
136 +        }
137 +        break;
138          
139        case BOND_HEAD:
140          if( the_namespc.type != MOLECULE_HEAD ){
# Line 162 | Line 175 | void walk_down( struct node_tag* the_node, struct name
175            walk_down( the_node->stmt_list, current_namespc );
176          }
177          break;
165
166      case MEMBER_HEAD:
167        if( the_namespc.type != RIGIDBODY_HEAD ){
168          print_tree_error( the_node,
169                            "The Member block is not in "
170                            "a rigidBody namespace" );
171        }
172        else{
173          init_member( the_node->index );
174          current_namespc.index = the_node->index;
175          current_namespc.type = the_node->type;
176          walk_down( the_node->stmt_list, current_namespc );
177        }
178        break;
178        
179        case ZCONSTRAINT_HEAD:
180          if( the_namespc.type != GLOBAL_HEAD ){
# Line 206 | Line 205 | void walk_down( struct node_tag* the_node, struct name
205          switch( the_namespc.type ){
206          case BOND_HEAD: // fall through
207          case BEND_HEAD: // fall through
208 <        case TORSION_HEAD: // same for the first three
208 >        case TORSION_HEAD:
209 >        case RIGIDBODY_HEAD:
210 >        case CUTOFFGROUP_HEAD: // same for the first four
211            init_members( the_node, the_namespc );
212            break;
213  
214          default:
215            print_tree_error( the_node,
216                              "Members statement not in a bond, bend, "
217 <                            "or torsion" );
217 >                            "torsion, RigidBody, or CutoffGroup" );
218            break;
219          }
220          break;
# Line 239 | Line 240 | void walk_down( struct node_tag* the_node, struct name
240          break;
241  
242        case POSITION_STMT:
243 <        if( the_namespc.type != ATOM_HEAD && the_namespc.type != RIGIDBODY_HEAD){
243 >        if( the_namespc.type != ATOM_HEAD ){
244            print_tree_error( the_node,
245                              "position statement is not located in an "
246 <                            "atom or rigidBody block" );
246 >                            "atom block" );
247          }
248          
249          init_position( the_node, the_namespc );
250          break;
251  
252        case ORIENTATION_STMT:
253 <        if( the_namespc.type != ATOM_HEAD && the_namespc.type != RIGIDBODY_HEAD){
253 >        if( the_namespc.type != ATOM_HEAD ){
254            print_tree_error( the_node,
255                              "orientation statement is not located in an "
256 <                            "atom or rigidBody block" );
256 >                            "atom block" );
257          }
258          
259          init_orientation( the_node, the_namespc );
# Line 309 | Line 310 | void print_tree_error( struct node_tag* err_node, char
310               "Parse tree error: rigidBody head node error -> %s\n",
311               err_msg );
312      break;
313 +    
314 +  case CUTOFFGROUP_HEAD:
315 +    sprintf( painCave.errMsg,
316 +             "Parse tree error: CutoffGroup head node error -> %s\n",
317 +             err_msg );
318 +    break;
319  
320    case ATOM_HEAD:
321      sprintf( painCave.errMsg,
# Line 338 | Line 345 | void print_tree_error( struct node_tag* err_node, char
345               err_msg );
346      break;
347  
341  case MEMBER_HEAD:
342    sprintf( painCave.errMsg,
343             "Parse tree error: member head node error [%d] -> %s\n",
344             err_node->index,
345             err_msg );
346    break;
347
348    case MEMBERS_STMT:
349      sprintf( painCave.errMsg,
350 <             "Parse tree error: members node error => ( %d, %d, %d, %d )\n"
350 >             "Parse tree error: members node error (nMembers = %d)\n"
351               "                  -> %s\n",
352 <             err_node->the_data.mbrs.a,
353 <             err_node->the_data.mbrs.b,
354 <             err_node->the_data.mbrs.c,
355 <             err_node->the_data.mbrs.d,
352 >             err_node->the_data.mbrs.nMembers,
353               err_msg );
354      break;
355  
# Line 411 | Line 408 | void print_tree_error( struct node_tag* err_node, char
408      sprintf( painCave.errMsg,
409               "Parse tree error: orientation node error => ( %lf, %lf, %lf )\n"
410               "                  -> %s\n",
411 <             err_node->the_data.ort.x,
412 <             err_node->the_data.ort.y,
413 <             err_node->the_data.ort.z,
411 >             err_node->the_data.ort.phi,
412 >             err_node->the_data.ort.theta,
413 >             err_node->the_data.ort.psi,
414               err_msg );
415      break;
416  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines