A shift-reduce parser for Mercury