Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
C/C++ Compiler design from scratch
Rating: 4.4 out of 5(46 ratings)
421 students

C/C++ Compiler design from scratch

Design of a C++ compiler(Guided project)
Created byEzeuko Emmanuel
Last updated 3/2024
English

What you'll learn

  • the student will learn what are tokens, and the different kinds of tokens in compiler design. the student will also generate his/her own token enum list in c++
  • the student will design a scanner used by compilers in checking for error and matching tokens, you will learn how to open a c++ file and copy its content
  • The student will learn about the parser and create his/her own parser which will parse 20 different kinds of language syntax in our compiler design
  • you will learn and design the semantic analysis of a compiler design , and how our compiler design learns sentence are structures. Also code generation.

Course content

5 sections30 lectures4h 52m total length
  • 0. download code files0:02
  • 1. opening the c++ file7:37

    we would learn how to open the c++ file we want to compile and copy its content

  • 2. What are tokens9:10

    We would what tokens are , their types and uses, we also create our own token enum list

  • message me for help0:58
  • 3. the scanning process7:33

    We are going to learn about the scanner. How the scanner scans our c++ file to generate tokens.

  • 4. how to skip whitespaces7:24

    whitespaces are operational directives , and are not useful during compilation. in this lesson we would learn how the scanner skips them.

  • 5. scan keyword tokens9:08

    How does scanner check for keywords?we would learn how  keywords like break, continue, int etc. are generated.

  • 6. scan Char tokens6:42

    Characters: ?, >, <, (, ), etc. we would learn how they are scanned in this lesson.

  • 7. how to the generate token8:32

    we would learn how numbers and identifiers are generated.

  • 8. the makeToken function9:36

    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.

Requirements

  • All levels in the knowledge of the C++ languge and compiler design

Description

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.

Who this course is for:

  • C++ developers
  • Compiler design