2 * @file vtparse_table.h
5 * An implementation of Paul Williams' DEC compatible state machine parser
6 * This code is in the public domain.
7 * @author Joshua Haberman <joshua@reverberate.org>
10 #ifndef VTPARSE_TABLE_H
11 #define VTPARSE_TABLE_H
14 VTPARSE_STATE_ANYWHERE = 0,
15 VTPARSE_STATE_CSI_ENTRY = 1,
16 VTPARSE_STATE_CSI_IGNORE = 2,
17 VTPARSE_STATE_CSI_INTERMEDIATE = 3,
18 VTPARSE_STATE_CSI_PARAM = 4,
19 VTPARSE_STATE_DCS_ENTRY = 5,
20 VTPARSE_STATE_DCS_IGNORE = 6,
21 VTPARSE_STATE_DCS_INTERMEDIATE = 7,
22 VTPARSE_STATE_DCS_PARAM = 8,
23 VTPARSE_STATE_DCS_PASSTHROUGH = 9,
24 VTPARSE_STATE_ESCAPE = 10,
25 VTPARSE_STATE_ESCAPE_INTERMEDIATE = 11,
26 VTPARSE_STATE_GROUND = 12,
27 VTPARSE_STATE_OSC_STRING = 13,
28 VTPARSE_STATE_SOS_PM_APC_STRING = 14,
32 VTPARSE_ACTION_CLEAR = 1,
33 VTPARSE_ACTION_COLLECT = 2,
34 VTPARSE_ACTION_CSI_DISPATCH = 3,
35 VTPARSE_ACTION_ESC_DISPATCH = 4,
36 VTPARSE_ACTION_EXECUTE = 5,
37 VTPARSE_ACTION_HOOK = 6,
38 VTPARSE_ACTION_IGNORE = 7,
39 VTPARSE_ACTION_OSC_END = 8,
40 VTPARSE_ACTION_OSC_PUT = 9,
41 VTPARSE_ACTION_OSC_START = 10,
42 VTPARSE_ACTION_PARAM = 11,
43 VTPARSE_ACTION_PRINT = 12,
44 VTPARSE_ACTION_PUT = 13,
45 VTPARSE_ACTION_UNHOOK = 14,
48 typedef unsigned char state_change_t;
50 state_change_t GET_STATE_TABLE(const int state, const int ch);
51 vtparse_action_t GET_ENTRY_ACTIONS(const int state);
52 vtparse_action_t GET_EXIT_ACTIONS(const int state);
53 const char *GET_ACTION_NAMES(const int n);
54 const char *GET_STATE_NAMES(const int n);