in reply to Re^4: Parsing and converting Fortran expression
in thread Parsing and converting Fortran expression [solved]

split

%left '.and.' '.or.'

into two lines

%left '.or.' %left '.and.'

(See how tricky parsing is :)

Also, I'm using perl's precedences (which perlop says is the same as C's) instead of FORTRAN's, which I haven't bothered to look up :)

If you do look them up and they differ, just remember "low precedence at top, higher precedence is lower" :) (yacc standard :)

Also, I guessed that FORTRAN's .not. is a different precedence than C's !, it may be more like perl's "not" (or not :)

(See how tricky parsing is :)

Also note that I don't have to worry about C's precedences - the benefits of complete parenthesizing :)