Skip to main content
CF

Building a Parser from scratch

2h 31m 11s
English
Paid

Parsing, or syntactic analysis, is a crucial initial stage in designing and implementing a compiler. A well-designed syntax can significantly influence users to choose your programming language. This course is a practical class on building a manual Recursive-descent parser. If you're interested in parsing theory and automated algorithms, you might also consider our [Parsing Algorithms] class.

Why Choose Recursive Descent Parsers?

Recursive descent parsers are widely used in many production programming languages. Unlike automated parsing algorithms, manual implementation allows you to have full control over the parsing process, tackling complex constructs that may not be achievable with automatic parsers.

Implementing a manual parser from scratch provides an in-depth understanding of the process, demystifying internal structures, turning parser building into an engaging engineering task.

Course Overview

In the Building a Parser from Scratch class, we focus on the practical implementation and exploration of various parser aspects. You will learn the concept of Recursive descent parsing, understand what a Tokenizer is and how it works with the Parser module. You'll also discover what an Abstract Syntax Tree (AST) is, how to format these ASTs, and learn about “lookahead” and predictive parsing. Ultimately, you'll build a parser for a complete programming language similar to Java or JavaScript.

Building a parser will also enhance your practical skills in other programming languages.

Target Audience

Who should take this class?

This class is designed for any curious engineer who wants to acquire skills in building complex systems—such as creating a parser for a programming language, which is a challenging engineering task—and gain transferable knowledge for developing such systems. If you are particularly interested in compilers, interpreters, and source code transformation tools, this class is also ideal for you.

Prerequisites include understanding basic data structures and algorithms: trees, lists, traversal, and regular expressions.

Implementation Tools

We use JavaScript due to its elegant multi-paradigm structure, combining functional programming, class-based, and prototype-based OOP, which fit perfectly for our purposes.

JavaScript is familiar to many engineers, making it easier to start coding immediately. However, our approach ensures that JS-specific constructs are minimal, facilitating transferability to other programming languages of your choice.

Note: Our objective is for students to actively follow, understand, and implement each detail of the parser themselves, rather than relying on direct copy-pasting from a final solution. The complete source code is available in video lectures, with guidance on structuring specific modules.

Unique Features of This Class

  • Concise and focused content. Each lecture stays self-contained, concise, and covers directly relevant material, avoiding distractions.
  • Animated presentations paired with live-editing notes, enhancing topic comprehension and illustrating object structure connections dynamically.
  • End-to-end live coding sessions include assignments. The entire source code, from scratch to completion, is demonstrated in our video lectures.

Course Structure

The course is divided into four parts, comprising 18 lectures and numerous sub-topics. Below is the table of contents and curriculum:

Part 1: Basic Expressions and Tokenizer

We explore basic expressions such as Numbers and Strings and develop Tokenizer modules using regular expressions.

Part 2: Program Structure

This section covers program structures, including statements, statement lists, blocks, and recursive production rules. We discuss various AST formats and begin constructing more complex expressions.

Part 3: Control Flow and Functions

Here, we implement variables, assignments, and operator precedence, introducing function abstractions. Control structures like the If-statement and iteration loops are also defined.

Part 4: Object-Oriented Programming

In the final part, we implement classes and objects, discussing property and array access. We also implement generic function and method calls, culminating in building the final parser executable.

About the Authors

Dmitry Soshnikov

Dmitry Soshnikov thumbnail

Dmitry Soshnikov is a Russian software engineer and educator focused on programming-language internals, compiler construction, JavaScript engine architecture, and the theoretical computer-science foundations underneath modern software development. His independent course catalog is one of the deepest sources of long-form material on language implementation available outside university CS programs.

His CourseFlix listing carries nine courses spanning parser combinators, interpreter construction, garbage-collection algorithm internals, the design of pattern-matching engines, and JavaScript object-model deep dives. Material is paid and aimed at engineers who want to understand how the languages they use every day actually work under the hood.

Udemy

Udemy thumbnail

Udemy is the largest open marketplace for online courses on the internet. Founded in 2010 by Eren Bali, Oktay Caglar, and Gagan Biyani and headquartered in San Francisco, the company went public on the Nasdaq in 2021 under the ticker UDMY. The platform hosts well over two hundred thousand courses across software development, IT and cloud, data science, design, business, marketing, and creative skills, taught by tens of thousands of independent instructors. Roughly seventy million learners use it worldwide, and the corporate arm — Udemy Business — supplies a curated subset of that catalog to enterprise customers.

Because Udemy is a marketplace rather than a single editorial publisher, the catalog is uneven by design. The strongest material lives in the long-form, project-based courses authored by working engineers — full-stack JavaScript, React, Node.js, Python data science, AWS, Docker and Kubernetes, mobile development with Flutter and React Native, and cloud certification preparation. The CourseFlix listing under this source is the slice of that catalog that has been mirrored here for offline-friendly viewing, organized by topic and updated as new releases land. Pricing on Udemy itself swings dramatically with the site's near-permanent sales, which is why the platform is best treated as a deep reference catalog: pick instructors with strong reviews and a track record of updating their material rather than buying on the headline price alone.

Watch Online 18 lessons

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 18 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: Tokenizer | Parser
All Course Lessons (18)
#Lesson TitleDurationAccess
1
Tokenizer | Parser Demo
14:02
2
Numbers | Strings
10:40
3
From State Machines to Regular Expressions
11:14
4
Statements and Statement list
10:59
5
Blocks: nested scopes
06:03
6
Different AST formats
04:47
7
Binary Expressions
12:09
8
Assignment Expression
11:09
9
Variable Statement
08:54
10
If-Statement
07:17
11
Equality | Logical
06:52
12
Unary Expression
05:11
13
Iteration Statement
08:28
14
Function Declaration
05:39
15
Member Expression
08:08
16
Call Expression
05:05
17
OOP | Classes
07:40
18
Final Executable
06:54
Unlock unlimited learning

Get instant access to all 17 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription

Related courses

Frequently asked questions

What is Building a Parser from scratch about?
Parsing, or syntactic analysis, is a crucial initial stage in designing and implementing a compiler . A well-designed syntax can significantly influence users to choose your programming language. This course is a practical class on…
Who teaches this course?
It is taught by Dmitry Soshnikov, Udemy. You can find more courses by these instructors on the corresponding source pages.
How long is the course?
It contains 18 lessons with a total runtime of 2 hours 31 minutes. Every lesson is available to watch online at your own pace.
Is it free to watch?
It is part of CourseFlix's premium catalog. A subscription unlocks the full video player; the course description, table of contents, and preview information are available to everyone.
Where can I watch it online?
The course is available to watch online on CourseFlix at https://courseflix.net/course/building-a-parser-from-scratch. The page hosts every lesson with the integrated video player; no download is required.