-
Home
-
API
-
XenoAtom.Ansi
-
AnsiTokenizer
AnsiTokenizer Class
Definition
Show inherited members (7)
Tokenizes ANSI/VT escape sequences from a stream of UTF-16 characters.
public sealed class AnsiTokenizer : IDisposable
This tokenizer is designed to be:
- Streaming: sequences may span multiple chunks; pass
isFinalChunk: false to keep state - Tolerant: malformed sequences never throw; they are surfaced as UnknownEscapeToken
- Mostly syntactic: CSI/OSC are tokenized without deep semantics, except optional SGR decoding
ANSI terminology:
- CSI (Control Sequence Introducer): typically
ESC [, ends with a final byte in 0x40–0x7E - SGR (Select Graphic Rendition): CSI with final byte
m - OSC (Operating System Command): starts with
ESC ], terminated by BEL or ST (ESC \\)
References (terminology and byte ranges):
- ECMA-48 / ISO/IEC 6429: control functions and escape sequence structure
- xterm control sequences (OSC 8 hyperlinks, common private modes)
Tip: use kind:method, kind:property, kind:ctor. Press Esc to clear.
Constructors (1)
Properties (1)
OptionsGets the options used by this tokenizer.
Methods (4)