Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Parsing for Humans
Search
Yorick Peterse
May 20, 2014
Programming
2
110
Parsing for Humans
Presentation for the Amsterdam Ruby user group.
Yorick Peterse
May 20, 2014
Tweet
Share
More Decks by Yorick Peterse
See All by Yorick Peterse
Garbage Collection Crash Course
yorickpeterse
1
390
Making GitLab Faster
yorickpeterse
2
470
Rubinius & The Eternal Yak
yorickpeterse
1
270
Oga
yorickpeterse
3
210
Other Decks in Programming
See All in Programming
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
270
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
380
Go コードベースの構成と AI コンテキスト定義
andpad
0
130
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
140
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
10
1.3k
tparseでgo testの出力を見やすくする
utgwkk
2
260
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
780
Integrating WordPress and Symfony
alexandresalome
0
160
Socio-Technical Evolution: Growing an Architecture and Its Organization for Fast Flow
cer
PRO
0
380
UIデザインに役立つ 2025年の最新CSS / The Latest CSS for UI Design 2025
clockmaker
18
7.6k
【CA.ai #3】ワークフローから見直すAIエージェント — 必要な場面と“選ばない”判断
satoaoaka
0
270
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
7
2.3k
Featured
See All Featured
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandezseo
1
1.3k
Amusing Abliteration
ianozsvald
0
63
How GitHub (no longer) Works
holman
316
140k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
0
200
Designing for Performance
lara
610
69k
First, design no harm
axbom
PRO
1
1k
The Cult of Friendly URLs
andyhume
79
6.7k
A designer walks into a library…
pauljervisheath
210
24k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
34
Transcript
Parsing For Humans
@yorickpeterse (Github, Twitter, Gmail, etc)
Olery http://olery.com/
Parsing “Analysing a string of symbols according to the rules
of a grammar.”
10 + 10
number = [0-9]+ operator = “+”
Vocabulary Token, AST, Lexer & Parser
Token A label for a specific part of the input.
10 [:INTEGER, “10”]
Abstract Syntax Tree A tree structure representing the input.
Markdown Lists * Item * Nested item
(unordered-list (list “Item” (unordered-list (list “Nested item”))))
Lexer Takes raw input and returns a sequence of tokens.
Parser Takes tokens as input and returns an AST.
Available Tools
ANTLR, Bison, Coco/R, Flex, Happy, Lemon, jQuery, Parslet, Racc, Ragel,
Rexical, Treetop, Yacc
Ragel & Racc
Ragel “A finite state machine compiler.”
“<!--” any* “-->” => { … };
$ ragel -R lexer.rl -o lexer.rb
Racc “A LALR(1) parser generator.”
expression : NUMBER OPERATOR NUMBER { … } ;
$ racc -o parser.rb parser.y
Oga Parsing XML/HTML in Ruby https://github.com/yorickpeterse/oga
Questions?