Research and Design of TTCN-3/C Compiler
- Author
- WangWenJuan
- Advisor
- ZengHua
- School
- Southwest Jiaotong University
- Major
- Applied Computer Technology
- Classification
- TP393.02 Computer network architecture and design
- Degree
- Master's thesis
- Year
- 2004
- Downloads
- 223
- Citations
- 7
Abstract
With the advent of IPv6 protocol suite and related products, the routing protocol testing has become a hot spot. The traditional router test method tested only on a single port or a pair of ports of the router, not fully reflect the router functionality and performance indicators in real network environment. Key Laboratory of Sichuan Network Communication design multi-port router concurrent test system, the test system can simulate the router to work in a real network environment, which can make the test more accurate, more complete. This paper reflects the work is an important part of the test support tools for the study. The theme of this thesis is described how to use TTCN-3 test control data into the the executable test control data technology that can perform the test system. For a variety reasons, I did not use the more common explanation, while the use of compiled. In order to facilitate integration in other parts of the test system, the first TTCN-3 language into such a high-level language C related C code with other parts of the joint compilation, the resulting machine code. The author developed the compiler process is divided into four phases: lexical analysis, parsing, semantic analysis and code generation. Because they do not generate the final machine code, TTCN-3 / C compiler generated code can be regarded as intermediate code (such as many programming compiler generates assembly language code), and therefore does not need to consider the final code optimization problem. The compiler uses twice the scan. The first pass read into the TTCN-3 source, and its lexical analysis, syntax analysis and semantic analysis. The second pass through the to traverse first pass output syntax tree to complete the code generation. Because of the time, the work reflected in this paper covers only the lexical analysis, parsing, semantic analysis, the constructor syntax tree, the establishment of the symbol table and the associated error handling. Specific code generation part of the work completed by another student of the TTCN-3 compiler team. To reduce compiler development cycle, taking into account other factors, lexical analysis is generated automatically constructs lexical analysis tools LEX FLEX version parsing part is generated with the parser generator YACC BISION version 's. Semantic analysis as part of the parsing subroutine embedded the YACC grammar rules section. Among them, the syntax analysis is a core part of the author of the study. Parsing difficulty is how to resolve the conflict of the the YACC grammar rules section. To solve this problem, the author summarizes the three kinds of ways to reduce conflict by changing the format of TTCN-2 syntax rules part of the writing. Southwest Jiaotong University Graduate Thesis Day page two compiler syntax tree and symbol table data structure syntax and semantic analysis stage design. And author abstracts fTCN 3 and semantic content. Finally, a brief introduction of error handling, and code generation design ideas.
Table of contents
Abstract 3-5
ABSTRACT 5-7
directory 7-10
first chapter 10-16 <br / > 1.1 IPv6 protocol testing techniques need 10-11
1.2 The project's research background 11-13
1.2.1 traditional router testing methods and its limitations 11-12
1.2.2 concurrent multi-port router test systems 12-13
1.3 This thesis reflects the main research work 13-14
1.4 working papers reflect the characteristics 14-15
1.5 Thesis structure and arrangement 15-16
Chapter TTCN and support tools 16-22 < br /> 2.1 TTCN and distributed TTCN-3 test system for the new requirements 16-17
2.1.1 TTCN Overview 16
2.1.2 composed by multiple computers Distributed TTCN-3 test system for the new requirements 16-17
2.2 TTCN support tools Introduction 17-18
2.3 concurrent multi-port router TTCN test system -3 support tools 18-20
2.4 concurrent multi-port router test system TTCN-3 / C Compiler overall design 20-22
2.4.1 compiler phases 20
2.4.2 compiler over 20-22
Chapter lexical analysis and parsing 22-36
3.1 lexical analysis 22-25
3.1.1 lexical analysis Introduction 22
3.1.2 use LEX lexical analyzer tool constructed 22-23
3.1.3 lexical analyzer output 23-25 ??
3.2 syntax analysis 25-31
3.2.1 Parsing Profile 25
3.2.2 use YACC Tools constructed parser 25-26
3.2.3 YACC grammar rules section conflicts 26-30
3.2.3.1 Conflict Profile 26-27
3.2.3.2 to reduce the conflict 27-30
3.2.4 YACC and LEX's work together 30
3.2.5 parser output 30-31
3.3 syntax tree 31-36
3.3.1 parse tree and syntax tree Profile 31-32
3.3.2 The compiler syntax tree structure causes 32
3.3.3 The compiler syntax tree construction method 32-36
3.3.3.1 defines the syntax tree node data structure 32-33
3.3.3.2 constructed in YACC syntax tree 33-34
3.3.3.3 output syntax tree 34-36
Chapter semantics analysis 36-52
4.1 Semantic Analysis Introduction 36
4.2 TTCN-3 with semantically related content 36-41
4.2.1 TTCN -3 statement 37-38
4.2.2 TTCN-3 scoping rules 38-40
4.2.2.1 TTCN-3 scoping rules Introduction 38-40
4.2.2.2 TTCN-3 scoping rules uniqueness #, 31 40
4.2.3 TTCN-3 type 40-41 <br / > 4.3 Symbol Table 41-45
4.3.1 Introduction symbol table 41-42
4.3.2 TTCN-3 / C compiler symbol table design 42-45
4.3.2.1 symbol table entry data structure 42-43
4.3.2.2 symbol table using the data structure 43-44
4.3. 2.3 symbol table and the table entry operation 44-45
4.4 YACC completed in semantic analysis 45-50
4.4.1 YACC the semantic value 45 -46
4.4.2 embedding semantic block 46-50
4.5 semantic analysis output 50-52
CHAPTER error handling and code generation Introduction 52-54
5.1 Error Handling Introduction 52
5.2 Code Generation Profile 52-54
Chapter VI Conclusion and Outlook 54 -56
6.1 This work summarizes 54-55
6.2 Future Work Prospects 55-56
Thanks 56-57
References 57-61
master's degree and research papers published during 61
Related dissertations
- Dynamic Structure of Modern Chinese
- The Study on Marked-Passive-Sentence in Modern Chinese
- Micro Database Engine Research
- OCCL Compiler for Linux
- The Study on Title of Chinese Contemporary Fiction
- Research on Automatic Question Answering Technology in Restricted Domains
- Study on Passive Construction in the Quotations from Er Cheng
- See "thou polysemous verbs from cognitive semantics" in
- A Study on the Dififculties with Banked Cloze Test of College Students
- Analysis of Legal Terminology of Hong Kong's Chinese/English Bilingual Legal Texts:a Lexicographical Perspective
- A Study on the Decategorization of English Verb Tenses
- Word-formation of Clothes-inherited Morpheme and Its Using in Teaching of Chinese as a Foreign Language
- Research on Approximate Number Words in Teaching Chinese as a Second Language
- A Study on the Special Time Adverbs in Xiangxiang Dialect
- The modern Chinese "not N N" construction research
- The Three Plane Research on Nominal Sentence
- The Internal Morpheme Linear Order of Chinese VN and NV Compounds
- The Study of Existential Sentences in Korean and Chinese
- Reseach on the First Contact Target Object Verbs of Modern Chinese Language
- Comparative Study between"Pashi" and "Pabushi"