General purpose graph-based parser