Our tiny language features a few types: int, float, bool, string and arrays of those types. We can even declare new type names based on other types but it still missing a record type. Today we will address this.
Today we will add a relatively simple feature that will be very useful for a future extension: type declarations.
Today we will do something relatively easy: let’s add a way to declare boolean variables and express boolean literals.
Now that we have the basic language set implemented we can consider adding new features to it. Today we will add arrays.
In this part we will complete the missing statements from part 6 and finish our front end.
In part 5 we described the objects that we will need to semantically analyze a tiny program. In current part we will extend the parser of part 4 to do the semantic analysis and create the GENERIC trees.
In the last installment of this series we saw how to verify that the sequence of tokens of the input is syntactically valid. Today we will see what we need to give it meaning.
Now that we have a stream of tokens we can start performing syntactic analysis.
Now that the minimal infrastructure is already set, we can start with the implementation of our tiny front end. Today we will talk about the lexer.
The previous installment of this series was all about the syntax and the semantics of the tiny language. In this chapter we will start implementing a front end for tiny in GCC. The journey will be long but rewarding. Let’s get started.