def validateArguments(terms):
    """Does some preliminary argument validatation, such as checking fo matching
    braces and braces."""
    bracketCount = 0
    for term in terms:
        if term == '[':
            bracketCount += 1
        elif term == ']':
            bracketCount -= 1
    if bracketCount:
        print('rpn:  mismatched brackets (count: {})'.format(bracketCount))
        return False
    parenCount = 0
    for term in terms:
        if term == '(':
            parenCount += 1
        elif term == ')':
            parenCount -= 1
    if parenCount:
        print('rpn:  mismatched parenthesis (count: {})'.format(parenCount))
        return False
    braceCount = 0
    for term in terms:
        if term == '{':
            braceCount += 1
        elif term == '}':
            braceCount -= 1
    if braceCount:
        print('rpn:  mismatched braces (count: {})'.format(braceCount))
        return False
    return True
