Related articles |
---|
Tool for replacing switch with if-then-else in C? mock@cs.washington.edu (Markus Mock) (1997-08-07) |
Re: Tool for replacing switch with if-then-else in C? genew@vip.net (1997-08-09) |
From: | genew@vip.net (Gene Wirchenko) |
Newsgroups: | comp.compilers |
Date: | 9 Aug 1997 20:12:26 -0400 |
Organization: | All USENET -- http://www.Supernews.com |
References: | 97-08-019 |
Keywords: | C, translator, comment |
Markus Mock <mock@cs.washington.edu> wrote:
>Does anybody know a system that translates C source code to C source
>replacing all switch constructs by if-then-else constructs?
>
>Thanks.
>[Why would you want such a thing? -John]
Possibly due to Standard limitations. I think that you're only
guaranteed 40 cases per switch. I don't know what the limitation is
for nested ifs (or if there is one).
switch is also rather brain-dead on conditions and perhaps Mr.
Mock wants to then spruce up the code with more complex conditions.
Sincerely,
Gene Wirchenko
[The limit's actually 257 per switch, but I suppose I could see the
spruce up stuff. -John]
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.