track bookmark level.

Mon, 31 Dec 2001 08:25:04 +0000

author
eric
date
Mon, 31 Dec 2001 08:25:04 +0000
changeset 24
6575fcfbdb1b
parent 23
1fe64161aaac
child 25
139b91f9a224

track bookmark level.

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