def METHOD_NAME(
      word_iterator,
      stop_if_parse_stack_is_empty=False,
      stop_word=None,
      expect_nonmatching_closing_parenthesis=False):
  result_stack = []
  for word,word_iterator in simple_parser.infix_as_postfix(
         word_iterator=word_iterator,
         stop_if_parse_stack_is_empty=stop_if_parse_stack_is_empty,
         stop_word=stop_word,
         expect_nonmatching_closing_parenthesis
           =expect_nonmatching_closing_parenthesis):
    if (word.value == "not"):
      arg = result_stack.pop()
      result_stack.append("(!%s)" % arg)
    elif (word.value in ["and", "or"]):
      rhs = result_stack.pop()
      lhs = result_stack.pop()
      if (word.value == "and"):
        result_stack.append("(%s&%s)" % (lhs, rhs))
      else:
        result_stack.append("(%s|%s)" % (lhs, rhs))
    elif (word.value == "within"):
      assert word_iterator.pop().value == "("
      radius = float(word_iterator.pop().value)
      assert word_iterator.pop().value == ","
      nested_result = METHOD_NAME(
        word_iterator=word_iterator,
        expect_nonmatching_closing_parenthesis=True)
      if (nested_result == ""): raise RuntimeError("Missing argument.")
      result_stack.append("@(%.2f,%s)" % (radius, nested_result))
    elif (word.value == "around"):
      assert word_iterator.pop().value == "("
      nested_result = METHOD_NAME(
        word_iterator=word_iterator,
        stop_word=",")
      if (nested_result == ""): raise RuntimeError("Missing argument.")
      radius = float(word_iterator.pop().value)
      assert word_iterator.pop().value == ")"
      result_stack.append("@(%.2f,%s)" % (radius, nested_result))
    elif (word.value == "for"):
      var = word_iterator.pop().value
      assert word_iterator.pop().value == "in"
      nested_result = METHOD_NAME(
        word_iterator=word_iterator,
        stop_if_parse_stack_is_empty=True)
      if (nested_result == ""): raise RuntimeError("Missing argument.")
      result_stack.append("(for %s in %s)" % (var, nested_result))
    else:
      result_stack.append(word.value)
  if (len(result_stack) == 0):
    return ""
  result = result_stack[0]
  for item in result_stack[1:]:
    result = "(%s&%s)" % (result, item)
  return result