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
120
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
400
Making GitLab Faster
yorickpeterse
2
490
Rubinius & The Eternal Yak
yorickpeterse
1
290
Oga
yorickpeterse
3
210
Other Decks in Programming
See All in Programming
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
170
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
1
680
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
3
770
今さら聞けない .NET CLI
htkym
0
190
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.9k
AI Nativeにデータを扱うための組織・基盤のこれまでとこれから
kirimaru
0
110
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
1.5k
5分で問診!Composer セキュリティ健康診断
codmoninc
0
950
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
220
Apache Hive: Toward a Cloud Native Lakehouse
okumin
0
180
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
150
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
490
Featured
See All Featured
Visualization
eitanlees
152
17k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
570
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
460
Discover your Explorer Soul
emna__ayadi
2
1.3k
Tell your own story through comics
letsgokoyo
1
1k
Fireside Chat
paigeccino
42
4k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
370
From π to Pie charts
rasagy
0
270
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
490
Context Engineering - Making Every Token Count
addyosmani
9
1k
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?