00001
00002
00003
00004
00005
00006
00007 #ifndef LANGELEM_H
00008 #define LANGELEM_H
00009
00010 #include "parserinfo.h"
00011
00012 namespace srchilite {
00013
00017
00018 class HighlightState;
00019 class HighlightStateBuilder;
00020 class LangElemsPrinter;
00021
00022
00023 class LangElem : public ParserInfo
00024 {
00025 private:
00027 const std::string name;
00029 bool redef;
00030
00031 bool subst;
00032
00033 public:
00034 LangElem(const std::string &n) :
00035 name(n), redef(false), subst(false) {
00036 }
00037
00038 virtual ~LangElem() {
00039 }
00040
00041 const std::string getName() const {
00042 return name;
00043 }
00044
00049 virtual const std::string toString() const {
00050 return name;
00051 }
00052
00058 virtual const std::string toStringOriginal() const = 0;
00059
00060 bool isRedef() const {
00061 return redef;
00062 }
00063 void setRedef() {
00064 redef = true;
00065 }
00066 bool isSubst() const {
00067 return subst;
00068 }
00069 void setSubst() {
00070 subst = true;
00071 }
00072
00076 const std::string toStringParserInfo() const;
00077
00078
00079 public:
00080 virtual void dispatch_build(HighlightStateBuilder *, HighlightState * state);
00081 virtual void dispatch_collect_const(LangElemsPrinter *);
00082
00083 };
00084
00085 }
00086
00087 #endif