calculator implemented by link stack