Start
tokens = []
current_position = 0
program = "your C program here"
while current_position < length of program:
char = program[current_position]
if char is letter or '_':
identifier = ""
while char is letter or digit or '_':
identifier += char
current_position++
char = program[current_position]
tokens.append(identifier)
elif char is digit:
number = ""
while char is digit:
number += char
current_position++
char = program[current_position]
tokens.append(number)
elif char is '"':
string = '"'
current_position++
char = program[current_position]
while char != '"':
string += char
current_position++
char = program[current_position]
string += '"'
tokens.append(string)
elif char is operator or special symbol:
tokens.append(char)
current_position++
elif char is whitespace:
current_position++
else:
current_position++
End