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 ); |
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 ); |
162 |
|
walk_down( the_node->stmt_list, current_namespc ); |
163 |
|
} |
164 |
|
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; |
179 |
|
|
180 |
|
case ZCONSTRAINT_HEAD: |
181 |
|
if( the_namespc.type != GLOBAL_HEAD ){ |
202 |
|
|
203 |
|
switch( the_node->type ){ |
204 |
|
|
205 |
< |
case MEMBER_STMT: |
205 |
> |
case MEMBERS_STMT: |
206 |
|
switch( the_namespc.type ){ |
207 |
|
case BOND_HEAD: // fall through |
208 |
|
case BEND_HEAD: // fall through |
212 |
|
|
213 |
|
default: |
214 |
|
print_tree_error( the_node, |
215 |
< |
"Member statement not in a bond, bend, " |
215 |
> |
"Members statement not in a bond, bend, " |
216 |
|
"or torsion" ); |
217 |
|
break; |
218 |
|
} |
239 |
|
break; |
240 |
|
|
241 |
|
case POSITION_STMT: |
242 |
< |
if( the_namespc.type != ATOM_HEAD ){ |
242 |
> |
if( the_namespc.type != ATOM_HEAD && the_namespc.type != RIGIDBODY_HEAD){ |
243 |
|
print_tree_error( the_node, |
244 |
|
"position statement is not located in an " |
245 |
< |
"atom block" ); |
245 |
> |
"atom or rigidBody block" ); |
246 |
|
} |
247 |
|
|
248 |
|
init_position( the_node, the_namespc ); |
249 |
|
break; |
250 |
|
|
251 |
|
case ORIENTATION_STMT: |
252 |
< |
if( the_namespc.type != ATOM_HEAD ){ |
252 |
> |
if( the_namespc.type != ATOM_HEAD && the_namespc.type != RIGIDBODY_HEAD){ |
253 |
|
print_tree_error( the_node, |
254 |
|
"orientation statement is not located in an " |
255 |
< |
"atom block" ); |
255 |
> |
"atom or rigidBody block" ); |
256 |
|
} |
257 |
|
|
258 |
|
init_orientation( the_node, the_namespc ); |
304 |
|
err_msg ); |
305 |
|
break; |
306 |
|
|
307 |
+ |
case RIGIDBODY_HEAD: |
308 |
+ |
sprintf( painCave.errMsg, |
309 |
+ |
"Parse tree error: rigidBody head node error -> %s\n", |
310 |
+ |
err_msg ); |
311 |
+ |
break; |
312 |
+ |
|
313 |
|
case ATOM_HEAD: |
314 |
|
sprintf( painCave.errMsg, |
315 |
|
"Parse tree error: atom head node error [%d] -> %s\n", |
330 |
|
err_node->index, |
331 |
|
err_msg ); |
332 |
|
break; |
333 |
< |
|
334 |
< |
case TORSION_HEAD: |
333 |
> |
|
334 |
> |
case ZCONSTRAINT_HEAD: |
335 |
|
sprintf( painCave.errMsg, |
336 |
< |
"Parse tree error: torsion head node error [%d] -> %s\n", |
336 |
> |
"Parse tree error: Zconstraint head node error [%d] -> %s\n", |
337 |
|
err_node->index, |
338 |
|
err_msg ); |
339 |
|
break; |
340 |
< |
|
341 |
< |
case ZCONSTRAINT_HEAD: |
340 |
> |
|
341 |
> |
case MEMBER_HEAD: |
342 |
|
sprintf( painCave.errMsg, |
343 |
< |
"Parse tree error: Zconstraint head node error [%d] -> %s\n", |
343 |
> |
"Parse tree error: member head node error [%d] -> %s\n", |
344 |
|
err_node->index, |
345 |
|
err_msg ); |
346 |
|
break; |
347 |
|
|
348 |
< |
case MEMBER_STMT: |
348 |
> |
case MEMBERS_STMT: |
349 |
|
sprintf( painCave.errMsg, |
350 |
< |
"Parse tree error: member node error => ( %d, %d, %d, %d )\n" |
350 |
> |
"Parse tree error: members node error => ( %d, %d, %d, %d )\n" |
351 |
|
" -> %s\n", |
352 |
< |
err_node->the_data.mbr.a, |
353 |
< |
err_node->the_data.mbr.b, |
354 |
< |
err_node->the_data.mbr.c, |
355 |
< |
err_node->the_data.mbr.d, |
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, |
356 |
|
err_msg ); |
357 |
|
break; |
358 |
|
|
439 |
|
|
440 |
|
void kill_tree( struct node_tag* the_node ){ |
441 |
|
|
409 |
– |
// These two are needed to get rid of the integer list |
442 |
|
|
411 |
– |
struct integer_list_tag* current_il; |
412 |
– |
struct integer_list_tag* temp_il; |
413 |
– |
|
414 |
– |
|
443 |
|
if( the_node != NULL ){ |
444 |
|
|
445 |
|
if( the_node->stmt_list != NULL ){ |