[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Grammatica-users] multiline in token definition
From: |
Steffen Gaede |
Subject: |
Re: [Grammatica-users] multiline in token definition |
Date: |
Fri, 04 Nov 2011 08:33:06 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 |
> Understand that an LL parser like Grammatica is context-free, i.e. the
> tokenization is separated from the grammar rules. You can run Grammatica
> in tokenize-only mode to show just the stream of tokens read.
>
> The order of the token definitions is important, and has always been such:
>
> 1. The longest matching token
> 2. The first defined token (if both have same length)
>
> Hence, do like this:
>
> - Keep tokens short (without whitespace).
ok, that's the hint:
> - Place string tokens above regex tokens.
If I first place the regex, then I become the errors. After changing
order, it works now.
I've build like your Example from arithmetic language, so it was not
clearly visible about this rule.
Best regards,
Steffen.