1997Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Command Parsers, continued -->
<!--X-From-R13: @nguna Kbfcr <lbfcrNunjnvv.rqh> -->
<!--X-Date: Mon, 25 Nov 1996 02:28:32 +0100 -->
<!--X-Message-Id: Pine.GSO.3.93.961124144944.23104A&#45;100000#uhunix2,its.Hawaii.Edu -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Command Parsers, continued</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:yospe#hawaii,edu">
</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>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00061.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00060.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00060.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00061.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00059">Author</A>
&nbsp;|&nbsp;<A HREF="#00059">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00059">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Command Parsers, continued</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud#bug,belgonet.be">mud#bug,belgonet.be</A></LI>
<LI><em>Subject</em>: Command Parsers, continued</LI>
<LI><em>From</em>: Nathan Yospe &lt;<A HREF="mailto:yospe#hawaii,edu">yospe#hawaii,edu</A>&gt;</LI>
<LI><em>Date</em>: Sun, 24 Nov 1996 15:14:57 -1000</LI>
<LI><em>Reply-To</em>: Nathan Yospe &lt;<A HREF="mailto:yospe#hawaii,edu">yospe#hawaii,edu</A>&gt;</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>

As mentioned in my previous post, I am using unique namespaces to refer
to both hard and softcoded functions. The namespaces take the form of a
case insensitive string of length ~7 characters, at most. (they can be
longer, but internal functionality discourages it. Now, on to searching
through the db for functions (and anything else named, for that matter,
which means virtually everything in the entire db.)

Let me introduce the alphatree.

class alphatree{   // perhaps templatize the class?
protected:
  named * member;
public:
  virtual named * search(mudstring &amp;name);
  virtual void addmember(named * member, mudstring &amp;name);
  virtual void remmember(mudstring &amp;name);
};

class ATleaf: public alphatree{
public:
  named * search(mudstring &amp;name){
    if(member.check(name))
      return member;
    else
      return NULL;
  }
  void addmember(named * member, mudstring &amp;name);
  void remmember(mudstring &amp;name);
};

class ATmononode: public alphatree{
  alphatree *branch;
  char name;
public:
  . . .
};

class ATbinode: public alphatree{
  alphatree *branch[2];
  char name[2];
public:
  . . .
};

class ATtrinode. . . . class AThexnode

class ATfull: public alphatree{
  alphatree *branch[36];
public:
   . . .
};

For the fullnode, the 36 branches are direct linked to the coresponding
characters by an enumeration switch. Its a lot faster than any other
library tree I've found, and saves memory over most of them for large
namespaces ( &gt; 4000 names ) I think I'm losing a bit on the smaller lists,
but what the hell... its adaptable. That's important. If anyone knows a
better way to do this, let me know.

   __    _   __  _   _   ,  ,  , ,  
  /_  / / ) /_  /_) / ) /| /| / /\            First Light of a Nova Dawn
 /   / / \ /_  /_) / \ /-|/ |/ /_/            Final Night of a World Gone
Nathan F. Yospe - University of Hawaii Dept of Physics - yospe#hawaii,edu

</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00061.html">Command Parsing</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00060.html">Re: Call for Opinions: MIGE</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00060.html">Re: Call for Opinions: MIGE</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00061.html">Command Parsing</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00059"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00059"><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: Its nice to be back</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00003" HREF="msg00003.html">Re: Its nice to be back</A></strong>, 
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Fri 14 Feb 1997, 11:18 GMT
</LI>
<LI><strong><A NAME="00005" HREF="msg00005.html">Re: Its nice to be back</A></strong>, 
Nathan Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Sat 15 Feb 1997, 16:51 GMT
</LI>
</ul>
</LI>
<LI><strong><A NAME="00062" HREF="msg00062.html">MUD Design Digest V1 #56</A></strong>, 
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Wed 18 Dec 1996, 03:42 GMT
<LI><strong><A NAME="00060" HREF="msg00060.html">Re: Call for Opinions: MIGE</A></strong>, 
Chris Lawrence <a href="mailto:clawrenc#xsvr1,cup.hp.com">clawrenc#xsvr1,cup.hp.com</a>, Wed 27 Nov 1996, 17:18 GMT
<LI><strong><A NAME="00059" HREF="msg00059.html">Command Parsers, continued</A></strong>, 
Nathan Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Mon 25 Nov 1996, 01:28 GMT
<LI><strong><A NAME="00061" HREF="msg00061.html">Command Parsing</A></strong>, 
Nathan Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Sun 24 Nov 1996, 23:06 GMT
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00100" HREF="msg00100.html">command parsing</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Thu 13 Mar 1997, 15:00 GMT
</LI>
<LI><strong><A NAME="00102" HREF="msg00102.html">Re: command parsing</A></strong>, 
Adam Wiggins <a href="mailto:nightfall#inficad,com">nightfall#inficad,com</a>, Thu 13 Mar 1997, 16:22 GMT
</LI>
<LI><strong><A NAME="00125" HREF="msg00125.html">command parsing</A></strong>, 
claw <a href="mailto:claw#null,net">claw#null,net</a>, Tue 18 Mar 1997, 02:08 GMT
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>