migrated to ANTLR4, minor fixes