Monday, 30 May 2016

Shift/Reduce demonstration - 0 [Happy]

Happy is a LALR(1) parser.

Left Associativity


The production (as shown).
Two expressions ( 1 + 1 + 1, and 1 + 1 * 1)  are demonstrated.


Finally, Exp3 will be reduced to Expression.

Right Associativity

The production (as shown).
One expression ( 1 + 1 + 1)  is demonstrated.



Finally, Exp3 will be reduced to Expression.

 


No comments :

Post a Comment