src-highlite.git - src-highlite

index : src-highlite.git
src-highlite
summary refs log tree commit diff
path: root/src/regexpstate.cpp
diff options
context:
space:
mode:
authorLorenzo Bettini <bettini@dsi.unifi.it>2007年06月08日 10:11:29 +0000
committerLorenzo Bettini <bettini@dsi.unifi.it>2007年06月08日 10:11:29 +0000
commite9ea18fdc4f4f57b9ab8c9a4c6c182b0a1919b07 (patch)
tree92186c3de0146a0fa595e64b6a6aca1417078c0b /src/regexpstate.cpp
parent6fcee8f6e2f2212855b5b3e3ea5db76dc5d48cc3 (diff)
downloadsrc-highlite-e9ea18fdc4f4f57b9ab8c9a4c6c182b0a1919b07.tar.gz
release 2.7rel_2_7
Diffstat (limited to 'src/regexpstate.cpp')
-rw-r--r--src/regexpstate.cpp 83
1 files changed, 0 insertions, 83 deletions
diff --git a/src/regexpstate.cpp b/src/regexpstate.cpp
deleted file mode 100644
index 997db08..0000000
--- a/src/regexpstate.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// C++ Implementation: %{MODULE}
-//
-// Description:
-//
-//
-// Author: %{AUTHOR} <%{EMAIL}>, (C) %{YEAR}
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
-#include "regexpstate.h"
-
-#include "keys.h"
-#include "messages.h"
-
-#include <stdlib.h>
-
-using namespace std;
-
-int RegExpState::global_id = 1;
-
-RegExpFormatter::RegExpFormatter(const string &el, RegExpStatePtr r, int exit, bool all) :
- elem(el), exit_state_level(exit), exit_all(all), next_state(r)
-{
-}
-
-void RegExpFormatter::setNextState(RegExpStatePtr r)
-{
- next_state_strong = r;
-}
-
-RegExpStatePtr RegExpFormatter::getNextState() const
-{
- RegExpStatePtr next = next_state.lock();
- if (!next)
- return next_state_strong;
-
- return next;
-}
-
-/**
- * Return the formatter associated to the passed index.
- * If the index is negative, it returns the default formatter.
- * @param index
- * @return
- */
-const string &
-RegExpState::get_elem(int index)
-{
- return formatters[(index<0 ? 0 : index)]->elem;
-}
-
-void
-RegExpState::add_exp(const std::string &s, ParserInfo *parserInfo, RegExpFormatterPtr f)
-{
- const string &ex = buffer.str();
- if (ex.size())
- buffer << "|";
-
- buffer << s;
-
- formatters.push_back(f);
- subExpressions.push_back(make_pair(s, *parserInfo));
-}
-
-void
-RegExpState::freeze()
-{
- const string &buffered = buffer.str();
- try {
- reg_exp.assign(buffered);
- } catch (boost::bad_expression &e) {
- printError("bad expression: " + buffered);
- throw;
- }
-}
-
-void
-RegExpState::set_default_formatter(RegExpFormatterPtr f)
-{
- formatters[0] = f;
-}
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月17日 08:09:22 +0000

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