[DGD] Parse_string confusion

Mikael Lind z94lind at mtek.chalmers.se
Mon Jan 21 16:19:53 CET 2002


Quoting S. Foley from 16:59, 2002-01-18:

> I'm not 100% sure I understand the problem, but it seems to me like this
> grammar would result in a lot of 'Bad token at offset <number>' errors.
> Basically, if you feed parse_string a string it can't fully 'tokenize' it
> will generate an error.
>
> Try this grammar instead:
>
> return !!parse_string("regstring = /[a-zA-Z]+/     "+
>                        "notregstring = /[^a-zA-Z]+/ "+
>                        "full : regstring",
>                        str
>                       );

Also, a "nomatch" token rule was recently introduced.

regstring = /[a-zA-Z]+/
notregstring = nomatch
full : regstring

See "dgd/doc/parser" for more information.

// Mikael / Elemel

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list