[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: %prec doesn't seem to work?
From: |
Adam Smalin |
Subject: |
Re: %prec doesn't seem to work? |
Date: |
Fri, 5 Apr 2013 21:04:49 -0400 |
Do you mean this page in the documentation?
http://www.gnu.org/software/bison/manual/html_node/Contextual-Precedence.html
I read it but the only thing I can come up with is that the single angle
bracket (< or >) must be in conflict but I don't think that can happen if
its rval '<' (rval VS '<') because nothing reduces. I guess I could put
rval in another rule and since that reduces it will cause a shift/reduce
conflict but if that solves it i'll be very surprised.
I might have did it wrong but a quick test I wrote rvalDummy: rval and
replaced rval '<' '<' with rvalDummy '<' '<' (and another variant) I just
got ambiguity errors during runtime
On Fri, Apr 5, 2013 at 2:47 AM, Akim Demaille <address@hidden> wrote:
>
> Le 5 avr. 2013 à 01:25, Adam Smalin <address@hidden> a écrit :
>
> > I believe %prec is what I want but it DOESN'T do what I want. I don't
> > understand what it actually does. Why isn't it making the below the same?
> >
> > | rval '<' '<' rval %prec LSHIFT
> > | rval LSHIFT' rval
> >
> > It doesn't seem to change the precedence. It isn't evaluating the
> variable
> > before < < like << does. It does ((intVar1<intVar2)<intVar3)< < Foo i
> > believe. It isn't doing intVar3< < Foo which is what i checked for.
>
> You need to read carefully the documentation to understand why
> it does not do what you'd like it to.
>
> Have you tried to have two different ">" tokens, as I suggested,
> one standing for "> followed by >" and "> not followed by >"?
> Both denoting a single >, but with embedded information on the
> following token.
>
>
- Re: %prec doesn't seem to work?, (continued)
- Re: %prec doesn't seem to work?, Akim Demaille, 2013/04/03
- Re: %prec doesn't seem to work?, Hans Aberg, 2013/04/03
- Re: %prec doesn't seem to work?, Akim Demaille, 2013/04/04
- Re: %prec doesn't seem to work?, Hans Aberg, 2013/04/04
- Re: %prec doesn't seem to work?, Adam Smalin, 2013/04/04
- Re: %prec doesn't seem to work?, Akim Demaille, 2013/04/05
- Re: %prec doesn't seem to work?,
Adam Smalin <=