英语论文翻译栏目提供最新英语论文翻译格式、英语论文翻译硕士论文范文。详情咨询QQ:1847080343(论文辅导)

词法语法分析器简介 文献翻译

日期:2018年01月15日 编辑: 作者:无忧论文网 点击次数:10637
论文价格:50元/篇 论文编号:lw200705231944405781 论文字数:8078 所属栏目:英语论文翻译
论文地区:中国 论文语种:中文 论文用途:文献翻译 Literature Translation
附件2:外文原文(复印件)

Lex Introduction Lex is a program generator designed for lexical processing of character input streams. It accepts a high-level, problem oriented specification for character string matching, and produces a program in a general purpose language which recognizes regular expressions. The regular expressions are specified by the user in the source specifications given to Lex. The Lex written code recognizes these expressions in an input stream and partitions the input stream into strings matching the expressions. At the boundaries between strings program sections provided by the user are executed. The Lex source file associates the regular expressions and the program fragments. As each expression appears in the input to the program written by Lex, the corresponding fragment is executed. The user supplies the additional code beyond expression matching needed to complete his tasks, possibly including code written by other generators. The program that recognizes the expressions is generated in the general purpose programming language employed for the user's program fragments. Thus, a high level expression language is provided to write the string expressions to be matched while the user's freedom to write actions is unimpaired. This avoids forcing the user who wishes to use a string manipulation language for input analysis to write processing programs in the same and often inappropriate string handling language.

词法语法分析器简介

Lex 简介 Lex 是被设计用来处理字符输入流的词法分析过程的程序产生器。它接受顶层的字符,由问题导向对特定字符串匹配, 而且生成一种用来识别一般表达式的普通的目标语言程序。 一般的表达被使用者按照字符资源规范传送给 Lex。 Lex写出代码识别输入流中的表达式并且转换成与表达式匹配的字符串。 这些字符串在用户提供的程序段的分阶线处被执行。 Lex源文件将一般表达式与程序段联系起来。当每个表达式出现由Lex写入程序中时,执行相应的程序片段。 使用者在表达式匹配的时候提供下一段代码来完成要执行的任务, 可能包括由其他的产生器写的代码。这个程序用来识别用户输入的程序段与用普通的目标语言产生的表达式。因此,当要写行动的使用者的自由被不损害的时候 , 一种高级的表达语言被提供要匹配的字符串表达式。 这避免强迫想使用操作语言作为输入分析写处理一样的目标语言使用者和时常不适当的操作语言。 Lex 不是一种完整的语言,它只是某种高级语言的扩充,因此Lex没有为描述动作设计新的语言,而是借助其宿主语言来描述致动作。我们只介绍C作为Lex的宿主语言时的使用方法,在UNIX系统中,FORTARAN语言的一种改进形式RATFOR也可以做Lex的宿主语言。但是宁可表现一种新的语言一个产生器扮演重要角色的可能被增加到不同的目标语言, 叫做“宿主语言.”,正如一般用途语言能生产代码涉及不同的计算机硬件,Lex 能写不同的主语言的代码。主语言被用为输出编码产生被 Lex 以及作为被使用者增加的目标片段。 可并行的外部程序库为不同的主语言提供。 这使 Lex 能适应对不同的环境和不同的使用者。 每个申请可能指向对工作,使用者的背景和地方性的落实计划是适当的硬件和主要的组合语言。目前,唯一的支持宿主语言是 C, 虽然Fortran ( 在 Ratfor 的形式 [2] 已经过去是可得的。 Lex 它本身在 UNIX , GCOS 和操作系统/370 上存在;但是被 Lex 产生的代码可能被无论何处适当的编辑器使用。