Introduce a C Compiler ucc
  Home FAQ Contact Sign in
comp.lang.c only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.c Profile…
 Up
Introduce a C Compiler ucc         


Author: dreamAnders
Date: May 10, 2008 18:15

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, which will help you to master the
C language.
63 Comments
Re: Introduce a C Compiler ucc         


Author: vippstar
Date: May 10, 2008 18:35

On May 11, 4:15 am, dreamAnders yahoo.com.cn> wrote:
> 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 fromhttp://sourceforge.net/projects/ucc, which will help you to master the
> C language.

Your implementation of assert in ucc/ucl/linux/include/assert.h is not
ANSI C, (or ISO C) as it evaluates it's parameter more than once if
NDEBUG is not defined.
Example: assert(printf("hello world\n")); would call print twice.

I suggest you rewrite _assert (and also rename to _Assert) to return
void, and make the check twice there.
no comments
Re: Introduce a C Compiler ucc         


Author: Robert Gamble
Date: May 10, 2008 18:42

On May 10, 9:15 pm, dreamAnders yahoo.com.cn> wrote:
> 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 fromhttp://sourceforge.net/projects/ucc, which will help you to master the
> C language.

At about 1 comment per 1000 lines of code it may be difficult to get
this adopted for "research and instructional use".

--
Robert Gamble
no comments
Re: Introduce a C Compiler ucc         


Author: dreamAnders
Date: May 10, 2008 19:21

On May 11, 9:35 am, vipps...@gmail.com wrote:
> On May 11, 4:15 am, dreamAnders yahoo.com.cn> wrote:
>
>> 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 fromhttp://sourceforge.net/projects/ucc, which will help you to master the
>> C language.
>
> Your implementation of assert in ucc/ucl/linux/include/assert.h is not
> ANSI C, (or ISO C) as it evaluates it's parameter more than once if
> NDEBUG is not defined.
> Example: assert(printf("hello world\n"));...
Show full article (1.11Kb)
no comments
Re: Introduce a C Compiler ucc         


Author: dreamAnders
Date: May 10, 2008 19:24

yes, I accept this . Nearly no comments. I wanted to write this code
in a self-explanatory way. And I provide an internal implementation
document, hope that will help developers understanding the code.

On May 11, 9:42 am, Robert Gamble gmail.com> wrote:
> On May 10, 9:15 pm, dreamAnders yahoo.com.cn> wrote:
>
>> 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 fromhttp://sourceforge.net/projects/ucc, which will help you to master the
>> C language.
>
> At about 1 comment per 1000 lines of code it may be difficult to get
> this adopted for "research and instructional use".
>
> --
> Robert Gamble
no comments
Re: Introduce a C Compiler ucc         


Author: Dan
Date: May 10, 2008 20:20

"dreamAnders" yahoo.com.cn> wrote in message
news:1b33b933-749a-48ca-af4f-d7f87f8ebc37@p25g2000pri.googlegroups.com...
> 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, which will help you to master the
> C language.

Can it compile itself?
no comments
Re: Introduce a C Compiler ucc         


Author: Gene
Date: May 10, 2008 20:42

On May 10, 11:20 pm, "Dan" wrote:
> "dreamAnders" yahoo.com.cn> wrote in message
>
> news:1b33b933-749a-48ca-af4f-d7f87f8ebc37@p25g2000pri.googlegroups.com...
>
>> 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, which will help you to master the
>> C language.
>
> Can it compile itself?

From User's Manual:
Show full article (1.13Kb)
no comments
Re: Introduce a C Compiler ucc         


Author: Rui Maciel
Date: May 11, 2008 03:21

On Sat, 10 May 2008 18:15:57 -0700, dreamAnders wrote:
> 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, which will help
> you to master the C language.

Do you have a site dedicated to your project?

Rui Maciel
no comments
Re: Introduce a C Compiler ucc         


Author: Bart
Date: May 11, 2008 06:52

On May 11, 2:15 am, dreamAnders yahoo.com.cn> wrote:
> 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 fromhttp://sourceforge.net/projects/ucc, which will help you to master the
> C language.

As I understand it, this is just a bare compiler source code?

There are no binaries, so another compiler is needed to get started.

There appear to be no standard header files or library files,
presumably you are relying on these things from another compiler?

--
Bartc
no comments
Re: Introduce a C Compiler ucc         


Author: noagbodjivictor
Date: May 11, 2008 08:36

On May 10, 9:15 pm, dreamAnders yahoo.com.cn> wrote:
> 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 fromhttp://sourceforge.net/projects/ucc, which will help you to master the
> C language.

Congratulations. I hope this project will evolve quickly.
no comments
1 2 3 4 5 6 7