Source-highlight Library
statelangelem.h
1 //
2 // C++ Interface: %{MODULE}
3 //
4 // Description:
5 //
6 //
7 // Author: %{AUTHOR} <%{EMAIL}>, (C) %{YEAR}
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12 #ifndef STATELANGELEM_H
13 #define STATELANGELEM_H
14 
15 #include "statestartlangelem.h"
16 #include "langelems.h"
17 
18 namespace srchilite {
19 
20 class StringDef;
21 class StringDefs;
22 class StateStartLangElem;
23 
31 // doublecpp: forward declarations, DO NOT MODIFY
32 class HighlightState; // file: highlightstate.h
33 class HighlightStateBuilder; // file: highlightstatebuilder.h
34 class LangElemsPrinter; // file: langelemsprinter.h
35 // doublecpp: end, DO NOT MODIFY
36 
37 class StateLangElem : public LangElem
38 {
39  private:
40  StateStartLangElem *statestartlangelem;
41  LangElems *langelems;
42  bool state;
43 
44 public:
45  StateLangElem(const std::string &n, StateStartLangElem *start, LangElems *elems, bool st = false);
46 
47  ~StateLangElem();
48 
49  void set_elems(LangElems *elems) { langelems = elems; }
50  void set_state() { state = true; }
51 
52  virtual const std::string toString() const;
53 
54  virtual const std::string toStringOriginal() const;
55 
56  StateStartLangElem *getStateStart() const { return statestartlangelem; }
57  bool isState() const { return state; }
58  LangElems *getElems() const { return langelems; }
59 // doublecpp: dispatch methods, DO NOT MODIFY
60 public:
61 virtual void dispatch_build(HighlightStateBuilder *, HighlightState * state);
62 virtual void dispatch_collect_const(LangElemsPrinter *);
63 // doublecpp: end, DO NOT MODIFY
64 };
65 
66 }
67 
68 #endif
Builds an HighlightState from the language definition file collected structures.
Definition: highlightstatebuilder.h:22
Definition: langelem.h:23
collection of LangElem objects
Definition: langelems.h:33
Represents a state during the highlighting (e.g., comment state, string state, etc.)
Definition: highlightstate.h:47
C++ class: doctemplate.h.
Definition: bufferedoutput.cpp:13
A language element that may start a new state/environment.
Definition: statestartlangelem.h:25
virtual const std::string toStringOriginal() const
return the original representation (without any preprocessing); this is useful for printing errors ...
virtual const std::string toString() const
return the string representation (with preprocessing)
a language element that introduces a new state pattern Composite
Definition: statelangelem.h:37
Prints all the language elements.
Definition: langelemsprinter.h:26