In progress

This commit is contained in:
Nathan Braswell
2013-08-16 00:03:26 -04:00
parent d21f521266
commit 2eaf640855
10 changed files with 137 additions and 76 deletions

View File

@@ -23,7 +23,7 @@ void Lexer::addRegEx(std::string regExString) {
}
Symbol* Lexer::next() {
std::cout << "Current at is \"" << input.substr(currentPosition,input.length()-1) << "\" currentPos is " << currentPosition << " out of " << input.length() <<std::endl;
//std::cout << "Current at is \"" << input.substr(currentPosition,input.length()-1) << "\" currentPos is " << currentPosition << " out of " << input.length() <<std::endl;
//If we're at the end, return an eof
if (currentPosition >= input.length()-1)
return new Symbol("$EOF$", true);
@@ -44,8 +44,8 @@ Symbol* Lexer::next() {
//std::cout << "Current at is \"" << input.substr(currentPosition,input.length()-1) << "\" currentPos is " << currentPosition <<std::endl;
return new Symbol(longestRegEx->getPattern(), true, eatenString);
} else {
std::cout << "Found no applicable regex" << std::endl;
std::cout << "Remaining is ||" << input.substr(currentPosition,input.length()-1) << "||" << std::endl;
//std::cout << "Found no applicable regex" << std::endl;
//std::cout << "Remaining is ||" << input.substr(currentPosition,input.length()-1) << "||" << std::endl;
return NULL;
}
}