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_global
for global statements such asmacros
,global variables
etc.file_functions
for all the function statementsfile_local
for 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
show
andglobal:
org:
keyword - Add
repeat
orr
keyword
#include <stdio.h>
int main(){
return 0;
}
git clone https://github.com/surajkareppagol/CREPL
cd CREPL
Activate virtual environment,
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python3 src/main.py
To deactivate virtual environment,
deactivate
-
exit
orexit()
Exit the CREPL by resetting the template. -
clear
orclear()
Clear the screen. -
reset
orreset()
Reset the template. -
show
orshow()
View current content of template file. -
g:
orglobal:
Add global statements, useg: #include <stdlib.h>
orglobal: #define MAX 100
-
repeat
orr
To execute once again