About Cinter
This program is a C language interpreter. Main goal of the project is fast executing programs
with compilation process omitted. It is an alternative to ordinary interpreters and compilers.
It also can be useful in writting scripts and macros in C.
Application has console interface and is based on three modules:
- source code scanner,
- parser,
- interpreter core that runs written programs.
Subset of grammar accepted by parser:
- keywords - void, int, float, if, while, else
- operators - =, +, -, *, /, ==, <, >, <=, >=, !=, ++, --, ||, &&, !
- blocks - main, if [else], while
- I/O operations - printf, scanf
Constraints:
- variable declaration - Variable declaration cannot be used to simultaneous value assignment.
The only possible construction is e.g.
int a,b,..,c;
orfloat a,b,..,c;
. - forced conversion - When the left side of the assignment (lvalue) is of integer type and the right side is an expression of another type (currently only float) then "possible loss of precision" warning is displayed and lvalue conversion is performed.
- printf instruction - It can only be used to display single variable value e.g.
printf(variable_name);
. - scanf instruction - It can only be used to receive single variable value e.g.
scanf(&varibale_name);
. - block construction - Program cannot have any procedures or functions, it can only have
main
block,while
andif [else]
constructions. - brackets - Round brackets cannot be used in neither arithmetical nor logical expressions.