Opened 2 years ago
Last modified 2 years ago
#2602 assigned defect
Parser conflict resolve - scalarLit
Reported by: | aburamadan | Owned by: | Dimitar Misev |
---|---|---|---|
Priority: | major | Milestone: | 10.0 |
Component: | qlparser | Version: | 10.0 |
Keywords: | Cc: | dmisev/pbaumann | |
Complexity: | Medium |
Description
note: for parser warnings and conflicts to be shown, use these bison flags:
“-r state –report-file=parserreport -t -W”.
The output file 'parserreport' is generated in the /qlparser dir.
-relevant state:
290 generalLit: scalarLit .
309 scalarLitList: scalarLit .
The scalarLit here has some conflict.
I think the main problem here is from the rule:-
scalarLitList: scalarLitList comma scalarLit
as this might cause some form of ambiguity. I would suggest the following change:
scalarLitList: scalarLit comma scalarLit
I could be wrong here though.
The other issue here seems to be related to the case a RCPAR follows.
After looking at it further, I think that the problem here is that scalarLitList is way too complex.
If we look at how the rules are:-
(check parser or: https://doc.rasdaman.org/04_ql-guide.html#appendix-a-rasql-grammar)
scalarLitList: scalarLitList COMMA scalar | scalar
scalar: complex | atomic
complex: LCPAR scalarLitList RCPAR
this can quickly get out of control.
I'm not sure if this is desired here but, I think it would be better to simplify this.
Perhaps some sort of separation between atomic and complex, would make it unambiguous.