-
Book Overview & Buying
-
Table Of Contents
Building Programming Language Interpreters
By :
In the context of interpreters and programming languages, the word stack can mean many different things. In the context of register machines, the stack is the saved state of the registers as you enter a new function. This is what allows the execution of one function to be able to use registers without knowing which registers are being used by the function calling it.In the case of stack machines, however, the operators themselves form a stack, but in that case, the word has a different meaning because it doesn’t represent the higher-level abstraction of stack frames in the language itself.The distinction is between the function call stack as a feature of the language itself, how arguments are passed, and how return values are produced versus the implementation details of how the interpreter executes its instructions.An interpreter that’s implemented as a stack machine still needs to have a higher-level construct to represent...