I am totally new to bison an I am confused on many parts but when I tried compiling my code it gave me the error
bison -d Compiler/grammar.y
("Compiler/grammar.y", line 9) error: unrecognized: %define
("Compiler/grammar.y", line 9) error: Skipping to next %
This is the code:
%{
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int yylex (void);
void yyerror (char const *);
%}
%define api.value.type {double}
%token NAME COLON RIGHT_ARROW LEFT_BRACE RIGHT_BRACE
%start input
%%
input:
NAME COLON RIGHT_ARROW LEFT_BRACE RIGHT_BRACE
%%
void yyerror(char const *x)
{
printf("Error %s\n",x)
exit(1);
}
I checked the documentation and nothing seemed wrong. I am writing in c and using bison version 3.0.4 and flex 2.5.6.