rewrite grammar to ANTLR4