Ken Domino

Results 839 comments of Ken Domino

Please add the test to the [examples/ directory](https://github.com/antlr/grammars-v4/tree/master/sql/tsql/examples). Every change to a grammar must have proof that the problem is fixed via the Github Actions tests for this repo.

This change does not work. It does not parse the example you provide. ``` $ ./bin/Debug/net8.0/Test.exe ../examples/4422.sql line 5:9 no viable alternative at input 'WITHabcdas(SELECT*FROMOPENQUERY' line 5:9 extraneous input 'OPENQUERY'...

> This modification works normally with me, and the version of the antlr plugin I am using is 1.23.1. Is there a problem with the plugin? My mistake. I was...

I believe the problem is that [simpleExpr](https://github.com/antlr/grammars-v4/blob/e6d1e0650c1058c3b55b8d8b8d8011c0d3910408/sql/mysql/Oracle/MySQLParser.g4#L2890-L2919) has a missing predicate at the choice between columnRef vs. literalOrNull. The double-quoted string should be allowed, but shunted through literalOrNull, not columnRef....

> And btw. ANSI_QUOTES should not be on by default. SQL modes are empty by default, in the server. It was turned on in the code with your initial commit....

I'm not sure what is happening quite yet, but I have traced it to where AdaptivePredict() has a bunch of choices, but somehow makes the "wrong" choice because there is...

I added predicates before the `columnRef` and `literalOrNull` alts, but I noticed that Antlr inserts some kind of action for alt 1. This causes the predicate for `columnRef` to not...

In fact, just swapping the 1st and 2nd alt allows the parse to work, too. ``` $ ./bin/Debug/net8.0/Test.exe in.txt -tree (queries (query (simpleStatement (selectStatement (queryExpression (queryExpressionBody (queryPrimary (querySpecification SELECT (selectItemList...

Let's hold off for this swap workaround so we can study why this action is inserted by Antlr. I removed the predicates I added in the workaround. There's only one...

Looks like I never added the file with example for calling a visitor. See the code below. VisitorInterp should in the example because the audience is one who wants to...