let get_state () = try Stack.top state_stack with Stack.Empty -> Normal