Source-highlight Library
/home/bettini/work/source-highlight/src-highlite/lib/srchilite/langelems.h
00001 //
00002 // Author: Lorenzo Bettini, (C) 1999-2009
00003 //
00004 // Copyright: See COPYING file that comes with this distribution
00005 //
00006 //
00007 #ifndef LANGELEMS_H
00008 #define LANGELEMS_H
00009 
00010 #include "langelem.h"
00011 
00012 #include <list>
00013 #include <map>
00014 #include <string>
00015 
00016 using std::list;
00017 using std::map;
00018 using std::string;
00019 
00020 namespace srchilite {
00021 
00023 typedef list<LangElem *> LangElemsBase;
00024 
00029 // doublecpp: forward declarations, DO NOT MODIFY
00030 class LangElemsPrinter; // file: langelemsprinter.h
00031 // doublecpp: end, DO NOT MODIFY
00032 
00033 class LangElems : protected list<LangElem *>
00034 {
00035   typedef LangElemsBase base;
00036   typedef base::iterator Pointer;
00037   typedef list<Pointer> PointerList;
00038   typedef map<string, PointerList> ElemMap;
00039 
00040   ElemMap elem_map;
00041 
00042   public:
00043     using base::const_iterator;
00044     using base::begin;
00045     using base::end;
00046     using base::size;
00047 
00048     LangElems();
00049 
00050     virtual ~LangElems();
00051 
00056     void add(LangElem *el);
00057 
00063     void redef(LangElem *el);
00064 
00070     void subst(LangElem *el);
00071 
00076     const std::string toString() const;
00077 
00083     const std::string toStringOriginal() const;
00084 // doublecpp: dispatch methods, DO NOT MODIFY
00085 public:
00086 virtual void dispatch_collect_const(LangElemsPrinter *);
00087 // doublecpp: end, DO NOT MODIFY
00088 };
00089 
00090 }
00091 
00092 #endif