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
Goのパーサ作ってvscode拡張作ってみた!
Search
ほりしょー
July 31, 2023
Technology
0
170
Goのパーサ作ってvscode拡張作ってみた!
「めぐろLT#5」にて発表
https://meguro-lt.connpass.com/event/288483/
ほりしょー
July 31, 2023
Tweet
Share
More Decks by ほりしょー
See All by ほりしょー
開発プロセスを継続的に改善する仕組み作り ~ 強いスクラムをいかに維持するか ~
h0r15h0
0
100
ドメインイベント増えすぎ問題
h0r15h0
2
770
LLM(Copilot)を最大限活用するための取り組みとその副産物
h0r15h0
1
180
現実世界の事象から学ぶSOLID原則
h0r15h0
29
20k
集団意思決定の落とし穴と誰も望まない技術的負債
h0r15h0
1
5k
デザインパターンを学んだら世界が広がった話
h0r15h0
2
360
Other Decks in Technology
See All in Technology
"プロポーザルってなんか怖そう"という境界を超えてみた@TSUDOI by giftee Tech #1
shilo113
0
190
Simplifying Cloud Native app testing across environments with Dapr and Microcks
salaboy
0
160
ビズリーチ求職者検索におけるPLMとLLMの活用 / Search Engineering MEET UP_2-1
visional_engineering_and_design
1
130
PHPからはじめるコンピュータアーキテクチャ / From Scripts to Silicon: A Journey Through the Layers of Computing Hiroshima 2025 Edition
tomzoh
0
140
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.2k
AWS IoT 超入門 2025
hattori
0
340
20251007: What happens when multi-agent systems become larger? (CyberAgent, Inc)
ornew
1
280
[Keynote] What do you need to know about DevEx in 2025
salaboy
0
170
カンファレンスに託児サポートがあるということ / Having Childcare Support at Conferences
nobu09
1
570
やる気のない自分との向き合い方/How to Deal with Your Unmotivated Self
sanogemaru
0
500
AWS Control Tower に学ぶ! IAM Identity Center 権限設計の第一歩 / IAM Identity Center with Control Tower
y___u
0
170
[Codex Meetup Japan #1] Codex-Powered Mobile Apps Development
korodroid
2
790
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
35
6.1k
A Tale of Four Properties
chriscoyier
161
23k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
Facilitating Awesome Meetings
lara
56
6.6k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
4 Signs Your Business is Dying
shpigford
185
22k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.5k
Optimizing for Happiness
mojombo
379
70k
Transcript
ほりしょー Go のパーサを作って VSCode 拡張作ってみた!
ほりしょー(堀崎祥) ラクスル23 新卒入社 ハコベル所属 サーバーサイドエンジニア Go / Ruby / DDD
自己紹介
なに作ったの?
Go Getter Setter Go のstruct からGetter, Setter を自動生成 してくれるVSCode 拡張
VSCode Marketplace GitHub
なぜ作ったのか? 既存拡張では 自動入力できない 構文が存在 生成コードの テンプレートを 用意したい Go の言語仕様を おさらいしたい
1 2 3
なぜ作ったのか? 入力フォーマット を自由に設定 したい 既存拡張では 自動入力できない 構文が存在 Go の言語仕様を おさらいしたい
1 2 今日は ← → の話 3 独自パーサ 言語仕様
パーサ VSCode 拡張 独自パーサの話 既存拡張は正規表現ベース → 複雑な型(複数行に及ぶ型, struct とか) が存在すると解析できない。
ならば、言語仕様に則った パーサを作ってしまおう パーサジェネレータの Flex, Bison(ts-jison) を使用して パーサを作成 (ts-jison) Flex, Bison パーサ生成
パーサジェネレータ 元はGCC に使用 Ruby, Go などにも使用されていた パーサを作成するためのプログラム 細かい処理を気にせず 構文規則を記述しパーサを作成可能 Flex(
字句解析), Bison( 構文解析) 頑張って構文規則を書いてくのみ! BNF 記法
言語仕様は? Go では言語仕様が公開されている The Go Programming Language Specification EBNF 記法で記述されているため
Bison に移行しやすい。 言語仕様は薄いので頑張って読む!
なぜ作ったのか? 入力フォーマット を自由に設定 したい 既存拡張では 自動入力できない 構文が存在 Go の言語仕様を おさらいしたい
1 2 3 独自パーサ 言語仕様 今日は ← → の話 (VSCode 拡張の話はしません🙇) 構文規則を頑張って書く Go のSpec を漁る
ぜひ使ってみ てください〜 Go Getter Setter VSCode Marketplace GitHub