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