27 #include "parse_error.h"
33 #define snprintf _snprintf
38 ParseError::ParseError(
const ParseError& p)
45 ParseError::ParseError(
const std::string& exp,
int line,
int col)
52 ParseError::~ParseError() =
default;
54 std::ostream& operator<<( std::ostream& os,
const ParseError& p)
56 return ( os <<
"ParseError: Expected " << p.m_exp <<
" at line " << p.m_line
57 <<
", column " << p.m_col <<
"." << std::endl);
60 ParseError::operator std::string()
63 snprintf( buf, 1024,
"ParseError: Expected %s at line %d, column %d.",
64 m_exp.c_str(), m_line, m_col);
65 return std::string( buf);
68 ParseError::operator std::string()
const
71 snprintf( buf, 1024,
"ParseError: Expected %s at line %d, column %d.",
72 m_exp.c_str(), m_line, m_col);
73 return std::string( buf);