Extract common rules from JSONiq and XQuery grammar lexer into CommonLexer file - #1801
Open
CaiJimmy wants to merge 7 commits into
Open
Extract common rules from JSONiq and XQuery grammar lexer into CommonLexer file#1801CaiJimmy wants to merge 7 commits into
CaiJimmy wants to merge 7 commits into
Conversation
QT3 Test Results - Parser:
|
| Test Suite | Passing | Failing | Errors | Skipped | Total |
|---|---|---|---|---|---|
app |
1984 | 39 | 127 | 7 | 2157 |
array |
207 | 0 | 1 | 1 | 209 |
fn |
10024 | 381 | 232 | 498 | 11135 |
map |
220 | 0 | 0 | 0 | 220 |
math |
149 | 0 | 0 | 0 | 149 |
misc |
700 | 77 | 34 | 60 | 871 |
op |
4192 | 63 | 70 | 41 | 4366 |
prod |
10344 | 569 | 465 | 829 | 12207 |
ser |
321 | 21 | 1 | 0 | 343 |
xs |
147 | 6 | 0 | 11 | 164 |
| Total | 28288 | 1156 | 930 | 1447 | 31821 |
Full analysis report: see analysis-jsoniq in artifacts.
QT3 Test Results - Parser:
|
| Test Suite | Passing | Failing | Errors | Skipped | Total |
|---|---|---|---|---|---|
app |
2024 | 38 | 88 | 7 | 2157 |
array |
207 | 0 | 1 | 1 | 209 |
fn |
10078 | 343 | 216 | 498 | 11135 |
map |
220 | 0 | 0 | 0 | 220 |
math |
149 | 0 | 0 | 0 | 149 |
misc |
719 | 64 | 28 | 60 | 871 |
op |
4284 | 14 | 27 | 41 | 4366 |
prod |
10571 | 442 | 365 | 829 | 12207 |
ser |
343 | 0 | 0 | 0 | 343 |
xs |
153 | 0 | 0 | 11 | 164 |
| Total | 28748 | 901 | 725 | 1447 | 31821 |
Full analysis report: see analysis-xquery in artifacts.
CaiJimmy
force-pushed
the
jimmy/common-grammar
branch
from
August 26, 2026 10:50
753076c to
027716d
Compare
CaiJimmy
force-pushed
the
jimmy/common-grammar
branch
from
August 26, 2026 11:04
027716d to
622c69e
Compare
CaiJimmy
marked this pull request as ready for review
August 26, 2026 11: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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now that the JSONiq and XQuery grammar are so similar, I propose avoid repeating codes in grammar definitions,
and use
importsyntax from ANTLR4 to avoid code duplication.This PR does it at lexer level, and the next PR will do it at parser level.
This does not affect Java translation level. Code reuse in TranslationVisitor and XQueryTranslationVisitor is more difficult and experimented in #1804, but did not work as I expected.