Source-highlight Library
/home/bettini/work/source-highlight/src-highlite/lib/srchilite/namedsubexpslangelem.h
00001 //
00002 // C++ Interface: NamedSubExpsLangElem
00003 //
00004 // Description: represents a regular expression made by many marked groups
00005 // and each marked group represents a different language element
00006 //
00007 // Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2007-2009
00008 //
00009 // Copyright: See COPYING file that comes with this distribution
00010 //
00011 //
00012 
00013 #ifndef NAMEDSUBEXPSLANGELEM_H_
00014 #define NAMEDSUBEXPSLANGELEM_H_
00015 
00016 #include "statestartlangelem.h"
00017 
00018 #include <list>
00019 
00020 namespace srchilite {
00021 
00022 class StringDef;
00023 
00025 typedef std::list<std::string> ElementNames;
00026 
00032 // doublecpp: forward declarations, DO NOT MODIFY
00033 class HighlightState; // file: highlightstate.h
00034 class HighlightStateBuilder; // file: highlightstatebuilder.h
00035 class LangElemsPrinter; // file: langelemsprinter.h
00036 // doublecpp: end, DO NOT MODIFY
00037 
00038 class NamedSubExpsLangElem : public StateStartLangElem
00039 {
00041     const ElementNames *elementNames;
00042 
00044     StringDef *regexpDef;
00045 public:
00052         NamedSubExpsLangElem(const ElementNames *names, StringDef *def, bool exit = false, bool all = false);
00053         virtual ~NamedSubExpsLangElem();
00054 
00058     virtual const std::string toString() const;
00059 
00064     virtual const std::string toStringOriginal() const;
00065 
00069     const ElementNames *getElementNames() const { return elementNames; }
00070 
00074     const StringDef *getRegexpDef() const { return regexpDef; }
00075 
00076 // doublecpp: dispatch methods, DO NOT MODIFY
00077 public:
00078 virtual void dispatch_build(HighlightStateBuilder *, HighlightState * state);
00079 virtual void dispatch_collect_const(LangElemsPrinter *);
00080 // doublecpp: end, DO NOT MODIFY
00081 };
00082 
00083 }
00084 
00085 #endif /*NAMEDSUBEXPSLANGELEM_H_*/