[antlr-interest] LINQ in a lexer/parser? (WAS: C# Target Poll)

Johannes Luber JALuber at gmx.de
Mon May 19 16:09:41 PDT 2008


> Hi,
> 
> > I was thinking of using it in the runtime. As I neither have 
> > used LINQ yet nor have looked for a place where LINQ would be 
> > useful I can't give you an example. It was simply on my list 
> > with a low priority - and you wanted to see all my items. ;) 
> > And to close this thread: I don't know if LINQ is useful in a 
> > lexer or parser within the generated part but users may use 
> > it in actions and member sections.
> 
> Sorry, I didn't mean to put you on the spot.
> 
> I had read an article using LINQ to implement parser combinators. His
> version worked but was unoptimized iirc, I was hoping you had some ideas
> on
> LINQ's utility...

Somehow this looks familiar - do you have still the link?
> 
> Also saw this http://www.codeplex.com/LinqOverCSharp but, haven't had time
> to even look at the code.

Hmm - I don't see how that compiler does help with ANTLR code generation.
 
> Supporting C# 3 syntax in actions would be cool!. I suspect that adding
> full
> support for C# v3 syntax (incl. LINQ) in action blocks would require
> target-language-specific action lexers as was the case with ANTLR v2.x - a
> change to the ANTLR tool itself in other words.

Why is the normal action syntax not enough? Isn't the content of actions largely left alone? And even if there is some problem one could use partial classes to define LINQ queries in separate methods. This is a good idea anyway for better syntax highlighting.

Johannes
> 
> 
> Micheal
> 
> -----------------------
> The best way to contact me is via the list/forum. My time is very limited.

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx


More information about the antlr-interest mailing list