added pstate/cstate, switched lexer_init with scanner_iniT