generalized select grammar