@@ -4,8 +4,6 @@ C_Interpreter
44[ ![ Build Status] ( https://travis-ci.org/rswinkle/C_Interpreter.svg?branch=master )] ( https://travis-ci.org/rswinkle/C_Interpreter )
55[ ![ Coverity Scan Build Status] ( https://scan.coverity.com/projects/3624/badge.svg )] ( https://scan.coverity.com/projects/3624 )
66
7- [ ![ Contact me on Codementor] ( https://cdn.codementor.io/badges/contact_me_github.svg )] ( https://www.codementor.io/rswinkle )
8-
97[ http://www.robertwinkler.com/projects/c_interpreter.html ] ( http://www.robertwinkler.com/projects/c_interpreter.html )
108
119This started as C port of an old college assignment
@@ -17,6 +15,13 @@ Now my goal is to make something approaching scriptable
1715C. I'll consider it done when it can run itself ...
1816so it'll probably never be completely done.
1917
18+ Download
19+ ========
20+ Get the source from [ Github] ( https://github.com/rswinkle/C_Interpreter ) .
21+
22+
23+ Alternatives
24+ ============
2025If you're looking for something more professional there's
2126
2227* [ Cling] ( http://root.cern.ch/drupal/content/cling )
@@ -27,25 +32,26 @@ fast and self-contained they have a command line switch -run to immediately
2732run it after compiling so you can use C as a JIT scripting language,
2833
2934
30-
35+ Tests
36+ =====
3137I've kept the old tests around (updating them so they
3238keep working) but I've been adding new tests for
3339new features. They're not comprehensive and they
3440don't test every edge case but they're growing.
3541
42+
43+ Misc
44+ ====
3645I'm using the 5th edition of C: A Reference Manual for
3746all the nitty gritty details and the very convenient
3847complete C grammar/syntax in the appendix.
3948
40- The grammar below is the current status more or less.
41- It'll be interesting to see how it grows and which
42- parts converge with full syntax first.
43-
4449I've also added a BNF spec for C I found online just
4550to have something for reference in the repository.
4651
47- I've now added a preprocessor which currently supports
48- the following (and of course actually using the macros):
52+ Current Grammar (work in progress)
53+ ==================================
54+ ### Preprocessor
4955
5056#include "relative path based on current directory"
5157#define name
@@ -54,9 +60,9 @@ the following (and of course actually using the macros):
5460#undef name
5561# (null directive)
5662
63+ It also of course supports actually using the macros.
5764
58- Current Grammar (work in progress)
59- ==================================
65+ ### C language
6066
6167translation_unit -> top_level_declaration
6268 translation_unit top_level_declaration
@@ -261,21 +267,9 @@ all my tests at once.
261267Usage: ./cinterpreter [-E] script
262268~/C_Interpreter/build $ ./cinterpreter ../tests/switch.txt
263269[ouhput from switch.txt here]
264- ~/C_Interpreter/build $ ../runtests.sh
265- running normal tests
266- ==================
267- executing ../tests/backslash.txt
268- executing ../tests/break_continue.txt
269- executing ../tests/problem6.txt
270- ...
271- comparing output of ../tests/backslash.txt
272- comparing output of ../tests/break_continue.txt
273- comparing output of ../tests/problem6.txt
274- ...
275- ~/C_Interpreter/build $ ../runtests_valgrind.sh | grep ERROR
276- ==30652== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)
277- ==30652== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)
278- ==30655== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)
279- ...
270+ ~/C_Interpreter/build $ ../runtests.py
271+ Should be nothing here, only failures produce output
272+ ~/C_Interpreter/build $ ../run_valgrind_tests.py
273+ Same here. Note this make take a minute, valgrind makes things slow
280274~/C_Interpreter/build $
281275
0 commit comments