112 | | * main query [2] / simple query [3]: above definition generate structural ambiguity. Not a problem for ANTLR (which selects the right-recursive solution), but some other parser generators generate all solutions - which are exponential wrt the number of main queries. I propose to use the alternative rules given below. |
113 | | * above rule [2] can generate infinite array of quantifiers: "word" +*{23}(,17}? would be legal. |
114 | | * rule 5: option marker '?' makes "[]" a valid query. Propose to remove question mark. |
115 | | * expression [11] / basic expression [12]: structural ambiguity. See proposed alternative below. |
| 112 | * main query {{{[2]}}} / simple query {{{[3]}}}: above definition generate structural ambiguity. Not a problem for ANTLR (which selects the right-recursive solution), but some other parser generators generate all solutions - which are exponential wrt the number of main queries. I propose to use the alternative rules given below. |
| 113 | * above rule {{{[2]}}} can generate infinite array of quantifiers: {{{"word" +*{23}{,17}{2,}?+}}} would be legal. |
| 114 | * rule {{{[5]}}}: option marker '?' makes "[]" a valid query. Propose to remove question mark. |
| 115 | * expression {{{11}}} / basic expression {{{[12]}}}: structural ambiguity. See proposed alternative below. |
| 116 | * attached file contains an antlr4 grammar, including comments on how to use it on mac / unix / linux platform |