I have been asked from my job to make a meta-compiler.My job is take user programs written in LOGO(Its for a school)and convert them with preprocessor and C++11 meta programming techniques to C++ code. What i am trying to do right now is suppose we have this expression in our file
MAKE var = NUMBER: 21
that defines a variable called var
and assigns the number 21
in it.
I have to convert it to something C++ like auto var = 21;
while compiling with g++.
I have defined MAKE
as auto
but i cant figure out how i will place ;
at the end of the expression at compile time and change NUMBER:
with something else that C++ will accept as i cant define :
in preprocessor. I am not sure that auto var = 21;
is the final form i have to find the solution whatever works accepted.
Aucun commentaire:
Enregistrer un commentaire