Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!knuth!mjbtn!raider!elgamy!elg From: elg@elgamy.RAIDERNET.COM (Eric Lee Green) Newsgroups: comp.sys.amiga.programmer Subject: Re: Lemmings - a tutorial Part V (last) Message-ID: <00671061076@elgamy.RAIDERNET.COM> Date: 7 Apr 91 21:51:16 GMT References: <1991Apr5.234958.23678@starnet.uucp> <1991Mar31.003933.1483@mintaka.lcs.mit.edu> <1991Apr1.020748.26863@mintaka.lcs.mit.edu> From article <1991Apr5.234958.23678@starnet.uucp>, by sschaem@starnet.uucp (Stephan Schaem): > Come one how many people here dont use jump table instead of multi cmp? > An example would be for instruction encoding for a compiler. > Intead of up to 16 test (that would have been done in probability > usage) you replace it by 10 instruction (with an offset jump table). Most "C" compilers will do this automatically for a "switch" statement. Don't understand what you mean by "instruction encoding for a compiler." Most parser generators generate table-driven parsers in the first place, i.e., they automatically generate a "jump table" as you put it. Similarly, the "lexer" in any decent compiler will similarly be table-driven. Do you mean the code generator? The optimizer? Hmm? (Do you know what I'm talking about, anyways?). -- Eric Lee Green (318) 984-1820 P.O. Box 92191 Lafayette, LA 70509 elg@elgamy.RAIDERNET.COM uunet!mjbtn!raider!elgamy!elg