Geração de compiladores baseada em componentes - Gabriel de Godoy Corrêa e Castro (2014)
The construction of a compiler of a real size programming language is a complex and big project. So, proper tools are needed to help in this task. However, compiler generation systems are still not popular yet. This is due to the complexity of these systems, complicated by their lack of readability and low reusability of language definitions used by other systems. This dissertation presents a compiler development environment which is focused on the readability of the compiler code, making the environment simpler to use. This environment translates the source code to an abstract syntax tree and performs, subsequently, semantic actions to generate code while visiting the AST generated. The environment is supported by a code generator infrastructure that encapsulates fundamental and recurring concepts of the constructs of imperative programming languages. The infrastructure consists of components of semantic actions, intermediary code instructions and a symbol table. The components are utilized by the programming language implementer to perform the semantic actions necessary to compile the language. The symbol table is used to control the declarations of the variables used in the infrastructure and allows the selection of different strategies for scope control and memory allocation. The environment was validated with an implementation for the compiler of the language Small, defined herein.