Source-highlight Library
namedsubexpslangelem.h
1 //
2 // C++ Interface: NamedSubExpsLangElem
3 //
4 // Description: represents a regular expression made by many marked groups
5 // and each marked group represents a different language element
6 //
7 // Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2007-2009
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12 
13 #ifndef NAMEDSUBEXPSLANGELEM_H_
14 #define NAMEDSUBEXPSLANGELEM_H_
15 
16 #include "statestartlangelem.h"
17 
18 #include <list>
19 
20 namespace srchilite {
21 
22 class StringDef;
23 
25 typedef std::list<std::string> ElementNames;
26 
32 // doublecpp: forward declarations, DO NOT MODIFY
33 class HighlightState; // file: highlightstate.h
34 class HighlightStateBuilder; // file: highlightstatebuilder.h
35 class LangElemsPrinter; // file: langelemsprinter.h
36 // doublecpp: end, DO NOT MODIFY
37 
39 {
41  const ElementNames *elementNames;
42 
45 public:
52  NamedSubExpsLangElem(const ElementNames *names, StringDef *def, bool exit = false, bool all = false);
53  virtual ~NamedSubExpsLangElem();
54 
58  virtual const std::string toString() const;
59 
64  virtual const std::string toStringOriginal() const;
65 
69  const ElementNames *getElementNames() const { return elementNames; }
70 
74  const StringDef *getRegexpDef() const { return regexpDef; }
75 
76 // doublecpp: dispatch methods, DO NOT MODIFY
77 public:
78 virtual void dispatch_build(HighlightStateBuilder *, HighlightState * state);
79 virtual void dispatch_collect_const(LangElemsPrinter *);
80 // doublecpp: end, DO NOT MODIFY
81 };
82 
83 }
84 
85 #endif /*NAMEDSUBEXPSLANGELEM_H_*/
Builds an HighlightState from the language definition file collected structures.
Definition: highlightstatebuilder.h:22
NamedSubExpsLangElem(const ElementNames *names, StringDef *def, bool exit=false, bool all=false)
const StringDef * getRegexpDef() const
Definition: namedsubexpslangelem.h:74
std::list< std::string > ElementNames
collection of element names
Definition: namedsubexpslangelem.h:22
StringDef * regexpDef
the whole regular expression defiition
Definition: namedsubexpslangelem.h:44
const ElementNames * getElementNames() const
Definition: namedsubexpslangelem.h:69
unsigned int exit
the exit level
Definition: highlightstatebuilder.cpp:28
represent a string for a language definition file's element
Definition: stringdef.h:25
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 toString() const
const ElementNames * elementNames
the element names
Definition: namedsubexpslangelem.h:41
virtual const std::string toStringOriginal() const
Prints all the language elements.
Definition: langelemsprinter.h:26
An element with subparts (subexpressions), each with a possible different name.
Definition: namedsubexpslangelem.h:38