views:

1277

answers:

5

Have you done any work with ASN.1 to C# compiler? Can you recommend it?

I have used Objective Systems ASN1C which I would recommend.

I have also played a little with BinaryNotes.

+2  A: 

You can google around for "ANTLR ASN.1" or check this link: http://www.antlr.org/grammar/list

alex2k8
+1  A: 

There's a company called OSS Nokalva that have a C# tool that may do what you want. The company I was at previously used their C++ tools, and I think we found that they worked reasonably well (it was another section that actually used them).

Simon Callan
+1  A: 

If you have any choice, flee in terror from ASN.1. It has got to be the world's most complicated way of specifying the format of sequential data. (I used to work for the phone company, where we were forced to use ASN.1, and we never found a decent compiler, checker, you name it. And the phone company had money to spend on such things!)

Norman Ramsey
A: 

I've used the objective system compiler, but the thing that really bugs me is that I have to use a huge amount of copy and paste code. I wish asn.1 was more object oriented, because the telecom implementations definately are not.

I've used the free compiler (asn1c), but just for viewing the contents of various packets.

I do also agree with Norman about fleeing in terror from ASN.1. However, I have to use it to read information from mobile networks!

Nick R
A: 

I used the Obective Systems ASN1C compiler for C code (C# wasn't even invented yet) when I was writing an H.323 stack. I thought it was pretty easy to use and very fast.

My recommendation would be to use it, but if possible, use C/C++ instead of C# so that it is fast. In my experience, non-native languages such as C# and Java still can't beat C's performance. If you're stuck with C#, I would still think ASN1C would be the way to go since I know it works well.

Poldon
Where did you get the idea that C# is interpreted? It never has and probably never will be. Neither is Java interpreted anymore.
erikkallen
Well, I guess you can say C# and Java are "compiled", but only in the sense that these days, both are compiled at the last minute by the VM (or whatever you want to call it on .NET). However, Java used to be interpreted before JIT was widespread. In my experiences though, I've always found C/C++ to outperform C# and Java, if for no other reason than the code is compiled for its target platform with no steps in between.
Poldon