Hi,
I know that this is a problem with my lexer and I'm doing something
stupid, but I have a problem with simple k,v pairs of the format:
[String "quoted string with spaces and non-alhpa chars"]
My grammar
------------------
LEFT_SQUARE: '[';
RIGHT_SQUARE: ']';
STRING: 'a'..'z'|'A'..'Z';
TEXT: ('a'..z'|'A'..'Z'|' '|',')+
pair: LEFT_SQUARE (info=STRING) ' ' '"' (value=TEXT) '"' RIGHT_SQUARE
NEWLINE+ -> transform(i={$info.text},v={$value.text});
This fails with "mismatched input expecting 'Test ' expecting STRING"
(note the space that should not be present).
pair: LEFT_SQUARE (info=TEXT) ' ' '"' (value=TEXT) '"' RIGHT_SQUARE
NEWLINE+ -> transform(i={$info.text},v={$value.text});
This grabs the space and passes it to transform (which I really don't want)
Can anyone see what I'm doing wrong? I know the answer is probably simple
Thanks,
Kev
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.