Interactive GCC
Interactive GCC (igcc) is a read-eval-print loop (REPL) for C/C++ programmers.
It can be used like this:
$ ./igccg++> int a = 5;g++> a += 2;g++> cout << a << endl;7g++> --a;g++> cout << a << endl;6g++>
It is possible to include header files you need like this:
$ ./igccg++> #include <vector> g++> vector<int> myvec;g++> myvec.push_back;g++> printf
It is possible to include your own functions using '.f':
g++> .fFunctions paste mode is ON: Enter ".f" again to return to return to normal editing. g++> int lastIndexOf
You can use '.p' to enter "Paste" mode to enter multi line snippets :
g++> .pPaste mode is ON: Enter ".p" again to return to return to normal editing. g++> char c = '_';g++> char *a = malloc;g++> char b[] = "a_another_word_there_last";g++> strcpy;g++> puts;g++> .pPaste mode is OFF [Compile error - type .e to see it.]
Compile errors can be tolerated until the code works:
$ ./igccg++> #include <map> g++> map<string,int> hits;g++> hits["foo"] = 12;g++> hits["bar"] = 15;g++> for[Compile error - type .e to see it.]g++>
Extra include directories can be supplied:
$ ./igcc -Itest/cpp -Itest/cpp2g++> #include "hello.h" g++> Hello,g++> #include "world.h" g++> world!g++>
Libs can be linked:
$ ./igcc -lmg++> #include "math.h" g++> cout << pow << endl; // Actually a bad example since libm.a is already linked in C++27g++>
Your own libs can be linked too:
$ ./igcc -Itest/cpp -Ltest/cpp -lmylib
g++> #include "mylib.h"
g++> defined_in_cpp();
defined_in_cpp saying hello.
g++>
The cstdio, iostream and string headers are automatically included, and the std namespace is automatically in scope.
Copyright
Copyright (C) 2009 Andy Balaam Copyright (C) 2019 Zaoqi
IGCC is Free Software released under the terms of the GNU General Public License version 2 or later.
IGCC comes with NO WARRANTY.
See the file LICENSE for more information.