首页> 中文期刊> 《计算机应用与软件》 >基于 ANTLR的 SQL 语法分析策略与实现

基于 ANTLR的 SQL 语法分析策略与实现

         

摘要

以SQL预编译的构建为目的,提出一种基于ANTLR( Another Tool for Language Recognition )的SQL预编译设计模型。模型从编译原理的角度出发,采用扩展的巴科斯范式EBNF ( Extended Backus-Naur Form )定义SQL文法规则。在定义文法规则时,兼顾了SQL语言的特点和ANTLR识别器的工作原理,提出两层分析、嵌入Java语言的设计策略;在语法解析时,通过借鉴树编辑距离的相关研究成果,将目标代码和用户代码进行映射,实现了语法树异同点的检测。%We put forward an ANTLR-based SQL pre-compilation design model for the purpose of SQL pre-compilation construction .From the pointview of compilation principle , the model uses the extended Backus-Naur form ( EBNF) to defined SQL grammar rules .When doing this, it takes into consideration both the characteristics of SQL language and the operational principle of ANTLR recognition unit , presents the design strategy of two layer analysis and embedded Java language .In grammar analysis , it maps the object code and user code by learning from the research outcome of related tree edit distance , and achieves the detection of the similarities and differences of syntactic tree .

著录项

相似文献

  • 中文文献
  • 外文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号