I don't see that the example is complete/correct. Where does the code do anything with str?

One step would be to define the syntax of the language, the types of statements and the data types....