Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxSadInterpreter.h

00001 /*
00002  *  Copyright (c) 1998, University of Amsterdam, The Netherlands.
00003  *  All rights reserved.
00004  *
00005  *
00006  *  Author(s):
00007  *  Dennis Koelma (koelma@wins.uva.nl)
00008  *  Edo Poll (poll@wins.uva.nl)
00009  */
00010 
00011 #ifndef HxSadInterpreter_h
00012 #define HxSadInterpreter_h
00013 
00014 #include "HxStd.h"
00015 
00016 #include "list"
00017 
00018 #include "HxSyntaxLeafNode.h"
00019 #include "HxSyntaxBranchNode.h"
00020 
00021 class HxScanner;
00022 
00023 class HxRegKey;
00024 class HxRegistry;
00025 
00026 class HxSadInterpreter
00027 {
00028 public:
00029     static HxSadInterpreter&    instance();
00030 
00031     void                        setRegistry(HxRegistry& registry);
00032 
00033     void                        argumentDefinition(HxSyntaxNode* argDef);
00034 
00035     void                        beginClass(
00036                                     HxSyntaxNode* head,
00037                                     HxSyntaxNode* storage,
00038                                     HxSyntaxNode* delegate);
00039     void                        endClass();
00040 
00041     void                        functionDeclaration(HxSyntaxNode* mfDecl);
00042 
00043     HxString                    thisClass() const;
00044 
00045     void                        beginMenu(HxSyntaxNode*);
00046     void                        endMenu(HxSyntaxNode*);
00047     void                        beginMenuItem(HxSyntaxNode*);
00048     void                        endMenuItem(HxSyntaxNode*);
00049 
00050 private:
00051                                 HxSadInterpreter();
00052                                 HxSadInterpreter(const HxSadInterpreter&);
00053 
00054     friend class HxSadInterpreterFriend;
00055 
00056     void                        reportError(int lineNr, HxString msg) const;
00057 
00058     HxScanner*                  _scanner;
00059 
00060     struct ClassInfo {
00061         int                     _inClass;
00062         HxString                _thisClass;
00063         HxString                _delegateClass;
00064         int                     _hasDelegate;
00065         int                     _isHeap;
00066     };
00067 
00068     ClassInfo                   _classInfo;
00069     HxRegistry*                 _registry;
00070     HxRegKey*                   _classesKey;
00071     HxRegKey*                   _methodsKey;
00072     HxRegKey*                   _functionsKey;
00073     HxRegKey*                   _thisClassKey;
00074     HxRegKey*                   _argumentsKey;
00075     HxRegKey*                   _menusKey;
00076 
00077     struct MenuFrame
00078     {
00079                                 MenuFrame();
00080                                 MenuFrame(HxString, HxRegKey*, int);
00081         HxString                label;
00082         HxRegKey*               key;
00083         int                     nItems;
00084     };
00085 
00086     typedef list<MenuFrame>                 MenuFrameList;
00087     typedef MenuFrameList::const_iterator   MenuFrameListConstIter;
00088 
00089     MenuFrameList               _menuStack;
00090     MenuFrame*                  _menuFrame;
00091 };
00092 
00093 inline HxString
00094 HxSadInterpreter::thisClass() const 
00095 { 
00096     return _classInfo._thisClass; 
00097 }
00098 
00099 inline
00100 HxSadInterpreter::MenuFrame::MenuFrame()
00101 {
00102 }
00103 
00104 inline
00105 HxSadInterpreter::MenuFrame::MenuFrame(HxString l, HxRegKey* k, int n)
00106     : label(l), key(k), nItems(n) 
00107 {
00108 }
00109 
00110 #endif

Generated on Tue Feb 3 14:18:41 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001