parser.y

changeset 27
7a28031fe457
parent 20
a1cd8cb9d09e
child 30
35fad7ec7732
     1.1 diff -r 4368c5fd9242 -r 7a28031fe457 parser.y
     1.2 --- a/parser.y	Tue Jan 01 03:44:40 2002 +0000
     1.3 +++ b/parser.y	Tue Jan 01 03:46:08 2002 +0000
     1.4 @@ -6,15 +6,18 @@
     1.5  
     1.6  %union {
     1.7    int integer;
     1.8 +  char character;
     1.9    double fp;
    1.10    char *string;
    1.11    page_size_t size;
    1.12    range_t range;
    1.13 +  page_label_t page_label;
    1.14  }
    1.15  
    1.16  %token <integer> INTEGER
    1.17  %token <fp> FLOAT
    1.18  %token <string> STRING
    1.19 +%token <character> CHARACTER
    1.20  %token <size> PAGE_SIZE
    1.21  
    1.22  %token ELIPSIS
    1.23 @@ -38,7 +41,7 @@
    1.24  %token RESOLUTION
    1.25  %token INPUT
    1.26  
    1.27 -%token FORMAT
    1.28 +%token LABEL
    1.29  %token PAGE
    1.30  %token PAGES
    1.31  %token BOOKMARK
    1.32 @@ -151,8 +154,11 @@
    1.33  output_file_clause:
    1.34  	FILE_KEYWORD STRING  ';' { output_set_file ($2) } ;
    1.35  
    1.36 -format_clause:
    1.37 -	FORMAT STRING ';' { output_set_page_number_format ($2) } ;
    1.38 +label_clause:
    1.39 +	LABEL ';' { page_label_t label = { NULL, '\0' }; output_set_page_label (label); }
    1.40 +	| LABEL STRING ';' { page_label_t label = { $2, '\0' }; output_set_page_label (label); }
    1.41 +	| LABEL CHARACTER ';' { page_label_t label = { NULL, $2 }; output_set_page_label (label); }
    1.42 +	| LABEL STRING ',' CHARACTER ';' { page_label_t label = { $2, $4 }; output_set_page_label (label); } ;
    1.43  
    1.44  page_ranges:
    1.45  	range { output_pages ($1); }
    1.46 @@ -172,13 +178,13 @@
    1.47  	| bookmark_name_list ',' bookmark_name ;
    1.48  
    1.49  bookmark_clause:
    1.50 -	BOOKMARK { output_push_context (); }
    1.51 +	BOOKMARK { output_push_context (); bookmark_level++; }
    1.52  	bookmark_name_list
    1.53 -	output_clause_list ';' { output_pop_context (); } ;
    1.54 +	output_clause_list ';' { bookmark_level--; output_pop_context (); } ;
    1.55  
    1.56  output_clause:
    1.57  	output_file_clause
    1.58 -	| format_clause
    1.59 +	| label_clause
    1.60  	| page_clause | pages_clause
    1.61  	| bookmark_clause
    1.62  	| output_clause_list ;