3 ms·
This is for building a compiler for the language tiny: http://thinkingeek.com/gcc-tiny/ http://thinkingeek.com/gcc-tiny/ Otherwise, get your hands dirty with a
by theaustinseven 9y ago
This is for building a compiler for the language tiny: http://thinkingeek.com/gcc-tiny/ http://thinkingeek.com/gcc-tiny/
Otherwise, get your hands dirty with a parser generator(PEG parser generators[1] tend to be fairly forgiving). It is pretty easy to get started making an interpreter that way, and it is quick to prototype with.
[1]: http://bford.info/packrat/ http://bford.info/packrat/
- CalChris 9y agoI would recommend keeping your hands clean and using ANTLR [1]. ANTLR4 is powerful lexer/parser generator. LL(*) is ridiculously powerful. Also, ANTLR is well documented and the his book [2] is quite readable. [1] www.antlr.org [2] https://pragprog.com/book/tpantlr2/the-definitive-antlr-4-reference https://pragprog.com/book/tpantlr2/the-definitive-antlr-4-re... Also, if you're really only interested in the language then you should think about targeting LLVM IR or the JVM.