Font Size: a A A

An Extensible Open Compiler Supporting Static Meta-programming

Posted on:2007-05-10Degree:MasterType:Thesis
Country:ChinaCandidate:J F DengFull Text:PDF
GTID:2178360185961718Subject:Computer software and theory
Abstract/Summary:PDF Full Text Request
General purpose programming language sometimes can not be used to solve some problems naturally and effectively, because of the limitations of the language's expressive power(syntax constructs, control structures, combination means etc.). At that time, a domain-specific language will be a good choice.So it's significant that programmers can create a DSL conveniently for their own purposes.I design and implement an extensible open compiler supporting static meta-programming named OpenLua in this paper.It allows programmer to create a DSL rapidly by intoducing new syntax constructs.At first, there is a introduction to meta-programming, open compiler, and Lua language. An overview of OpenLua follows.Then I describe the language extensions made to Lua by OpenLua, which include three new constructs: user-defined syntax, source transformer, and module importation, and how compiler deals with them ,namely their semantics. Then the concrete algorithms are illustrated, which includes open lexcial analysis, open SLR parsing, and predictive recursive-descent parsing, etc. . And also you can see the details of the exposed programmable interfaces of OpenLua and the execution environment of meta-program. After that , it will be explained that how to perform a source transformation.I use some interesting examples to demonstrate how OpenLua can be used to extend the programming language. And then readers can see some related work in this area. At last, I summarize some shorcommings of OpenLua and give a plan of improvements in the future.
Keywords/Search Tags:meta-programming, open compiler, extensible language, Lua
PDF Full Text Request
Related items