At 13:22 24/11/2008, Ilya Sterin wrote:
>So in my grammar, I capture blocks of JSON-like structures. I
>don't want antlr to try to parse that structure, but rather to
>evaluate it as a string.
>
>Here is a sample code...
>
>define project as {
> "name": "some_widget",
> "version": "0.01-alpha"
>}
[...]
>json
> : '{' .* '}'
> ;
The problem is because you've used a parser rule instead of a
lexer rule (and thus . means "any token", not "any
character"). If you change this to a lexer rule, then it should
work.
(Of course, this assumes that {...} isn't used for any other
construct in your language. If it is, then things get more
complicated.)
List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org:8080/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
-~----------~----~----~----~------~----~------~--~---