[antlr-interest] New article on StringTemplates and Treewalkers
sohail at taggedtype.net
sohail at taggedtype.net
Wed Jan 11 13:56:47 PST 2006
> Gregg Reynolds wrote:
>
>> Andy Tripp wrote:
>> More specifically: how hard would it be to write an ML or Haskell
>> emitter for Antlr (something I'd like to see)?
>
> Good question, and my related question is "will StringTemplate make that
> any easier?".
Now you're just being mean. This is as big a difference as generating code
for a stack based machine when your AST assumes a register based machine
(like gcc). This is an analogy for functional languages and imperative
languages like C++ or Java. Therefore, you might need to tweak your AST
(but then again, you might not!)
>> How hard would it be to write an ML or Haskell front-end for
>> Jazillion? (I mean relative to a C frontend, not relative to a
>> backend to Antlr, which would no doubt be easier.)
>
> Answer: very hard: the translation rules are all C-specific. To put it
> bluntly, the Jazillian "front-end" is not in any way separated from the
> "engine"
> and "backend". I believe it's impossible to design such a
> any-language-to-any-language translation engine, despite the fact that
> Semantic Designs claims to have such a product.
With some constraints, I think this is possible.
> brain has already tokenized it into a sequence of 5 tokens:
> int [ ] i ;
> But given that same chunk of code, our brains to NOT easily form an AST
> structure:
I think some people do. Thats why lisp is so easy to read. For those :)
More information about the antlr-interest
mailing list