help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reduce-Reduce problem choosing a path


From: Adam Smalin
Subject: Reduce-Reduce problem choosing a path
Date: Thu, 30 May 2013 16:02:16 -0400

Here is an example of my input

thing { $var.member }

The problem is I allow

thing { .member $var }

So what is happening is I'd LIKE to always use $var.member but it can
reduce $var then .member which should not be allowed if $var is in front of
it (or $foo or $anything).

I'm not exactly sure where to put the precedence rule or how to. Both paths
take VarB but one reduces too early. I blindly put %dprec on VarB ('$'
VarName %dprec 1) and on Token (Token: Tokenb  %dprec 2 { ... }). But I
haven't used dprec and unsure how it works.I get the same ambiguity error


Ambiguity detected.
Option 1,
  Body3 -> <Rule 43, tokens 183 .. 186>
    Body3 -> <Rule 43, tokens 183 .. 185>
      Body3 -> <Rule 41, tokens 183 .. 184>
        Body4 -> <Rule 50, tokens 183 .. 184>
          VarB -> <Rule 173, tokens 183 .. 184>
            '$' <tokens 183 .. 183>
            VarName <tokens 184 .. 184>
      Body4 -> <Rule 51, tokens 185 .. 185>
        Token -> <Rule 53, tokens 185 .. 185>
          Tokenb -> <Rule 57, tokens 185 .. 185>
            '.' <tokens 185 .. 185>
    Body4 -> <Rule 44, tokens 186 .. 186>
      Body5 -> <Rule 77, tokens 186 .. 186>
        Body5B -> <Rule 79, tokens 186 .. 186>
          Var -> <Rule 1063, tokens 186 .. 186>
            VarFilter -> <Rule 1064, tokens 186 .. 186>
              VAR <tokens 186 .. 186>

Option 2,
  Body3 -> <Rule 41, tokens 183 .. 186>
    Body4 -> <Rule 50, tokens 183 .. 186>
      VarB -> <Rule 173, tokens 183 .. 186>
        '$' <tokens 183 .. 183>
        VarName -> <Rule 1023, tokens 184 .. 186>
          VarName <tokens 184 .. 184>
          '.' <tokens 185 .. 185>
          Var -> <Rule 1063, tokens 186 .. 186>
            VarFilter -> <Rule 1064, tokens 186 .. 186>
              VAR <tokens 186 .. 186>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]