From: | Ram Bhamidipaty <ramb@spring.epic.com> |
Newsgroups: | comp.compilers |
Date: | 16 May 1997 23:39:58 -0400 |
Organization: | Primenet Services for the Internet |
References: | 97-05-183 |
Keywords: | C, assembler |
Ray Dillinger <bear@sonic.net> writes:
> I can write ... in C, ... a ... huge main() routine, ...
>
> However, this will violate every "reasonable" assumption a maker of C
> compiers will have about programming style.
>
> Will modern C systems handle this?
>
> [Probably not. Machine generated source code always seems to break
> compilers designed for code written by humans. -John]
I have a bit of experience with exactly this sort thing. I modified
Bison to produce directly executable parsers, and they were huge. For
example the gcc grammar generated a yyparse() with 24,000 lines. An
oberon grammar yielded a yyparse() with almost 10,000 lines. Both
these numbers were for the grammar only (ie no semantic code).
However there is some good news. I was able to compile the oberon
grammar on a solaris machine with their new ANSI compiler. I think I
was able to use gcc (as a compiler) as well without trouble. The
compile jobs need a fair amount of memory though. I recall the compile
needing to run on a machine with around 128 meg of main memory.
Note that since you are attempting to force the compiler to put global
variables into registers you will probably need to turn on some level
of optimization. With the code I generated there was a definite slow
down when optimization was turned off.
-Ram
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.