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
18namespace srchilite {
19
20class StringDef;
21class StringDefs;
22class StateStartLangElem;
23
31// doublecpp: forward declarations, DO NOT MODIFY
32class HighlightState; // file: highlightstate.h
33class HighlightStateBuilder; // file: highlightstatebuilder.h
34class LangElemsPrinter; // file: langelemsprinter.h
35// doublecpp: end, DO NOT MODIFY
36
37class StateLangElem : public LangElem
38{
39 private:
40 StateStartLangElem *statestartlangelem;
41 LangElems *langelems;
42 bool state;
43
44public:
45 StateLangElem(const std::string &n, StateStartLangElem *start, LangElems *elems, bool st = false);
46
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
60public:
61virtual void dispatch_build(HighlightStateBuilder *, HighlightState * state);
62virtual 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
Represents a state during the highlighting (e.g., comment state, string state, etc....
Definition: highlightstate.h:47
Definition: langelem.h:24
Prints all the language elements.
Definition: langelemsprinter.h:27
collection of LangElem objects
Definition: langelems.h:34
a language element that introduces a new state pattern Composite
Definition: statelangelem.h:38
virtual const std::string toString() const
return the string representation (with preprocessing)
Definition: statelangelem.cpp:40
virtual const std::string toStringOriginal() const
return the original representation (without any preprocessing); this is useful for printing errors
Definition: statelangelem.cpp:49
A language element that may start a new state/environment.
Definition: statestartlangelem.h:25
C++ class: doctemplate.h.
Definition: bufferedoutput.cpp:13