parser.y

Fri, 28 Dec 2001 04:55:47 +0000

author
eric
date
Fri, 28 Dec 2001 04:55:47 +0000
changeset 7
e1f52aa9f252
parent 5
9eb47d44dab9
child 8
7288d2753c18
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 BOOKMARK
    30 %token OUTPUT
    32 %type <integer> range
    33 %type <integer> ranges
    35 %%
    37 statements: statement | statements statement ;
    39 statement: input_statement | output_statement ;
    42 range:	INTEGER ELIPSIS INTEGER
    43 	| INTEGER ;
    45 ranges:	range
    46 	| ranges ',' range ;
    49 file_clause:
    50 	FILE STRING  ';' ;
    52 image_clause:
    53 	IMAGE ranges ';' ;
    55 rotate_clause:
    56 	ROTATE INTEGER ';' ;
    58 crop_clause:
    59 	CROP FLOAT ',' FLOAT ';' ;
    61 size_clause:
    62 	SIZE FLOAT ',' FLOAT ';' ;
    64 part:
    65 	EVEN | ODD | ALL ;
    67 part_clause:
    68 	part input_clause ;
    70 input_clause:
    71 	part_clause
    72 	| file_clause | image_clause | rotate_clause
    73 	| crop_clause | size_clause
    74 	| input_clause_list ;
    76 input_clauses:
    77 	input_clause
    78 	| input_clauses input_clause ;
    80 input_clause_list:
    81 	'{' input_clauses '}' ;
    83 input_statement:
    84 	INPUT input_clause ;
    86 page_clause:
    87 	PAGE ranges ';'
    88 	| PAGE ranges ',' STRING ';' ;
    90 bookmark_clause:
    91 	BOOKMARK STRING ';' ;
    93 output_clause:
    94 	page_clause | bookmark_clause
    95 	| output_clause_list ;
    97 output_clauses:
    98 	output_clause
    99 	| output_clauses output_clause ;
   101 output_clause_list:
   102 	'{' output_clauses '}' ;
   104 output_statement:
   105 	OUTPUT output_clause ;