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
94
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
380
Making GitLab Faster
yorickpeterse
2
460
Rubinius & The Eternal Yak
yorickpeterse
1
260
Oga
yorickpeterse
3
200
Other Decks in Programming
See All in Programming
インターフェース設計のコツとツボ
togishima
2
690
Using AI Tools Around Software Development
inouehi
0
1.2k
SODA - FACT BOOK
sodainc
1
830
F#で自在につくる静的ブログサイト - 関数型まつり2025
pizzacat83
0
290
FastMCPでMCPサーバー/クライアントを構築してみる
ttnyt8701
2
130
「兵法」から見る質とスピード
ickx
0
260
UPDATEがシステムを複雑にする? イミュータブルデータモデルのすすめ
shimomura
1
530
Julia という言語について (FP in Julia « SIDE: F ») for 関数型まつり2025
antimon2
3
910
Prism.parseで 300本以上あるエンドポイントに 接続できる権限の一覧表を作ってみた
hatsu38
1
110
JSAI2025 RecSysChallenge2024 優勝報告
unonao
1
450
eBPFを用いたAIネットワーク監視システム論文の実装 / eBPF Japan Meetup #4
yuukit
3
750
ワンバイナリWebサービスのススメ
mackee
10
7.7k
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Six Lessons from altMBA
skipperchong
28
3.8k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
2.8k
Code Review Best Practice
trishagee
68
18k
Designing Experiences People Love
moore
142
24k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Product Roadmaps are Hard
iamctodd
PRO
53
11k
What's in a price? How to price your products and services
michaelherold
245
12k
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Why You Should Never Use an ORM
jnunemaker
PRO
56
9.4k
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?