def tokenize(raw):
	"""Produces list of tokens indicated by a raw expression string.

	For example the string '(43-(3*10))' results in the list
	['(', '43', '-', '(', '3', '*', '10', ')', ')']
	"""
	SYMBOLS = set('+-x*/() ')  # allow for '*' or 'x' for multiplication

	mark = 0
	tokens = []
	n = len(raw)
	for j in range(n):
		if raw[j] in SYMBOLS:
			if mark != j:
				tokens.append(raw[mark:j])  # complete preceding token
			if raw[j] != ' ':
				tokens.append(raw[j])  # include this token
			mark = j + 1  # update mark to being at next index
	if mark != n:
		tokens.append(raw[mark:n])  # complete preceding token
	return tokens