Adds support to BodyLimitAction and support for parser errors

This commit is contained in:
Felipe Zimmerle
2015-07-22 20:55:17 -03:00
parent 30b2624ec5
commit 261ee9f115
8 changed files with 337 additions and 23 deletions

View File

@@ -74,8 +74,7 @@ int Driver::parse(const std::string &f) {
int res = parser.parse();
if (this->audit_log->init() == false)
{
if (this->audit_log->init() == false) {
return false;
}
@@ -98,11 +97,18 @@ int Driver::parseFile(const std::string &f) {
}
void Driver::error(const yy::location& l, const std::string& m) {
std::cerr << l << ": " << m << std::endl;
void Driver::error(const yy::location& l, const std::string& m,
const std::string& c) {
if (parserError.tellp() == 0) {
parserError << "Parser error, ";
parserError << "Filename: " << file << ". ";
parserError << "Line: " << l.end.line << ". ";
parserError << "Column: " << l.end.column << ". ";
}
parserError << c;
}
void Driver::error(const std::string& m) {
std::cerr << m << std::endl;
void Driver::parser_error(const yy::location& l, const std::string& m) {
parserError << ". " << m << "." << std::endl;
}