10 #define __EXTERN_C__ 1
13 #if defined(__cplusplus) || defined(__STDC__)
14 #if defined(__cplusplus) && defined(__EXTERN_C__)
21 int yyback(int *, int);
24 /* You may need to put /DLEX_SCANNER in your makefile
25 * if you're using LEX!
28 /* int yyoutput(int); */
34 #if defined(__cplusplus) || defined(__STDC__)
35 #if defined(__cplusplus) && defined(__EXTERN_C__)
43 /* struct pexpr *expr; */
59 %token CLOSE_SQUARE 10
63 /* %type <expr> command expr arglist arg arg1 */
64 %type <s> command expr arglist arg arg1
68 commands : /* empty */
73 {process_command(proio_cons(make_word($1), NULL)); free($1);}
75 {process_command($1);}
77 {syntax_error("Unrecognized command.");}
80 expr : WORD OPEN arglist CLOSE
81 {$$ = proio_cons(make_word($1), $3); free($1);}
82 | OPEN_SQUARE CLOSE_SQUARE
83 {$$ = proio_cons(NULL, NULL);}
84 | OPEN_SQUARE arglist CLOSE_SQUARE
91 {$$ = proio_cons($1, NULL);}
94 {$$ = proio_cons($1, $3);}
97 arg : WORD EQUALS arg1
98 {$$ = proio_cons(make_word("="), proio_cons(make_word($1), proio_cons($3, NULL)));
104 {$$ = make_word($1); free($1);}
106 {$$ = make_string($1); free($1);}
108 {$$ = make_integer($1); free($1);}
109 | INTEGER PERIOD INTEGER
110 {$$ = make_real($1, $3); free($1); free($3); }
111 | INTEGER EXP INTEGER
112 {$$ = make_exp($1, $3); free($1); free($3); }
114 INTEGER PERIOD INTEGER EXP INTEGER
115 {$$ = make_exp2($1, $3, $5); free($1); free($3);
127 #include "../common/lex_yy.c"
138 /* Ansi prototype. If this doesn't work for you... uncomment
142 void yyerror(char *s)
148 * Unfortunately, my DOS version of FLEX
149 * requires yywrap to be #def'ed, whereas
150 * the UNIX flex expects a proper function.
153 /* Not sure if __SC__ is the appropriate thing
162 #else if !defined(__alpha) && !defined(__ultrix)
163 int yywrap() { return 1; }