class LispEnvironment

Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::lisp::LispEnvironment Class Reference

#include <LispEnvironment.h>

Inheritance diagram for acdk::lisp::LispEnvironment:

acdk::lang::Object acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Detailed Description

Represents an Lisp-Interpreter.

Roger Rene Kommer
2005/04/08 10:53:20

Public Member Functions

 LispEnvironment (IN(acdk::util::RProperties) environment=Nil, IN(RStringArray) args=Nil, bool trace=false)
 ~LispEnvironment ()
void init (bool loadCode=false)
 loads standard lisp files in /cfg/lib/acdk/lisp/autoload.lsp.

void initEnv ()
 initialize environmnet variables

void deinit ()
 uninizialize the LispEnvironment.

RString parseEval (const char *&ptr, int &rest)
RLispVar parseEval (IN(RString) str)
RLispCode parse (IN(RLispTokenizer) in, IN(acdk::io::RPrintWriter) out, bool interactiv=false, bool parseOneToken=false)
void interactive (IN(acdk::io::RCharReader) in, IN(acdk::io::RCharWriter) out)
virtual RLispVar eval (IN(RLispVar) list)
RLispVar lookupVar (IN(RString) str, bool warn=true)
 Lookup for var in.

RLispVar lookupLocalVar (IN(RString) str)
 Lookup for var in only local scopes returns Nil if not found.

RFunction lookupFunction (IN(RString) str)
bool isMacro (IN(RString) str)
virtual void bindLocal (IN(RString) symbol, IN(RLispVar) value, bool forcelocal=false)
virtual void bindGlobal (IN(RString) symbol, IN(RLispVar) value)
virtual void bindGlobal (IN(RString) symbol, IN(RString) value)
virtual void bindToEnv (IN(RString) symbol, IN(RLispVar) value)
virtual void bindToEnv (IN(RString) symbol, IN(RString) value)
void registerDefun (IN(RLispFunction) func)
RString load (IN(RLispTokenizer) tok)
 load code into Lisp-Environment
  • in the Intput

RString load (IN(RString) filename)
RString loadUnparsedFile (IN(RString) filename)
void dumpEnv (IN(acdk::io::RCharWriter) out)
 Debugging function.

bool trace ()
 Debugging function.

void trace (bool t)
 Debugging function.

bool trace (IN(RString) symbol)
 Debugging function.

void trace (IN(RString) symbol, bool dotrace)
 Debugging function.

void traceln (IN(RString) out)
void traceflush (IN(RString) str)
void trace_begin (IN(RString) out)
void trace_end (IN(RString) out)
void setBreak (int b)
int getBreak ()
RLispVar debug_interactive (IN(RLispVar) var)
RLispVar lastEvaled ()
RString lastEvaledString ()
void returnNow (bool set)
bool returnNow ()
void exitNow (int exitval)
bool exitNow ()
int exitValue ()
acdk::util::RIterator functionIterator ()
 returns an KeyIterator, where value is RFunction

acdk::util::RIterator buildinsIterator ()
acdk::util::RIterator defunsIterator ()
acdk::util::RProperties environment ()
acdk::util::RHashMap globals ()
acdk::util::RHashSet includes ()
void setInOut (IN(RCharReader) rin, IN(RCharWriter) rout, IN(RCharWriter) rerr)
RLispVar _eval (IN(RLispVar) list)
RLispVar _eval (IN(RLispList) list)
RLispVar _eval (IN(RLispSymbol) list)
RLispVar _eval (IN(RLispAtom) list)
void storeCompiled (IN(RString) file)
 store all compiled functions, macros an globals variables a file.

void storeCompiled (IN(::acdk::io::RWriter) out)
void loadCompiled (IN(RString) file, bool replace)
 Loads image file.

void loadCompiled (IN(::acdk::io::RReader) in, bool replace)
 Loads image file.

Static Public Member Functions

RLispList parseToList (IN(RString) str)
RLispAtom t ()
void registerFunction (const char *name, const char *decl, LispNativFunction func, bool preeval=true)
acdk::util::RHashMap _staticFuncs ()
RLispEnvironment lenv ()

Public Attributes

acdk::io::RPrintWriter out
acdk::io::RPrintWriter err
acdk::io::RInputReader in
Stack< RFile_modulStack
 The current Modul stack.

Stack< RLispStackFrame_stackFrame
Stack< RLispVar_evalStack

Private Attributes

acdk::util::RProperties _environment
acdk::util::RHashMap _globals
acdk::util::RHashMap _defuns
acdk::util::RHashMap _macros
acdk::util::RHashSet _includes
 all fq names of included lsp-files

acdk::util::RHashSet _tracedSymbols
bool _trace
RLispVar _lastEvaled
bool _returnNow
int _tracelevel
int _break
bool _exitNow
int _exitValue
RStringArray _cmlineArgs

Static Private Attributes

 global instance

RLispEnvironment _glenv
 this will be used if not already set

acdk::util::RHashMap __staticFuncs
 normal buildin function

RLispAtom __trueVar


class LispBinaryCode

Constructor & Destructor Documentation

acdk::lisp::LispEnvironment::LispEnvironment IN(acdk::util::RProperties environment = Nil,
IN(RStringArray args = Nil,
bool  trace = false

acdk::lisp::LispEnvironment::~LispEnvironment  ) 

Member Function Documentation

RLispVar acdk::lisp::LispEnvironment::_eval IN(RLispAtom list  ) 

RLispVar acdk::lisp::LispEnvironment::_eval IN(RLispSymbol list  ) 

RLispVar acdk::lisp::LispEnvironment::_eval IN(RLispList list  ) 

RLispVar acdk::lisp::LispEnvironment::_eval IN(RLispVar list  ) 

acdk::util::RHashMap acdk::lisp::LispEnvironment::_staticFuncs  )  [static]

virtual void acdk::lisp::LispEnvironment::bindGlobal IN(RString symbol,
IN(RString value
[inline, virtual]

virtual void acdk::lisp::LispEnvironment::bindGlobal IN(RString symbol,
IN(RLispVar value

virtual void acdk::lisp::LispEnvironment::bindLocal IN(RString symbol,
IN(RLispVar value,
bool  forcelocal = false

virtual void acdk::lisp::LispEnvironment::bindToEnv IN(RString symbol,
IN(RString value
[inline, virtual]

virtual void acdk::lisp::LispEnvironment::bindToEnv IN(RString symbol,
IN(RLispVar value

acdk::util::RIterator acdk::lisp::LispEnvironment::buildinsIterator  ) 

RLispVar acdk::lisp::LispEnvironment::debug_interactive IN(RLispVar var  ) 

acdk::util::RIterator acdk::lisp::LispEnvironment::defunsIterator  ) 

void acdk::lisp::LispEnvironment::deinit  ) 

uninizialize the LispEnvironment.

needed to release this instance.

void acdk::lisp::LispEnvironment::dumpEnv IN(acdk::io::RCharWriter out  ) 

Debugging function.

acdk::util::RProperties acdk::lisp::LispEnvironment::environment  )  [inline]

virtual RLispVar acdk::lisp::LispEnvironment::eval IN(RLispVar list  )  [virtual]

bool acdk::lisp::LispEnvironment::exitNow  )  [inline]

void acdk::lisp::LispEnvironment::exitNow int  exitval  )  [inline]

int acdk::lisp::LispEnvironment::exitValue  )  [inline]

acdk::util::RIterator acdk::lisp::LispEnvironment::functionIterator  ) 

returns an KeyIterator, where value is RFunction

int acdk::lisp::LispEnvironment::getBreak  )  [inline]

acdk::util::RHashMap acdk::lisp::LispEnvironment::globals  )  [inline]

acdk::util::RHashSet acdk::lisp::LispEnvironment::includes  )  [inline]

void acdk::lisp::LispEnvironment::init bool  loadCode = false  ) 

loads standard lisp files in /cfg/lib/acdk/lisp/autoload.lsp.

Error if ACDK_HOME is not defined.
loadCode load code instead of image

void acdk::lisp::LispEnvironment::initEnv  ) 

initialize environmnet variables

void acdk::lisp::LispEnvironment::interactive IN(acdk::io::RCharReader in,
IN(acdk::io::RCharWriter out

bool acdk::lisp::LispEnvironment::isMacro IN(RString str  )  [inline]

RLispVar acdk::lisp::LispEnvironment::lastEvaled  )  [inline]

RString acdk::lisp::LispEnvironment::lastEvaledString  )  [inline]

RLispEnvironment acdk::lisp::LispEnvironment::lenv  )  [inline, static]

RString acdk::lisp::LispEnvironment::load IN(RString filename  ) 

RString acdk::lisp::LispEnvironment::load IN(RLispTokenizer tok  ) 

load code into Lisp-Environment

  • in the Intput

The result of the evaluated code

void acdk::lisp::LispEnvironment::loadCompiled IN(::acdk::io::RReader in,
bool  replace

Loads image file.

replace replace current env.

void acdk::lisp::LispEnvironment::loadCompiled IN(RString file,
bool  replace

Loads image file.

replace replace current env.

RString acdk::lisp::LispEnvironment::loadUnparsedFile IN(RString filename  ) 

RFunction acdk::lisp::LispEnvironment::lookupFunction IN(RString str  ) 

RLispVar acdk::lisp::LispEnvironment::lookupLocalVar IN(RString str  ) 

Lookup for var in only local scopes returns Nil if not found.

RLispVar acdk::lisp::LispEnvironment::lookupVar IN(RString str,
bool  warn = true

Lookup for var in.

  • locals in scopes from inner to outer
  • functions
  • global variables (setg)
  • environmnet

RLispCode acdk::lisp::LispEnvironment::parse IN(RLispTokenizer in,
IN(acdk::io::RPrintWriter out,
bool  interactiv = false,
bool  parseOneToken = false

RLispVar acdk::lisp::LispEnvironment::parseEval IN(RString str  ) 

RString acdk::lisp::LispEnvironment::parseEval const char *&  ptr,
int &  rest

RLispList acdk::lisp::LispEnvironment::parseToList IN(RString str  )  [static]

void acdk::lisp::LispEnvironment::registerDefun IN(RLispFunction func  ) 

void acdk::lisp::LispEnvironment::registerFunction const char *  name,
const char *  decl,
LispNativFunction  func,
bool  preeval = true

bool acdk::lisp::LispEnvironment::returnNow  )  [inline]

void acdk::lisp::LispEnvironment::returnNow bool  set  )  [inline]

void acdk::lisp::LispEnvironment::setBreak int  b  )  [inline]

void acdk::lisp::LispEnvironment::setInOut IN(RCharReader rin,
IN(RCharWriter rout,
IN(RCharWriter rerr

void acdk::lisp::LispEnvironment::storeCompiled IN(::acdk::io::RWriter out  ) 

void acdk::lisp::LispEnvironment::storeCompiled IN(RString file  ) 

store all compiled functions, macros an globals variables a file.

Environment and build in functions will not be stored

RLispAtom acdk::lisp::LispEnvironment::t  )  [static]

void acdk::lisp::LispEnvironment::trace IN(RString symbol,
bool  dotrace

Debugging function.

bool acdk::lisp::LispEnvironment::trace IN(RString symbol  )  [inline]

Debugging function.

void acdk::lisp::LispEnvironment::trace bool  t  )  [inline]

Debugging function.

bool acdk::lisp::LispEnvironment::trace  )  [inline]

Debugging function.

void acdk::lisp::LispEnvironment::trace_begin IN(RString out  ) 

void acdk::lisp::LispEnvironment::trace_end IN(RString out  ) 

void acdk::lisp::LispEnvironment::traceflush IN(RString str  ) 

void acdk::lisp::LispEnvironment::traceln IN(RString out  ) 

Friends And Related Function Documentation

friend class LispBinaryCode [friend]

Member Data Documentation

acdk::util::RHashMap acdk::lisp::LispEnvironment::__staticFuncs [static, private]

normal buildin function

RLispAtom acdk::lisp::LispEnvironment::__trueVar [static, private]

int acdk::lisp::LispEnvironment::_break [private]

RStringArray acdk::lisp::LispEnvironment::_cmlineArgs [private]

acdk::util::RHashMap acdk::lisp::LispEnvironment::_defuns [private]

acdk::util::RProperties acdk::lisp::LispEnvironment::_environment [private]

Stack<RLispVar> acdk::lisp::LispEnvironment::_evalStack

bool acdk::lisp::LispEnvironment::_exitNow [private]

int acdk::lisp::LispEnvironment::_exitValue [private]

RLispEnvironment acdk::lisp::LispEnvironment::_glenv [static, private]

this will be used if not already set

acdk::util::RHashMap acdk::lisp::LispEnvironment::_globals [private]

acdk::util::RHashSet acdk::lisp::LispEnvironment::_includes [private]

all fq names of included lsp-files

RLispVar acdk::lisp::LispEnvironment::_lastEvaled [private]

LispEnvironment* acdk::lisp::LispEnvironment::_lenv [static, private]

global instance

acdk::util::RHashMap acdk::lisp::LispEnvironment::_macros [private]

Stack<RFile> acdk::lisp::LispEnvironment::_modulStack

The current Modul stack.

bool acdk::lisp::LispEnvironment::_returnNow [private]

Stack<RLispStackFrame> acdk::lisp::LispEnvironment::_stackFrame

bool acdk::lisp::LispEnvironment::_trace [private]

acdk::util::RHashSet acdk::lisp::LispEnvironment::_tracedSymbols [private]

int acdk::lisp::LispEnvironment::_tracelevel [private]

acdk::io::RPrintWriter acdk::lisp::LispEnvironment::err

acdk::io::RInputReader acdk::lisp::LispEnvironment::in

acdk::io::RPrintWriter acdk::lisp::LispEnvironment::out