计算机与现代化 ›› 2010, Vol. 1 ›› Issue (10): 63-67,7.doi: 10.3969/j.issn.1006-2475.2010.10.016

• 软件工程 • 上一篇    下一篇

可视编译器的设计与实现

蒋秀锋,任志雄   

  1. 华东师范大学,上海 200062
  • 收稿日期:2010-05-04 修回日期:1900-01-01 出版日期:2010-10-21 发布日期:2010-10-21

Design and Implementation of Visual Compiler

JIANG Xiu-feng, REN Zhi-xiong   

  1. East China Normal University, Shanghai 200062, China
  • Received:2010-05-04 Revised:1900-01-01 Online:2010-10-21 Published:2010-10-21

摘要: 通过一个实际的可视编译器开发实例,描述编译器前端的实现方法。这个编译程序除了易于操作的窗口程序外,还包含了标准C语言子集的编译器。这套编译器涵盖了词法分析器、语法分析器、语义分析器、中间代码生成器和简单错误处理器等一整套程序。通过这个实例可以直观地表现词法和语法的构造过程,图文并茂,生动说明编译器中词法器、语法器的功能及其构造过程。

关键词: 自上而下, 自下而上, C-minus, 词法, 语法, 编译

Abstract: This paper shows how to implement a compiler’s front end through an actual visual compiler. It’s a visual program contenting C subset and easy to operate. This compiler contents lexical analyzer, syntax analyzer, semantic analyzer, intermediate code generator, and a simple error recovery. Through this project, this paper intuitively shows lexical and syntax's construct processing, and describes lexical and syntax’s function and construct processing.

Key words: top-down, bottom-up, c-minus, lexical, syntax, compiler

中图分类号: