vendredi 31 juillet 2015

VS2010, flex & bison, redefinition and syntax errors with no line numbers

I've set up flex and bison, figured out how to get them to work properly, and also weeded out the bulk of errors which made it into the generated code, now I am convinced that the 3 remaining errors are not my fault:

Error   10  error C2371: 'free' : redefinition; different basic types

Error   8   error C2059: syntax error : '=' path...\parser.tab.c

Error   9   error C2040: 'malloc' : 'void *(size_t)' differs in levels of indirection from 'void *(size_t)' path...\parser.tab.c

The file parser.tab.c is about 1600 lines long, so I don't intend to look for a suspicious '=' through the whole file. Also it redirects to the code in my own files with the #line instruction (didn't even know it existed before) so it would complain about my own files, as it did before.

As I said, there are no line numbers, the field is empty, which is why I sought refuge here, I have no clue where to even look. Double clicking the error doesn't do anything either. It is not an issue with my installation, I opened two other projects in C# and XNA and they behave fine.

Flex and bison have been giving me a real hard time so far, so I can't wait to get them to compile correctly.

Edit: Bison file

%{

#include "lex.yy.c"
#include "stdlib.h"

#define E_IDENTIFIER 300
#define E_FUNCTION 301

int currentBrackets = 0;
%}

%token E_FUNCTION E_IDENTIFIER

%%

expression: E_IDENTIFIER {return E_IDENTIFIER;}

%%

Aucun commentaire:

Enregistrer un commentaire