Computer Engineering and Applications ›› 2010, Vol. 46 ›› Issue (21): 66-68.DOI: 10.3778/j.issn.1002-8331.2010.21.018

• 研发、设计、测试 • Previous Articles     Next Articles

Grammar and semantic extensions of Front compiler front-end generator for Elegant

ZHU Heng-wei,ZHANG Ming-guo,QIAO Hai-quan   

  1. Beijing Qinghe Building Zi 6,Beijing 100085,China
  • Received:2009-06-02 Revised:2009-07-30 Online:2010-07-21 Published:2010-07-21
  • Contact: ZHU Heng-wei

对编译器前端生成器Front的语法和语义扩展

朱恒伟,张明国,乔海泉   

  1. 北京清河大楼子6,北京 100085

  • 通讯作者: 朱恒伟

Abstract: The expressivity in semantic domain of a compiler front-end generator for Elegant—Front is enhanced to access the expressive level of attribute grammar rules in Elegant through extending the grammar and semantics of Front using embedding text and optional grammar structures.A compiler front-end of Modelica modeling language is developed and the front-ends of Front itself,ScanGen,Diagrams are compiled using the extended Front,rusulting in that the extended Front runs well with backward compatibility,and can meet the needs of developing complex program language’s compiler front-end.

Key words: compiler generator, compiler front-end generator, Front, Elegant, grammar, semantics

摘要: 针对Front相对Elegant属性语法规则在语义表达方面的不足,采用嵌入文本、增加可选结构等方式,对Front的语法和语义进行了有效扩展。用其开发了Modelica仿真建模语言编译器前端、编译了ScanGen、Diagrams及Front自身的编译前端,结果表明,所采用的扩展思路简便易行,扩展后的Front基本具备与Elegant属性语法相当的语义表达能力,能够满足复杂语言编译器前端的需要,且保持与扩展前版本的后向兼容性。

关键词: 编译器生成器, 编译器前端生成器, Front, Elegant, 语法, 语义

CLC Number: