'Parse the expression.
:param data: str for the input to be parsed
:param signature: ``dict<str, str>`` that maps variable names to type
strings
:returns: a parsed Expression'

def parse(self, data, signature=None):

    data = data.rstrip()
    self._currentIndex = 0
    (self._buffer, mapping) = self.process(data)
    try:
        result = self.process_next_expression(None)
        if self.inRange(0):
            raise UnexpectedTokenException((self._currentIndex + 1), self.token(0))
    except LogicalExpressionException as e:
        msg = (u'%s\n%s\n%s^' % (e, data, (u'    ' * mapping[(e.index - 1)])))
        raise LogicalExpressionException(None, msg)
    if self.type_check:
        result.typecheck(signature)
    return result
