add foreach grammar and sample code