|
|
Up |
|
|
  |
Author: dreamAndersdreamAnders 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 |
|
  |
Author: vippstarvippstar 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 |
|
  |
Author: Robert GambleRobert 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 |
|
  |
Author: dreamAndersdreamAnders 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 |
|
  |
Author: dreamAndersdreamAnders 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 |
|
  |
Author: DanDan Date: May 10, 2008 20:20
> 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 |
|
  |
Author: GeneGene Date: May 10, 2008 20:42
On May 10, 11:20Â pm, "Dan" 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.
>
> Can it compile itself?
From User's Manual:
|
| Show full article (1.13Kb) |
| no comments |
|
  |
Author: Rui MacielRui 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 |
|
  |
Author: BartBart 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 |
|
  |
|
|
  |
Author: noagbodjivictornoagbodjivictor 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 |
|
|
|
|