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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
290
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
750
From LALR to IELR: A Lrama's Next Step
junk0612
2
5.4k
RubyConf Taiwan / Understanding Parser Generators surrounding Ruby with Contributing Lrama
junk0612
2
7.3k
LL法とLR法の違いは?調べてみた!-完全版-/Comparing LL and LR parse algorithm -EX Edition-
junk0612
0
2.8k
Other Decks in Programming
See All in Programming
複数ドメインを一つのアプリに統合するFlutterの設計と運用_FlutterKaigi2026登壇資料(須永高弘)
takahirosunaga
0
150
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
2k
LLM 101
dalinaum
0
470
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
360
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
330
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
14
11k
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
170
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
100
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
3
1.7k
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
130
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
520
Kotlinize Is Not Just Converting to Kotlin
chigichan24
1
220
Featured
See All Featured
30 Presentation Tips
portentint
PRO
1
460
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2.1k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
810
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Building Applications with DynamoDB
mza
96
7.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
970
How STYLIGHT went responsive
nonsquared
100
6.3k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
Ethics towards AI in product and experience design
skipperchong
2
460
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
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.