Font Size: a A A

Research And Implementation Of ST-C# Scripting Compiler

Posted on:2008-02-01Degree:MasterType:Thesis
Country:ChinaCandidate:J J YingFull Text:PDF
GTID:2178360215493333Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
An embedded scripting compiler can support the scripting language inthe application software and support secondary development byuser-defined scripts, thus better meets the users' requirements andimproves the extensibility and universality of the software. Furthermore,more and more applications are developed based on DotNet recently. Inthis paper, a scripting compiler named "ST-C#" is developed for theabove-mentioned DotNet based software and implemented in the "StockSearching"software successfully.The involved processes of designing a scripting language containdefinitions of the language; format of the virtual machine, the developmentof the compiler and virtual machine. Our "ST-C#" language is similar tothe C# language for the syntax and supports abundant operations withoperators, character strings, arrays and functions, the free writing style,function overloading and so on. Moreover, to support real-time, the functions of the "ST-C#" are divided into three libraries: intrinsic functionlibraries, systemic function libraries and user-defined libraries.In order to speed up running scripts, scripts should be changed intovirtual machine code and provided for the virtual machine to implement.The instruction system of common virtual machine includes low-levelinstructions that is similar to the assemble instructions. To minimize thedifficulty of the compiler development and simplify the design of thevirtual machine, the minimum instruction set of virtual machine wasdesigned when define the format of virtual machine code. The treestructure is used to save the compilation results so that only fourinstructions are enough to control the program. The tree structure mayreduce the performance of the expression operations, but the difficulty ofthe compiler and virtual machine development is also reduced enormously.In this paper, the process of how to compile the scripts into virtualmachine code in "ST-C#" scripting compiler is discussed and the adoptedtechnologies in lexical analysis, syntax analysis and virtual machine codegeneration are elaborated. Our compiler is independent of the runningenvironment because of the designing abstraction of virtual machine code,which is similar to the fore-end of a general compiler. The virtual machineis designed to support the running of scripting language. To simplify andclarify our virtual machine of "ST-C#", two components includinginstruction parser component that is responsible for executing the code andexpression computation component that is responsible for computing the expressions are constructed.Finally, the embedded scripting compiler in "Stock Searching" isintroduced and the process of running the scripts is explained. Theexperimental result shows that the "ST-C#" scripting compiler is muchpracticable.
Keywords/Search Tags:ST-C# scripting language, virtual machine instruction, scripting compiler, virtual machine
PDF Full Text Request
Related items