Skip to content

Nakrez/ucc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

309 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

*****************************
UCC : Micro C Compiler
*****************************

* Informations

Ucc is a C compiler that aims at compiling C89 compliant programms (for now).
Ucc is written in C++ 11.
Ucc is in early stage development. Indeed it is only able to parse and build
AST from input files.

* Compilation

To compile UCC you only need to have a C++ 11 compliant compiler.
You just have to do these 3 commands to build it:

./bootstrap
./configure
make

* Documentation

To generate documentation simply run 'make doxygen-doc'. This will generate
the documentation in doc/gen

* Usage

Usage: ucc [OPTION...] file...
ucc: Micro C compiler

      --ast-dump             Dump the content of the ast (debug purpose)
      --ast-print            Pretty print the input file (debug purpose)
      --ast-print-bindings   Pretty print the input file compute and print the
                             bindings associated (debug purpose)
  -b, --compute-bindings     Compute bindings on the AST
      --fsyntax-only         Check the code for errors, but don't do anything
                             beyond that.
  -p, --parse                Parse the input file
      --parse-trace          Activate parse trace
      --type-check           Check type from the input file
  -w, --disable-warnings     Disable all warnings
      --Wall                 Enable warning flags about constructions that are
                             questionable
      --Werror               Treat warnings as errors
      --Wextra               Enable extra warning flags
      --Wuninitialized       Warn if variable is used before being initialized
  -?, --help                 Give this help list
      --usage                Give a short usage message

* Status

- PARSER (C89, with gcc extension) : 90%
- AST : 90% (cannot embed "__asm__" statements and "gcc __attribute__")
- PRETTY-PRINTER : 90% (print the generated AST from the code)
- BINDER : 90% (link usage of variables, types, ... To their definitions)
- TYPE CHECKER : 90% (verify type correctness from input file)
- ANALYSIS : 5% (try to detect questionable constructions)
- MIDDLE END : 0%
- BACK END : 0%

* License

UCC is under GPL2. See COPYING file for more informations.

* Known bugs

- The parser as some problem with type definitions. Once a typedef or an
enumeration define an identifier this identifier is flagged as type
(enum constant) no matter redefinition in different scopes.

* Contact

If you find bugs, or you have any questions, ... Feel free to can contact me
at b.covolato AT gmail.com

* Note

- UCPP is not working for now (more interesting and funnier to work on the
actual compiler). So you need first to preprocess (or not use C preprocessor
directive) input files before running UCC on it.

- Unfortunately LIBC headers uses a lot gcc attributes, as well as variadic
parameters type, which are not handled by UCC for now. So to test your code you
will have to declare C standard function that you want to use (malloc,
printf, ...) and avoid LIBC headers.

About

Micro C Compiler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors