err_syntax16.y revision 264790
1264790Sbapt%{ 2264790Sbaptint yylex(void); 3264790Sbaptstatic void yyerror(const char *); 4264790Sbapt%} 5264790Sbapt 6264790Sbapt%token second 7264790Sbapt 8264790Sbapt%% 9264790Sbapt 10264790Sbaptfirstx 11264790Sbapt : '(' secondx 12264790Sbapt ; 13264790Sbapt 14264790Sbaptsecond : 15264790Sbapt ')' 16264790Sbapt ; 17264790Sbapt 18264790SbaptS: error 19264790Sbapt%% 20264790Sbapt 21264790Sbapt#include <stdio.h> 22264790Sbapt 23264790Sbaptint 24264790Sbaptmain(void) 25264790Sbapt{ 26264790Sbapt printf("yyparse() = %d\n", yyparse()); 27264790Sbapt return 0; 28264790Sbapt} 29264790Sbapt 30264790Sbaptint 31264790Sbaptyylex(void) 32264790Sbapt{ 33264790Sbapt return -1; 34264790Sbapt} 35264790Sbapt 36264790Sbaptstatic void 37264790Sbaptyyerror(const char* s) 38264790Sbapt{ 39264790Sbapt printf("%s\n", s); 40264790Sbapt} 41