2 |
|
#include <stdlib.h> |
3 |
|
#include <string.h> |
4 |
|
|
5 |
< |
#include <node_list.h> |
6 |
< |
#include <make_nodes.h> |
7 |
< |
#include <simError.h> |
5 |
> |
#include "node_list.h" |
6 |
> |
#include "make_nodes.h" |
7 |
> |
#include "simError.h" |
8 |
|
|
9 |
|
/* |
10 |
|
walks to to the top of a stmt_list. Needed when assigning the |
88 |
|
struct node_tag* the_node; |
89 |
|
the_node = ( struct node_tag* )malloc( sizeof( node ) ); |
90 |
|
|
91 |
< |
the_node->type = MEMBER_STMT; |
91 |
> |
the_node->type = MEMBERS_STMT; |
92 |
|
the_node->index = 0; |
93 |
|
the_node->next_stmt = NULL; |
94 |
|
the_node->prev_stmt = NULL; |
95 |
|
the_node->stmt_list = NULL; |
96 |
|
|
97 |
< |
the_node->the_data.mbr.a = a; |
98 |
< |
the_node->the_data.mbr.b = b; |
99 |
< |
the_node->the_data.mbr.c = 0; |
100 |
< |
the_node->the_data.mbr.d = 0; |
97 |
> |
the_node->the_data.mbrs.a = a; |
98 |
> |
the_node->the_data.mbrs.b = b; |
99 |
> |
the_node->the_data.mbrs.c = 0; |
100 |
> |
the_node->the_data.mbrs.d = 0; |
101 |
|
|
102 |
|
return the_node; |
103 |
|
} |
107 |
|
struct node_tag* the_node; |
108 |
|
the_node = ( struct node_tag* )malloc( sizeof( node ) ); |
109 |
|
|
110 |
< |
the_node->type = MEMBER_STMT; |
110 |
> |
the_node->type = MEMBERS_STMT; |
111 |
|
the_node->index = 0; |
112 |
|
the_node->next_stmt = NULL; |
113 |
|
the_node->prev_stmt = NULL; |
114 |
|
the_node->stmt_list = NULL; |
115 |
|
|
116 |
< |
the_node->the_data.mbr.a = a; |
117 |
< |
the_node->the_data.mbr.b = b; |
118 |
< |
the_node->the_data.mbr.c = c; |
119 |
< |
the_node->the_data.mbr.d = 0; |
116 |
> |
the_node->the_data.mbrs.a = a; |
117 |
> |
the_node->the_data.mbrs.b = b; |
118 |
> |
the_node->the_data.mbrs.c = c; |
119 |
> |
the_node->the_data.mbrs.d = 0; |
120 |
|
|
121 |
|
return the_node; |
122 |
|
} |
126 |
|
struct node_tag* the_node; |
127 |
|
the_node = ( struct node_tag* )malloc( sizeof( node ) ); |
128 |
|
|
129 |
< |
the_node->type = MEMBER_STMT; |
129 |
> |
the_node->type = MEMBERS_STMT; |
130 |
|
the_node->index = 0; |
131 |
|
the_node->next_stmt = NULL; |
132 |
|
the_node->prev_stmt = NULL; |
133 |
|
the_node->stmt_list = NULL; |
134 |
|
|
135 |
< |
the_node->the_data.mbr.a = a; |
136 |
< |
the_node->the_data.mbr.b = b; |
137 |
< |
the_node->the_data.mbr.c = c; |
138 |
< |
the_node->the_data.mbr.d = d; |
135 |
> |
the_node->the_data.mbrs.a = a; |
136 |
> |
the_node->the_data.mbrs.b = b; |
137 |
> |
the_node->the_data.mbrs.c = c; |
138 |
> |
the_node->the_data.mbrs.d = d; |
139 |
|
|
140 |
|
return the_node; |
141 |
|
} |
223 |
|
return the_node; |
224 |
|
} |
225 |
|
|
226 |
+ |
struct node_tag* rigidbody_blk( int index, struct node_tag* stmt_list ){ |
227 |
+ |
|
228 |
+ |
struct node_tag* the_node; |
229 |
+ |
the_node = ( struct node_tag* )malloc( sizeof( node ) ); |
230 |
+ |
|
231 |
+ |
the_node->type = RIGIDBODY_HEAD; |
232 |
+ |
the_node->index = 0; |
233 |
+ |
the_node->next_stmt = NULL; |
234 |
+ |
the_node->prev_stmt = NULL; |
235 |
+ |
the_node->stmt_list = walk_to_top( stmt_list ); |
236 |
+ |
|
237 |
+ |
return the_node; |
238 |
+ |
} |
239 |
+ |
|
240 |
|
struct node_tag* atom_blk( int index, struct node_tag* stmt_list ){ |
241 |
|
|
242 |
|
struct node_tag* the_node; |
293 |
|
return the_node; |
294 |
|
} |
295 |
|
|
296 |
+ |
struct node_tag* member_blk( int index, struct node_tag* stmt_list ){ |
297 |
+ |
|
298 |
+ |
struct node_tag* the_node; |
299 |
+ |
the_node = ( struct node_tag* )malloc( sizeof( node ) ); |
300 |
+ |
|
301 |
+ |
the_node->type = MEMBER_HEAD; |
302 |
+ |
the_node->index = index; |
303 |
+ |
the_node->next_stmt = NULL; |
304 |
+ |
the_node->prev_stmt = NULL; |
305 |
+ |
the_node->stmt_list = walk_to_top( stmt_list ); |
306 |
+ |
|
307 |
+ |
return the_node; |
308 |
+ |
} |
309 |
+ |
|
310 |
|
struct node_tag* zconstraint_blk( int index, struct node_tag* stmt_list ){ |
311 |
|
|
312 |
|
struct node_tag* the_node; |