class

Obelisk::ContextManager

Inherits Reference < Object

Context manager for tracking parsing context and state transitions

Constructors

new(max_history_size : Int32 = 1000)
Source

Instance methods

add_token(token : Token) : Nil

Add a token to the history

Source
clear_history

Clear history (useful for document boundaries)

Source
create_context(state : LexerState, text : String, position : Int32) : ParsingContext

Create parsing context for current state

Source
log_transition(from : String, to : String, position : Int32) : Nil

Log a state transition

Source
recent_transitions(count : Int32) : Array(NamedTuple(from: String, to: String, position: Int32))

Get recent state transitions

Source
stats

Get statistics about the parsing session

Source