[antlr-interest] philosophy about translation
Terence Parr
parrt at cs.usfca.edu
Fri Oct 6 11:44:13 PDT 2006
On Oct 6, 2006, at 10:36 AM, Johnicholas Hines wrote:
> Is the deep analysis that Andy Tripp's COBOL to Java project requires
> a corner case of ANTLR usage? It seems to me he's building at least a
> full dataflow graph, which I believe is more extreme than most
> transformations.
>
> My projects with antlr include things like "replicate bash's
> brace-expansion in a standalone tool", and "convert pure lambda
> calculus to continuation-passing style".
Yes, you are right. My simple polynomial differentiation translator
worked great. One could argue however that showing declarative rules
in this case would be easy also:
<a=int><id><c=int> --> <a*c><id><c-1>
Andy: how do you deal with references to grammatical constructs such
as <expr>? ANTLR you only work with tokens, period? How do you
deal with extreme context like you need to do a translation on this
expression but only if it's the expression within a while within a
particular function?
Ter
More information about the antlr-interest
mailing list