|Re: Debugging lexer & parser [message #993446 is a reply to message #993416]
||Mon, 24 December 2012 12:14
| Henrik Lindberg
Registered: July 2009
Use of data rules is good unless you end up with lots of tiny tokens, |
have to have long lists of things to include (because 'not' is not
possible), or end up with lots of fiddling with hidden on/off (which has
subtle unwanted effects in several places).
When you reach that point, you can write a more powerful external lexer.
Thought that could be good to know if you start feeling you are digging
yourself into a hole.
On 2012-24-12 11:11, Barrie Treloar wrote:
> Alexander Nittka wrote on Mon, 24 December 2012 02:21
>> is there a reason, you can't make your unquoted string definition a
>> datatype rule rather than a terminal rule?
> Because the common Terminals package does so for Strings? I assumed that
> was the best way for unquoted strings.
> I had looked at
> http://www.eclipse.org/Xtext/documentation.html#parser_rules but it says
>> Character ranges, wildcards, the until token and the negation as well
>> as the EOF token are only available for terminal rules.
> Which I assumed also meant datatype rules.
> Since unquoted string can be anything that does not contain a space in
> it, I couldn't work out how to build this with anything but a Terminal
> rule. Which in the end I just gave up and stripped it back to bare
> bones and made it work with the existing instance of the grammar I had
> to test against.
> I'm still very new to all this, so if you can craft a Datatype Rule I'm
> willing to give it a go.
Powered by FUDForum
. Page generated in 0.02919 seconds