摘要: Polyglot是一种避免代码复制的、高度可扩展的编译器前端框架。用户只需扩展该框架,定义对抽象语法树、语义分析等的必要修改,即可实现Java语言扩展。为指导用户在Polyglot上快速开展工作,该文总结Polyglot的主要流程和类体系,剖析其利用委托、访问者、抽象工厂等实现可升级扩展的方法,简述了Polyglot的已有应用及应用步骤。
关键词:
可升级扩展,
遍,
访问者,
委托
Abstract: Polyglot is a highly extensible compiler frontend framework, while avoiding code duplication. Users may extend the framework to define any necessary changes on abstract syntax tree and semantic analysis for implementing language extensions. In order to direct users to work with Polyglot fleetly, the main flow and class hierarchy of Polyglot are summarized, and the methodologies of the scalable extensibility are anatomized, in which the delegation, visitors and abstract factories are employed. And the use steps of Polyglot and the related application are stated in a nut shell.
Key words:
scalable extensibility,
pass,
visitor,
delegation
中图分类号:
张 昱. 一种构建Java语言扩展的编译器框架[J]. 计算机工程, 2007, 33(19): 51-53.
ZHANG Yu. Compiler Framework for Building Java Language Extensions[J]. Computer Engineering, 2007, 33(19): 51-53.