src-highlite.git - src-highlite

index : src-highlite.git
src-highlite
summary refs log tree commit diff
path: root/src/lib/namedsubexpslangelem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/namedsubexpslangelem.cpp')
-rw-r--r--src/lib/namedsubexpslangelem.cpp 47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/lib/namedsubexpslangelem.cpp b/src/lib/namedsubexpslangelem.cpp
new file mode 100644
index 0000000..c3a4201
--- /dev/null
+++ b/src/lib/namedsubexpslangelem.cpp
@@ -0,0 +1,47 @@
+//
+// C++ Interface: NamedSubExpsLangElem
+//
+// Description: represents a regular expression made by many marked groups
+// and each marked group represents a different language element
+//
+// Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#include "namedsubexpslangelem.h"
+#include "stringdef.h"
+#include "tostringcollection.h"
+
+using namespace std;
+
+NamedSubExpsLangElem::NamedSubExpsLangElem(const ElementNames *names, StringDef *def,
+ bool ex, bool al) :
+ StateStartLangElem("named subexps", ex, al), // "named subexps" is a bogus name
+ elementNames(names), regexpDef(def)
+{
+}
+
+NamedSubExpsLangElem::~NamedSubExpsLangElem() {
+ if (elementNames)
+ delete elementNames;
+ if (regexpDef)
+ delete regexpDef;
+}
+
+const std::string
+NamedSubExpsLangElem::toString() const
+{
+ string res = StateStartLangElem::toString() + " " + collectionToString(elementNames, ',') +
+ regexpDef->toString();
+ return res;
+}
+
+const std::string
+NamedSubExpsLangElem::toStringOriginal() const
+{
+ string res = StateStartLangElem::toString() + " " + collectionToString(elementNames, ',') +
+ regexpDef->toStringOriginal();
+ return res;
+}
generated by cgit v1.2.3 (git 2.39.1) at 2025年10月01日 00:31:37 +0000

AltStyle によって変換されたページ (->オリジナル) /