Source-highlight Library
delimitedlangelem.h
1 //
2 // C++ Interface: delimitedlangelem
3 //
4 // Description:
5 //
6 //
7 // Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004-2009
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12 #ifndef DELIMITEDLANGELEM_H
13 #define DELIMITEDLANGELEM_H
14 
15 #include "statestartlangelem.h"
16 
17 namespace srchilite {
18 
19 class StringDef;
20 
26 // doublecpp: forward declarations, DO NOT MODIFY
27 class HighlightState; // file: highlightstate.h
28 class HighlightStateBuilder; // file: highlightstatebuilder.h
29 // doublecpp: end, DO NOT MODIFY
30 
32 {
33 private:
34  StringDef *start;
35  StringDef *end;
36  StringDef *escape;
37  bool multiline;
38  bool nested;
39 
40 public:
49  DelimitedLangElem(const std::string &n, StringDef *s, StringDef *e,
50  StringDef *es, bool multi, bool nes);
51 
53 
58  virtual const std::string toString() const;
59 
65  virtual const std::string toStringOriginal() const;
66 
70  StringDef *getStart() const {
71  return start;
72  }
73 
77  StringDef *getEnd() const {
78  return end;
79  }
80 
84  StringDef *getEscape() const {
85  return escape;
86  }
87 
91  bool isMultiline() const {
92  return multiline;
93  }
94 
98  bool isNested() const {
99  return nested;
100  }
101 // doublecpp: dispatch methods, DO NOT MODIFY
102 public:
103 virtual void dispatch_build(HighlightStateBuilder *, HighlightState * state);
104 // doublecpp: end, DO NOT MODIFY
105 };
106 
107 }
108 
109 #endif
Builds an HighlightState from the language definition file collected structures.
Definition: highlightstatebuilder.h:22
bool isMultiline() const
Definition: delimitedlangelem.h:91
represent a string for a language definition file's element
Definition: stringdef.h:25
Definition: delimitedlangelem.h:31
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
bool isNested() const
Definition: delimitedlangelem.h:98
DelimitedLangElem(const std::string &n, StringDef *s, StringDef *e, StringDef *es, bool multi, bool nes)
StringDef * getEnd() const
Definition: delimitedlangelem.h:77
virtual const std::string toStringOriginal() const
return the original representation (without any preprocessing); this is useful for printing errors ...
StringDef * getEscape() const
Definition: delimitedlangelem.h:84
StringDef * getStart() const
Definition: delimitedlangelem.h:70
virtual const std::string toString() const
return the string representation (with preprocessing)