tree grammar