00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _COMPILE_
00025 #define _COMPILE_
00026
00027
00028 #include "signals.hh"
00029 #include "klass.hh"
00030 #include "Text.hh"
00031 #include "uitree.hh"
00032 #include <string>
00033 #include <list>
00034 #include <stack>
00035 #include <map>
00036
00037 #include "description.hh"
00038
00040
00045
00046
00047 #define kMaxHeight 1024
00048
00049
00050 class Compiler
00051 {
00052 protected:
00053 Klass* fClass;
00054 bool fNeedToDeleteClass;
00055 Tree fUIRoot;
00056 Description* fDescription;
00057
00058 public:
00059 Compiler (const string& name, const string& super, int numInputs, int numOutputs, bool vec);
00060 Compiler (Klass* k);
00061
00062 virtual ~Compiler();
00063
00064 virtual void compileMultiSignal (Tree lsig) = 0;
00065 virtual void compileSingleSignal (Tree lsig) = 0;
00066
00067 Klass* getClass() { return (Klass*)fClass; }
00068
00069 void setDescription(Description* descr) { fDescription= descr; }
00070 Description* getDescription() { return fDescription; }
00071
00072 protected:
00073 virtual Tree prepare (Tree L0) = 0;
00074 virtual Tree prepare2 (Tree L0) = 0;
00075
00076
00077 void addIncludeFile (const string& str) { fClass->addIncludeFile(str); }
00078 void addLibrary (const string& str) { fClass->addLibrary(str); }
00079
00080
00081 void addUIWidget(Tree path, Tree widget);
00082 void generateWidgetCode(Tree fulllabel, Tree varname, Tree sig);
00083 void generateUserInterfaceTree(Tree t);
00084 void generateUserInterfaceElements(Tree elements);
00085 Tree prepareUserInterfaceTree(Tree t);
00086
00087 void generateMacroInterfaceTree(const string& pathname, Tree t);
00088 void generateMacroInterfaceElements(const string& pathname, Tree elements);
00089 void generateWidgetMacro(const string& pathname, Tree fulllabel, Tree varname, Tree sig);
00090
00091
00092 };
00093 #define generateEquivRecGroup generateRecGroup
00094
00095
00096 void compileSignals (const string& name, const string& super, int numInputs, int numOutputs, Tree lsig);
00097
00098 #endif