算术表达式的 LL(1)语法分析器
张会霞
(辽宁师范大学 计算机与信息技术学院,辽宁 大连 116000)
摘要:语法分析是编译程序的核心部分,对其进行研究有着重要意义。本文介绍了编译过程语法分析阶段使用的LL(1)预测分析法的相关概念,并以算术表达式为例,对LL(1)语法分析器的构成及具体实现进行了详细的阐述。
关键词:语法分析;算术表达式;LL(1)文法;LL(1)语法分析器;
ArithmeticExpressions of LL(1) Parser
Zhang Huixia
(College of Computer and Information Technology, Liaoning Normal University, Dalian Liaoning 116000, China)
Abstract:Syntax analysis is the core part of compiler.It is of great significance to study it .This paper introduces the relevant concepts of LL(1) predictive analysis method used in the parsing stage of compilation process,and takes arithmetic expressions for example to elaborate the structure and concrete implementation of LL(1) parser.
Key words:syntax analysis; arithmetic expressions; LL(1) grammar; LL(1) parser
前言
编译程序极大地推动了计算机