|
PH Logo
Logo intepreter modeled after UCB Logo.
|
#include <Interpreter.h>
Public Member Functions | |
| Interpreter (World *world) | |
| Verbs * | getVerbs () |
| void | setDebug (bool on) |
| void | run (World *world, const std::string &sentence) |
| void | runTokenized (World *world, const std::string &tokenized) |
| void | defun (const std::string &name, const std::string &args) |
| void | end () |
| wList | sentence2words (const std::string &sentence) |
| pThing | varOrLiteral (World *world, const std::string &s) |
| void | getNextThing (World *world, TokenStream *ts, pThing *thing) |
A LOGO intepreter.
Definition at line 30 of file Interpreter.h.
| void phlogo::Interpreter::defun | ( | const std::string & | name, |
| const std::string & | args | ||
| ) |
define a new LOGO function, and end it.
Definition at line 107 of file Interpreter.cpp.
| void phlogo::Interpreter::getNextThing | ( | World * | world, |
| TokenStream * | ts, | ||
| pThing * | thing | ||
| ) |
Used by verbs to get a single thing.
A thing is:
Definition at line 143 of file Interpreter.cpp.
| void phlogo::Interpreter::run | ( | World * | world, |
| const std::string & | sentence | ||
| ) |
Run a LOGO sentence, returning the result.
| void phlogo::Interpreter::runTokenized | ( | World * | world, |
| const std::string & | tokenized | ||
| ) |
Run a tokenized LOGO sentence, returning the result.
Definition at line 78 of file Interpreter.cpp.
| wList phlogo::Interpreter::sentence2words | ( | const std::string & | sentence | ) |
Tokenize a sentence into a list of words.
Definition at line 39 of file Interpreter.cpp.
| boost::shared_ptr< Thing > phlogo::Interpreter::varOrLiteral | ( | World * | world, |
| const std::string & | s | ||
| ) |
If the thing is a literal return it, otherwise evaluate it as a variable.
Definition at line 121 of file Interpreter.cpp.
1.7.4