#ifndef KSGSCompile_H #define KSGSCompile_H #include #include #include using namespace Framework; namespace KSGScript { struct KSGSCompileVariable; // aus dieser Datei struct KSGSCompileFunktion; // aus dieser Datei struct KSGSCompileKlasse; // aus dieser Datei class KSGSCompVarTable { private: RCArray< Text > *namen; Array< KSGSCompileVariable* > *vars; int ref; public: // Konstruktor __declspec( dllexport ) KSGSCompVarTable(); // Destruktor __declspec( dllexport ) ~KSGSCompVarTable(); // nicht constant __declspec( dllexport ) bool addVariable( const char *name, KSGSCompileVariable *var ); // constant __declspec( dllexport ) KSGSCompileVariable *get( const char *name ) const; // gibt die Variable eines Namens zurück __declspec( dllexport ) bool hat( const char *name ) const; // prüft, ob name vorhanden ist // Reference Counting __declspec( dllexport ) KSGSCompVarTable *getThis(); __declspec( dllexport ) KSGSCompVarTable *release(); }; class KSGSCompFuncTable { private: RCArray< Text > *namen; Array< KSGSCompileFunktion* > *funks; int ref; public: // Konstruktor __declspec( dllexport ) KSGSCompFuncTable(); // Destruktor __declspec( dllexport ) ~KSGSCompFuncTable(); // nicht constant __declspec( dllexport ) bool addFunktion( const char *name, KSGSCompileFunktion *func ); // constant __declspec( dllexport ) KSGSCompileFunktion *get( const char *name ) const; // gibt die Funktion eines Namens zurück __declspec( dllexport ) bool hat( const char *name ) const; // prüft, ob name vorhanden ist // Reference Counting __declspec( dllexport ) KSGSCompFuncTable *getThis(); __declspec( dllexport ) KSGSCompFuncTable *release(); }; class KSGSCompKlassTable { private: RCArray< Text > *namen; Array< KSGSCompileKlasse* > *klassen; int ref; public: // Konstruktor __declspec( dllexport ) KSGSCompKlassTable(); // Destruktor __declspec( dllexport ) ~KSGSCompKlassTable(); // nicht constant __declspec( dllexport ) bool addKlasse( const char *name, KSGSCompileKlasse *klasse ); // constant __declspec( dllexport ) KSGSCompileKlasse *get( const char *name ) const; // gibt die Klasse eines Namens zurück __declspec( dllexport ) KSGSCompileKlasse *get( int id ) const; // gibt die Klasse einer id zurück __declspec( dllexport ) bool hat( const char *name ) const; // prüft, ob name vorhanden ist __declspec( dllexport ) bool hat( int id ) const; // prüft, ob id vorhanden ist // Reference Counting __declspec( dllexport ) KSGSCompKlassTable *getThis(); __declspec( dllexport ) KSGSCompKlassTable *release(); }; struct KSGSCompileVariable { int typ; int id; int sichtbar; // 0 = global, 1 = global in klasse, 2 = lokal in Klasse, 3 = lokal in Funktion // Konstruktor __declspec( dllexport ) KSGSCompileVariable( int t, int s ); }; struct KSGSCompileFunktion { int typ; int id; int sichtbar; // 0 = global, 1 = global in klasse, 2 = lokal in Klasse Array< int > parameterTyp; KSGSCompVarTable vars; // tabelle mit lokalen variblen // Konstruktor __declspec( dllexport ) KSGSCompileFunktion( int t, int s, std::initializer_list< int > pt ); }; struct KSGSCompileKlasse { int id; KSGSCompVarTable vars; KSGSCompFuncTable funcs; }; } #endif