摘要
编译器是高级语言的工作基础,它本身是一种复杂的程序。文中研究并实现了编译器前端的自动构造技术,能大大提高编译类软件的开发效率。重点讨论了如何合理设置接口,以便综合运用词法、语法分析器的自动构造工具LEX和YACC。提出了预置三级错误陷阱来分别俘获源程序词法、语法、语义错误的思想,能减少错误级联,并能更准确地报告错误的性质。作者已应用该技术编写出一个面向C语言的并行语言编译器前端,验证了该技术是可行的和高效的。
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.
出处
《微机发展》
2004年第4期82-83,88,共3页
Microcomputer Development
基金
西安理工大学在职研究生科研基金资助项目(105-210288)