'How does the declaration nonassoc work in fsyacc?

I'm trying to figure out how %nonassoc works in fsyacc. I have this code snippet that I'm trying to figure out how it works.

%nonassoc letprec
%left DEQ LTH
%left PLUS MINUS

DEQ = '==' LTH = '<' I'm not sure my understanding is fully correct right now. As of my understanding, nonassoc means that you can alter the parenthesis in an expression, without affecting the result. I have also read it used in fsyacc for invalid expressions, though I am confused how nonassoc letprec works in this code snippet. I have a feeling it's something about the two following declarations both being Left associative. and what would happen if I omitted %nonassoc letprec? What would it mean if I put %nonassoc letprec between the two %left declarations?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source