Fri, 28 Dec 2001 16:04:15 +0000
*** 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@8 | 29 | %token PAGES |
eric@5 | 30 | %token BOOKMARK |
eric@5 | 31 | %token OUTPUT |
eric@5 | 32 | |
eric@5 | 33 | %type <integer> range |
eric@5 | 34 | %type <integer> ranges |
eric@5 | 35 | |
eric@5 | 36 | %% |
eric@5 | 37 | |
eric@7 | 38 | statements: statement | statements statement ; |
eric@5 | 39 | |
eric@7 | 40 | statement: input_statement | output_statement ; |
eric@5 | 41 | |
eric@5 | 42 | |
eric@7 | 43 | range: INTEGER ELIPSIS INTEGER |
eric@7 | 44 | | INTEGER ; |
eric@5 | 45 | |
eric@5 | 46 | ranges: range |
eric@7 | 47 | | ranges ',' range ; |
eric@5 | 48 | |
eric@5 | 49 | |
eric@5 | 50 | file_clause: |
eric@5 | 51 | FILE STRING ';' ; |
eric@5 | 52 | |
eric@5 | 53 | image_clause: |
eric@5 | 54 | IMAGE ranges ';' ; |
eric@5 | 55 | |
eric@5 | 56 | rotate_clause: |
eric@5 | 57 | ROTATE INTEGER ';' ; |
eric@5 | 58 | |
eric@5 | 59 | crop_clause: |
eric@5 | 60 | CROP FLOAT ',' FLOAT ';' ; |
eric@5 | 61 | |
eric@5 | 62 | size_clause: |
eric@5 | 63 | SIZE FLOAT ',' FLOAT ';' ; |
eric@5 | 64 | |
eric@5 | 65 | part: |
eric@7 | 66 | EVEN | ODD | ALL ; |
eric@5 | 67 | |
eric@5 | 68 | part_clause: |
eric@7 | 69 | part input_clause ; |
eric@5 | 70 | |
eric@5 | 71 | input_clause: |
eric@5 | 72 | part_clause |
eric@5 | 73 | | file_clause | image_clause | rotate_clause |
eric@7 | 74 | | crop_clause | size_clause |
eric@7 | 75 | | input_clause_list ; |
eric@5 | 76 | |
eric@5 | 77 | input_clauses: |
eric@5 | 78 | input_clause |
eric@7 | 79 | | input_clauses input_clause ; |
eric@7 | 80 | |
eric@7 | 81 | input_clause_list: |
eric@7 | 82 | '{' input_clauses '}' ; |
eric@5 | 83 | |
eric@5 | 84 | input_statement: |
eric@8 | 85 | INPUT input_clauses ; |
eric@5 | 86 | |
eric@5 | 87 | page_clause: |
eric@8 | 88 | PAGE INTEGER ';' |
eric@8 | 89 | | PAGE INTEGER ',' STRING ';' ; |
eric@8 | 90 | |
eric@8 | 91 | pages_clause: |
eric@8 | 92 | PAGES ranges ';' |
eric@8 | 93 | | PAGES ranges ',' STRING ';' ; |
eric@5 | 94 | |
eric@5 | 95 | bookmark_clause: |
eric@8 | 96 | BOOKMARK INTEGER ',' STRING ';' |
eric@8 | 97 | | BOOKMARK STRING ';' ; |
eric@5 | 98 | |
eric@5 | 99 | output_clause: |
eric@8 | 100 | page_clause | pages_clause | bookmark_clause |
eric@7 | 101 | | output_clause_list ; |
eric@5 | 102 | |
eric@5 | 103 | output_clauses: |
eric@5 | 104 | output_clause |
eric@7 | 105 | | output_clauses output_clause ; |
eric@7 | 106 | |
eric@7 | 107 | output_clause_list: |
eric@7 | 108 | '{' output_clauses '}' ; |
eric@5 | 109 | |
eric@5 | 110 | output_statement: |
eric@8 | 111 | OUTPUT output_clauses ; |