formula tree parsing