How I built Rockstar: Parsing esoteric languages with .NET
summary
A working interpreter for a Zeppelin subset of Rockstar is implemented in C#/.NET using Pegasus to generate a parser from a parsing expression grammar, then mapped into an abstract syntax tree of node types. The build covers numbers, output, blocks, operator precedence (add and multiply), variables, function definitions, calls with scoped environments and return handling. The pipeline parses source -> AST -> evaluator and runs live examples (including chained arithmetic), producing correct console output.
AI-written summary · about
chapters (26)
- 0:00Intro
- 8:55How Rockstar got started
- 11:33Theory of compilers
- 16:44Creating a new solution
- 17:32Adding Pegasus
- 17:58Pazza
- 20:30Grammar
- 21:35Program
- 24:48Evaluate
- 26:20Run
- 29:34Block evaluator
- 30:33Expression
- 32:31Addition
- 34:15New Case Statement
- 36:09Addition Expressions
- 37:31Arithmetic Operators
- 38:44Multiplication
- 39:31Binary nodes
- 42:29Assignment Note
- 44:24Lookup
- 46:28Functions
- 48:32Implementation Time
- 50:13Function Declaration
- 53:27Syntax Tree
- 54:51Return
- 56:35Function Calls
related talks
52mBuilding a parser in C#, from first principles
58mParsing in C# from first principles
01h 08mAnalyzing source code using Roslyn
51mThe Future of C#
34mLanguage Design Where Paradigms Meet
50mThe Future of C#
01h 01mBuilding Code Analyzers with the new C# compiler platform (Roslyn)
37mThe Elixir parser under the microscope
