mediawiki-extensions-AbuseF.../parser_native/eval.cpp

25 lines
449 B
C++
Raw Normal View History

#include <cstdlib>
2008-08-05 08:24:21 +00:00
#include <iostream>
#include <string>
#include "filter_evaluator.h"
#include "request.h"
2008-08-05 08:24:21 +00:00
int main(int argc, char** argv)
{
afp::request r;
std::string result;
2008-08-05 08:24:21 +00:00
try {
if (!r.load(std::cin))
return 1;
2008-08-05 08:24:21 +00:00
result = r.evaluate();
} catch (afp::exception &excep) {
std::cout << "EXCEPTION: " << excep.what() << std::endl;
std::cerr << "EXCEPTION: " << excep.what() << std::endl;
2008-08-05 08:24:21 +00:00
}
std::cout << result << "\0";
2008-08-05 08:24:21 +00:00
}