added next_char to state machine

removed parameter passing to action functions
WIP adapting state machine to addition of next char