Expand description
Parser for implementing virtual terminal emulators
Parser is implemented according to Paul Williams’ ANSI parser
state machine. The state machine doesn’t assign meaning to the parsed data
and is thus not itself sufficient for writing a terminal emulator. Instead,
it is expected that an implementation of Perform is provided which does
something useful with the parsed data. The Parser handles the book
keeping, and the Perform gets to simply handle actions.
§Examples
For an example of using the Parser please see the examples folder. The example included
there simply logs all the actions Perform does. One quick thing to see it in action is to
pipe vim into it
cargo build --release --example parselog
vim | target/release/examples/parselogJust type :q to exit.
§Differences from original state machine description
- UTF-8 Support for Input
- OSC Strings can be terminated by 0x07
- Only supports 7-bit codes. Some 8-bit codes are still supported, but they no longer work in all states.
Modules§
- state
- ANSI escape code parsing state machine
Structs§
- Ascii
Parser - Only allow parsing 7-bit ASCII
- Params
- Params
Iter - Immutable subparameter iterator.
- Parser
- Parser for raw VTE protocol which delegates actions to a
Perform - Utf8
Parser - Allow parsing UTF-8
Traits§
- Char
Accumulator - Build a
charout of bytes - Perform
- Performs actions requested by the
Parser
Type Aliases§
- Default
Char Accumulator - Most flexible
CharAccumulatorforParserbased on active features