Using ANTLR V4.7
Compiling in Java
{ =, -, *, /, ==, !=, +=, *=, cout << string, cout << double , endl }
struct, struct.inner
double, string
struct Coordinates
{
double x, y;
};
struct Human
{
string name;
double weight;
Coordinates coord;
};
void main()
{
double a = 55.355;
Human Petya;
Petya.name = "Petr";
Petya.weight = 97.79;
Petya.coord.x = 55.25;
Petya.coord.x = 27.12;
cout<<Petya.name<<endl;
cout << (Petya.weight)<<endl;
Petya.weight *= Petya.weight / 10;
cout << (Petya.weight);
}
Petr
97.79
956.288