Adds variable TX and action "capture".

This commit is contained in:
Felipe Zimmerle
2015-08-05 10:07:47 -03:00
parent be4a0cb41c
commit 4f47651a6f
34 changed files with 338 additions and 30 deletions

View File

@@ -20,6 +20,7 @@
#include <iterator>
#include <sstream>
#include <vector>
#include <list>
#include "operators/operator.h"
#include "utils/acmp.h"
@@ -68,7 +69,7 @@ bool Pm::evaluate(Assay *assay, const std::string &input) {
rc = acmp_process_quick(&pt, &match, input.c_str(), input.length());
if (rc == 1) {
// save into tx, etc...
this->matched.push_back(std::string(match));
}
return rc == 1;

View File

@@ -17,6 +17,7 @@
#define SRC_OPERATORS_PM_H_
#include <string>
#include <list>
#include "operators/operator.h"
#include "utils/acmp.h"
@@ -40,6 +41,7 @@ class Pm : public Operator {
virtual bool init(const char **error);
void postOrderTraversal(acmp_btree_node_t *node);
std::list<std::string> matched;
protected:
ACMP *m_p;
};

View File

@@ -16,6 +16,7 @@
#include "operators/rx.h"
#include <string>
#include <list>
#include "operators/operator.h"
@@ -27,6 +28,7 @@ bool Rx::evaluate(Assay *assay, const std::string& input) {
SMatch match;
if (regex_search(input, &match, m_re) && match.size() >= 1) {
this->matched.push_back(match.match);
return true;
}

View File

@@ -17,6 +17,7 @@
#define SRC_OPERATORS_RX_H_
#include <string>
#include <list>
#include "operators/operator.h"
#include "utils/regex.h"
@@ -38,6 +39,8 @@ class Rx : public Operator {
m_re(param) { }
bool evaluate(Assay *assay, const std::string &input);
std::list<std::string> matched;
private:
Regex m_re;
};