I suck at this, clearly I don't get it. It feels like I've made zero
progress in weeks.
I finally got to the point where I can output a simple AST with one
grammar, and I'm trying to use a tree grammar to translate that into the
target language using templates.
My simple tree:
(DOCUMENT (GET '
"mismatched tree node: DOCUMENT expecting DOCUMENT"
I'm not having very good luck trying to do simple things apparently.
My ToStringTree:
(DOCUMENT (PRINT 'variable'))
My tree grammar:
document
: ^(DOCUMENT statement*)
;
statement
: ^(PRINT LITERAL)
;
List: http://www.antlr.
Is there a quick and dirty way to print out the tree with tabs/line
feeds to make it a little more readable using the C# runtime?
-=Chris
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--~--~---
Chris Lambrou wrote:
> Is there a recommended way of writing a grammar so that it can be used to
> target different runtimes? I'd like to be able to use the same grammar to
> target both C# (for use in an ASP.NET server application) and in JavaScript
> (for use by clients). The ANTLR book is fill
I'm having a problem turning this text into tokens. I know it has to be
something obvious, but I can't see it...
[%"Dear "%][% name %][%",
It has come to our attention that your account is in
arrears to the sum of "%][% debt %][%".
Please settle your account before "%][%