#include <schcont.hpp>
Inheritance diagram for SchemeContinuation:
This class determines the Scheme computation model providing the method JustEvaluate() and overriding the method CustomCommand() so that it handles to instruction codes missing in the base class. The specific context handling is also provided.
Definition at line 104 of file schcont.hpp.
Public Types | |
enum | CustomInstructions { case_check = max_command - 1 } |
additional instructions More... | |
enum | Instructions { just_evaluate = -1, evaluate_prepared = -2, evaluate_progn = -3, quote_parameter = -4, drop_result = -5, return_unspecified = -6, end_of_clauses = -7, cond_clause = -8, bail_on_false = -9, set_context = -10, assign_to = -11, assign_location = -12, generic_iteration = -13, iteration_callback = -14, max_command = -14 } |
The instruction set of the machine. More... | |
Public Member Functions | |
SchemeContinuation () | |
The default constructor. | |
SchemeContinuation (const SchemeContinuation &other, bool b) | |
The CALL/CC-related constructor. | |
~SchemeContinuation () | |
The destructor. | |
SchContextRef | GetContext () const |
Get the current context. | |
void | SetContext (const SchContextRef &context) |
Set the current context. | |
bool | Step () |
Perform a single step of the evaluation. | |
int | GetMark () const |
Mark the todo stack before starting an evaluation. | |
bool | Ready (int mark=0) const |
Is the evaluation complete? | |
SReference | Get () |
Get the result of the evaluation. | |
void | ReplaceContinuation (const IntelibContinuation &other) |
Replace the entire state of the continuation. | |
void | PushTodo (int opcode, const SReference ¶m) |
Add an instruction to the todo stack. | |
void | PushTodo (int opcode) |
Add a parameterless instruction to the todo stack. | |
bool | PopTodo (int &opcode, SReference ¶m) |
Get (and remove) the top of the todo stack. | |
void | PushResult (const SReference ¶m) |
Put item into the result stack. | |
bool | PopResult (SReference ¶m) |
Get (and remove) the item from top of the result stack. | |
void | RegularReturn (const SReference &ref) |
Return a value from a Lisp function. | |
void | ReferenceReturn (SReference &ref, const SReference &superstruct) |
Return an assignable reference from a Lisp function. | |
void | AgentReturn (const SReference &val, const SExpressionSetfAgent *ag) |
Return a Setf Agent from a Lisp function. | |
void | TailReturn (const SReference &ref) |
Return a tail (to be evaluated) from a Lisp function. | |
void | ReturnUnspecified () |
Return the 'unspecified' value from a Lisp function. | |
void | SetContext (const SReference &cont) |
Set current lexical context. | |
Static Public Member Functions | |
static void | InterruptEvaluator () |
Interrupt the evaluation. | |
static void | RemoveInterruption () |
Cances the interruption of the evaluation. | |
static void | SuspendInterruptions () |
Temporaryly disallow interruptions. | |
static void | ResumeInterruptions () |
Allow interruptions again. | |
Protected Member Functions | |
void | PlaceFormToStack (const SExpressionCons *form, int len) |
Place a prepared form to the stack. | |
Protected Attributes | |
SReference * | PTheFalseValue |
|
additional instructions
Definition at line 119 of file schcont.hpp. |
|
The instruction set of the machine. Zero and positive opcodes stand for "call a function with that many args", in which case the function object and the args are taken from the result stack. The numbers from -1 downto max_command are the special operation codes. The numbers below max_command are for the operations added by subclasses (e.g., Scheme-specific and Lisp-specific instructions).
Definition at line 201 of file conteval.hpp. |
|
The default constructor.
Definition at line 107 of file schcont.hpp. References PTheSchemeBooleanFalse. |
|
The CALL/CC-related constructor.
Definition at line 111 of file schcont.hpp. References PTheSchemeBooleanFalse. |
|
The destructor.
Definition at line 116 of file schcont.hpp. |
|
Get the current context.
Reimplemented from IntelibContinuation. Definition at line 122 of file schcont.hpp. References IntelibContinuation::GetContext(). |
|
Set the current context.
Definition at line 126 of file schcont.hpp. References IntelibContinuation::SetContext(). |
|
|
Mark the todo stack before starting an evaluation.
Definition at line 168 of file conteval.hpp. |
|
Is the evaluation complete?
Definition at line 175 of file conteval.hpp. |
|
Get the result of the evaluation.
Definition at line 96 of file conteval.cpp. |
|
Replace the entire state of the continuation. This is how the CALL/CC feature works.
Definition at line 70 of file conteval.cpp. |
|
Add an instruction to the todo stack.
Definition at line 199 of file conteval.cpp. References IntelibContinuation::set_context. Referenced by IntelibContinuation::PlaceFormToStack(), IntelibContinuation::PushTodo(), and IntelibContinuation::TailReturn(). |
|
Add a parameterless instruction to the todo stack.
Definition at line 229 of file conteval.cpp. References IntelibContinuation::PushTodo(). |
|
Get (and remove) the top of the todo stack.
Definition at line 235 of file conteval.cpp. Referenced by IntelibContinuation::Step(). |
|
Put item into the result stack.
Definition at line 249 of file conteval.cpp. Referenced by IntelibContinuation::AgentReturn(), IntelibContinuation::ReferenceReturn(), IntelibContinuation::RegularReturn(), and IntelibContinuation::Step(). |
|
Get (and remove) the item from top of the result stack.
Definition at line 264 of file conteval.cpp. Referenced by IntelibContinuation::Step(). |
|
Return a value from a Lisp function.
Definition at line 273 of file conteval.cpp. References IntelibContinuation::PushResult(). Referenced by IntelibContinuation::ReturnUnspecified(). |
|
Return an assignable reference from a Lisp function.
Definition at line 290 of file conteval.cpp. References IntelibContinuation::PushResult(). |
|
Return a Setf Agent from a Lisp function.
Definition at line 300 of file conteval.cpp. References IntelibContinuation::PushResult(). |
|
Return a tail (to be evaluated) from a Lisp function.
Definition at line 310 of file conteval.cpp. References IntelibContinuation::just_evaluate, and IntelibContinuation::PushTodo(). |
|
Return the 'unspecified' value from a Lisp function.
Definition at line 315 of file conteval.cpp. References IntelibContinuation::RegularReturn(). Referenced by IntelibContinuation::Step(). |
|
Set current lexical context.
Definition at line 288 of file conteval.hpp. Referenced by SetContext(), and LispContinuation::SetContext(). |
|
Interrupt the evaluation.
Definition at line 296 of file conteval.hpp. |
|
Cances the interruption of the evaluation.
Definition at line 298 of file conteval.hpp. |
|
Temporaryly disallow interruptions.
Definition at line 300 of file conteval.hpp. |
|
Allow interruptions again.
Definition at line 302 of file conteval.hpp. |
|
Place a prepared form to the stack.
Definition at line 452 of file conteval.cpp. References IntelibContinuation::just_evaluate, and IntelibContinuation::PushTodo(). |
|
Definition at line 134 of file conteval.hpp. |