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
Using Tsql, and Version 4.12.0 of the Antlr tool, generate a parser and lexer for both CSharp and Cpp targets. Then, look at the generated TsqlParser files.
In a generated table of Cpp target TsqlParser.cpp auto staticData = std::make_unique<TSqlParserStaticData>( and that in C# PlsqlParser.cs _LiteralNames, the very last entry in the string table "literalNames" for C# is '?', but it is '\\u003F' for the C++ code. U+003F is the Unicode for the ?-character. There is no string literal '\\u003F' in the lexer or parser grammar, just '?', here.
The strings literals should be identical across all targets, and identical to the string literal in the grammar. This is necessary if error messages that occur of a parse are to remain identical. In my opinion, the generated C++ code is wrong.
Does this difference have something to do with something with fragment rules?
The text was updated successfully, but these errors were encountered:
kaby76
changed the title
Cpp and other targets differ in string values from grammar
Cpp contains string literals that are not identical in grammar
Feb 23, 2023
Using Tsql, and Version 4.12.0 of the Antlr tool, generate a parser and lexer for both CSharp and Cpp targets. Then, look at the generated TsqlParser files.
In a generated table of Cpp target TsqlParser.cpp
auto staticData = std::make_unique<TSqlParserStaticData>(
and that in C# PlsqlParser.cs_LiteralNames
, the very last entry in the string table "literalNames" for C# is'?'
, but it is'\\u003F'
for the C++ code.U+003F
is the Unicode for the?
-character. There is no string literal'\\u003F'
in the lexer or parser grammar, just'?'
, here.The strings literals should be identical across all targets, and identical to the string literal in the grammar. This is necessary if error messages that occur of a parse are to remain identical. In my opinion, the generated C++ code is wrong.
Does this difference have something to do with something with
fragment
rules?The text was updated successfully, but these errors were encountered: