首页 | 本学科首页   官方微博 | 高级检索  
     

编译器前端自动构造的研究与实现
引用本文:王馨梅,王冬芳.编译器前端自动构造的研究与实现[J].微机发展,2004,14(4):82-83,88.
作者姓名:王馨梅  王冬芳
作者单位:西安理工大学,西安理工大学 陕西西安710048,陕西西安710048
基金项目:西安理工大学在职研究生科研基金资助项目(105-210288)
摘    要:编译器是高级语言的工作基础,它本身是一种复杂的程序。文中研究并实现了编译器前端的自动构造技术,能大大提高编译类软件的开发效率。重点讨论了如何合理设置接口,以便综合运用词法、语法分析器的自动构造工具LEX和YACC。提出了预置三级错误陷阱来分别俘获源程序词法、语法、语义错误的思想,能减少错误级联,并能更准确地报告错误的性质。作者已应用该技术编写出一个面向C语言的并行语言编译器前端,验证了该技术是可行的和高效的。

关 键 词:编译器前端  自动构造  编译程序  高级语言  中间代码  目标代码
文章编号:1005-3751(2004)04-0082-02

Research and Implementation of Auto-Constructed Front-End Compiler
WANG Xin-mei,WANG Dong-fang.Research and Implementation of Auto-Constructed Front-End Compiler[J].Microcomputer Development,2004,14(4):82-83,88.
Authors:WANG Xin-mei  WANG Dong-fang
Abstract:A complier is the basis of an advanced language and a complicated program. This paper mainly discusses the technology on auto-construction of a front-end complier,which can greatly improve the developing efficiency of compiler software.How to set up the interface appropriately for using LEX and YACC is discussed as an emphasis. The idea is brought forward that the complier can capture the lexical, syntax and semantic errors from source codes by seting up three classes of error traps in advance.So it can reduce the ascending series errors,and more exactly report the sort of the errors. With this technology,have finished a front-end compiler of C -oriented parallel language, and this practice have proved the technology feasible and highly effective.
Keywords:compiler  auto-construct  LEX  YACC  error trap
本文献已被 CNKI 维普 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号