Third iteration of QMake parser, looking for a parser generator

Andreas Pakulat apaku at gmx.de
Wed Jul 4 19:20:52 UTC 2007


On 04.07.07 17:29:35, Alexander Dymo wrote:
> I really think you should be using kdevelop-pg and hand written / flex
> lexer because kdevelop-pg is something which we can improve.
> Concerning AST, I don't think you'll get that bad AST for qmake
> projects. In anyway, somebody has to do smth with the AST at some
> point because we already have python and ruby and c# and java parsers
> using kdevelop-pg and needing that.

Why is everybody so eager to get me to use kdev-pg? 

Anyway, so I sat down and wrote up a simple, non-functional, but
ast-demonstrating parser for kdev-pg. Guess what: The generated AST is
not usable. I don't see why I should need to keep the token-stream
around after parsing, but I'd need to do that because the AST only
contains std::size_t for any token that is matched (like variable names
for example). Also there are some indirections in the AST which are
useless. So I'd have to write a visitor that transforms the
generated AST in a usable one.

Instead I think I'll write up a attributed grammar for Coco/R where I
can go on using my hand-written AST and I don't have to care about
encodings of files because I can write a template for the parser that
uses Qt classes for handling the input.

Andreas

-- 
You will be surprised by a loud noise.




More information about the KDevelop-devel mailing list