Files
quartz-research-note/content/Red Green Syntax Tree.md
Matsuura Tomoya(Windows) bb453aba6b
All checks were successful
Build / build (push) Successful in 6m45s
[obsidian] vault backup: 2025-07-31 14:24:30[
2025-07-31 14:24:30 +09:00

13 lines
889 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#compiler-design
[Red-Green Trees: an Overview. Six months ago I dug into Roslyns… | by Bayastan | Jun, 2025 | Medium](https://medium.com/@krendelia2021/red-green-trees-an-overview-17bae2d84e8c)
[[抽象構文木]]というか[[具象構文木]]の実装方法の一つ。
構文の途中で差し込まれたコメントなどのトリビアなどを保持して、完全なソースコードに戻せるけど実行効率などをよくしたままにできるやり方。
部分的に構文木を書き換えたりするとソースコードのロケーション情報がずれたりするので、文字幅とオフセットを別々に持たせるというやり方をしている
ながいけどこれがわかりやすい
[Ruby Parser開発日誌 (19) - 最高の構文木の設計 2024年版 - かねこにっき](https://yui-knk.hatenablog.com/entry/2024/08/23/113543)