Pattern Matching | Creating programming language

aNNiMON aNNiMON

550
2 năm trước
In this video I'll show how to create a powerful pattern matching expression in your programming language.
Project source code: https://github.com/aNNiMON/Own-Programming-Language-Tutorial

🎥 A series of video tutorials on creating your own programming language from scratch in Java. You will learn:
- on what steps the compilation of the program is divided;
- what is a lexer and parser;
- how to set priorities of operations;
- how to add data types (integers and float numbers, strings)
- how the program is executed;
- how cycles, branching and functions are implemented;
- what is an abstract syntax tree (AST);
- how best to traverse the AST;
- how to make modules or library functions.
In the end, we even write a game on the created programming language.
Source code: https://github.com/aNNiMON/Own-Programming-Language-Tutorial

👉 Visit my website https://annimon.com/
There you will find a lot of useful articles and lessons, you can ask a question interesting you or discuss it on the forum.

✏️
X: https://x.com/annimon_com
Telegram: https://t.me/annimon_com

00:00 Intro
00:14 Overview
00:54 Basic number matcher implementation
06:07 Supporting match as expression
06:54 String matcher implementation
07:41 Variable pattern matching
09:20 Default case implementation
10:22 Optional conditions
11:58 List pattern matching
12:56 Tuple pattern matching
13:42 Outro