initial version of calculator parser imported from an older demo