Raxol.Terminal.ParserStateManager (Raxol Terminal v2.6.0)

Copy Markdown View Source

Consolidated terminal parser state manager combining simple emulator operations with comprehensive parser state management.

This module consolidates functionality from:

  • Simple parser state operations on Emulator structs
  • Comprehensive parser state management from Parser.State.Manager

Usage

For simple emulator operations:

emulator = ParserStateManager.reset_parser_state(emulator)

For comprehensive parser operations:

manager = ParserStateManager.create_parser_manager()
manager = ParserStateManager.process_char(manager, ?A)

Migration from Parser.State.Manager

Use create_parser_manager/0 instead of Parser.State.Manager.new/0

Summary

Functions

Adds an intermediate character to the buffer. Returns the updated emulator.

Adds a parameter to the current parser state. Returns the updated emulator.

Clears all intermediate characters. Returns the updated emulator.

Clears all parser parameters. Returns the updated emulator.

Gets the current intermediate characters buffer. Returns the intermediates buffer as a binary string.

Gets the current parser mode (state). Returns the current mode.

Gets the current parser parameters. Returns the list of parameters.

Gets the current parser state. Returns the parser state.

Processes a character in the current parser state. Returns the updated emulator and any output.

Resets the parser state to its initial state. Returns the updated emulator.

Sets the intermediate characters buffer. Returns the updated emulator.

Sets the parser mode (state). Returns the updated emulator.

Sets the parser parameters. Returns the updated emulator.

Updates the parser state. Returns the updated emulator.

Functions

add_intermediate(emulator, char)

Adds an intermediate character to the buffer. Returns the updated emulator.

add_param(emulator, param)

Adds a parameter to the current parser state. Returns the updated emulator.

clear_intermediates(emulator)

Clears all intermediate characters. Returns the updated emulator.

clear_params(emulator)

Clears all parser parameters. Returns the updated emulator.

create_parser_manager()

See Raxol.Terminal.Parser.State.Manager.new/0.

get_intermediates(emulator)

Gets the current intermediate characters buffer. Returns the intermediates buffer as a binary string.

get_mode(emulator)

Gets the current parser mode (state). Returns the current mode.

get_params(emulator)

Gets the current parser parameters. Returns the list of parameters.

get_parser_state(emulator)

Gets the current parser state. Returns the parser state.

process_char(emulator, char)

Processes a character in the current parser state. Returns the updated emulator and any output.

process_parser_char(manager, char)

See Raxol.Terminal.Parser.State.Manager.process_char/2.

reset_parser_state(emulator)

Resets the parser state to its initial state. Returns the updated emulator.

set_intermediates(emulator, intermediates)

Sets the intermediate characters buffer. Returns the updated emulator.

set_mode(emulator, mode)

Sets the parser mode (state). Returns the updated emulator.

set_params(emulator, params)

Sets the parser parameters. Returns the updated emulator.

update_parser_state(emulator, new_state)

Updates the parser state. Returns the updated emulator.