Index of the interpreter module
-
m
pylogo.interpreter
...
-
- interpreter for pylogo
- Ian Bicking <ianb@colorstudy.com>
-
a
EOF
...
-
a
Logo
...
-
a
StringTypes
...
-
C
BoundUserFunction
...
-
C
Frame
...
- A local frame. This frame usually has a parent frame, which is
the scope that created this scope (usually via a function call).
This chain implements the dynamic scoping; in a more typical
lexically scoped language, the namespace would be attached to the
container, not the previous caller.
-
a
prompts
...
-
a
special_forms
...
-
a
tokenizer
...
-
f
__init__
...
-
f
add_command
...
-
f
apply
...
- Apply the args to the func. If the function has an
attribute logo_aware, which is true, then the first argument
passed to the function will be this interpreter object. This
allows special functions, like IF or WHILE, to manipulate the
interpreter.
-
f
erase_name
...
-
f
eval
...
- Evaluate a list in this scope.
-
f
expr
...
- Top level expression-getter/evaluator (see also expr_top).
-
f
expr_inner
...
- An 'inner' expression, an expression that does not include
infix operators.
-
f
expr_list
...
- Grab a list (the '[' has already been grabbed).
-
f
expr_top
...
- Unlike expr(), this ignores empty lines; should only be used
in top-level expressions (including expressions taken from
lists).
-
f
expr_without_error
...
- Get a full expression from the tokenizer, execute it, and
return the value.
-
f
function_names
...
-
f
get_function
...
-
f
get_nonactor_function
...
-
f
get_nonactor_variable
...
-
f
get_variable
...
-
f
import_function
...
- Inputs the function func into the namespace, using the name
it was originally defined with. The special attribute
logo_name overrides the function name, and aliases provides
abbreviations for the function (like FD for FORWARD).
-
f
import_logo
...
- Import a logo file. This executes the file, including any TO
statements, putting everything into the normal namespace/scope.
-
f
import_logo_stream
...
-
f
import_module
...
- Import a module (either a module object, or the string name of
the module), moving all of its exported functions into the
current namespace (nested namespaces are not supported).
-
f
input_loop
...
- Read-Eval-Print-Repeat loop, i.e., the standard prompt.
-
f
load_defs
...
- Load function definitions from a file. This file should have
one function annotation on a line (lines starting with # or ;
are comments).
-
f
make_local
...
-
f
new
...
- Add a new frame, and return that frame.
-
f
pop_actor
...
-
f
pop_tokenizer
...
-
f
push_actor
...
-
f
push_tokenizer
...
- You can stack up multiple tokenizers, as the interpreter goes
from evaluating a file to a list to a sublist, etc. New
interpreters are created for a new scope.
-
f
set_function
...
-
f
set_variable
...
-
f
set_variable_local
...
-
f
special_for
...
- Special FOR form. Again with the variable name.
-
f
special_local
...
- The special LOCAL form (with unevaluated variables). (Should
this be generally greedy?)
-
f
special_localmake
...
- The special LOCALMAKE form
-
f
special_make
...
- The special MAKE form (special because a variable in the
first argument isn't evaluated).
-
f
special_makeattr
...
-
f
special_tell
...
-
f
special_to
...
- The special TO form.
-
f
tokenizer__get
...
- Gets the current tokenizer.
-
f
tokenizer_stack
...
-
f
variable_names
...
-
C
Interpreter
...
- The interpreter gets tokens (from a reader.TrackingStream) and
runs them. It holds the namespace, which is dynamically scoped.
-
f
__init__
...
-
f
apply
...
- Apply the args to the func. If the function has an
attribute logo_aware, which is true, then the first argument
passed to the function will be this interpreter object. This
allows special functions, like IF or WHILE, to manipulate the
interpreter.
-
f
eval
...
- Evaluate a list in this scope.
-
f
expr
...
- Top level expression-getter/evaluator (see also expr_top).
-
f
expr_inner
...
- An 'inner' expression, an expression that does not include
infix operators.
-
f
expr_list
...
- Grab a list (the '[' has already been grabbed).
-
f
expr_top
...
- Unlike expr(), this ignores empty lines; should only be used
in top-level expressions (including expressions taken from
lists).
-
f
expr_without_error
...
- Get a full expression from the tokenizer, execute it, and
return the value.
-
f
get_function
...
-
f
get_variable
...
-
f
import_function
...
- Inputs the function func into the namespace, using the name
it was originally defined with. The special attribute
logo_name overrides the function name, and aliases provides
abbreviations for the function (like FD for FORWARD).
-
f
import_logo
...
- Import a logo file. This executes the file, including any TO
statements, putting everything into the normal namespace/scope.
-
f
import_logo_stream
...
-
f
import_module
...
- Import a module (either a module object, or the string name of
the module), moving all of its exported functions into the
current namespace (nested namespaces are not supported).
-
f
input_loop
...
- Read-Eval-Print-Repeat loop, i.e., the standard prompt.
-
f
load_defs
...
- Load function definitions from a file. This file should have
one function annotation on a line (lines starting with # or ;
are comments).
-
f
pop_actor
...
-
f
pop_tokenizer
...
-
f
push_actor
...
-
f
push_tokenizer
...
- You can stack up multiple tokenizers, as the interpreter goes
from evaluating a file to a list to a sublist, etc. New
interpreters are created for a new scope.
-
f
special_for
...
- Special FOR form. Again with the variable name.
-
f
special_local
...
- The special LOCAL form (with unevaluated variables). (Should
this be generally greedy?)
-
f
special_localmake
...
- The special LOCALMAKE form
-
f
special_make
...
- The special MAKE form (special because a variable in the
first argument isn't evaluated).
-
f
special_makeattr
...
-
f
special_tell
...
-
f
special_to
...
- The special TO form.
-
f
tokenizer__get
...
- Gets the current tokenizer.
-
C
RootFrame
...
- The root/global frame object. This holds all the function
definitions, and global variables. All the algorithms end up
being different than for Frame, so they don't even inherit from
each other, though they present the same interface. Huh.
-
f
__init__
...
-
f
add_command
...
-
f
apply
...
- Apply the args to the func. If the function has an
attribute logo_aware, which is true, then the first argument
passed to the function will be this interpreter object. This
allows special functions, like IF or WHILE, to manipulate the
interpreter.
-
f
erase_name
...
-
f
eval
...
- Evaluate a list in this scope.
-
f
expr
...
- Top level expression-getter/evaluator (see also expr_top).
-
f
expr_inner
...
- An 'inner' expression, an expression that does not include
infix operators.
-
f
expr_list
...
- Grab a list (the '[' has already been grabbed).
-
f
expr_top
...
- Unlike expr(), this ignores empty lines; should only be used
in top-level expressions (including expressions taken from
lists).
-
f
expr_without_error
...
- Get a full expression from the tokenizer, execute it, and
return the value.
-
f
function_names
...
-
f
get_function
...
-
f
get_nonactor_function
...
-
f
get_nonactor_variable
...
-
f
get_variable
...
-
f
import_function
...
- Inputs the function func into the namespace, using the name
it was originally defined with. The special attribute
logo_name overrides the function name, and aliases provides
abbreviations for the function (like FD for FORWARD).
-
f
import_logo
...
- Import a logo file. This executes the file, including any TO
statements, putting everything into the normal namespace/scope.
-
f
import_logo_stream
...
-
f
import_module
...
- Import a module (either a module object, or the string name of
the module), moving all of its exported functions into the
current namespace (nested namespaces are not supported).
-
f
input_loop
...
- Read-Eval-Print-Repeat loop, i.e., the standard prompt.
-
f
load_defs
...
- Load function definitions from a file. This file should have
one function annotation on a line (lines starting with # or ;
are comments).
-
f
make_local
...
-
f
new
...
-
f
pop_actor
...
-
f
pop_tokenizer
...
-
f
push_actor
...
-
f
push_tokenizer
...
- You can stack up multiple tokenizers, as the interpreter goes
from evaluating a file to a list to a sublist, etc. New
interpreters are created for a new scope.
-
f
set_function
...
-
f
set_variable
...
-
f
set_variable_local
...
-
f
special_for
...
- Special FOR form. Again with the variable name.
-
f
special_local
...
- The special LOCAL form (with unevaluated variables). (Should
this be generally greedy?)
-
f
special_localmake
...
- The special LOCALMAKE form
-
f
special_make
...
- The special MAKE form (special because a variable in the
first argument isn't evaluated).
-
f
special_makeattr
...
-
f
special_tell
...
-
f
special_to
...
- The special TO form.
-
f
tokenizer__get
...
- Gets the current tokenizer.
-
f
tokenizer_stack
...
-
f
variable_names
...
-
C
UserFunction
...
- A function the user defines, using TO. When this function is
called, the contents of the TO statement are executed. The
contents are not interpreted until then -- they are kept as tokens
in a list.
-
f
arity
...
- Get the arity of a function (the number of arguments it takes).
If the function has an arity attribute, this will be used as an
override, otherwise inspect is used to find the number of
arguments.
-
f
load_module
...
- Loads a module given its name, because imp.find_module is
annoying.