Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Introduce a C Compiler ucc

45 views
Skip to first unread message

dreamAnders

unread,
May 10, 2008, 9:13:59 PM5/10/08
to
ucc is an ANSI C Compiler. Its code size is about 15,000 lines.
The lexer, parser and code generator are all hand-written.
The code structure is very clear and straightforward. And there is an
interesting value numbering algorithm.
It also has a document explaining the internal implementation.
If you are interested at this compiler, you can download it from
http://sourceforge.net/projects/ucc

karel

unread,
May 11, 2008, 2:46:20 AM5/11/08
to
On May 11, 11:13 am, dreamAnders <dream_and...@yahoo.com.cn> wrote:
> ucc is an ANSI C Compiler. Its code size is about 15,000 lines.

Tryin to compile this :
#include <stdio.h>
int main()
{
printf("hello world\n");
return 0;
}
gives me this:
[k2@Antec ucc]$ ucc t.c
fatal error in /usr/local/lib/ucc/ucl
ucc fatal error
If I remove the include it compiles OK.
Where the ucl searches for <stdio.h> ?

Jaro Gress

Alex L.K

unread,
May 11, 2008, 9:33:38 PM5/11/08
to
On May 11, 9:13 am, dreamAnders <dream_and...@yahoo.com.cn> wrote:
> ucc is an ANSI C Compiler. Its code size is about 15,000 lines.
> If you are interested at this compiler, you can download it fromhttp://sourceforge.net/projects/ucc

What are the advantages of this compiler ?

karel

unread,
May 12, 2008, 1:04:50 AM5/12/08
to

Its code can be followed using Eclipse Debugger which makes great
reading.
There is new version that solved the fatal error message on system
that has memory file handling bad.
It is also smaller and faster then gcc.

Razvan Aciu

unread,
May 12, 2008, 4:43:57 AM5/12/08
to
I think this is a great job. Keep it going!

There is now a tendency to write C compilers using more liberal licences
than GPL, which is used by gcc.
Examples: http://clang.llvm.org/ and http://pcc.ludd.ltu.se/
They can be used even as libraries for different purposes like backends for
advanced code generators to C, code checkers, IDE syntax highlighting, etc.
Probably all of these compilers are much easier to integrate in other
projects than gcc.

For ucc if someone can contact the developer, I have a suggestion: please do
not target MASM for the assembly generated code, because the MASM licence
restricts MASM redistribution both for free or commercial projects so it
will render ucc useless to developers who want to distribute ucc or use ucc
as part of other packages. I don't even know if you have the right to
include ml.exe in the ucc package. It is much better to generate assembly
for NASM ( http://sourceforge.net/projects/nasm ) (it can also be used in
linux or MacOS as a gas replacement), YASM (
http://www.tortall.net/projects/yasm/ ) (also NASM compatible) or FASM (
http://flatassembler.net/ ) (this is written in assembly so it can't be
interfaced with C programs as a library).

Razvan

"dreamAnders" <dream_...@yahoo.com.cn> wrote in message

0 new messages