home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.compilers      Compiler construction, theory, etc. (Mod      2,753 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,757 of 2,753   
   Joshua Cranmer to All   
   Switch statement code generation   
   03 Nov 09 08:01:56   
   
   From: Pidgeot18@verizon.invalid   
      
   I'm trying to put together a list of various methods to do code generate   
   for switch statements.   
      
   This is what I have so far:   
   * Successive if/else branches   
   * Jump tables   
   * branch tables with linear and binary scans   
   * Clustering tables (e.g., if you have cases 0-100 and 300-400).   
      
   Are there any other methods worth mentioning?   
      
   --   
   Beware of bugs in the above code; I have only proved it correct, not   
   tried it. -- Donald E. Knuth   
   [I think I've seen hashing into branch tables. -John]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca