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
92
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
370
Making GitLab Faster
yorickpeterse
2
450
Rubinius & The Eternal Yak
yorickpeterse
1
250
Oga
yorickpeterse
3
200
Other Decks in Programming
See All in Programming
未経験でSRE、はじめました! 組織を支える役割と軌跡
curekoshimizu
1
210
オレを救った Cline を紹介する
codehex
15
14k
JAWS Days 2025のインフラ
komakichi
1
350
Swift Testingのモチベを上げたい
stoticdev
2
210
Go 1.24でジェネリックになった型エイリアスの紹介
syumai
2
310
Webフレームワークとともに利用するWeb components / JSConf.jp おかわり
spring_raining
1
140
⚪⚪の⚪⚪をSwiftUIで再現す る
u503
0
130
The Clean ArchitectureがWebフロントエンドでしっくりこないのは何故か / Why The Clean Architecture does not fit with Web Frontend
twada
PRO
56
18k
コードを読んで理解するko build
bells17
1
120
データベースのオペレーターであるCloudNativePGがStatefulSetを使わない理由に迫る
nnaka2992
0
250
Better Code Design in PHP
afilina
0
180
Expoによるアプリ開発の現在地とReact Server Componentsが切り開く未来
yukukotani
2
240
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Building an army of robots
kneath
303
45k
Building a Scalable Design System with Sketch
lauravandoore
461
33k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
GraphQLの誤解/rethinking-graphql
sonatard
69
10k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
390
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
100
18k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
RailsConf 2023
tenderlove
29
1k
How to train your dragon (web standard)
notwaldorf
91
5.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?