class

VT::Parser

Inherits Reference < Object

src/vt/parser.cr

Constructors

new(handler : Handler)

Initializes a new Paul Williams state machine that dispatches events to the provided handler.

Source

Instance methods

idle?

Returns true if the state machine is currently in the ground state.

Source
parse(bytes : Bytes) : Nil

Parses a slice of bytes, synchronously dispatching events to the handler.

Source
parse(str : String) : Nil

Parses a UTF-8 string by inspecting its underlying bytes.

Source
parse(io : IO, buffer_size : Int32 = 4096) : Nil

Consumes from an IO stream until EOF, parsing byte chunks as they arrive. The default chunk buffer size is 4096 bytes.

Source
reset

Forcefully resets the parser back to the ground state and clears all intermediate and parameter state.

Source