P'' interpreter in javascript