Using antlr for kdev4

Andreas Pakulat apaku at gmx.de
Fri Dec 1 12:16:21 UTC 2006


On 01.12.06 13:44:42, Alexander Dymo wrote:
> On Friday 01 December 2006 13:15, Andreas Pakulat wrote:
> > > I also assume that you've looked at using KDevelop-PG as well. Although
> > > Jakob says he's argued against it, I don't recall the conversation.
> >
> > The biggest problem with kdev-pg is, that the AST it generates doesn't
> > allow for modifications, which means I'd have to think about other ways
> > to change the project file. If I understood adymo correctly he mentioned
> > that we could use the AST to get the proper position where to insert a
> > new variable (or anything else) and then insert directly into the file.
> > This would of course mean having to reparse on every change to a file
> > and possibly also reparse the subprojects...
> 
> Well, I don't think that's going to be easier with Antlr. Yes, you can create
> more customized AST in Antlr (to make ast smaller and add "write back"
> methods), but I guess  the same thing could be achieved with custom 
> kdev-pg ast tree walker.

Hmm, so I would parse a file, run a tree-walker over the AST and then
create another AST out of that? As I may end up doing pretty much the
same thing in antlr, I think you have a point here. 

> So if you're deciding against flex/bison, I'd still recommend kdev-pg.

Noted, the only thing that kdev-pg currently for me personally is
lacking is documentation of syntax. Antlr's isn't great but at least it
exists ;) On the other hand, jpetso is often in IRC and I can bug him
with any problems, I guess :)

Ok, so how about this: I'll give flex/bison another try the next 2 days,
if it doesn't work out, I check on kdev-pg and write tree-walker. Matt
does that feel better in terms of dependecies? (Especially as kdev-pg
parsers don't need a library)

Andreas

-- 
You have a truly strong individuality.




More information about the KDevelop-devel mailing list