From: Dowling, W. (W. (TS USA) <wil...@th...> - 2005-01-24 22:06:37
|
One limitation of the flexml-generated parser is that its prototype is fixed within flexml: int yylex() In order to pass in a parameter to the generated parser, I had to resort to a flex command line that contained this (I am generating C++ code, hence the class declaration) -PLinksXML \ -DYY_DECL='"class LinksAPIStart; static LinksAPIStart * private_Start_ptr; int LinksXMLlex(LinksAPIStart *LinksAPIStart_ptr)"' \ -DYY_USER_INIT='"private_Start_ptr=LinksAPIStart_ptr;"' This trick allows me to refer to the parameter passed into the parser (LinksAPIStart_ptr) using the name private_Start_ptr in my .act file. I sure would like a cleaner way to do this. Any ideas? Will -- William F. Dowling Thomson/ISI (www.isinet.com) 215-386-0100 x-1156 ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ |