Changeset 5345 for developers/werner/fped/fpd.y
- Timestamp:
- 07/31/09 03:33:56 (4 years ago)
- File:
-
- 1 edited
-
developers/werner/fped/fpd.y (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
developers/werner/fped/fpd.y
r5341 r5345 22 22 23 23 static struct frame *curr_frame; 24 static struct frame * *next_frame;24 static struct frame *last_frame = NULL; 25 25 static struct table **next_table; 26 26 static struct loop **next_loop; … … 123 123 124 124 125 %token TOK_FRAME TOK_TABLE TOK_VEC TOK_PAD TOK_RECT TOK_LINE TOK_ARC 125 %token TOK_FRAME TOK_TABLE TOK_VEC 126 %token TOK_PAD TOK_RECT TOK_LINE TOK_CIRC TOK_ARC 126 127 127 128 %token <num> NUMBER … … 142 143 all: 143 144 { 144 frames = zalloc_type(struct frame); 145 next_frame = &frames->next; 146 set_frame(frames); 145 root_frame = zalloc_type(struct frame); 146 set_frame(root_frame); 147 147 } 148 148 frame_defs frame_items 149 { 150 root_frame->prev = last_frame; 151 if (last_frame) 152 last_frame->next = root_frame; 153 else 154 frames = root_frame; 155 } 149 156 ; 150 157 … … 158 165 if (find_frame($2)) 159 166 yyerrorf("duplicate frame \"%s\"", $2); 160 *next_frame = zalloc_type(struct frame); 161 (*next_frame)->name = $2; 162 set_frame(*next_frame); 163 next_frame = &(*next_frame)->next; 167 curr_frame = zalloc_type(struct frame); 168 curr_frame->name = $2; 169 set_frame(curr_frame); 170 curr_frame->prev = last_frame; 171 if (last_frame) 172 last_frame->next = curr_frame; 173 else 174 frames = curr_frame; 175 last_frame = curr_frame; 164 176 165 177 } 166 178 frame_items '}' 167 179 { 168 set_frame( frames);180 set_frame(root_frame); 169 181 } 170 182 ; … … 302 314 { 303 315 $$ = alloc_type(struct vec); 316 $$->name = NULL; 304 317 $$->base = $2; 305 318 if ($2) … … 354 367 $$->u.line.other = $3; 355 368 } 356 | TOK_ ARC base base opt_base369 | TOK_CIRC base base 357 370 { 358 371 $$ = new_obj(ot_arc); 359 372 $$->base = $2; 360 373 $$->u.arc.start = $3; 361 $$->u.arc.end = $4 ? $4 : $3; 374 $$->u.arc.end = $3; 375 } 376 | TOK_ARC base base base 377 { 378 $$ = new_obj(ot_arc); 379 $$->base = $2; 380 $$->u.arc.start = $3; 381 $$->u.arc.end = $4; 362 382 } 363 383 | TOK_FRAME ID base
Note: See TracChangeset
for help on using the changeset viewer.
