Hi I have ran into some trouble with my code, it seamed to even stump the prof he relly cant give me a run around and then sent me to the ta :(. What i have to do is format a output of a .c file in java. well i have gotten this code working for the if and for statements
Java Code:
//  forStatement formats a for statement.
    private void forStatement() {
    	verifyNextToken(Token.LEFT_PARENTHESIS);
        expression(Token.RIGHT_PARENTHESIS);
        token = lexer.getNextToken();
        output.endLine(false);
        output.indent();
        verifyCurrentToken(Token.LEFT_BRACE);
        output.endLine(false);
        expression(Token.SEMICOLON);
        lexer.adjustSpacing(Lexer.SUPPRESS_LEADING_SPACE);
        token = lexer.getNextToken();
        output.endLine(false);
        output.unindent();
        verifyCurrentToken(Token.RIGHT_BRACE);
        output.endLine(false);
        output.unindent();
    }

//  ifStatement formats a if statement.
	private void ifStatement() {
		verifyNextToken(Token.LEFT_PARENTHESIS);
        expression(Token.RIGHT_PARENTHESIS);
        token = lexer.getNextToken();
        output.endLine(false);
        output.indent();
        verifyCurrentToken(Token.LEFT_BRACE);
        output.endLine(false);
        expression(Token.SEMICOLON);
        lexer.adjustSpacing(Lexer.SUPPRESS_LEADING_SPACE);
        token = lexer.getNextToken();
        output.endLine(false);
        output.unindent();
        verifyCurrentToken(Token.RIGHT_BRACE);
        output.endLine(false);
        output.unindent();		
	}
and they work fine, but when I start the code for the while loop id done not work. It should be the same as the for loop in structure right?
Java Code:
//  whileStatement formats a while statement.
	   private void whileStatemnt() {
		    verifyNextToken(Token.LEFT_PARENTHESIS);
	        expression(Token.RIGHT_PARENTHESIS);
	        token = lexer.getNextToken();
	        output.endLine(false);
	        output.indent();
	        verifyCurrentToken(Token.LEFT_BRACE);
	        output.endLine(false);
	        expression(Token.SEMICOLON);
	        lexer.adjustSpacing(Lexer.SUPPRESS_LEADING_SPACE);
	        token = lexer.getNextToken();
	        output.endLine(false);
	        output.unindent();
	        verifyCurrentToken(Token.RIGHT_BRACE);
	        output.endLine(false);
	        output.unindent();
	    }
can anyone see whats wrong with this I have been looking at this for a while now and I cant figue out whats wrong.
Thanks