Font Size: a A A

Study And Implementation Of The Parser For A General Modeling Language For Multi-domain System

Posted on:2006-04-09Degree:MasterType:Thesis
Country:ChinaCandidate:H HuangFull Text:PDF
GTID:2178360182969327Subject:Mechanical design and theory
Abstract/Summary:PDF Full Text Request
Complex physical system, generally a synthesis of subsystems from different domains such as mechanical, electrical, hydraulic and control systems, must be modeled and simulated under a general program circumstance to obtain integral results of performance test and analysis. Modelica is a new language for the physical modeling of multi-domain systems, which unifies and generalizes previous modeling languages and supports the object-oriented modeling, multi-domain modeling, declarative physical modeling and continuous and discrete-event hybrid modeling. Hence it suits the description for modern complex multi-domain systems very well, and represents the new trend of modern modeling and simulation technology. To resolve practical problems with Modelica language, such steps as modeling, parsing, optimizing and computation must be taken, which are all dependent on an integral modeling and simulation program system platform. Parsing the source codes of model language, which is the essential component in that platform, is in charge of loading and analyzing the ready model files, system library and all kinds of domain library written in certain language, and finally translates to a general intermediate representations, which provides all integral and detail informations of original models for the subsequent generation of DAEs(Differential Algebraic Equations) and the computation carried out by resolve engine. This paper studies the characteristics and specification of the Modelica language for general multi-domain modeling, and analyses all syntactic characteristics supporting modeling of multi-domain system in an all-round way. In addition, it also studies the design techniques for modern compiler and several tools. By fully comparing with FLEX and BISON, ANTLR has been chosen to be the right tool for parsing that language. The compiler in this paper has been divided into two ends: front-end and back-end. The parser in this paper belongs to the front-end, which can be separated into lexical scanner, syntactic parser, error handler and semantic analysis by function. In the design of scanner, this paper determines the design principles of lexical scanner, and implements the techniques for description and reorganization of word. In the analysis of parser, it studies the classes in abstract syntax tree and other storage structure based on container emphatically, gives the full compare between them and the automatic generation of parser with recursion descend analytical method is also studied and analyzed. Error handling and semantic analysis are topics in upper level, and the studies and partial implementation of them are also included in this paper. At the end of the paper, some Modelica source files and all domain libraries have been parsed with the implemented program. From the result of those tests, conclusion can be drawn that the parser in this paper can parsing the very complex Modelica source code files correctly and the design and the implementation are correct and effective.
Keywords/Search Tags:Multi-domain, Modeling language, Parser, Compiler
PDF Full Text Request
Related items