Untested: added function to grammar.py.