help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bison doesn't parse my include file


From: Juergen Schumacher
Subject: bison doesn't parse my include file
Date: Tue, 10 Jan 2012 01:02:02 +0100

sorry for bothering anybody,

i am trying to c++ parse an include file with flex 2.5.35 and bison 2.3 on a 
mac os x snow leopard installation - everything without include file works 
perfectly.

my latest attempt was:

I|i          BEGIN(incl);

<incl>[ \t]*
<incl>[^ \t\n]+ {
        printf(yytext);
        printf("\n");

                       std::ifstream fin(yytext);
                       yy_buffer_state* my_buffer_state = 
yy_create_buffer(&fin, YY_BUF_SIZE);
                       yypush_buffer_state(my_buffer_state);
                       BEGIN(INITIAL);
                 }

i get the stream name correct, but receive an <<EOF>> immediately - instead of 
the parsed parameter values -
although i can read the stream via lex()...

am i stupid or do i miss some basic parser call...?

any help would be highly appreciated.

regards

juergen

 
--
Dr. Juergen Schumacher
Hochschule fuer Technik Stuttgart
Forschungszentrum zafh.net
Schellingstrasse 24
70174 Stuttgart
Telefon: 0711.8926.2840
Telefax: 0711.8926.2986
Mobil: 0170.3445457
www.zafh.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]