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"
}
Here is a simple grammar rule to demonstrate the issue I'm having...
definesomething
: define IDENT as json
;
json
: '{' .* '}'
;
IDENT
: ('0'..'9'|'a'..'z'|'A'..'Z'|'_')+;
WHITESPACE
: ( '\t' | ' ' | '\r' | '\n' | '\u000C' )+ { $channel=HIDDEN; } ;
This is fact tries to evaluate the content between the braces. I
actually would like the rule to evaluate all the content as one
string, though I will later parse it within my application. Is there
a way I can accomplish this?
Thanks.
Ilya
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
-~----------~----~----~----~------~----~------~--~---