From: Martin Q. <mar...@lo...> - 2006-08-30 05:52:44
|
Ok, done. I just commited a testcase having 2 parsers embeeded. This code is quite crude: I failed to get the action files working in that case. We do not use them in our project, so I dunno it is actually broken or whether I'm an idiot unable to set this up properly. It would be really cool if you could double check. I had to call flexml twice to generate the scanner and the header separately. Again, we do so in SimGrid and it kinda breaks when I try to do one run only. Naturally, if you have 2 parsers, you need the parser controls functions such as the following: extern int one_lex (void); extern void one_restart (FILE *input_file ); extern void one__switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE one__create_buffer (FILE *file,int size ); extern void one__delete_buffer (YY_BUFFER_STATE b ); extern void one__flush_buffer (YY_BUFFER_STATE b ); extern void one_push_buffer_state (YY_BUFFER_STATE new_buffer ); extern void one_pop_buffer_state (void ); It may be cool if those function where added to the header file. Here and in SimGrid, we declare them manually in a separate header file. I cannot find anymore how we got the XML application entry points functions prototypes (STag_* and ETag_*) declared properly so that it compile without "implicit declaration of function" warning. We got this working in SimGrid, but the commited example spits lots of warnings. I think that's it. As you can see, it seems to be room for improvement both in this testcase and in flexml to properly deal with multiple scanners... Bye, Mt. On Mon, Aug 28, 2006 at 10:42:23AM -0400, William F. Dowling wrote: > Sorry I messed this up for you. Would it be possible for you to check > in a tiny test into the testbed/ directory, in the style of the ones > that are there, that would fail before your change, but passes after > your change? >=20 > This way we would have 1) a documented case of using >1 flexer; and 2) a > test that would hopefully fail if other changes are introduced that do > not respect the need for $tagprefix. Since I don't have any such cases > yet, I didn't notice the failure I introduced. >=20 > Will >=20 > On Sun, 2006-08-27 at 20:47 +0000, Martin Quinson wrote: > > Update of /cvsroot/flexml/flexml > > In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv5660 > >=20 > > Modified Files: > > flexml.pl=20 > > Log Message: > > Make sure bufferstack and bufferliteral play well wrt -P option: I have= 2 flexers in the same application --=20 L'informatique soit =E7a marche pas, soit ca marchait avant qu'on y touche. |