[antlr-interest] philosophy about translation

Monty Zukowski monty at codetransform.com
Fri Oct 6 10:45:57 PDT 2006


on 10/6/06, Paul Johnson <gt54-antlr at cyconix.com> wrote:
...
> 5 - what if your language has multiple ways to do the same thing?
> Indirection and array access, for example? It makes little sense to code
> this redundancy into the AST. You can instead have a pass which, for
> example, eliminates indirections and replaces them with array accesses.


A great example of an intermediate representation of C that has been
reduced to the essentials is http://manju.cs.berkeley.edu/cil/

For instance, pointer and array access are reduced to one canonical
format.  This reduces the number of cases you have to handle when
translating.  Of course, this is more appropriate for translation to
code that doesn't need to be edited by humans (in this case it is a C
to C translator).  There may be semantics in the actual style used to
represent something that could be important for "natural" translation,
which is what Andy is aiming for, I think.

Monty


More information about the antlr-interest mailing list