On 14 august 2007 00:35 Rob Kennedy wrote: Subject: Re: About compiler-compilers, parsers
> GNU Flex has a C++ mode, where the lexer it generates is a class rather > than a set of global variables and functions. It also lets you provide > your own yyinput function, where you fill Flex's buffer from whatever > source you want, including a stream. (In C, you can also simply provide > your own FILE* value, which is usually a file, but can also be any > other C > file handle.) Unfortunately Delphi will not compile C++ so that's a bit more difficult to use. I might be able to use a secondary compiler to compile the parser and then link that into Delphi but then I'll need to write all my data structures twice, that's not something I'm looking forward to. Especially since C++ is like French to me: I can read it but I can only write it with a dictionary. > > > (2) Are there any other tools similar to lex/yacc, commercial or > open > > source that can generate Delphi code? I've been following a few other > > parser projects but they don't generate Delphi code. > > Mike Lischke's Delphi Compiler Generator is based on TP Lex. Have you > looked at it yet? This project? http://www.grendelproject.nl/dyacclex/ I'm using a hacked version right now. I've modified it so the generated files are class-based and it works, also it's *UGLY* - because I only modified the libraries (lexlib and yacclib) and the .cod files; Anyway, with all its ugliness it's an good system, it works fine. Looking forward for a bigger project to test my new tools! > > You might try asking on the comp.compilers newsgroup. > I just registered to the email variant of comp.compilers newsgroup. Thanks for the tip! -- Cosmin Prund _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

