Skip to main content
CF

Building a Parser from scratch

2h 31m 11s
English
Paid

Building a Parser from scratch is a 18-lesson 2 hours 31 minutes self-paced course by Dmitry Soshnikov, Udemy. Parsing, or syntactic analysis, is a crucial initial stage in designing and implementing a compiler .

Course facts

Lessons
18
Duration
2 hours 31 minutes
Level
All levels
Language
English
Updated
Instructor
Dmitry Soshnikov, Udemy
Price
Premium

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.

Who teaches Building a Parser from scratch?

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.

What lessons are included in Building a Parser from scratch?

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

What courses are similar to Building a Parser from scratch?

Frequently asked questions

What prior knowledge or skills should I have before taking this course?
Before enrolling, you should have a basic understanding of programming concepts and familiarity with a high-level programming language like Java or JavaScript. While the course will cover the specifics of building a Recursive-descent parser, knowledge of syntax trees and basic compiler theory could be beneficial for grasping the more complex topics.
What will I build by the end of this course?
By the end of the course, you will have constructed a complete recursive-descent parser capable of parsing a programming language similar to Java or JavaScript. This includes implementing a tokenizer, handling various expressions and statements, and generating an Abstract Syntax Tree (AST). The final project will culminate in creating a functional parser for a syntactically rich language.
Who is the target audience for this course?
This course is designed for software developers and computer science students interested in compiler construction and language design. It is ideal for those who want to gain practical experience in parser implementation and improve their understanding of the inner workings of programming languages.
How does this course compare in depth to other parsing courses?
This course offers a practical approach to building a parser manually, focusing on Recursive-descent parsing. Unlike theoretical courses that cover automated parsing algorithms, this course provides hands-on experience with the manual construction process, offering insights into the complexities and benefits of controlling parsing logic in production environments.
What specific tools or platforms will I learn to use in this course?
The course does not focus on specific external tools or platforms but rather emphasizes the manual construction of a parser using general programming concepts. You will work with code to build components like the tokenizer and Abstract Syntax Tree (AST) without relying on automated tools, enhancing your programming skills.
What topics are not covered in this course?
The course does not delve into automated parsing algorithms or the theory behind them, such as LL, LR, or LALR parsing techniques. It strictly focuses on manual Recursive-descent parsing, offering an alternative perspective to automated approaches discussed in courses like Parsing Algorithms.
How will the skills from this course benefit my career or other courses?
The skills acquired in this course will enhance your understanding of compiler design and programming language implementation. Mastery of manual parsing techniques can be valuable in roles focused on language development, compiler construction, or any position requiring strong problem-solving skills in complex systems. Additionally, the knowledge can serve as a strong foundation for advanced courses in compiler theory and language processing.