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
20namespace srchilite {
21
22class StringDef;
23
25typedef std::list<std::string> ElementNames;
26
32// doublecpp: forward declarations, DO NOT MODIFY
33class HighlightState; // file: highlightstate.h
34class HighlightStateBuilder; // file: highlightstatebuilder.h
35class LangElemsPrinter; // file: langelemsprinter.h
36// doublecpp: end, DO NOT MODIFY
37
39{
42
45public:
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
77public:
78virtual void dispatch_build(HighlightStateBuilder *, HighlightState * state);
79virtual 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
Represents a state during the highlighting (e.g., comment state, string state, etc....
Definition: highlightstate.h:47
Prints all the language elements.
Definition: langelemsprinter.h:27
An element with subparts (subexpressions), each with a possible different name.
Definition: namedsubexpslangelem.h:39
const ElementNames * elementNames
the element names
Definition: namedsubexpslangelem.h:41
const StringDef * getRegexpDef() const
Definition: namedsubexpslangelem.h:74
const ElementNames * getElementNames() const
Definition: namedsubexpslangelem.h:69
StringDef * regexpDef
the whole regular expression defiition
Definition: namedsubexpslangelem.h:44
virtual const std::string toStringOriginal() const
Definition: namedsubexpslangelem.cpp:48
virtual const std::string toString() const
Definition: namedsubexpslangelem.cpp:40
A language element that may start a new state/environment.
Definition: statestartlangelem.h:25
unsigned int exit
the exit level
Definition: statestartlangelem.h:28
represent a string for a language definition file's element
Definition: stringdef.h:25
C++ class: doctemplate.h.
Definition: bufferedoutput.cpp:13
std::list< std::string > ElementNames
collection of element names
Definition: namedsubexpslangelem.h:25