Fri, 28 Dec 2001 04:44:05 +0000
Initial revision
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 EVEN
16 %token ODD
17 %token ALL
19 %token FILE
20 %token IMAGE
21 %token ROTATE
22 %token CROP
23 %token SIZE
24 %token INPUT
26 %token PAGE
27 %token BOOKMARK
28 %token OUTPUT
30 %type <integer> range
31 %type <integer> ranges
33 %%
35 statements: statement | statements statement;
37 statement: input_statement | output_statement;
40 range: INTEGER ".." INTEGER
41 | INTEGER;
43 ranges: range
44 | ranges ',' range;
47 file_clause:
48 FILE STRING ';' ;
50 image_clause:
51 IMAGE ranges ';' ;
53 rotate_clause:
54 ROTATE INTEGER ';' ;
56 crop_clause:
57 CROP FLOAT ',' FLOAT ';' ;
59 size_clause:
60 SIZE FLOAT ',' FLOAT ';' ;
62 part:
63 EVEN | ODD | ALL;
65 part_clause:
66 part ';' ;
68 input_clause:
69 part_clause
70 | file_clause | image_clause | rotate_clause
71 | crop_clause | size_clause;
73 input_clauses:
74 input_clause
75 | input_clauses input_clause;
77 input_statement:
78 INPUT '{' input_clauses '}' ;
81 page_clause:
82 PAGE ranges ';'
83 | PAGE ranges ',' STRING ';' ;
85 bookmark_clause:
86 BOOKMARK STRING ';' ;
88 output_clause:
89 page_clause | bookmark_clause;
91 output_clauses:
92 output_clause
93 | output_clauses output_clause;
95 output_statement:
96 OUTPUT '{' output_clauses '}' ;