use grammar/actions to build up the logic