MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
[MUD-Dev] Re: Question on c++ switch optimization, and parsers in general.
Ben Greear wrote:
> Basically, I'll have a bunch of classes hashed into an array
> that will contain the keywords mapped to an enum.
>
> Now, I get the enum, and then I need to call the various commands
> that the enum maps to.
Maybe I am interpreting "keywords" wrong here, but if you know the keywords
at compile time then you might want to look into programs that can come up
with a perfect hash-function for you. A perfect hashfunction is a function
that takes a string and returns a unique number for your N keywords in the
range [0..N]. Your unix system (if you use one) probably comes with a
program to generate a perfect hashfunction.
--
Ola Fosheim Groestad,Norway http://www.stud.ifi.uio.no/~olag/
- Thread context:
- [MUD-Dev] Re: Question on c++ switch optimization, and parsers i, (continued)
- [MUD-Dev] Question on c++ switch optimization, and parsers in general.,
Ben Greear greear#cyberhighway,net, Mon 08 Feb 1999, 05:32 GMT
- [MUD-Dev] Re: Question on c++ switch optimization, and parsers i,
Jon A. Lambert jlsysinc#ix,netcom.com, Mon 08 Feb 1999, 05:56 GMT
- [MUD-Dev] Re: Question on c++ switch optimization, and parsers in general.,
Ola Fosheim Grøstad olag#ifi,uio.no, Mon 08 Feb 1999, 16:53 GMT
- [MUD-Dev] Re: Question on c++ switch optimization, and parsers in general.,
Adam Wiggins adam#angel,com, Mon 08 Feb 1999, 19:47 GMT
- [MUD-Dev] Re: Question on c++ switch optimization, and parsers in general.,
Mark Gritter mark#erdos,Stanford.EDU, Mon 08 Feb 1999, 21:18 GMT
- [MUD-Dev] Re: Question on c++ switch optimization, and parsers in general.,
Oliver Jowett icecube#ihug,co.nz, Mon 08 Feb 1999, 21:23 GMT
[ Other Periods
| Other mailing lists
| Search
]