You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ScyllaDB project uses Antlr3 with the C++ runtime.
In scylladb/scylladb#1703 it was noted that ugly error messages are reported. Particularly strange is:
line 1:20 missing K_VIEW at '<missing '
Forget for a moment why ScyllaDB even tries to print this token (it shouldn't!) but the fact that any token is being printed as <missing appears to be a simple Antlr3 bug:
/usr/include/antlr3parser.inl has in Parser<ImplTraits>::getMissingSymbol() the following code:
// Create the token text that shows it has been inserted//
token->setText("<missing ");
text = token->getText();
if (!text.empty())
{
text.append((constchar *) this->get_rec()->get_state()->get_tokenName(expectedTokenType) );
text.append(">");
}
Note how this code modifies the variable "text", which is a copy of the text in the token, and not the text in the token... Unfortunately, this isn't Java - when getText() returns a string (see /usr/include/antlr3commontoken.hpp) it is a copy, not a reference, and modifying it doesn't modify the token object.
Correct code would probably look something like this (untested):
The ScyllaDB project uses Antlr3 with the C++ runtime.
In scylladb/scylladb#1703 it was noted that ugly error messages are reported. Particularly strange is:
Forget for a moment why ScyllaDB even tries to print this token (it shouldn't!) but the fact that any token is being printed as
<missing
appears to be a simple Antlr3 bug:/usr/include/antlr3parser.inl has in
Parser<ImplTraits>::getMissingSymbol()
the following code:Note how this code modifies the variable "text", which is a copy of the text in the token, and not the text in the token... Unfortunately, this isn't Java - when getText() returns a string (see /usr/include/antlr3commontoken.hpp) it is a copy, not a reference, and modifying it doesn't modify the token object.
Correct code would probably look something like this (untested):
The text was updated successfully, but these errors were encountered: