From b25e1c5ade39d0663ebd074777334667ea1e007b Mon Sep 17 00:00:00 2001 From: Timothy Washington Date: Thu, 27 Nov 2008 18:49:27 -0500 Subject: [PATCH] fixed all the way to expr/exprsingle of the grammar --- cc/xpath.sablecc | 41 +++-------------------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) diff --git a/cc/xpath.sablecc b/cc/xpath.sablecc index 81e6370..1d5db89 100755 --- a/cc/xpath.sablecc +++ b/cc/xpath.sablecc @@ -378,23 +378,15 @@ Tokens Productions - xpath = expr; - expr = forexpr; - //expr = exprsingle? expr_part*; + expr = exprsingle? expr_part*; expr_part = T.comma exprsingle; - // Causes too much inlining - //exprsingle = {for} forexpr | - // {quantif} quantifiedexpr | - // {if} ifexpr | - // {or} orexpr; - - // cannot input expression - Error: [1,1] expecting: EOF exprsingle = {for} forexpr | {quantif} quantifiedexpr | - {if} ifexpr; + {if} ifexpr | + {or} orexpr; forexpr = simpleforclause T.keyword_return exprsingle; @@ -408,7 +400,6 @@ Productions ifexpr = T.keyword_if T.lparenth expr T.rparenth T.keyword_then [exprsingle1]:exprsingle T.keyword_else [exprsingle2]:exprsingle; - orexpr = andexpr orexpr_part*; orexpr_part = T.keyword_or andexpr; @@ -437,30 +428,6 @@ Productions {idiv} T.keyword_idiv | {mod} T.keyword_mod; - //multiplicativeexpr = unionexpr mone; - // mone = T.star2 unionexpr; - - /* - shift/reduce conflict in state [stack: PCastableexpr PMultiplicativeexprPartPart PCastableexpr TKeywordInstance TKeywordOf PItemtype *] on TStar in { - [ PMultiplicativeexprPart = PMultiplicativeexprPartPart PCastableexpr TKeywordInstance TKeywordOf PItemtype * ] followed by TStar (reduce), - [ POccurrenceindicator = * TStar ] (shift) - - - - shift/reduce conflict in state [stack: PCastableexpr PMultiplicativeexprPartPart PCastableexpr TKeywordInstance TKeywordOf PItemtype *] on TStar in { - 36 * -16 instance of xs:double * - - [ PMultiplicativeexprPart = PMultiplicativeexprPartPart PCastableexpr TKeywordInstance TKeywordOf PItemtype * ] followed by TStar (reduce), - * -16 instance of xs:double * - - [ POccurrenceindicator = * TStar ] (shift) - * - - If I want to use the expression 'A', how can I remove any ambiguity that the last star is an occurence indicator (versus another multiplier) - A) 36 * -16 instance of xs:double* - - */ - unionexpr = intersectexceptexpr unionexpr_part*; unionexpr_part = unionexpr_part_part intersectexceptexpr; unionexpr_part_part = {unionkey} T.keyword_union | @@ -525,7 +492,6 @@ Productions {axis} axisstep; - /** * Axes */ @@ -554,7 +520,6 @@ Productions forwardaxis_part_seven = T.axis_following T.axis_delim; forwardaxis_part_eight = T.axis_namespace T.axis_delim; - abbrevforwardstep = T.abbrev_attrib? nodetest; reversestep = {reverse} reversestep_part | -- 2.11.4.GIT