Improve syntactic rule matching efficiency