Facing problems with lex/bison

Discussion in 'Software' started by prashantkyal, Sep 10, 2007.

  1. prashantkyal


    Sep 10, 2007
    Likes Received:
    Hi ppl!
    I am new to bison and lex. I have written a set of programs in lex and bison where yylex generated thru lex is used as an input in bison.
    When I try to compile the files, the tab.c file generated thru bison is compiled successfully. But during the compilation of the file generated thru the lex starts I get the following error:

    g++ -o obj/conf_parser.o -I/home/pkyal/WORK/SWAT/MMDSP/parser/test/devkit/libmmparser/obj -I/home/pkyal/WORK/SWAT/MMDSP/parser/devkit/libmmparser/include -Wno-deprecated -c obj/conf_parser.cpp
    In file included from conf_parser.l:4:
    conf_parser.y:130: syntax error before `*' token
    conf_parser.y:131: syntax error before `*' token
    conf_parser.y:132: syntax error before `*' token
    conf_parser.y:133: syntax error before `*' token

    the lines in cinf_parser.y as per the error are as follows:
    126 %union {
    127 int integer;
    128 float float_ieee;
    129 char* str;
    130 YYLIST_T* list;
    131 YYCORE_T* coretype;
    132 YYBLOC_T* bloctype;
    133 YYPARAM_T* paramtype;
    134 }

    I'm using YYLIST_T etc as datatypes that I wish to parse. I have typedef them in an included header.

    Any suggestions as to what may be the possible error... a problem due to different version or somethng... bcoz I dont see any syntactic error in the code..
    prashantkyal, Sep 10, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.