[antlr-interest] C# working version

Robin Debreuil robin at debreuil.com
Fri Mar 5 13:28:31 PST 2004


> What about to add csproj/sln-files in next version zip-archive?

I'll do that - I'll try to put the calls to java in there as well...


> Yes, this is not a bug, it just parsing very looong time. Under MSVC#
> debugger I wait more than 10 minutes and I have not waited. Than I run it
> under comman line. C# parser works very interesting, it may parse more
than
> 1000 line/second and after that may sleep about 1 minute. Is this problem
> with garbage collector or 512MB on my computer is not enough to parse 415K
> file?

I haven't gotten all 20k lines of that to parse at once, but each section
seems to. I suspect the problem comes down to

1) Me.

2) I tried to make it somewhat similar looking to the ecma spec, but antlr
probably works better when things look more antlr like. There are a lot of
constructs in there that could be folded into others for example.

3) There are a few spots where syntactic predicates are used. I tried to
keep those down, but haven't optimized them to only look ahead partially.
Mostly this is with numbers, and higher level members (class, interface,
enum etc.), but in the expression parts a bit too. I would imagine there are
situations where this gets geometrically large, but there are only so many
'nondeterminism' errors I can look at before calling in the heavy artillery.
I think some of those can now be taken out or shortened at least.. Some
could also use {LA(2)==xx;}? instead, which I think would be faster.

4) I had a hard time with expressions, it would be the place that
improvements would help the most I suspect. It already looks pretty
different than the spec, and would benefit from being scrapped and rewritten
in a more antlr way. It might catch a few more errors this way though, not
sure..

Anyway, I'm just using this for programming smaller multimedia files (swf,
svg, and small directx apps), so it probably is good enough for that. I
might work more on verifying the tree and compiling before going back to the
speed issues, but if anyone else wants a go at it, that would be great
too...

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