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
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
480
Rubinius & The Eternal Yak
yorickpeterse
1
270
Oga
yorickpeterse
3
210
Other Decks in Programming
See All in Programming
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
200
クラウドに依存しないS3を使った開発術
simesaba80
0
230
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
120
ゆくKotlin くるRust
exoego
1
210
CSC307 Lecture 04
javiergs
PRO
0
650
Deno Tunnel を使ってみた話
kamekyame
0
340
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
1
780
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
680
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
220
Basic Architectures
denyspoltorak
0
480
DevFest Android in Korea 2025 - 개발자 커뮤니티를 통해 얻는 가치
wisemuji
0
190
Vibe codingでおすすめの言語と開発手法
uyuki234
0
190
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
9.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
Believing is Seeing
oripsolob
1
33
Leo the Paperboy
mayatellez
4
1.3k
How to Talk to Developers About Accessibility
jct
1
100
Designing Powerful Visuals for Engaging Learning
tmiket
0
200
Optimising Largest Contentful Paint
csswizardry
37
3.6k
How to make the Groovebox
asonas
2
1.9k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
HDC tutorial
michielstock
1
330
Everyday Curiosity
cassininazir
0
120
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.9k
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?