Using single "'" / "Hiding" terminal rules [message #663110] |
Sun, 03 April 2011 17:22 |
Simon Stratmann Messages: 27 Registered: February 2011 |
Junior Member |
|
|
Hello,
in the language my editor is for you can either use ' for characters, like in java, or to access attributes like "object'anAttribute".
Let's say this is my grammar (I can't post the real grammar, so this will have to do):
Object :
"object" name=ID "with" attributes+=ID*;
Access :
object=ID "'" attribute=ID;
With this something like
should work, but the parser expects the ' to open a string and thus another ' to close the string.
How can I get this to work?
My title is the way it is because when I remove the STRING terminal rule, it works, but I need this somewhere else (in my real grammar), but only once. So I thought it might be possible to "hide" this terminal rule in a way that it is only recognized where used in a parser rule and not somewhere else.
Any help is appreciated.
Thanks a lot,
Simon
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02608 seconds