1.1 diff -r 86a98659662f -r 9eb47d44dab9 parser.y 1.2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.3 +++ b/parser.y Fri Dec 28 04:44:05 2001 +0000 1.4 @@ -0,0 +1,97 @@ 1.5 +%{ 1.6 +#include <stdio.h> 1.7 +%} 1.8 + 1.9 +%union { 1.10 + int integer; 1.11 + double fp; 1.12 + char *string; 1.13 +} 1.14 + 1.15 +%token <integer> INTEGER 1.16 +%token <fp> FLOAT 1.17 +%token <string> STRING 1.18 + 1.19 +%token EVEN 1.20 +%token ODD 1.21 +%token ALL 1.22 + 1.23 +%token FILE 1.24 +%token IMAGE 1.25 +%token ROTATE 1.26 +%token CROP 1.27 +%token SIZE 1.28 +%token INPUT 1.29 + 1.30 +%token PAGE 1.31 +%token BOOKMARK 1.32 +%token OUTPUT 1.33 + 1.34 +%type <integer> range 1.35 +%type <integer> ranges 1.36 + 1.37 +%% 1.38 + 1.39 +statements: statement | statements statement; 1.40 + 1.41 +statement: input_statement | output_statement; 1.42 + 1.43 + 1.44 +range: INTEGER ".." INTEGER 1.45 + | INTEGER; 1.46 + 1.47 +ranges: range 1.48 + | ranges ',' range; 1.49 + 1.50 + 1.51 +file_clause: 1.52 + FILE STRING ';' ; 1.53 + 1.54 +image_clause: 1.55 + IMAGE ranges ';' ; 1.56 + 1.57 +rotate_clause: 1.58 + ROTATE INTEGER ';' ; 1.59 + 1.60 +crop_clause: 1.61 + CROP FLOAT ',' FLOAT ';' ; 1.62 + 1.63 +size_clause: 1.64 + SIZE FLOAT ',' FLOAT ';' ; 1.65 + 1.66 +part: 1.67 + EVEN | ODD | ALL; 1.68 + 1.69 +part_clause: 1.70 + part ';' ; 1.71 + 1.72 +input_clause: 1.73 + part_clause 1.74 + | file_clause | image_clause | rotate_clause 1.75 + | crop_clause | size_clause; 1.76 + 1.77 +input_clauses: 1.78 + input_clause 1.79 + | input_clauses input_clause; 1.80 + 1.81 +input_statement: 1.82 + INPUT '{' input_clauses '}' ; 1.83 + 1.84 + 1.85 +page_clause: 1.86 + PAGE ranges ';' 1.87 + | PAGE ranges ',' STRING ';' ; 1.88 + 1.89 +bookmark_clause: 1.90 + BOOKMARK STRING ';' ; 1.91 + 1.92 +output_clause: 1.93 + page_clause | bookmark_clause; 1.94 + 1.95 +output_clauses: 1.96 + output_clause 1.97 + | output_clauses output_clause; 1.98 + 1.99 +output_statement: 1.100 + OUTPUT '{' output_clauses '}' ; 1.101 +