Source-highlight Library
statestartlangelem.h
1//
2// C++ Interface: statestartlangelem
3//
4// Description:
5//
6//
7// Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004
8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
12#ifndef STATESTARTLANGELEM_H
13#define STATESTARTLANGELEM_H
14
15#include "langelem.h"
16
17namespace srchilite {
18
19class StringDef;
20class StateLangElem;
21
26private:
28 unsigned int exit;
29
32
35
36public:
42 StateStartLangElem(const std::string &n, unsigned int exit = 0, bool all =
43 false);
44
45 virtual ~StateStartLangElem();
46
47 virtual const std::string toString() const;
48
54 void setExit(unsigned int level = 1) {
55 exit = level;
56 }
57
62 void setExitAll() {
63 exit_all = true;
64 }
65
69 bool exitAll() const {
70 return exit_all;
71 }
72
76 unsigned int getExit() const {
77 return exit;
78 }
79
84 return statelangelem;
85 }
86
92 statelangelem = s;
93 }
94};
95
96}
97
98#endif
Definition: langelem.h:24
a language element that introduces a new state pattern Composite
Definition: statelangelem.h:38
A language element that may start a new state/environment.
Definition: statestartlangelem.h:25
void setStateLangElem(StateLangElem *s)
Sets the state for which this element represents the start.
Definition: statestartlangelem.h:91
void setExit(unsigned int level=1)
Sets the "exit" property of this element (i.e., if the element is match then exit one state)
Definition: statestartlangelem.h:54
bool exit_all
whether to exit all states
Definition: statestartlangelem.h:31
unsigned int exit
the exit level
Definition: statestartlangelem.h:28
StateLangElem * getStateLangElem() const
Definition: statestartlangelem.h:83
void setExitAll()
Sets the "exit all" property of this element (i.e., if the element is match then exit all states and ...
Definition: statestartlangelem.h:62
bool exitAll() const
Definition: statestartlangelem.h:69
unsigned int getExit() const
Definition: statestartlangelem.h:76
StateLangElem * statelangelem
the possible State of which we represent the start.
Definition: statestartlangelem.h:34
virtual const std::string toString() const
return the string representation (with preprocessing)
Definition: statestartlangelem.cpp:33
C++ class: doctemplate.h.
Definition: bufferedoutput.cpp:13