[antlr-interest] Binary support

The Researcher researcher0x00 at gmail.com
Thu Sep 15 11:56:29 PDT 2011


> What I did until now, when reading binary files, is to write interface
> classes (in C# or Java), generate code out them and use reflection. In
> principal I like this approach, but with ANTLR, I was heading to be on an
> even higher level of abstraction, more language independent and hoped to be
> able to reduce manual work.
>

What I not so cleverly was saying is that when I was reading data structures
in C# and having come from days of using C, it seemed that there should be
some way to reuse all of those header files. Thus people created
http://pinvoke.net/ ,but it is the structures section that applies here. But
still wanting a higher level of laziness, I just wanted to find the
declarations in the header, right click and select an action to translate
the declarations into C#, then back in my code paste in the translated
declarations, ready for use with C#. Translating structure definitions is
easy. Translating language statements is where we make money. Being even
more lazy, I converted them to an intermediate language that could be used
to translate declarations from one language to another. Still haven't tried
it with functional and logic languages yet.

Eric


More information about the antlr-interest mailing list