2008-08-08 12:35:13 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2008 Andrew Garrett.
|
|
|
|
* Copyright (c) 2008 River Tarnell <river@wikimedia.org>
|
|
|
|
* Derived from public domain code contributed by Victor Vasiliev.
|
|
|
|
*
|
|
|
|
* Permission is granted to anyone to use this software for any purpose,
|
|
|
|
* including commercial applications, and to alter it and redistribute it
|
|
|
|
* freely. This software is provided 'as-is', without any express or
|
|
|
|
* implied warranty.
|
|
|
|
*/
|
|
|
|
|
2008-08-07 14:35:45 +00:00
|
|
|
#include <cstdlib>
|
2008-08-05 08:24:21 +00:00
|
|
|
#include <iostream>
|
|
|
|
#include <string>
|
|
|
|
|
2008-08-08 00:01:22 +00:00
|
|
|
#include "filter_evaluator.h"
|
|
|
|
#include "request.h"
|
2008-08-05 08:24:21 +00:00
|
|
|
|
2008-08-08 03:23:34 +00:00
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
|
|
|
afp::request r;
|
|
|
|
std::string result;
|
2008-08-05 08:24:21 +00:00
|
|
|
|
|
|
|
try {
|
2008-08-08 00:01:22 +00:00
|
|
|
if (!r.load(std::cin))
|
|
|
|
return 1;
|
2008-08-05 08:24:21 +00:00
|
|
|
|
2008-08-08 00:01:22 +00:00
|
|
|
result = r.evaluate();
|
2008-08-08 03:23:34 +00:00
|
|
|
} 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
|
|
|
}
|
|
|
|
|
2008-08-08 03:23:34 +00:00
|
|
|
std::cout << result << "\0";
|
2008-08-05 08:24:21 +00:00
|
|
|
}
|