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
99
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
Rails Frontend Evolution: It Was a Setup All Along
skryukov
0
240
Quand Symfony, ApiPlatform, OpenAI et LangChain s'allient pour exploiter vos PDF : de la théorie à la production…
ahmedbhs123
0
210
ペアプロ × 生成AI 現場での実践と課題について / generative-ai-in-pair-programming
codmoninc
2
20k
初学者でも今すぐできる、Claude Codeの生産性を10倍上げるTips
s4yuba
16
12k
PHP 8.4の新機能「プロパティフック」から学ぶオブジェクト指向設計とリスコフの置換原則
kentaroutakeda
2
1k
Railsアプリケーションと パフォーマンスチューニング ー 秒間5万リクエストの モバイルオーダーシステムを支える事例 ー Rubyセミナー 大阪
falcon8823
5
1.4k
脱Riverpod?fqueryで考える、TanStack Queryライクなアーキテクチャの可能性
ostk0069
0
340
なぜ適用するか、移行して理解するClean Architecture 〜構造を超えて設計を継承する〜 / Why Apply, Migrate and Understand Clean Architecture - Inherit Design Beyond Structure
seike460
PRO
3
790
RailsGirls IZUMO スポンサーLT
16bitidol
0
190
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
280
VS Code Update for GitHub Copilot
74th
2
670
PHPで始める振る舞い駆動開発(Behaviour-Driven Development)
ohmori_yusuke
2
420
Featured
See All Featured
Designing for humans not robots
tammielis
253
25k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.4k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
740
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
Optimizing for Happiness
mojombo
379
70k
Visualization
eitanlees
146
16k
Embracing the Ebb and Flow
colly
86
4.7k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
510
Into the Great Unknown - MozCon
thekraken
40
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?