[antlr-interest] Beginner problem
Ayende Rahien
Ayende at ayende.com
Sun Sep 4 16:56:18 PDT 2005
First, Im a complete beginner in both antlr and parsing.
Second, I want to build a pre processor that would recognize the following:
Code block: anything inside a <% %>
Text block: anything else.
The idea is to transform the input to so the <% %> would be gone and the
text would be properly set in:
output text
My (naïve) start is:
CODE_BLOCK
: CODE_START TEXT_BLOCK CODE_END
;
CODE_START
: "<%"
;
CODE_END
: "%>"
;
TEXT_BLOCK
: ~("<%")
;
This fails, but Im not sure how I can fix this. I read some of the
documentation on the site, and Im afraid I cant see a solution.
(I know that its very easy to do this with custom code, but the idea is
that the moment Ive code block and text blocks, I can start transforming
them by more complex rules.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20050905/23e46c1b/attachment.html
More information about the antlr-interest
mailing list