FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Resolve parser choice conflicts by adjusting lookahead in index-related rules by minleejae · Pull Request #2217 · JSQLParser/JSqlParser · GitHub

Resolve parser choice conflicts by adjusting lookahead in index-related rules - #2217

Merged
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:fix/index
Apr 8, 2025
Merged

Resolve parser choice conflicts by adjusting lookahead in index-related rules#2217
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:fix/index

Conversation

Copy link
Copy Markdown
Contributor

Hi @manticore-projects,

This PR addresses multiple parser choice conflicts by increasing the LOOKAHEAD values in the index-related grammar rules.

✅ Resolved Warnings:
The following conflicts have been resolved:

Warning: Choice conflict in (...)* construct at line 7661, column 5.
         Expansion nested within construct and expansion following construct
         have common prefixes, one of which is: "WITH"
         Consider using a lookahead of 2 or more for nested expansion.
Warning: Choice conflict involving two expansions at
         line 7860, column 17 and line 7888, column 17 respectively.
         A common prefix is: "SPATIAL" "COMMENT"
         Consider using a lookahead of 3 or more for earlier expansion.

⚠️ Remaining Warnings:
However, the following two warnings still remain:

Warning: Choice conflict in [...] construct at line 7863, column 19.
         Expansion nested within construct and expansion following construct
         have common prefixes, one of which is: "INDEX"
         Consider using a lookahead of 2 or more for nested expansion.
Warning: Choice conflict in [...] construct at line 8363, column 9.
         Expansion nested within construct and expansion following construct
         have common prefixes, one of which is: "WITH"
         Consider using a lookahead of 2 or more for nested expansion.

From what I can tell, these may stem from ambiguities involving Identifier vs keyword-based starts (INDEX, WITH, etc.). I suspect a deeper refactoring of how Identifier and keyword lookahead are handled might be needed.

If there’s a better pattern or common best practice to resolve such nested choice conflicts (especially those involving Identifier vs keyword lookahead), I’d appreciate your advice before going further.

Thanks!

manticore-projects merged commit f77825f into JSQLParser:master Apr 8, 2025
manticore-projects added a commit that referenced this pull request Apr 8, 2025
- completes #2217

Signed-off-by: Andreas Reichel <andreas@manticore-projects.com>

Copy link
Copy Markdown
Contributor

Thanks, I have completed the rest.
Cheers!

Copy link
Copy Markdown
Contributor Author

@manticore-projects
Thanks! Learned something new about lookahead!

Copy link
Copy Markdown
Contributor

@manticore-projects Thanks! Learned something new about lookahead!

If you ask me, its rather a shortcoming/problem of JavaCC itself. Your lookaheads were not wrong in my opinion and my syntax should not make any difference.

minleejae deleted the fix/index branch April 30, 2025 05:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL