Added support for null rules, works well.

This commit is contained in:
Nathan Braswell
2013-07-09 02:45:59 -04:00
parent 4c2fd967f0
commit 1c85e3693e
5 changed files with 90 additions and 38 deletions

View File

@@ -26,7 +26,7 @@ Symbol* Lexer::next() {
std::cout << "Current at is " << input.substr(currentPosition,input.length()-1) << " currentPos is " << currentPosition <<std::endl;
//If we're at the end, return an eof
if (currentPosition == input.length()-1)
return new Symbol("$EOF$", false);
return new Symbol("$EOF$", true);
int longestMatch = -1;
RegEx* longestRegEx = NULL;
std::string remainingString = input.substr(currentPosition,input.length()-1);