CPP version of Lemon