/**
* This defines the concept of an Expression. The expression is
* implemented as an array of tokens: where each token contains
* a string.
*
* @author Alex Menz
* @version 2013
*/
import java.util.*;
public class Expression
{
//---------------------------------------------------------------------
private ArrayList<Token> expression; //Expression is input as a String

//---------------------------------------------------------------------
/**
* Constructor: The String exp contains the infix expression.
* This breaks it into tokens and
* stores them in an ArrayList.
*/
public Expression(String exp)
{
//Create the array that represents the body of the Expression
expression = new ArrayList<Token>();

//Tokenize the expression using the String Tokenizer class.
//Assumed that the tokens are seperated by spaces
StringTokenizer strTok = new StringTokenizer(exp," ");

//Scan the input expression from left to right for tokens
while (strTok.hasMoreElements())
{
Token tok = new Token((String) strTok.nextElement());
expression.add(tok);
}
}

//---------------------------------------------------------------------
/**
* Alternative constructor. This creates an array with no tokens
* in it.
*/
public Expression()
{
//Create the array that represents the body of the Expression
expression = new ArrayList<Token>();
}

public int size()
{
return expression.size();
}

//---------------------------------------------------------------------
/**
* Appending a token at the end of the expression
*/
public void add(Token newElement)
{
expression.add(newElement);
}

//--------------------------------------------------------------
/**
* For each button, add an ActionListener object, which is
* coded here; and specifies what action is taken when that
* button is clicked.
* @param arg0
*/

//If it is an operand append it to postfix
if (nextToken.isOperand())
postfixExpression.add(nextToken);

//If it is an open parenthesis push it into stack
else if (nextToken.isOpenParen())
operatorStack.push(nextToken);
//If next token is a closed parenthesis
else if (nextToken.isClosedParen())
{
//Keep pulling operators out of stack and appending
//them to postfix, until top of stack is an open paren
topOfStack = operatorStack.top();
while (!topOfStack.isOpenParen())
{
postfixExpression.add(topOfStack);
operatorStack.pop();
topOfStack = operatorStack.top();
}
//and then discard the open paren
operatorStack.pop();
}
//If it is an operator ...
else if (nextToken.isOperator())
{
// get the precedence of this token
int tokenPrecedence = nextToken.getPrecedence();

// If stack is empty, push nextToken into stack
if (operatorStack.isEmpty())
operatorStack.push(nextToken);
else
{
//Get the precedence of the top of the stack
topOfStack = operatorStack.top();

//If the top of stack is an open parenthesis push nextToken
if (topOfStack.isOpenParen())
operatorStack.push(nextToken);
else
{
//Get the precedence of the top of stack
int stackPrecedence = topOfStack.getPrecedence();

//if nextToken's precedence is > that of top of stack's
//push next token into stack
if (tokenPrecedence > stackPrecedence)
operatorStack.push(nextToken);
else
{
//Keep pulling operators out of stack and appending
//them to postfix, as long all all these conditions are true
while ((tokenPrecedence <= stackPrecedence) &&
(!topOfStack.isOpenParen()) &&
(!operatorStack.isEmpty()))
{
topOfStack = operatorStack.pop();
postfixExpression.add(topOfStack);
if (!operatorStack.isEmpty())
{
topOfStack = operatorStack.top();
stackPrecedence = topOfStack.getPrecedence();
}
}

//If it is an operand, push it into stack
if (nextToken.isOperand())
{
operandStack.push(nextToken);
//System.out.println(operandStack);
}
//If it is an operator,
else if (nextToken.isOperator())
{
//Get two operands out of the stack
if (operandStack.isEmpty())
{
System.out.println("Error in PostfixEvaluator.eval() "+
"-- Input expression was probably wrong");
return Integer.MIN_VALUE;
}
Token operand2 = operandStack.pop();

//Push the result back into the stack
operandStack.push(result);
//System.out.println(operandStack);
}
}

//At the end, if only one element is left in the stack
if (operandStack.isEmpty())
{
System.out.println("Error in PostfixEvaluator.eval() "+
"-- Input expression was probably wrong");
return Integer.MIN_VALUE;
}

//Get the operand out of the stack, and convert it into
//an integer
Token topToken = operandStack.pop();
valueOfExpression = Integer.parseInt(topToken.getBody());

First, please use [code] tags [/code] when posting code in order to retain formatting.
Second, you haven't actually asked a question.
Third, that's a lot of code to expect people to look at...I'm sure you can narrow down your problem.