<!-- MHonArc v2.4.4 --> <!--X-Subject: Re: [MUD-Dev] string parsing --> <!--X-From-R13: "Tryvk O. Qebrf" <sryvkNkf1.fvzcyrk.ay> --> <!--X-Date: Mon, 03 Nov 1997 13:25:15 +0000 --> <!--X-Message-Id: 199711031325.OAA02485#xs1,simplex.nl --> <!--X-Content-Type: text/plain --> <!--X-Head-End--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>MUD-Dev message, Re: [MUD-Dev] string parsing</title> <!-- meta name="robots" content="noindex,nofollow" --> <link rev="made" href="mailto:felix#xs1,simplex.nl"> </head> <body background="/backgrounds/paperback.gif" bgcolor="#ffffff" text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000"> <font size="+4" color="#804040"> <strong><em>MUD-Dev<br>mailing list archive</em></strong> </font> <br> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] <br clear=all><hr> <!--X-Body-Begin--> <!--X-User-Header--> <!--X-User-Header-End--> <!--X-TopPNI--> Date: [ <a href="msg00227.html">Previous</a> | <a href="msg00229.html">Next</a> ] Thread: [ <a href="msg00198.html">Previous</a> | <a href="msg00231.html">Next</a> ] Index: [ <A HREF="author.html#00228">Author</A> | <A HREF="#00228">Date</A> | <A HREF="thread.html#00228">Thread</A> ] <!--X-TopPNI-End--> <!--X-MsgBody--> <!--X-Subject-Header-Begin--> <H1>Re: [MUD-Dev] string parsing</H1> <HR> <!--X-Subject-Header-End--> <!--X-Head-of-Message--> <UL> <LI><em>To</em>: <A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A></LI> <LI><em>Subject</em>: Re: [MUD-Dev] string parsing</LI> <LI><em>From</em>: "Felix A. Croes" <<A HREF="mailto:felix#xs1,simplex.nl">felix#xs1,simplex.nl</A>></LI> <LI><em>Date</em>: Mon, 3 Nov 1997 14:25:22 +0100 (MET)</LI> </UL> <!--X-Head-of-Message-End--> <!--X-Head-Body-Sep-Begin--> <HR> <!--X-Head-Body-Sep-End--> <!--X-Body-of-Message--> <PRE> cg#ami-cg,GraySage.Edmonton.AB.CA (Chris Gray) wrote: > [Felix C:] > > : object find_obj_in_obj(mixed *parsetree) > : { > : /* > : * parsetree = ({ obj1name, preposition, obj2name }) > : * > : * find obj1 in obj2 (the code below has been simplified) > : */ > : return present(parsetree[0], present(parsetree[2])); > : } > : > :Not actually very hackish, is it? Finding an object in another object > :is a fairly common operation. > > Well, are you going to have find_obj_on_obj, find_obj_beside_obj, > find_obj_under_obj, etc.? If the mud has such object relations as `next to', `on top of' etc, then it makes sense to have syntax rules, and functions to give them meaning, for all of them. > Wouldn't you also want 'present' to be able > to properly parse a noun phrase? That's where I was thinking you might > end up recursively calling parse_string. Nothing really bad here, I > guess - there probably aren't any truly tidy alternatives that work better. I made nouns single words to keep the example simple, but that can be changed (replacing Noun with NounPhrase): NounPhrase: ( OptArticle ) ( Adjectives ) word OptArticle: 'the' OptArticle: 'a' OptArticle: 'an' OptArticle: Adjectives: word Adjectives Adjectives: In this case, the parse tree in the above function would be ({ ({ optart }), ({ adjectives }), word, preposition, ({ optart }), ({ adjectives }), word }) All the parsing for present() would already be done, and there is no need for recursively calling the parser. Felix Croes </PRE> <!--X-Body-of-Message-End--> <!--X-MsgBody-End--> <!--X-Follow-Ups--> <HR> <ul compact><li><strong>Follow-Ups</strong>: <ul> <li><strong><A NAME="00231" HREF="msg00231.html">Re: [MUD-Dev] string parsing</A></strong> <ul compact><li><em>From:</em> coder#ibm,net</li></ul> </UL></LI></UL> <!--X-Follow-Ups-End--> <!--X-References--> <!--X-References-End--> <!--X-BotPNI--> <UL> <LI>Prev by Date: <STRONG><A HREF="msg00227.html">newbie</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg00229.html">Re: [MUD-Dev] Fear of magic (was:Usability and interface)</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg00198.html">Re: [MUD-Dev] string parsing</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg00231.html">Re: [MUD-Dev] string parsing</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#00228"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#00228"><STRONG>Thread</STRONG></A></LI> </UL> </LI> </UL> <!--X-BotPNI-End--> <!--X-User-Footer--> <!--X-User-Footer-End--> <ul><li>Thread context: <BLOCKQUOTE><UL> <LI><STRONG>Re: [MUD-Dev] string parsing</STRONG>, <EM>(continued)</EM> <ul compact> <LI><strong><A NAME="00192" HREF="msg00192.html">Re: [MUD-Dev] string parsing</A></strong>, Felix A. Croes <a href="mailto:felix#xs1,simplex.nl">felix#xs1,simplex.nl</a>, Fri 31 Oct 1997, 12:12 GMT </LI> <LI><strong><A NAME="00193" HREF="msg00193.html">Re: [MUD-Dev] string parsing</A></strong>, Felix A. Croes <a href="mailto:felix#xs1,simplex.nl">felix#xs1,simplex.nl</a>, Fri 31 Oct 1997, 20:06 GMT </LI> <LI><strong><A NAME="00197" HREF="msg00197.html">Re: [MUD-Dev] string parsing</A></strong>, Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 01 Nov 1997, 18:17 GMT </LI> <LI><strong><A NAME="00198" HREF="msg00198.html">Re: [MUD-Dev] string parsing</A></strong>, Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 01 Nov 1997, 20:17 GMT </LI> <LI><strong><A NAME="00228" HREF="msg00228.html">Re: [MUD-Dev] string parsing</A></strong>, Felix A. Croes <a href="mailto:felix#xs1,simplex.nl">felix#xs1,simplex.nl</a>, Mon 03 Nov 1997, 13:25 GMT <UL> <LI><strong><A NAME="00231" HREF="msg00231.html">Re: [MUD-Dev] string parsing</A></strong>, coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Tue 04 Nov 1997, 04:30 GMT </LI> </UL> </LI> <LI><strong><A NAME="00233" HREF="msg00233.html">Re: [MUD-Dev] string parsing</A></strong>, Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Tue 04 Nov 1997, 07:03 GMT </LI> <LI><strong><A NAME="00235" HREF="msg00235.html">Re: [MUD-Dev] string parsing</A></strong>, Felix A. Croes <a href="mailto:felix#xs1,simplex.nl">felix#xs1,simplex.nl</a>, Tue 04 Nov 1997, 12:25 GMT <UL> <LI><strong><A NAME="00254" HREF="msg00254.html">Re: [MUD-Dev] string parsing</A></strong>, coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Sun 09 Nov 1997, 05:39 GMT </LI> </UL> </LI> </ul> </LI> </UL></BLOCKQUOTE> </ul> <hr> <center> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] </center> <hr> </body> </html>