
we would learn how to open the c++ file we want to compile and copy its content
We would what tokens are , their types and uses, we also create our own token enum list
We are going to learn about the scanner. How the scanner scans our c++ file to generate tokens.
whitespaces are operational directives , and are not useful during compilation. in this lesson we would learn how the scanner skips them.
How does scanner check for keywords?we would learn how keywords like break, continue, int etc. are generated.
Characters: ?, >, <, (, ), etc. we would learn how they are scanned in this lesson.
we would learn how numbers and identifiers are generated.
in this lesson we would output all our tokens to a file. the final generation process takes place here. we would also send tokens to parser here.
You will learn how to setup the parser and initialize classes for the semantic analyzer
Learn twenty different language constructs and how they are parsed
Learn how to create the five different classes used for semantic analysis. the function list, argument list, local variable list, global variable list and the main friend class
learn how function declarations are compiled. you will also learn how the function arguments are added to the argument list.
i have added three pdf files, that will aid you in learning how manual compilation works. including how the stack is arranged and how to pop or push registers to the stack. and how registers store data.
in this lesson we learn how variables are declared. we learn how the variables are linked to their function and added to the local variable list. we learn how global variables are differentiated from local variables.
In this lesson we would learn how to exit a function. how the right_brace function is used exit functions and how the function scope was exited . several steps are taken which we would learn in this class.
the student will learn how the expresssion function is used to solve any type of arithmetic or logical expression including error check .
here, the student will learn how registers are assigned to variables before compiling . registers will be selected from either from the argument register array, global variable register array or local variable register array
here we compile the postfix expression patterns for both unary operations, binary operations including logical and arithmetic expressions.
Logical OR, logical AND, and Bang expression have their distinct algorithm which is different from the general expression algorithm. we would discuss that in this lesson
we will learn how to enter and exit while loop scopes and how the right_brace function terminates while loops
Here, we would learn how for loops are being compiled.
we learn how if expression, else if expression and else are compiled including how their exit is terminated in the right_brace function
we would learn how switch statements, case statements, switch break keyword and default keyword are compiled and also how they are terminated using the break keyword
we would learn the difference between the function call and function initialization and declaration. we also learn how the stack is used to update the argument registers and how registers are split.
25compiling tenary operation,
return statement,
break keyword,
continue keyword,
label keyword,
goto keyword,
cout keyword
The course takes a step-by-step practical approach to the design of a C++ compiler. The student starts with learning how to design the lexical analyzer or scanner, followed by the syntax analyzer or parser, then semantic analyzer and the intermediate code generation.
These make up the four major units of the course.All these units are compiled one after another.
The course will also provide a grasps of what tokens are, how they are generated and what they are used for in compiler designs.
. You will design a parser that parses chunks of more than 20 different language constructs we will use in the lesson and also be able to add your own custom language sentence in your own compiler design using c++ or any language of your choice.
The lessons and technique gotten from the course was used in the design of a multi-threaded HTTP web server.
This course is for all levels of C++ developers. who want to advance their programming skill through a project design and for developers who want to learn about compilers and also learn how to design them. we would start from the basic tokens and develop into the more complex compiler design in a step by step manner.
The high level programming language used in this course is the C++ language.
The only tool you will need is a good C++ editor example VsCode, Visual studio etc..
Basic knowledge of C++ is required, our compiled file will be an assembly language code which will consist of a mix of the standard MIPS assembly and RISC-V which you will learn in this course. A lot of course material including the full working compiler script which designs these different units is also attached.