First i'm sorry for my bad english, it's not my natural language. So, i'm trying to parse a DSL to c++ code so i can later compile it with G++ or GCC. I don't need expression evaluation, variable tables or anything like this. I just need to copy them in the resulting file. As an example:
start:
integer x
read x
write x + 2
[]
this code should turn into:
#include <iostream>
int main(void){
int x;
std::cin>>x;
std::cout<<x + 2;
return 0; }
and it should read an integer and write it + 2 to the console .. I would also like a if statement a while ... do ... a for and a do ... while ... It is possible with ANTLR4? I would like to use it, and if it's possible can you redirect me to a good tutorial series? I made something similar with flex and bison ... but it didn't turn out how i wished.
Thanks a lot men! You are awesome!