add find best matched nonterminal method in parser