Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ESM Super LT/Comparing LL and LR parse algorithm
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Junichi Kobayashi
November 08, 2023
Programming
250
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ESM Super LT/Comparing LL and LR parse algorithm
Junichi Kobayashi
November 08, 2023
More Decks by Junichi Kobayashi
See All by Junichi Kobayashi
XP をバイブルにする事業部で10年働いた新卒が語りたい『Tidy First?』/ Put your understanding into the code
junk0612
0
110
rage against annotate_predecessor
junk0612
0
280
The Implementations of Advanced LR Parser Algorithm
junk0612
3
2.8k
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
6
2.9k
LR で JSON パーサーを作る / Coding LR JSON Parser
junk0612
2
2k
「ナントカLR」を整理する / Clarifying LR Algorithms
junk0612
1
740
From LALR to IELR: A Lrama's Next Step
junk0612
2
5.3k
RubyConf Taiwan / Understanding Parser Generators surrounding Ruby with Contributing Lrama
junk0612
2
7.2k
LL法とLR法の違いは?調べてみた!-完全版-/Comparing LL and LR parse algorithm -EX Edition-
junk0612
0
2.7k
Other Decks in Programming
See All in Programming
カツオ、ご期待ください
suneo3476
0
170
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
390
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
34
16k
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
6.4k
気持ちぃ〜角丸 Squircle
ryu1013
0
290
golang-bob.pdf
iwatsukayura
0
130
wkhtmltopdfの次どうするか問題2026
willnet
2
1.9k
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
速習iPhone Duo対応
yuukiw00w
2
980
R8 の設定見直しでアプリサイズ削減
andpad
0
210
Simple Storage Service(S3) is not simple
iwatsukayura
0
270
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
130
Featured
See All Featured
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
580
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
530
Accessibility Awareness
sabderemane
1
250
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
520
The browser strikes back
jonoalderson
0
1.8k
4 Signs Your Business is Dying
shpigford
187
23k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
My Coaching Mixtape
mlcsv
0
350
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
710
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
810
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Transcript
LL 法と LR 法の違いは? 調べてみた! ESM アジャイル事業部 構文解析器研究部員 小林純一 (@junk0612)
RubyWorld Conference 2023 島根県立産業交流会館「くにびきメッセ」 2023/11/09(Thu.)
• 小林純一 • X / GitHub: @junk0612 • 株式会社永和システムマネジメント アジャイル事業部
◦ RubyxAgile グループ ◦ 構文解析器研究部員 • Lrama コントリビューター ◦ Named References の実装 ◦ 内部パーサーの Racc 化 など 自己紹介
世はまさに 大パーサー時代
LL 法 と LR 法
LL法とLR法 LL法 • トップダウン方式 • 左端導出 • 手書きに適している • 先読みによって構文を推測する
• Prism が採用している LR法 • ボトムアップ方式 • 右端導出 • 手書きには適さない • 決定論的に構文木を構築する • Lrama が生成するパーサーが 採用している
LL法とLR法 LL法 • トップダウン方式 • 左端導出 • 手書きに適している • 先読みによって構文を推測する
• Prism が採用している LR法 • ボトムアップ方式 • 右端導出 • 手書きには適さない • 決定論的に構文木を構築する • Lrama が生成するパーサーが 採用している
例: メソッド定義 method_definition def method_name ( args ) method_body end
method_definition def method_name ( args ) = method_body
method_definition LL法の場合
method_definition def method_name LL法の場合
method_definition def method_name 分岐 • → 引数 • → end-less
メソッド • → メソッド本体 ( = method_body LL法の場合
method_definition def method_name 分岐 • → 引数 • → end-less
メソッド • → メソッド本体 ( = method_body ( LL法の場合
method_definition def method_name ( args ) LL法の場合
method_definition def method_name ( args ) 分岐 • → end-less
メソッド • → メソッド本体 = method_body LL法の場合
method_definition def method_name ( args ) 分岐 • → end-less
メソッド • → メソッド本体 = method_body = LL法の場合
LL法の場合 method_definition def method_name ( args ) = method_body
LR法の場合 def
LR法の場合 def method_name
LR法の場合 def method_name ( args )
LR法の場合 def method_name ( args ) = method_body
LR法の場合 method_definition def method_name ( args ) = method_body
LL法とLR法 LL法 • トップダウン方式 • 左端導出 • 手書きに適している • 先読みによって構文を推測する
• Prism が採用している LR法 • ボトムアップ方式 • 右端導出 • 手書きには適さない • 決定論的に構文木を構築する • Lrama が生成するパーサーが 採用している
Let's parse everything your favorite algorithm.