
I have harboured the idea of making compiler for some time now. Today, I searched a little on Google and looking at some code in a tutorial, I got the idea. That, I can get started fairly fast by writing a simple lexical parser, which parses input code, using a hierarchy of if-else statements. No need to have stages for lexical analysis and parser generation. I’ll need regex support though, to detect numbers.
I think, a stack will be needed, to execute loops, etc.
Here is some very basic code, just to get started, it reads in a file.
0 Comments.