Ignore:
Timestamp:
07/31/09 03:33:56 (4 years ago)
Author:
werner
Message:
  • name of anonymous vectors wasn't initialized
  • made active vectors a little brighter to better tell them apart from inactive ones
  • frames are now (again) ordered from root down
  • added new item .circ to avoid crazy .arc syntax
File:
1 edited

Legend:

Unmodified
Added
Removed
  • developers/werner/fped/fpd.y

    r5341 r5345  
    2222 
    2323static struct frame *curr_frame; 
    24 static struct frame **next_frame; 
     24static struct frame *last_frame = NULL; 
    2525static struct table **next_table; 
    2626static struct loop **next_loop; 
     
    123123 
    124124 
    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 
    126127 
    127128%token  <num>   NUMBER 
     
    142143all: 
    143144                { 
    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); 
    147147                } 
    148148        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                } 
    149156        ; 
    150157 
     
    158165                        if (find_frame($2)) 
    159166                                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; 
    164176 
    165177                } 
    166178            frame_items '}' 
    167179                { 
    168                         set_frame(frames); 
     180                        set_frame(root_frame); 
    169181                } 
    170182        ; 
     
    302314                { 
    303315                        $$ = alloc_type(struct vec); 
     316                        $$->name = NULL; 
    304317                        $$->base = $2; 
    305318                        if ($2) 
     
    354367                        $$->u.line.other = $3; 
    355368                } 
    356         | TOK_ARC base base opt_base 
     369        | TOK_CIRC base base 
    357370                { 
    358371                        $$ = new_obj(ot_arc); 
    359372                        $$->base = $2; 
    360373                        $$->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; 
    362382                } 
    363383        | TOK_FRAME ID base 
Note: See TracChangeset for help on using the changeset viewer.