J4

• • 上一篇    下一篇

面向扩展文法语义分析器的自动生成

王胜军, 郭德贵, 金成植   

  1. (吉林大学 计算机科学与技术学院, 长春 130012)
  • 收稿日期:2005-01-10 修回日期:1900-01-01 出版日期:2005-11-26 发布日期:2005-11-26
  • 通讯作者: 王胜军

Automatic Generation of Semantic Parser for Extended Grammar

WANG Sheng-jun, GUO De-gui, JIN Cheng-zhi   

  1. (College of Computer Science and Technology, Jilin University, Changchun 130012, China)
  • Received:2005-01-10 Revised:1900-01-01 Online:2005-11-26 Published:2005-11-26
  • Contact: WANG Sheng-jun

摘要: 在扩展巴克斯范式(EBNF)Earley分析的基础上, 提出一个语义分析器的自动生成算法, 给出了一个带有语义动作的扩展文法和一个输入, 即可生成其语义分析器. 通过执行语义动作, 就可以进行类型检查、 中间代码生成及优化等相关工作, 使得该算法成为完整的扩展文法分析技术, 并在实际运用中成为可能.

关键词: Earley分析, 扩展文法, 操作符状态机, 语义动作, 分析器

Abstract: On the basis of Earley parsing extended grammars, this paper gives an automatic generation algorithm of a semantic parser for EBNF. Given an extended grammar with embedded semantic routines and an input string, the algorithm outputs the corresponding semantic parser. With the execution of these semantic routines, some work such as type checking, intermediate code generation and optimization can be done, which makes the parsing algorithm

Key words: Earley parsing, extended grammar, operator state machine, semantic routine, parser

中图分类号: 

  • TP301