The Design and Implementation of an Arithmetic Expression Parsing Engine

Author
ZhengZhiLi
Advisor
YuanYuYu , HanWanJiang
School
Beijing University of Posts and Telecommunications
Major
Software Engineering
Classification
TP391.1 Text Processing
Degree
Master's thesis
Year
2012
Downloads
24
Citations
0

Request the full text

Abstract

With the increasing developmeng of Internet and enterprise information construction, the requiredments of application system based on Web are more and more urgent. Based on the actual business, this text designed and implemented a simply and efficient expression parsing engine for exterpreises as the based component.The expression parsing engine support a variety of date types (including NULL, Integer, Real Number, Data, Boolean, String, Collections and Object Type); support arithmetic operators (addition, subtraction, multiplication, division, negation), logical operators (logical and, logincal or, logincal not), relational operators (negated, greater than, greater than or equal to, less than, leas than or equal to) and select operator (?:); support variable operating; support functions and customed expansion.Lexical analysis, syntax analysis and semantic analysis are introduced in detail how to step-by-step analysis from a string expression to get a result by expression parsing engine. Many basic concepts and algorithms, such as finite automata, regular expression, context-free grammar, operator precedence algorithm, Reverse Polish Expression, etc, are be introduced and given the appropriate instance to illustrate. Follow the text of the design ideas, you will understand the complexity of compiler design. If combined with the implement of the source code, you can futher compile system and parsing engine with a new understanding.Especially variables and fuction, the implementation in Reverse Polish Notation are rarely mentioned on many articles of the same type. For readers who have the same goals, there are some inspiration and reference.

Table of contents

Summary 4-5 ABSTRACT 5-9 Chapter 1 Introduction 9-11 1.1 subject background 9 <br / > 1.2 topics task 9-10 1.3 thesis structure basic introduction to the second chapter 10-11 parser 11-16 2.1 expression the main component of the formula basic process 11 2.2 parsing 11-12 2.3 resolve the various stages of work 12-13 2.4 parsing engine component structure few times 13-14 2.5 analysis of 14-16 Chapter lexical analysis 16-41 3.1 lexical analysis overview 16-19 3.1.1 morpheme , patterns and lexical unit 16-17 3.1.2 lexical analysis functions and ways of working 17-18 <br / > 3.1.3 input and pretreatment expression 18-19 3.2 lexical analysis of design formal description and identification nbsp 19-38 3.2.1 mode ; 19-21 3.2.2 lexical analyzer realization of ideas concrete realization 21-38 3.3 lexical analyzer 38-41 fourth Chapter parsing 41-51 4.1 grammar, syntax tree and sentence analysis 41-44 4.1.1 context-free grammars and related terms 41-42 4.1.2 syntax tree and ambiguity 42-43 4.1.3 sentence analysis 43-44 4.2 operator precedence analysis 44-50 4.2.1 operator grammar and grammar priority 44-46 realization of ideas 4.2.2 parsing 46-50 4.3 grammar and syntax analysis to achieve pre-scan 50-51 Chapter syntax translation 51-58 5.1 syntax definitions 51-53 <br / > 5.1.1 comprehensive property 51-52 5.1.2 on the parse tree node for SDD evaluated construction nbsp 52-53 5.2 syntax tree ; 53-56 5.2.1 syntax tree syntax tree 53-54 5.2.2 tectonic expression 54-55 5.2.3 tectonic syntax defines the syntax tree 55-56 5.3 S from the bottom-up calculation attribute defines 56-58 Chapter VI intermediate code generation 58-70 6.1 intermediate code 58-61 6.2 type checking 61-65 concrete realization of 6.3 intermediate code generated 65-70 Article achieve seven chapters variables and functions achieve 70-72 7.1 variable achieve 70 7.2 function 70-72 Chapter VIII Conclusion 72-73 8.1 summary of thesis work 72 8.2 problems and prospects 72-73 References 73-74 Thanks 74

Related dissertations

  1. Implementation and application of C++ general lexical, syntax analysis framework based on
  2. Statement Analysis of SQL Language and the Research of Database Security
    ZuoHongYan ·Guizhou University ·2006 ·Master's thesis
  3. The Research and Implementation of Embedded ECMA Interpreter
    ZhangJinBo ·Hohai University ·2006 ·Master's thesis
  4. Research on the Chinese Interface of Speech Based Book Query
  5. Study on Automated Testing Tool for GUI
    LiTao ·Sichuan University ·2005 ·Master's thesis
  6. Interprocedural data flow analysis technology research
    LiPingHua ·Southeast University ·2004 ·Master's thesis
  7. Design and Develop of Instrument Virtual Computer Assembly Language Based on DSP
    QuGuoDong ·Dalian Railway Institute ·2003 ·Master's thesis
  8. The Design and Implementation of source to source conversion of Fortran language
    LiXia ·PLA Information Engineering University ·2001 ·Master's thesis
  9. Research on Method for Mining Software Security Fault Feature Pattern
    YangFei ·Yanshan University ·2011 ·Master's thesis
  10. Research and Implementation of Filtration Systems Based on SQL Semamtics
  11. Keyword Extraction Based on Statistic and Syntactic Parsing
  12. The Automatic Marking Method of Script
    LiuXia ·Donghua University ·2014 ·Master's thesis
  13. The Name of Shanxi Wheaten Food and Cultural
  14. Recognition of Temporal Relation in Chinese Texts
    WangFengE ·Shanxi University ·2012 ·Master's thesis
  15. Using Lexical and Semantic Analysis for Ontology Integration
  16. Design and Implementation of Uyghur Words Automatic Proofreading System
  17. The Design and Implementation of Regular Expression Engines Based on Deterministic Finite Automata
  18. The Vocabulary Acquisition Learning Strategies in a Chinese Context
  19. A Corpus-based Study on the Vocabulary in China’s Contemporary College English Coursebooks
    ZhouZuo ·Shanghai Normal University ·2012 ·Doctoral dissertation
  20. Chinese Lexical with the Same Morpheme Teaching as a Second Language
    GouZuoXin ·Southwestern University ·2013 ·Master's thesis