public void run() throws BadCharacterException, BadNumberException
	{
		StringBuilder numberLexeme = new StringBuilder();
		int currentPos = 0;
		
		while(currentPos < expr.length)
		{
			//ignore white space
			if(expr[currentPos] == ' ' || expr[currentPos] == '\t' || expr[currentPos] == '\n')
			{
				currentPos++;
				continue;
			}
			//create new number lexeme
			else if(isDigit(expr[currentPos]))
			{
				currentPos = number(numberLexeme, currentPos);
				tokens.add(new Number(numberLexeme.toString()));
				
				numberLexeme = new StringBuilder();
			}
			//create operator lexeme
			else if(isOperator(expr[currentPos]))
			{
				tokens.add(new Operator(String.valueOf(expr[currentPos])));
				currentPos++;
			}
			else if(isParenthesis(expr[currentPos]))
			{
				tokens.add(new Token(String.valueOf(expr[currentPos])));
				currentPos++;
			}
			else
			{
				//bad character in the expression
				this.isOK = false;
				throw new BadCharacterException("Unknown character \"" + expr[currentPos] + "\" at position " + currentPos);
			}
		}
	}