const.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. package parser
  2. // Action is a DEC ANSI parser action.
  3. type Action = byte
  4. // These are the actions that the parser can take.
  5. const (
  6. NoneAction Action = iota
  7. ClearAction
  8. CollectAction
  9. MarkerAction
  10. DispatchAction
  11. ExecuteAction
  12. StartAction // Start of a data string
  13. PutAction // Put into the data string
  14. ParamAction
  15. PrintAction
  16. IgnoreAction = NoneAction
  17. )
  18. // nolint: unused
  19. var ActionNames = []string{
  20. "NoneAction",
  21. "ClearAction",
  22. "CollectAction",
  23. "MarkerAction",
  24. "DispatchAction",
  25. "ExecuteAction",
  26. "StartAction",
  27. "PutAction",
  28. "ParamAction",
  29. "PrintAction",
  30. }
  31. // State is a DEC ANSI parser state.
  32. type State = byte
  33. // These are the states that the parser can be in.
  34. const (
  35. GroundState State = iota
  36. CsiEntryState
  37. CsiIntermediateState
  38. CsiParamState
  39. DcsEntryState
  40. DcsIntermediateState
  41. DcsParamState
  42. DcsStringState
  43. EscapeState
  44. EscapeIntermediateState
  45. OscStringState
  46. SosStringState
  47. PmStringState
  48. ApcStringState
  49. // Utf8State is not part of the DEC ANSI standard. It is used to handle
  50. // UTF-8 sequences.
  51. Utf8State
  52. )
  53. // nolint: unused
  54. var StateNames = []string{
  55. "GroundState",
  56. "CsiEntryState",
  57. "CsiIntermediateState",
  58. "CsiParamState",
  59. "DcsEntryState",
  60. "DcsIntermediateState",
  61. "DcsParamState",
  62. "DcsStringState",
  63. "EscapeState",
  64. "EscapeIntermediateState",
  65. "OscStringState",
  66. "SosStringState",
  67. "PmStringState",
  68. "ApcStringState",
  69. "Utf8State",
  70. }