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
I'm surprised you didn't find more ambiguities. The language itself is ambiguous, and I did my best to resolve it.
Yes, the grammar has a bit of ambiguity. The information I gave are the ambiguous parse trees for one specific decision in the DFA. But, there are others, including these rules.
This information is computed via ls *.sql | trperf -x -c ar | grep -v '^0' | awk '{print $2}' | sort -u on every commit to the repo. The -c option is used to set what to display. Here, 'a' of 'ar' means the # of ambiguities, and 'r' of 'ar' the rule name, all values for a particular decision state in the DFA.
trparse --ambig constructs all possible ambiguity trees, for every decision state that is ambiguous. It fails if there are just too many trees to compute, as in the case with trparse --ambig bitrix_queries_cut.sql. Instead, I try to first pick a decision state with a low ambiguity, and then display the tree for that decision. The issue is that some input hit the same problem over and over. See how I apply it in this comment.
I haven't really checkout out SLL fallback problems. It turns out to be a huge problem with the PostgreSQL grammar. Antlr can have its issues.
I've ported the sql/mysql/Oracle grammar to CSharp. I found that the grammar is ambiguous.
(The main reason I did the CSharp port was to check for ambiguities in this grammar. All tools in Trash are in C#.)
Another example comes from the MySQL Reference manual https://dev.mysql.com/doc/refman/8.4/en/select.html.
Ambiguity is a problem because it causes performance issues for Antlr4.
The text was updated successfully, but these errors were encountered: