Porting .g grammar file to g4.