BrainIO

WalkAlong: 2



In WalkAlong 2, we would continue with the software layer. We design the compiler here. The software layer consists of the high level programming language, the compiler and the assembler. There are numerous high level programming language so, rather than design a new one which would take more time to learn, we would design our compiler around the C++ language. Our compiler would be able to compile C++ syntax to assembly language using the RISC-V ISA. Therefore we are designing a mini c++ compiler.

Most compiler designs are divided into several steps like: The lexical analysis, syntax analysis, semantic analysis, intermediate code generation, code optimizer, code generation. For simplicity I have divided the design into two major parts the tokenizer and the parser. The code optimization, intermediate code generation and assembler would very very easy if you understand the compiler design. So i would leave these last steps as assignemnt for students who followed through the course.

High level codes written in C++ are compiled using the compiler we would design to assembly language. The assembler converts it to machine code which would run on our virtual machine and SOC.

WalkAlong:1 Tokenizer