Re: Calling two times yyparse reloading yyin

2005-11-30 Thread Tim Van Holder
Ismael Moreno wrote: > First of all, i've included an "old" version of this piece of code. I fixed > after ask the yyin field, so sorry. > > Well, after using yyrestart and all what you said, now looks like the > problem is in the first yyparse() function. > > I made an diagram with an "assigment

Re: Calling two times yyparse reloading yyin

2005-11-29 Thread Ismael Moreno
First of all, i've included an "old" version of this piece of code. I fixed after ask the yyin field, so sorry. Well, after using yyrestart and all what you said, now looks like the problem is in the first yyparse() function. I made an diagram with an "assigment" node as a testcase. This diagrams

Re: Calling two times yyparse reloading yyin

2005-11-29 Thread Ismael Moreno
I forgot to mention that i've changed the delete instruction. As Tim said, it's better free, or use brackets at the end of the delete sentence, since i was deleting an array. And strdup is needed, because ::c_str() returns const* char, instead of char*. On 11/29/05, Ismael Moreno <[EMAIL PROTECTED

Re: Calling two times yyparse reloading yyin

2005-11-29 Thread Tim Van Holder
Ismael Moreno wrote: > void cAssigNode::translate(cVM& vm) throw(std::exception) > { > char* Text; > Text = strdup(RValue.c_str()); > > FILE* yyin = fmemopen(Text, strlen(Text), "r"); > if(yyin == NULL) > throw(cError("Can't open yyin stream")); > > yyparse(); yypars

Calling two times yyparse reloading yyin

2005-11-29 Thread Ismael Moreno
Hi all, I'm including a parser in Bison for a C++ project (a flow chart interpreter), but it brings me a lot of odd problems. The translation of a assigment node ( a assigment instruction) first parses the rvalue and, then, lvalue. RValue and LValue are strings, so yyin is loaded by fmemopen. The p