diff options
Diffstat (limited to 'test/err_syntax25.y')
-rw-r--r-- | test/err_syntax25.y | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/test/err_syntax25.y b/test/err_syntax25.y new file mode 100644 index 0000000..9b5dfd1 --- /dev/null +++ b/test/err_syntax25.y @@ -0,0 +1,51 @@ +%{ +int yylex(void); +static void yyerror(const char *); +%} + +%union { + int ival; + double dval; +} + +%union { + int ival2; + double dval2; +} + +%start expr +%type <tag2> expr + +%token NUMBER + +%% + +expr : '(' recur ')' + ; + +recur : NUMBER + { $$ = 1; } + ; + +%% + +#include <stdio.h> + +int +main(void) +{ + printf("yyparse() = %d\n", yyparse()); + return 0; +} + +int +yylex(void) +{ + return -1; +} + +static void +yyerror(const char* s) +{ + printf("%s\n", s); +} |