[DGD] Help with parse_string() grammar
Petter Nyström
md1pette at mdstud.chalmers.se
Mon Apr 10 00:20:01 CEST 2006
Okay... Here is obviously something I don't understand. I follow the
documentation when it says that a token rule can have several definitions
and then they're matched in a top-to-bottom order. But I don't understand
why the order of *different* token rules have an impact on things. I
thought they were just mathced against when a production ruled referenced
to it? And then it'd be matching against that specific token rule and not
all of them? I'm a little confused now... =)
But no matter, the suggested changes still won't let me parse any string
containing & or $ characters.
Thanks for the reply though. Maybe I'll understand it eventually.
Regards,
Jimorie
On Sun, 9 Apr 2006, Felix A. Croes wrote:
> Petter Nyström <md1pette at mdstud.chalmers.se> wrote:
>
>> [...]
>> plain = /[^&$]*/
>> name = /[a-zA-Z0-9]+/
>> char = /[a-zA-Z0-9]/
>
> Anything that could be a "char" is instead a "name". Anything thay could be
> a "name" is instead a "plain".
>
> You'll probably get more interesting results if you put these in
> reverse order: char, name, plain.
More information about the DGD
mailing list