Original Post
Does anyone know of any good tutorials online for compiler creation? I ordered a book but it won't get here for a while. :(
Quote:this->omnipotent = true;
Original post by Venerable Vampire
Life would be so much easier if we could just get the source code.
Quote:
Original post by iMalc Quote:this->omnipotent = true;
Original post by Venerable Vampire
Life would be so much easier if we could just get the source code.
ROFL - Nice line!
Learn Flex and Bison. They make compiler creation far quicker and the end result is faster too.
Quote:CpMan is correct, but he left out the fact that you still have to know how a compiler works pretty much to use them properly and efficiently.
Original post by iMalc
[...]Learn Flex and Bison. They make compiler creation far quicker and the end result is faster too.
Quote:
Original post by CpMan
I would learn a recursive descent parser. It's more intuitive and shows the concepts better, in my opinion.
Quote:Why would you want to read the generated code in the first place?
Original post by Extrarius
I opted not to use compiler compilers because they all spit out really ugly code with a very poor style that doesn't mesh with anything I've been working on. It seems to me that they are meant for standalone compilers that perform simple translations more than scripting libraries or things like that.
Quote:Because if it the compiler is going to be part of one of my projects, I'd have to integrate it cleanly into the rest. Just putting stuff in the code they spit out wouldn't work, because for ex I'd want the Compile() and Execute() functions to be part of a class that maintains state information that would be used when compiling/executing/etc. I'd also want them to be thread-safe (not sure if the code they generate is or not), and stuff like that.
Original post by doynax
[...]Why would you want to read the generated code in the first place?
You can't touch it anyway since it'll be regenerated any time you make a change to the syntax script.
Oh, and many complex compilers use them (GCC is a good example).
Quote:
Original post by Extrarius Quote:Because if it the compiler is going to be part of one of my projects, I'd have to integrate it cleanly into the rest. Just putting stuff in the code they spit out wouldn't work, because for ex I'd want the Compile() and Execute() functions to be part of a class that maintains state information that would be used when compiling/executing/etc. I'd also want them to be thread-safe (not sure if the code they generate is or not), and stuff like that.
Original post by doynax
[...]Why would you want to read the generated code in the first place?
You can't touch it anyway since it'll be regenerated any time you make a change to the syntax script.
Oh, and many complex compilers use them (GCC is a good example).
The generated code would have to fit into and work with the rest of my code. In other words, they were not suitable to my needs, which is why I didn't use them.
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more