Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

How to Write a Parser in Go

Gopher Academy via YouTube

Overview

Explore the process of building a parser from scratch using goyacc in this GopherCon 2018 talk by Sugu Sougoumarane. Learn how parsers can be applied to real-life applications beyond language construction. Follow along as Sugu demonstrates leveraging Go's features to create elegant constructs and implement them in a toy application. Discover use cases, understand when to use Go Yak, and gain insights into parser functionality. Examine barebones grammar, error handling, and code generation. Dive into lexical analysis, final implementation, and testing strategies. Conclude with a review of patterns used in the sqlparser module of Vitess, and gain practical knowledge on parser development in Go.

Syllabus

Intro
About me
Use cases
Two easy steps
What is Go Yak
Why use Go Yak
When not to use Go Yak
How a parser works
Barebones grammar
Go Yak
Lex
Error
Generate Go File
Quick Example
Parser
Area
Return Values
Result
Go Code
Lex Analyzer
Final Implementation
Test Function
Test Case
Test Case 2
JSON1 Parser
Back to the slides
Parser Code
Parse Function
Interfaces
Lexical Analyzers
Vitesse Parser

Taught by

Gopher Academy

Reviews

Start your review of How to Write a Parser in Go

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.