Skip to content
No description, website, or topics provided.
C
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
env
.gitignore
README
bool.c
gs.h
gstest.h
integer-constants.txt
lexer.c
main.c
parser.c
sample.c
test.c
tree.c

README

--------------------------------------------------------------------------------
 Overview
--------------------------------------------------------------------------------
This is my in-progress C compiler. Currently it only contains a lexer and a
parser, and the parser is not complete.
There is no support for the C preprocessor at all.  Any preprocessor commands
are simply ignored, as are comments.

The parser does parse some C programs, like the provided sample.c.
There's a really naive parse tree implementation to aid with debugging.
The `parse' subcommand has a `--show-parse-tree' option that will display this
parse tree.  Warning! It's really big!

Note that the canonical home of this project is at:

    https://git.groovestomp.com/cparser/

--------------------------------------------------------------------------------
 Setup, Requirements, Etc.
--------------------------------------------------------------------------------
Setup:

> cd /path/to/project/root
> source env/shell

Build:

> build

Run:

> ./test # Run tests.
> ./cparser --help
> ./cparser parse sample.c --show-parse-tree

--------------------------------------------------------------------------------
 To Do
--------------------------------------------------------------------------------
- Integer lexing is not correct? Double check C reference and
  integer-constants.txt test file.

- Unicode support? C unicode libraries: icu, utf8proc, *microutf8*, *nunicode*
  Both microutf8 and nunicode look quite good.
You can’t perform that action at this time.