[DGD] Re: RFC: parse_string()

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


> > 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 :).
> 
> One "why" response to "why not" could be that since in practice all
> large sets of rules are likely to be automatically generated through one
> or more layers of LPC code, one -could- say there is no reason why e.g.
> 
> 	parsedaemon->add_adjective("evil")
> 
> should not infact add the tokens
> 
> 	evil,
> 	Evil, eVil, evIl, eviL,
> 	EVil, EvIl, EviL, eVIl, eViL, evIL,
> 	EVIl, EViL, EvIL, eVIL,
> 	EVIL
> 
> or perhaps more realistically,
> 
> 	evil, Evil and EVIL
> 
> and avoid loading down the minimalistic interface with another operator.

*nod* I certainly considered this :).  However, I think the operator 
addition is a small cost in comparison.  For the sake of argument, say 
/ was adopted as the regexp delimiter instead of ', then you could do things
Perl style maybe, e.g.

   token: /[a-z]*/i

to indicate case insensitivity.  In comparison, you create 2^n extra tokens
(if you want every combination) for each word, where n is the length of it.
I'm thinking this would quickly grind the mud into the ground :).

Basically, the functionality for case insensitivity is there internally, I 
would like to see it taken advantage of :).

-- 
Greg Lewis                              Applied Maths Department
Email : glewis at maths.adelaide.edu.au    University of Adelaide
--
What use is magic if it can't save a unicorn?
		-- Peter S. Beagle, "The Last Unicorn"



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



More information about the DGD mailing list