guy 3ca976630a Patch level : 2.1 nopatch
Files correlati     : librerie
Ricompilazione Demo : [ ]
Commento            :

Aggiunti metodi vari per nuovi reports


git-svn-id: svn://10.65.10.50/trunk@12092 c028cbd2-c16b-5b4b-a496-9718f37d4682
2004-05-18 13:47:49 +00:00

79 lines
1.7 KiB
C++
Executable File

#ifndef __ALEX_H
#define __ALEX_H
#ifndef __RECORDSET_H
#include <recset.h>
#endif
class TVariant_stack : public TObject
{
TArray _var;
int _sp;
public:
int items() const { return _sp; }
bool drop();
TVariant& pop();
TVariant& peek(int depth = 0);
void roll(int depth);
void push(const TVariant& var);
void push(long n);
void push(const real& n);
void push(const char* str);
void reset();
bool overflow() const;
TVariant_stack() : _sp(0) { }
};
// Generic bytecode for any language
class TBytecode : public TArray
{
TString _name, _lib;
public:
void set_name(const char* name) { _name = name; }
const TString& name() const { return _name; }
void set_library(const char* lib) { _lib = lib; }
const TString& library() const { return _lib; }
};
// ALEX = Another Language EXtension
class TAVM;
class TAlex_virtual_machine : public TObject
{
TAVM* _avm; // Chesire's cat class
protected:
TAVM& avm();
public:
virtual size_t get_usr_words(TString_array& names) const;
virtual bool execute_usr_word(unsigned int opcode, TVariant_stack& stack);
virtual bool get_usr_val(const TString& name, TVariant& var) const;
virtual bool set_usr_val(const TString& name, const TVariant& var);
virtual void include_libraries(bool reload = false);
const TString& get_last_error() const;
bool compile(istream& instr, TBytecode& bc);
bool compile(const char* cmd, TBytecode& bc);
bool execute(const TBytecode& bc);
bool include(const char* fname);
void warm_restart();
void cold_restart();
void set_interactive(bool inter);
bool defined(const char* name);
TAlex_virtual_machine();
virtual ~TAlex_virtual_machine();
};
#endif