String grammar and actions