Implementation and application of C++ general lexical, syntax analysis framework based on

Author
WangQianHong
Advisor
XuWenBo , LiuBaoQin
School
University of Electronic Science and Technology
Major
Software Engineering
Classification
TP311.11 Programming method
Degree
Master's thesis
Year
2012
Downloads
94
Citations
0

Request the full text

Abstract

Computer programming language has also been greatly developed, with the rapiddevelopment of computer technology, especially in the network and technology,emerging out of a lot of new practical and powerful scripting language. Thus, we takeinto account in the development of new programming languages, each newprogramming language must have with them corresponding to the compiler, fromanother aspect of overstating the threshold of a new programming language research.Many times we do not need to develop a function of how powerful and comprehensiveprogramming language, but a function of a particular area of expertise language. As aresult, we want to develop such a formation of a new language based on C++,general-purpose lexical, grammatical framework, developers can use this framework toadd your own definition of syntax and lexical rules, parser, this framework must beflexible and easy to use. This paper, such a framework, and write a JSON parser tointroduce its application.The thesis process is divided into three parts:The first part is a study of general-purpose lexical parsing framework to achievethe knowledge involved in the process, including the BNF paradigm, paradigm ofABNF ABNF paradigm, content and rules define the compilation process of lexicalanalysis and syntax analysis, analysis ofapproach.The second part is a general-purpose lexical, syntax analysis framework for thedesign and implementation. Including the implementation of the framework structure,as well as in the framework of elements and the operator of the design and realization ofthe basic module and basic module, the paper shows some of the key code.The third part is the application of universal lexical, grammatical framework. Paperby using the framework to prepare a JSON interpreter, describes how to use theframework, and implementation to verify the framework of the available line of JSONinterpreter, and then through and professional JSON interpreter performance comparedto test the operational efficiency of the framework. Good test of the frameworkestablished, and the ability to use the framework to a small amount of code, which requires a lot of workload.

Table of contents

Summary 4-5 ABSTRACT 5-9 first chapter 9-13 1.1 Background and Significance 9 - 10 1.2 Research Status 10-11 1.3 The main 11 1.4 thesis structure 11-13 The second chapter of knowledge introduction 13-29 2.1 BNF paradigm 13-14 2.1.1 BNF paradigm origin 13 2.1.2 BNF paradigm content 13-14 2.2 ABNF paradigm 14-20 2.2.1 ABNF paradigm introduced 14 2.2.2 rules define 14 - 16 2.2.3 operator 16-19 2.2.4 core rules 19-20 2.2.5 ABNF relationship with the BNF 's 20 2.3 lexical analysis 20-25 2.3.1 concept and role of lexical analysis exemplified 20-22 2.3.2 lexical error 22 -23 2.3.3 input Buffer 23 2.3.4 23-25 ?? 2.4 parsing 25-28 2.4. a context-free grammar 26-27 2.4.2 LL (1) grammar 27-28 2.5 of this chapter subsections 28-29 third design and implementation of a common framework of Chapter 29-69 3.1 framework of basic modules 29-40 3.1.1 matcher 30-32 3.1 .2 elements and composite 32-36 3.1.3 scanner 36-38 3.1.4 parser semantic actions and 38-40 <br / > organizational Structure 3.2 framework 40-42 3.3 elements 42-48 3.3.1 literally matcher 42-46 3.3 .2 value matcher 46-48 3.4 operator 48-68 3.4.1 set operator 48-50 3.4.2 sequence operator 50-51 3.4.3 optional and recycling operator 51-55 3.4.4 basic types of operators 55-56 <br / > 3.4.5 operator precedence and grouping 56 3.4.6 rules 56-61 3.4.7 action is 61-68 <br / > 3.5 Summary application and test 68-69 Chapter IV generic framework 69-85 4.1 JSON About 69-72 4.2 JSON structure in C data structures 72-75 4.3 JSON parser construction 75-79 4.4 test 79-84 4.5 of this chapter summary 84-85 Chapter summary and Outlook 85-86 Thanks 86-87 References 87-89

Related dissertations

  1. The Design and Implementation of an Arithmetic Expression Parsing Engine
  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