object.h
来自「Shorthand是一个强大的脚本语言」· C头文件 代码 · 共 45 行
H
45 行
#ifndef __object_h
#define __object_h
///////////////////////////////////////////////////////////////////////////////
// $Header: /shorthand/src/object.h 4 1/09/03 7:14p Arm $
//-----------------------------------------------------------------------------
// Project: ShortHand interpreter
// Author: Andrei Remenchuk <andrei@remenchuk.com>
//-----------------------------------------------------------------------------
// object.h: ShortHand object interface
///////////////////////////////////////////////////////////////////////////////
#include "value.h"
#include "map.h"
#include "yydef.h"
class ShhModule;
/**
* ShortHand object.
*/
class ShhObject
{
protected:
string m_type;
ShhModule& m_module;
// location where the object was constructed
YYLTYPE m_ctor_location;
map<ShhValue> m_properties;
public:
ShhObject(ShhModule& module, const char* type, const YYLTYPE& location);
const char* getTypeName() const { return m_type; }
virtual void setProperty(const char* name, ShhValue value);
virtual ShhValue& getProperty(const char* name);
virtual void constructor(ShhValueList* args) = 0;
virtual ShhValue executeMethod(const char* name, ShhValueList* args) = 0;
virtual bool hasMethod(const char* name) = 0;
virtual ~ShhObject();
};
#endif // __object_h
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?