[DGD]parse_string

Erlend M. Simonsen erlends at fairplay.no
Tue Apr 6 02:16:12 CEST 1999


"Felix A. Croes" <felix at dworkin.nl> writes:

> Do whatever MudOS does?  This is not a parsing problem...

Okey. I'll dive into the MudOS parser tomorrow then, and see if I
can't figure something out.

> If I recall correctly, the MudOS parser allows you to add rules like
> this:
> 
>     buy STR from LIV

Which I also allow.

> 
> What you should do is treat 'from' as a special word, rather than
> a STR.  That way, you can distinguish between both cases when
> generating your function name.

You mean hard-code from as a special word? Hmm. I guess I will have to 
do something like that, since I don't know anything about the rule
which was matched.

> You shouldn't have to split up your grammar, though doing so may
> make your approach more modular and easier to understand.

It might. It's not hard to understand my code with one big grammar
either, since it is built from all the verbs in my /cmds/verb/ dir. 

Thanks for your help. I haven't really found an answer to my problem,
but making 'from' a special case would be a workaround. Now I just
have to figure out all the special-case words I should add.  

As I see it, the only way to solve this properly is to split the
grammar, allowing me to get the sentence of the matched rule. Other
than that, one big grammar works fine.

-- 
Erlend M. Simonsen / Fairplay International AS
erlesimo at online.no / erlends at fairplay.no

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



More information about the DGD mailing list