Font Size: a A A

The Design And Implementation Of A Configuration Language And Development Environment

Posted on:2004-05-23Degree:MasterType:Thesis
Country:ChinaCandidate:G LiFull Text:PDF
GTID:2168360095450962Subject:Computer software and theory
Abstract/Summary:PDF Full Text Request
With the increasing popularity of monitoring configuration software's application in industry controlling, it becomes more and more important to support programming interface. However, techniques in this field grow slowly. Most of the prevalent configuration softwares only provide script languages, which are directly executed through interpreting, and have the disadvantage of low efficiency, low stability and low reliability.This thesis studies the programming interface in configuration software. Based on comprehensively considering the specific features of monitoring configuration software's applying, a configuration language-C2000 language is designed, whose compiler and development environment are then fulfilled. The designing, syntax analysis, semantic analysis and intermediate code generating of C2000 are deeply discussed. A virtual machine is also presented and implemented to support the executing of the intermediate code. This thesis describes the fulfillment of the grammar elements at length. The debugging function of the development environment is also devised.A common framework of compiler is abstracted during the study of the compiler of C2000 language. After that, the implementation schemes of the front end and back end are presented. As'to the front end, this thesis doesn't use the method of syntax directed semantic analysis. Instead, it arranges syntax analysis and semantic analysis into different stages in virtue of the equal description of source program. As to the back end, it selects the scheme that a virtual machine executes the intermediate code through interpreting. The thought of combination of object oriented technique and complier construction technique is deeply used in the procedure of implementing.For supporting multilevel embedding domains, linear table instead of multilevel table is used to make the implementing of information tables management (such as symbol table and constant table management) simple and effective. To fulfill the searching algorithm of symbol table and constant table, an assistant table is introduced to solve the problem caused by the use of Hash algorithm.In the implementing of virtual machine, all P -instructions are encapsulated as classes. The virtual machine maintains the run-time environment, which is composed of code section, data section, function calling stack, operand stack, instruction pointer, etc. All that is good to the executing and the debugging of program.An abstract syntax tree is built after syntax analysis and traversed three times to do semantic analysis to generate the intermediate code. The design of the classes of C2000 language grammar elements is of great benefit to the simplification of the whole procedure. The problem of memory management in syntax analysis is solved with an assistant list.As a result, C2000 compiler can generate a compactly structured intermediate code effectively, which can be executed by C2000 virtual machine efficiently, safely, and stably. Thus the problem put forwarded at the beginning of this paper is solved, and the requirement of monitoring configuration software in the support of programming interface is satisfied well.
Keywords/Search Tags:Configuration, Abstract Syntax Tree, Intermediate Code, Virtual Machine, Run-time Environment
PDF Full Text Request
Related items