Implement a basic calculator that can handle addition, subtraction, and parentheses in a mathematical expression.