Mon, 31 Dec 2001 08:25:04 +0000
track bookmark level.
semantics.c | file | annotate | diff | revisions | |
semantics.h | file | annotate | diff | revisions |
1.1 --- a/semantics.c Mon Dec 31 08:25:04 2001 +0000 1.2 +++ b/semantics.c Mon Dec 31 08:25:04 2001 +0000 1.3 @@ -42,13 +42,6 @@ 1.4 } input_image_t; 1.5 1.6 1.7 -typedef struct bookmark_t 1.8 -{ 1.9 - struct bookmark_t *next; 1.10 - char *name; 1.11 -} bookmark_t; 1.12 - 1.13 - 1.14 typedef struct output_context_t 1.15 { 1.16 struct output_context_t *parent; 1.17 @@ -84,6 +77,7 @@ 1.18 FILE *yyin; 1.19 int line; /* line number in spec file */ 1.20 1.21 +int bookmark_level; 1.22 1.23 input_context_t *first_input_context; 1.24 input_context_t *last_input_context; 1.25 @@ -309,6 +303,7 @@ 1.26 return; 1.27 } 1.28 1.29 + new_bookmark->level = bookmark_level; 1.30 new_bookmark->name = name; 1.31 if (last_output_context->first_bookmark) 1.32 last_output_context->last_bookmark->next = new_bookmark; 1.33 @@ -452,8 +447,7 @@ 1.34 if (page->bookmark_list) 1.35 { 1.36 for (bookmark = page->bookmark_list; bookmark; bookmark = bookmark->next) 1.37 - printf ("bookmark '%s' ", bookmark->name); 1.38 - printf ("\n"); 1.39 + printf ("bookmark %d '%s'\n", bookmark->level, bookmark->name); 1.40 } 1.41 for (i = page->range.first; i <= page->range.last; i++) 1.42 {
2.1 --- a/semantics.h Mon Dec 31 08:25:04 2001 +0000 2.2 +++ b/semantics.h Mon Dec 31 08:25:04 2001 +0000 2.3 @@ -28,7 +28,16 @@ 2.4 } input_modifier_type_t; 2.5 2.6 2.7 +typedef struct bookmark_t 2.8 +{ 2.9 + struct bookmark_t *next; 2.10 + int level; /* 1 is outermost */ 2.11 + char *name; 2.12 +} bookmark_t; 2.13 + 2.14 + 2.15 extern int line; /* line number in spec file */ 2.16 +extern int bookmark_level; 2.17 2.18 2.19 boolean parse_spec_file (char *fn); 2.20 @@ -43,6 +52,8 @@ 2.21 void input_images (range_t range); 2.22 2.23 /* semantic routines for output statements */ 2.24 +void output_push_context (void); 2.25 +void output_pop_context (void); 2.26 void output_set_file (char *name); 2.27 void output_set_bookmark (char *name); 2.28 void output_set_page_number_format (char *format);