This patch makes the lexer throw an exception when an unexpected token is encountered, as opposed to the standard behavior of just printing it out and doing nothing.
Patch: Adam Simpkins
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@
1159733 13f79535-47bb-0310-9956-
ffa450edef68
exit(1);
}
+void unexpected_token(char* text) {
+ yyerror("Unexpected token in input: \"%s\"\n", text);
+ exit(1);
+}
+
%}
/**
}
}
+. {
+ unexpected_token(yytext);
+}
+
. {
/* Catch-all to let us catch "*" in the parser. */