PH Logo
Logo intepreter modeled after UCB Logo.
Public Member Functions
phlogo::Interpreter Class Reference

#include <Interpreter.h>

List of all members.

Public Member Functions

 Interpreter (World *world)
VerbsgetVerbs ()
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)

Detailed Description

A LOGO intepreter.

Definition at line 30 of file Interpreter.h.


Member Function Documentation

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:

  • A list -> "["
  • An array -> "{"
  • A verb -> "$"
  • A sub expression -> "("
  • otherwise a literal.

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.


The documentation for this class was generated from the following files:
 All Classes Functions