Implement a tiny interpreter to speedup the matching