[antlr-interest] Grammar issue

Stephen Tuttlebee themightystephen at googlemail.com
Thu Mar 17 05:07:38 PDT 2011


Also, forgot to ask...are you defining the format of this input or is it 
fixed (i.e. you can't change it). Because, if you are free to change it, 
then I would solve this problem by making sure strings are quoted in 
double quotes "my string" and then alter the parser to match a string / 
text literal by looking for the double quotes that mark the beginning 
and end of the string.

Or, another way round this would be to use the the fact that you have a 
new line between each key-value pair and use that to unambiguously be 
able to tell when one key-value ends and when another starts. (this 
method only works if you know there will always be a new line between 
each key-value pair and you never get two appearing on the same line)


More information about the antlr-interest mailing list