From: Grzegorz J. <ja...@ac...> - 2005-02-20 10:58:07
|
Hi, Sorry for the late reply, I was traveling and unable to access my e-mail. Dr Gorilla wrote: > Ok Im building the two occ core libs in visual studio - but i had to > drop down to cygwin to build the ptree-generated file. The plan is to rewrite this part in Python. Should be very straighforward, pls. do it if you have time and interest. > anyway im finding an odd problem: > > if I code - > > Opencxx::ProgramString* ps = new Opencxx::ProgramString; > *ps << "{}"; > > Opencxx::Program* program = ps; > > Lex lexer(program); > Parser parser(&lexer, errorLog); > > // parse tree > Ptree* result; > parser.rDefinition(result); > > > > no matter what i place into the source string its getting into an > infinite loop inside the Lex ctor > > do > { > kind = ReadToken(pos, len); > tokens_.push_back(Token(kind, pos, len)); > } > while (kind); > > when ReadToken hits an end of string (0 terminator) its just backing > up and returning the last character.... > > > am i doing something wrong ? Nope. It was a bug, which I have hopefully fixed. Some code in Lex.cc erroneously assumed that Program::Get() can always be undone by Program::Unget(). This is not true if Program::Get() returns EOF. See last postings on opencxx-commits mailing list for detailed account of what I have changed. My fixes went into occ-lib, so if you want them in opencxx proper, please backport (and ideally commit to our CVS). Best regards Grzegorz |