You're making this way, way, too complicated. Cut down your code into a
50-line example that doesn't work, with an example of an input that
shows right-associativity (try a=b-c-d rather than a=b+c+d). By the time
you've done this, you'll almost certainly have fixed the problem
yourself. If not, post the code, *after* making sure that Bison can
compile it.