10 #define YYLEX_PARAM &yylval
11 #define YYLEX_DECL() yylex(YYSTYPE *yylval)
12 #define YYERROR_DECL() yyerror(const char *s)
14 static void YYERROR_DECL();
27 %left UMINUS /* supplies precedence for unary minus */
29 %% /* beginning of rules section */
59 | '-' expr %prec UMINUS
67 { $$ = $1; base = ($1==0) ? 8 : 10; }
69 { $$ = base * $1 + $2; }
72 %% /* start of programs */
75 static int YYLEX_DECL();
90 fprintf(stderr, "%s\n", s);
96 /* lexical analysis routine */
97 /* returns LETTER for a lower case letter, yylval = 0 through 25 */
98 /* return DIGIT for a digit, yylval = 0 through 9 */
99 /* all other characters are returned immediately */
103 while( (c=getchar()) == ' ' ) { /* skip blanks */ }
105 /* c is now nonblank */