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

使用LR分析表的词法分析器与分析表最小化
引用本文:温敬和,庞艳霞,王娜. 使用LR分析表的词法分析器与分析表最小化[J]. 上海第二工业大学学报, 2007, 24(3): 201-209
作者姓名:温敬和  庞艳霞  王娜
作者单位:上海第二工业大学计算机与信息学院,上海,201209;上海第二工业大学计算机与信息学院,上海,201209;上海第二工业大学计算机与信息学院,上海,201209
摘    要:以一个模型语言为例,系统地介绍了使用LR分析表的词法分析器工作原理,以及词法分析器所使用的LR分析表最小化方法。使用LR分析表的词法分析器,统一了词法分析器和语法分析器的构造方法,简化了编译程序的设计和构造。分析表的最小化是通过编码压缩来实现的,分析表的最小化减少了编译程序运行所需的内存空间。

关 键 词:编译程序  词法分析  上下文无关文法  LR分析法  LR分析表最小化
文章编号:1001-4543(2007)03-0201-09
收稿时间:2007-03-22
修稿时间:2007-07-02

Lexical Analyzer Using LR Parsing Table and Minimizing LR Parsing Table
WEN Jing-he,PANG Yan-xi,WANG Na. Lexical Analyzer Using LR Parsing Table and Minimizing LR Parsing Table[J]. Journal of Shanghai Second Polytechnic University, 2007, 24(3): 201-209
Authors:WEN Jing-he  PANG Yan-xi  WANG Na
Affiliation:School of Computer and Information, Shanghai Second Polytechnic University, Shanghai 201209, ER.China
Abstract:Take the model language as an example of the principle of lexical analyzer generator is introduced in detail.The generated lexical analyzer uses the LR parsing table.The method to minimize the LR parsing table is also introduced.As long as the original algorithm of syntax analysis is slightly modified,it can be used for lexical analysis.The lexical analyzer using the LR parsing table unifies the construction method of lexical analyzer and syntax analyzer,simplifies the design and construction of compiler.The LR parsing table is minimized by code compressing.Using the minimized table,the storage space needed to carry out the compiler is reduced.
Keywords:compiler  lexical analysis  context-free grammar  LR parse  minimizing LR parsing table
本文献已被 CNKI 维普 万方数据 等数据库收录!
点击此处可从《上海第二工业大学学报》浏览原始摘要信息
点击此处可从《上海第二工业大学学报》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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