refactor of grammars, more options for documentation