orbit-lang/Bootstrap

Frontend - Parse Rule Utility

開放

#2 建立於 2021年5月16日

 (0 則留言) (0 個反應) (0 位負責人)Kotlin (0 個分叉)auto 404
Frontendgood first issue

倉庫指標

星標
 (0 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Some parse rules depend on other parse rules to parse sub-expressions (non-terminals). This is fine, but we should avoid manually constructing these rules and hide them behind a ParseRuleUtil interface, as we do in the TypeChecker.

I wouldn't mind even making ParseRules themselves private, and only exposing them via ParseRuleUtil singleton, which is itself injected via Koin. We do this already with TypeInferenceUtil and the path resolvers in the Graph package.

Ultimately, the goal is to have simple, clean interfaces that tightly control how the compiler (and more importantly library code) interacts with itself. Essentially, I'm talking about something akin to a "plugin" system that makes it trivially easy to write new phases in Orbit and allow them to communicate with & interogate the compiler at abritrary Phase-time.

貢獻者指南