[antlr-interest] C# parser - first pass

Robin Debreuil robin at debreuil.com
Thu Feb 26 13:09:41 PST 2004


I have the first pass of the C# parser, modeled on the C# specs done. It
just parses at this point - eg it doesn't break things into trees etc, so
obviously it isn't very useful. On the bright side it is easier to read ; ).
There are a few constructs it is still having trouble with (mostly the antlr
generated C#, if that counts, he he), and it only does #region and #define
preprocessing - I'm thinking I'll put conditionally compiled code in a
different stream or somthing, but haven't read up on that enough yet. I've
also skipped unsafe code for now, but will get that in for sure..

If anyone has advice or spots uber slow/bonehead constructs, I'm not
sensitive. I'm new to antrl (and bent that way regardless), so I'm sure
there are plenty...

You can see it at:
http://www.richmediabuilder.com/beta/CSharp/csGrammar.html

or download the grammar and an exe (drag cs files into it, or use 'CSharp
filename.xx')
http://www.richmediabuilder.com/beta/CSharp/CSharp.zip

I'll try to tackle tree construction now, I'm probably going to model that
on the CodeDom where it fits, unless there is a better standard for
AST's...?

Wonderful tool btw. Kudos to all involved.

Cheers,
Robin





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list