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 ***

eric@5 1 %{
eric@5 2 #include <stdio.h>
eric@5 3 %}
eric@5 4
eric@5 5 %union {
eric@5 6 int integer;
eric@5 7 double fp;
eric@5 8 char *string;
eric@5 9 }
eric@5 10
eric@5 11 %token <integer> INTEGER
eric@5 12 %token <fp> FLOAT
eric@5 13 %token <string> STRING
eric@5 14
eric@7 15 %token ELIPSIS
eric@7 16
eric@5 17 %token EVEN
eric@5 18 %token ODD
eric@5 19 %token ALL
eric@5 20
eric@5 21 %token FILE
eric@5 22 %token IMAGE
eric@5 23 %token ROTATE
eric@5 24 %token CROP
eric@5 25 %token SIZE
eric@5 26 %token INPUT
eric@5 27
eric@5 28 %token PAGE
eric@5 29 %token BOOKMARK
eric@5 30 %token OUTPUT
eric@5 31
eric@5 32 %type <integer> range
eric@5 33 %type <integer> ranges
eric@5 34
eric@5 35 %%
eric@5 36
eric@7 37 statements: statement | statements statement ;
eric@5 38
eric@7 39 statement: input_statement | output_statement ;
eric@5 40
eric@5 41
eric@7 42 range: INTEGER ELIPSIS INTEGER
eric@7 43 | INTEGER ;
eric@5 44
eric@5 45 ranges: range
eric@7 46 | ranges ',' range ;
eric@5 47
eric@5 48
eric@5 49 file_clause:
eric@5 50 FILE STRING ';' ;
eric@5 51
eric@5 52 image_clause:
eric@5 53 IMAGE ranges ';' ;
eric@5 54
eric@5 55 rotate_clause:
eric@5 56 ROTATE INTEGER ';' ;
eric@5 57
eric@5 58 crop_clause:
eric@5 59 CROP FLOAT ',' FLOAT ';' ;
eric@5 60
eric@5 61 size_clause:
eric@5 62 SIZE FLOAT ',' FLOAT ';' ;
eric@5 63
eric@5 64 part:
eric@7 65 EVEN | ODD | ALL ;
eric@5 66
eric@5 67 part_clause:
eric@7 68 part input_clause ;
eric@5 69
eric@5 70 input_clause:
eric@5 71 part_clause
eric@5 72 | file_clause | image_clause | rotate_clause
eric@7 73 | crop_clause | size_clause
eric@7 74 | input_clause_list ;
eric@5 75
eric@5 76 input_clauses:
eric@5 77 input_clause
eric@7 78 | input_clauses input_clause ;
eric@7 79
eric@7 80 input_clause_list:
eric@7 81 '{' input_clauses '}' ;
eric@5 82
eric@5 83 input_statement:
eric@7 84 INPUT input_clause ;
eric@5 85
eric@5 86 page_clause:
eric@5 87 PAGE ranges ';'
eric@5 88 | PAGE ranges ',' STRING ';' ;
eric@5 89
eric@5 90 bookmark_clause:
eric@5 91 BOOKMARK STRING ';' ;
eric@5 92
eric@5 93 output_clause:
eric@7 94 page_clause | bookmark_clause
eric@7 95 | output_clause_list ;
eric@5 96
eric@5 97 output_clauses:
eric@5 98 output_clause
eric@7 99 | output_clauses output_clause ;
eric@7 100
eric@7 101 output_clause_list:
eric@7 102 '{' output_clauses '}' ;
eric@5 103
eric@5 104 output_statement:
eric@7 105 OUTPUT output_clause ;
eric@5 106