lib Library API Documentation

KSModule Class Reference

An instance of this class represents a loaded module. More...

#include <koscript_context.h>

List of all members.

Public Types

typedef KSSharedPtr< KSModulePtr

Public Member Functions

 KSModule (KSInterpreter *, const QString &name, KSParseNode *=0)
virtual bool eval (KSContext &)
virtual KSValue::Ptr member (KSContext &, const QString &name)
virtual bool setMember (KSContext &, const QString &name, const KSValue::Ptr &v)
virtual bool isPebbles () const
QString name () const
KSNamespacenameSpace ()
KSValueobject (const QString &name)
void addObject (const QString &name, const KSValue::Ptr &v)
void removeObject (const QString &name)
KSInterpreterinterpreter ()

Protected Member Functions

void setCode (KSParseNode *node)


Detailed Description

An instance of this class represents a loaded module.

It holds the namespace with all symbols of the module and owns the parse tree. A module itself may be inserted in other namespaces.

Definition at line 41 of file koscript_context.h.


Member Function Documentation

bool KSModule::eval KSContext &   )  [virtual]
 

Executes the code of the module.

This method is usually called after the module has been loaded.

Definition at line 273 of file koscript_context.cc.

References eval().

Referenced by eval().

KSValue::Ptr KSModule::member KSContext &  ,
const QString name
[virtual]
 

If KSContext::leftExpr returns TRUE for the given context, then a new member is added to the object if it did not exist.

Otherwise 0 is returned for a non existing member. This function may nevertheless set an exception if a member is known but if it could not be read for some reason.

Definition at line 242 of file koscript_context.cc.

References member().

Referenced by member().

bool KSModule::setMember KSContext &  ,
const QString name,
const KSValue::Ptr v
[virtual]
 

May set an exception if the member could not be set.

Definition at line 266 of file koscript_context.cc.

References setMember().

Referenced by setMember().

virtual bool KSModule::isPebbles  )  const [inline, virtual]
 

Reimplemented by KSPebblesModule.

Definition at line 71 of file koscript_context.h.

QString KSModule::name  )  const [inline]
 

Returns:
the module's name.

Definition at line 76 of file koscript_context.h.

KSInterpreter* KSModule::interpreter  )  [inline]
 

Returns:
the interpreter that loaded and executed the module.

Definition at line 113 of file koscript_context.h.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for lib Library Version 1.3.5.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Nov 17 06:54:23 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003