sprocket_bio.grammar.parser

class sprocket_bio.grammar.parser.Event

Bases: object

Represents an event produced by the parser.

The parser produces a stream of events that can be used to construct a CST.

class NodeFinished

Bases: Event

A node has finished.

class NodeStarted(kind, forward_parent)

Bases: Event

A new node has started.

forward_parent

For left-recursive syntactic constructs, the parser produces a child node before it sees a parent. forward_parent saves the position of current event's parent.

kind

The kind of the node.

class Token(kind, span)

Bases: Event

A token was encountered.

kind

The syntax kind of the token.

span

The source span of the token.

classmethod abandoned()

Gets an start node event for an abandoned node.