#NEWLINE# def attempt_ApplicationExpression( self , expression , context ) : #NEWLINE# #INDENT# 'Attempt to make an application expression.  The next tokens are\n        a list of arguments in parens, then the argument expression is a\n        function being applied to the arguments.  Otherwise, return the\n        argument expression.' #NEWLINE# if self . has_priority ( APP , context ) : #NEWLINE# #INDENT# if ( self . inRange ( 0 ) and ( self . token ( 0 ) == Tokens . OPEN ) ) : #NEWLINE# #INDENT# if ( ( not isinstance ( expression , LambdaExpression ) ) and ( not isinstance ( expression , ApplicationExpression ) ) and ( not isinstance ( expression , FunctionVariableExpression ) ) and ( not isinstance ( expression , ConstantExpression ) ) ) : #NEWLINE# #INDENT# raise LogicalExpressionException ( self . _currentIndex , ( ( "The function '%s" % expression ) + "' is not a Lambda Expression, an Application Expression, or a functional predicate, so it may not take arguments." ) ) #NEWLINE# #UNINDENT# self . token ( ) #NEWLINE# accum = self . make_ApplicationExpression ( expression , self . process_next_expression ( APP ) ) #NEWLINE# while ( self . inRange ( 0 ) and ( self . token ( 0 ) == Tokens . COMMA ) ) : #NEWLINE# #INDENT# self . token ( ) #NEWLINE# accum = self . make_ApplicationExpression ( accum , self . process_next_expression ( APP ) ) #NEWLINE# #UNINDENT# self . assertNextToken ( Tokens . CLOSE ) #NEWLINE# return accum #NEWLINE# #UNINDENT# #UNINDENT# return expression