Generic VM-based formal language matching framework