At 23:43 11/10/2009, Graham Wideman wrote:
>First off, your OTHER rule should contain OR not AND if you want
to
>accept '$' or '{' when they are not part of '${'.
>
>Other than that, it should be possible to write this without
>resorting to an action (semantic predicate), which would allow
>visualizing in ANTLRworks and so on.
It's probably best to do the initial split at "replacement string"
vs. "everything else". Then you can further evaluate the
replacement string at the parser level:
file: ( TEXT { /* print out the text */ }
| STRING { /* look up and fill in the replacement */ }
)* EOF;
STRING: '${' (~'}')* '}';
TEXT: (~'$' | '$' ~'{')+;
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---