painted a grammar graph