From 0a57ef44f778d2993d0c75493113d3b264bfeb3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 24 May 2007 13:09:23 +0000 Subject: [PATCH] CommonCheck: Common functions used while checking for mistakes --- CommonCheck.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 CommonCheck.cpp diff --git a/CommonCheck.cpp b/CommonCheck.cpp new file mode 100644 index 000000000..d90eb1ba0 --- /dev/null +++ b/CommonCheck.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include "CommonCheck.h" +#include "tokenize.h" +#include +#include +//--------------------------------------------------------------------------- + +std::string FileLine(TOKEN *tok) +{ + std::ostringstream ostr; + ostr << "[" << Files[tok->FileIndex] << ":" << tok->linenr << "]"; + return ostr.str(); +} +//--------------------------------------------------------------------------- + +void ReportErr(const std::string errmsg) +{ + std::cerr << errmsg << std::endl; +} +//--------------------------------------------------------------------------- +