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
280
Oga
yorickpeterse
3
210
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
310
Claude Codeログ基盤の構築
giginet
PRO
7
3.1k
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.8k
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
830
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
180
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
450
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
140
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
260
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
210
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
510
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
2
570
ふつうのRubyist、ちいさなデバイス、大きな一年 / Ordinary Rubyists, Tiny Devices, Big Year
chobishiba
1
440
Featured
See All Featured
Become a Pro
speakerdeck
PRO
31
5.8k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
130
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
150
Designing for Performance
lara
611
70k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
140
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
390
YesSQL, Process and Tooling at Scale
rocio
174
15k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
210
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
61
52k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
210
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?