[DGD] Re: RFC: parse_string()

Gregory D Lewis glewis at maths.adelaide.edu.au
Wed Oct 8 20:26:48 CEST 1997


> This is a request for comments in the literal sense: please comment.

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 :).

Overall I think the suggested implementation is great, I have a couple of
comments/questions though.

>     mixed *parse_string(string grammar, string sentence)
> 
> A grammar is a single string made up of rules.  It can look like this:
> 
>     token:	'regular_expression'
>     whitespace:	'regular_expression'
>     FOO =	BAR '+' GNU
>     FOO =	token FOO ( BAR ) '+' GNU ? lpc_function_name
> 
> A rule either starts with `identifier :' or `idendifier ='.
> 
> 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 :).  

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 ;).

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.

-- 
Greg Lewis                              Applied Maths Department
Email : glewis at maths.adelaide.edu.au    University of Adelaide
--
Keep grandma off the streets -- legalize bingo.



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



More information about the DGD mailing list