parser.y

Fri, 28 Dec 2001 16:04:15 +0000

author
eric
date
Fri, 28 Dec 2001 16:04:15 +0000
changeset 8
7288d2753c18
parent 7
e1f52aa9f252
child 9
de78038d990f
permissions
-rw-r--r--

*** empty log message ***

     1 %{
     2 #include <stdio.h>
     3 %}
     5 %union {
     6   int integer;
     7   double fp;
     8   char *string;
     9 }
    11 %token <integer> INTEGER
    12 %token <fp> FLOAT
    13 %token <string> STRING
    15 %token ELIPSIS
    17 %token EVEN
    18 %token ODD
    19 %token ALL
    21 %token FILE
    22 %token IMAGE
    23 %token ROTATE
    24 %token CROP
    25 %token SIZE
    26 %token INPUT
    28 %token PAGE
    29 %token PAGES
    30 %token BOOKMARK
    31 %token OUTPUT
    33 %type <integer> range
    34 %type <integer> ranges
    36 %%
    38 statements: statement | statements statement ;
    40 statement: input_statement | output_statement ;
    43 range:	INTEGER ELIPSIS INTEGER
    44 	| INTEGER ;
    46 ranges:	range
    47 	| ranges ',' range ;
    50 file_clause:
    51 	FILE STRING  ';' ;
    53 image_clause:
    54 	IMAGE ranges ';' ;
    56 rotate_clause:
    57 	ROTATE INTEGER ';' ;
    59 crop_clause:
    60 	CROP FLOAT ',' FLOAT ';' ;
    62 size_clause:
    63 	SIZE FLOAT ',' FLOAT ';' ;
    65 part:
    66 	EVEN | ODD | ALL ;
    68 part_clause:
    69 	part input_clause ;
    71 input_clause:
    72 	part_clause
    73 	| file_clause | image_clause | rotate_clause
    74 	| crop_clause | size_clause
    75 	| input_clause_list ;
    77 input_clauses:
    78 	input_clause
    79 	| input_clauses input_clause ;
    81 input_clause_list:
    82 	'{' input_clauses '}' ;
    84 input_statement:
    85 	INPUT input_clauses ;
    87 page_clause:
    88 	PAGE INTEGER ';'
    89 	| PAGE INTEGER ',' STRING ';' ;
    91 pages_clause:
    92 	PAGES ranges ';'
    93 	| PAGES ranges ',' STRING ';' ;
    95 bookmark_clause:
    96 	BOOKMARK INTEGER ',' STRING ';'
    97 	| BOOKMARK STRING ';' ;
    99 output_clause:
   100 	page_clause | pages_clause | bookmark_clause
   101 	| output_clause_list ;
   103 output_clauses:
   104 	output_clause
   105 	| output_clauses output_clause ;
   107 output_clause_list:
   108 	'{' output_clauses '}' ;
   110 output_statement:
   111 	OUTPUT output_clauses ;