Null rules work in RNGLR now, but there seems to be a bug where somehow some states/rules get no lookahead.
This commit is contained in:
@@ -23,9 +23,9 @@ void Lexer::addRegEx(std::string regExString) {
|
||||
}
|
||||
|
||||
Symbol* Lexer::next() {
|
||||
std::cout << "Current at is \"" << input.substr(currentPosition,input.length()-1) << "\" currentPos is " << currentPosition <<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)
|
||||
if (currentPosition >= input.length()-1)
|
||||
return new Symbol("$EOF$", true);
|
||||
int longestMatch = -1;
|
||||
RegEx* longestRegEx = NULL;
|
||||
@@ -44,7 +44,7 @@ Symbol* Lexer::next() {
|
||||
return new Symbol(longestRegEx->getPattern(), true);
|
||||
} else {
|
||||
std::cout << "Found no applicable regex" << std::endl;
|
||||
std::cout << "Remaining is " << input.substr(currentPosition,input.length()-1) << std::endl;
|
||||
return new Symbol("$NO_APPLICABLE_REGEX$", true);
|
||||
std::cout << "Remaining is ||" << input.substr(currentPosition,input.length()-1) << "||" << std::endl;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user