Added code to take flex output and put into to tokens

Rewrote all of previous code due to compilation failing and instead
reimplemented previous changes with Prof. Wesleys Mackey's ex08 code as
a base.