shift-reduce parser for parsing sum expressions