12 static void yyerror(const char *s);
25 %left UMINUS /* supplies precedence for unary minus */
27 %% /* beginning of rules section */
57 | '-' expr %prec UMINUS
65 { $$ = $1; base = ($1==0) ? 8 : 10; }
67 { $$ = base * $1 + $2; }
70 %% /* start of programs */
73 extern int YYLEX_DECL();
86 yyerror(const char *s)
88 fprintf(stderr, "%s\n", s);
94 /* lexical analysis routine */
95 /* returns LETTER for a lower case letter, yylval = 0 through 25 */
96 /* return DIGIT for a digit, yylval = 0 through 9 */
97 /* all other characters are returned immediately */
101 while( (c=getchar()) == ' ' ) { /* skip blanks */ }
103 /* c is now nonblank */