'Attempt to make an application expression.  The next tokens are
a list of arguments in parens, then the argument expression is a
function being applied to the arguments.  Otherwise, return the
argument expression.'

def attempt_ApplicationExpression(self, expression, context):

    if self.has_priority(APP, context):
        if (self.inRange(0) and (self.token(0) == Tokens.OPEN)):
            if ((not isinstance(expression, LambdaExpression)) and (not isinstance(expression, ApplicationExpression)) and (not isinstance(expression, FunctionVariableExpression)) and (not isinstance(expression, ConstantExpression))):
                raise LogicalExpressionException(self._currentIndex, ((u"The    function    '%s" % expression) + u"'    is    not    a    Lambda    Expression,    an    Application    Expression,    or    a    functional    predicate,    so    it    may    not    take    arguments."))
            self.token()
            accum = self.make_ApplicationExpression(expression, self.process_next_expression(APP))
            while (self.inRange(0) and (self.token(0) == Tokens.COMMA)):
                self.token()
                accum = self.make_ApplicationExpression(accum, self.process_next_expression(APP))
            self.assertNextToken(Tokens.CLOSE)
            return accum
    return expression
