CREPL is REPL (readโevalโprint loop) program written in Python for C.
The program has three has three containers for three sections, that is,
file_globalfor global statements such asmacros,global variablesetc.file_functionsfor all the function statementsfile_localfor all local statements
The content from these three lists is written to a temporary C file, and it is compiled and executed, the result it displayed, if there are any errors, errors will be displayed.
If there is an error, the lists will revert back to previous code.
- Restructured the program
- Added support for multi-line statements
- Added support for nested statements
- Used Regex to distinguish local and global statements
- Add
showandglobal:org:keyword - Add
repeatorrkeyword
#include <stdio.h>
int main(){
return 0;
}git clone https://github.com/surajkareppagol/CREPL
cd CREPLActivate virtual environment,
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtpython3 src/main.pyTo deactivate virtual environment,
deactivate-
exitorexit()Exit the CREPL by resetting the template. -
clearorclear()Clear the screen. -
resetorreset()Reset the template. -
showorshow()View current content of template file. -
g:orglobal:Add global statements, useg: #include <stdlib.h>orglobal: #define MAX 100 -
repeatorrTo execute once again
