Use catamorphism instead of attribute grammar for evaluation