Resources needed: the theory and practice of OO compiler design
-
For some years, I have been working on an object-oriented language for writing simulations similar to Life[^]. I would now like to try my hand at designing a compiler and framework for running the language. TLC (Tiny Life Compiler) is broken into sections like COBOL, each representing a different phase of the simulation: environment, initialization, loop and final. In the environment section, different lifeforms can be defined by writing classes that inherit from the base
LIFEFORM
object or a class descended from it. Other aspects of the simulation, such as the type of grid (square or hex) and the behavior of the edges (are opposite edges joined or not), are defined there too. The initialization section is where starting states are set up; each generation is a single pass through the loop section which runs until anEXIT
command is executed; and the final section is where summary information can be presented. It would run basically as a console, with just an output display and very basic keyboard commands like "Press Enter to begin" and "Press any key to pause." The source code would be compiled to an optimized pseudocode, which would be run by an interpreter. I've written procedural language compilers before, so I'm familiar with the concept. I've never written an object-oriented one, though, and I'm not sure how the pseudocode would be arranged. If anyone has any recommended books or other resources, I would be grateful.