Skip to content
Snippets Groups Projects
Commit 22f56113 authored by dgelessus's avatar dgelessus
Browse files

Detect unhandled cases in generated Parser switch blocks

parent 620fd6fd
No related branches found
No related tags found
No related merge requests found
......@@ -1800,6 +1800,8 @@ public class Parser implements IParser
push(goTo(64), list);
}
break;
default:
throw new ParserException(lastToken, "[" + lastToken.getLine() + "," + lastToken.getPos() + "] Internal parser error: invalid action table REDUCE destination " + destination + ", current state " + state());
}
break;
case ACCEPT:
......@@ -1813,6 +1815,9 @@ public class Parser implements IParser
throw new ParserException(lastToken,
"[" + lastToken.getLine() + "," + lastToken.getPos() + "] " ,
Parser.errorMessages[Parser.errors[destination]]);
default:
throw new ParserException(lastToken, "[" + lastToken.getLine() + "," + lastToken.getPos() + "] Internal parser error: invalid action table entry " + action + ", destination " + destination + ", current state " + state());
}
}
}
......
......@@ -208,6 +208,8 @@ Macro:ParserParseReduce
$
Macro:ParserParseTail
default:
throw new ParserException(lastToken, "[" + lastToken.getLine() + "," + lastToken.getPos() + "] Internal parser error: invalid action table REDUCE destination " + destination + ", current state " + state());
}
break;
case ACCEPT:
......@@ -221,6 +223,9 @@ Macro:ParserParseTail
throw new ParserException(lastToken,
"[" + lastToken.getLine() + "," + lastToken.getPos() + "] " ,
Parser.errorMessages[Parser.errors[destination]]);
default:
throw new ParserException(lastToken, "[" + lastToken.getLine() + "," + lastToken.getPos() + "] Internal parser error: invalid action table entry " + action + ", destination " + destination + ", current state " + state());
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment