document grammar