Background
Two months ago self-taught the principle of compiling, in a cursory study of the front end of the implementation of a language can not be counted, has always wanted to maintain it, but the source code is written in Java, in my current state of Java completely can not interest, this period of time to learn C + +, Almost no high point was found after the regular expression was implemented, so it was decided to re-implement a language in C + +. In order to increase the difficulty I am ready to implement an object-oriented language, but also to reduce the difficulty I decided to temporarily do not write the language of the CFG (in fact, I do not quite remember how to write context-independent grammar), until the implementation process, how simple to write ... Because my actual level is limited, the compilation principle study is also very limited, may many places the realization way will follow own idea rather than the standard, if everybody interest welcome and I exchange ...
Implementation plan
In order to achieve the effect of C + +, and in order to prolong the development cycle, do not let themselves into the world to find practiced hand project dilemma, the development process I will follow the principle:
- All the data structures used, the algorithms are done in freehand manner, in other words, you may not see the containers and algorithms in the standard library.
- Because my current knowledge of the previous paragraph is very limited, and I do not intend to take the time to study, the flow
flex
bison
, so it is possible that lexical analysis and grammar analysis will be hand-coded way, so it is hand-made.
- So you can see I this project for the standard library dependence is relatively low, but also want to improve their own coding level, so there may be halfway to build the wheel chapter, hope Understanding.
- The last point is also the most important point, I really just a C + + beginner, I contact C + + only one months, and I touch programming just a year, so whether in the language or in the implementation of the algorithm if there are any problems can be casually pointed out, I very much hope to get other people's valuable advice.
The actual code should start from the next section, today a cursory look at the previous blog, because they have not attached importance to typesetting, only to find that the previous article typesetting like excrement, they can not see, and will strive to improve in the future ...
?
Implementing a new language (1)