[DGD] Re: RFC: parse_string()

Felix A. Croes felix at dworkin.nl
Thu Oct 9 00:45:04 CEST 1997


Gregory D Lewis wrote:
> I'm not sure if this meant public or private comment, but a bit of public
> toing and froing might be worthwhile, so I will post to the list :).

Public, by all means.


> Overall I think the suggested implementation is great, I have a couple of
> comments/questions though.
>[...]
> > A `:' rule specifies a class of tokens in a regular expression.  As a
> > special case, `whitespace :' specifies token-separating white space.
>
> My main question comes here.  Can a `:' rule be specified to match in a
> case insensitive manner?  I don't see anything in the specification that
> suggests this, although I am pretty sure that internally dgd regexp
> functions know about case insensitivity.  Erm, and if I can't specify it
> to be case insensitive, then why not :).  

You can make it [cC][aA][sS][eE] insensitive if you like.  The flag
for case insensitivity in the editor is just because the above example
is inconvenient when editing, as your input is not a programmed
response.

By the way, I won't be using the editor regular expression matcher for
this.  Having to match an arbitrary number of regular expressions and
keywords at the same time calls for lex-like DFA generation.  It will
be the third regular expression matcher in DGD.


> My other question was on the sentence to be parsed containing a newline,
> but I think that was just me having a `stupid attack' on regexps ;).

Newlines in the grammar -- and even in '-quoted string constants
in the grammar -- are perfectly legal.


> Interesting that the example given looks like something done with the
> MudOS parser package except that in this case no package of kfuns is needed,
> just one, and it has a lot more uses.

I deliberately designed it such that MudOS parsing can be trivially
simulated.  And parse_string() is not going to be a package, it will be
standard in true blue DGD :)

Dworkin



More information about the DGD mailing list