Skip to content
Snippets Groups Projects
Commit a5caefd0 authored by Jonathan Guinet's avatar Jonathan Guinet
Browse files

ENH: add debug output in otbParser

parent 6e5a471c
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@
#include "otbMath.h"
#include "itkMacro.h"
#include "otbParser.h"
#include "otbMacro.h"
namespace otb
{
......@@ -114,7 +115,7 @@ bool Parser::CheckExpr()
}
catch(ParserType::ExceptionType &e)
{
ExceptionHandler(e);
ExceptionHandlerDebug(e);
return false;
}
......@@ -140,6 +141,20 @@ void Parser::ExceptionHandler(ParserType::ExceptionType &e)
}
void Parser::ExceptionHandlerDebug(ParserType::ExceptionType &e)
{
otbGenericMsgDebugMacro( << std::endl
<< "Message: " << e.GetMsg() << std::endl
<< "Formula: " << e.GetExpr() << std::endl
<< "Token: " << e.GetToken() << std::endl
<< "Position: " << e.GetPos() << std::endl
<< std::endl);
// << "Errc: " << e.GetCode() << std::endl);
}
// Get the map with the variables
const std::map<std::string, Parser::ValueType*>& Parser::GetVar() const
{
......
......@@ -83,7 +83,8 @@ public:
/** Convert parser specific exception into itk exception */
virtual void ExceptionHandler(ExceptionType &e);
/** Convert parser specific exception into itk debug macro */
virtual void ExceptionHandlerDebug(ExceptionType &e);
protected:
Parser();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment