C语言词法语法分析工具CParser的设计与实现  被引量:4

Design and Implementation of Lexical and Syntax Analysis Tool CParser for C Language

在线阅读下载全文

作  者:杨劭君 苏小红[1] 王甜甜[1] 马培军[1] 

机构地区:[1]哈尔滨工业大学计算机科学与技术学院,哈尔滨150001

出  处:《智能计算机与应用》2014年第5期69-71,75,共4页Intelligent Computer and Applications

基  金:国家自然科学基金项目(61173021)

摘  要:程序分析技术包括控制流分析、数据流分析、别名分析、程序切片和程序插桩等技术,在程序理解,代码重构、代码优化和软件自动化调试等方面有着重要的应用,而词法分析和语法分析技术是程序分析技术的基础。本文设计与实现了一个轻量级的C语言词法语法分析工具CParser,通过词法分析、预处理和语法分析三个步骤,实现了根据源代码建立相应的抽象语法树的功能。工具使用简单方便,而且能够完整支持C99标准,可用于克隆代码检测、软件错误定位等后续研究工作。Program analysis techniques contains control flow analysis, data flow analysis, alias analysis, program slicing techniques and program instrumentation, and has important applications in program comprehension, code refactoring, code optimization, automated software debugging and other aspects. Especially, the lexieal analysis and syntax analysis technolo- gy is the basis for program analysis techniques. This paper designs and implements a new C language syntax analysis tool named CParser, through three steps which are lexical analysis, preprocessing and syntax analysis to achieve the establish- ment of the abstract syntax tree based on the source code. This tool is easy to use, and can fully support the C99 standard, furtherly can he used to code clone detection and fault localization.

关 键 词:词法分析 语法分析 抽象语法树 编译原理 

分 类 号:TP311[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象