Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Parsing for Humans
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Yorick Peterse
May 20, 2014
Programming
110
2
Share
Parsing for Humans
Presentation for the Amsterdam Ruby user group.
Yorick Peterse
May 20, 2014
More Decks by Yorick Peterse
See All by Yorick Peterse
Garbage Collection Crash Course
yorickpeterse
1
390
Making GitLab Faster
yorickpeterse
2
480
Rubinius & The Eternal Yak
yorickpeterse
1
280
Oga
yorickpeterse
3
210
Other Decks in Programming
See All in Programming
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
240
AIエージェントと協働するCLI開発 — BunとOpenClawで学んだこと
yoshikouki
1
230
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
450
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
0
110
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
17
5.9k
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
12k
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
2.7k
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
190
関係性から理解する"同一性"の型用語たち
pvcresin
2
640
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
170
ふつうのFeature Flag実践入門
irof
7
3.5k
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
820
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
6.9k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
160
How to Talk to Developers About Accessibility
jct
2
220
A Modern Web Designer's Workflow
chriscoyier
698
190k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Why Our Code Smells
bkeepers
PRO
340
58k
[SF Ruby Conf 2025] Rails X
palkan
2
1.1k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
Git: the NoSQL Database
bkeepers
PRO
432
67k
GraphQLとの向き合い方2022年版
quramy
50
15k
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?