#include "Constants.h" #include namespace Databoard { void printout(pANTLR3_BASE_TREE type) { std::cout << type->getText(type)->chars << " : " << type->getType(type) << std::endl; } std::string removeQuotes(std::string str) { if(str.length() > 0) { if(str.at(0) == '"') { str = str.substr(1, str.length()-1); } } if(str.length() > 0) { if(str.at(str.length()-1) == '"') { str = str.substr(0, str.length()-1); } } return str; } bool strEquals(const char* a, const char* b) { while(*a != '\0' && *b != '\0') { char c1 = *a; char c2 = *b; if(c1 >= 'a' && c1 <= 'z') { c1 += 'A'-'a'; } if(c2 >= 'a' && c2 <= 'z') { c2 += 'A'-'a'; } if(c1 != c2) { return false; } ++a; ++b; } if((*a == *b) && (*a == 0)) { return true; } else { return false; } } }