Add operator== for grammar.