[antlr-interest] C# Target Poll

Micheal J open.zone at virgin.net
Sat May 17 02:57:58 PDT 2008


 
Hi,

> While thinking about future improvements, I came across over 
> the switch of the used collections from the .NET versions to 
> the one supplied by C5 <http://www.itu.dk/research/c5/>.
[...]

What future improvements were these?

[...]

> Still, I can't simply switch the engines as I'd enforce the 
> same change for all C# target users. As I can see, the use of 
> C5 has the following disadvantages:
> 
> -The inclusion of another assembly, thus increasing the 
> application size
> -C5 may be fast, but the .NET classes are speedier as they 
> sacrifice some of the extended functionality. How much 
> exactly, I don't know, but if you care about nano-seconds, 
> then C5 might be the wrong choice. Compiler builders care 
> about the speed of their software after all.
> 
> Not problematic is:
> 
> -C5 can be used like ANTLR in (non)commercial projects as it 
> uses a BSD-like license.
> -It can be integrated with .NET classes as it is based on 
> interface programming.
> 
> In case, I have overlooked important points, please shout 
> them. I haven't done any work to switch to C5 yet, so voting 
> down my suggestion won't waste any effort from my side.

I think any discussion about C5 is premature since you are yet to discuss
the future improvements that led you to seek C5 in the first place.


My $0.02¢...

Having built CSharp2/CSharp3 targets previously for ANTLR v3, my advice is
that you may want to look at the Wintellect PowerCollections library
[http://www.codeplex.com/PowerCollections] rather than C5. Neither is
perfect but PowerCollections feels like an extension of the BCL and C5
definitely does not. The set abstraction in PowerCollections could be better
IMO as it is sadly NOT implemented as an interface but, it works. You can
always provide a custom ISet<T> abstraction (there are plenty of articles
discussing this - e.g.
http://www.codeproject.com/KB/recipes/GenericISet.aspx - and the
Iesi.Collections is open source too).

Some of our targets had to be 'as lean as possible' (no ANTLRWorks support,
LLk - not LL* - grammars hence no DFAs) so, we used just the standard BCL
and a custom ISet<T> abstraction. However, PowerCollections is open source
and has a few types that are useful in a more widely-distributed,
general-use, CSharp2 target such as the stock ANTLR one.

Micheal

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



More information about the antlr-interest mailing list