Base

Overview

Abstract base classes for format implementations.

Qwiratry::Format discovers concrete format modules dynamically and verifies that each operation class inherits from the matching walkable base class here. A format module normally provides ::Parse and/or ::Render classes under its format namespace, for example Qwiratry::Format::MyFormat::Parse, which inherit ParseWalkable / RenderWalkable.

Formats whose parser emits a custom tree model should also provide a Qwiratry::Tree::Navigator::* class that does Qwiratry::Tree::Navigator::Base.

These classes are contracts rather than useful implementations. The default methods throw so an incomplete plugin fails at the first attempted parse or render instead of silently returning an invalid value.

Optional pull roles add chunk-oriented capabilities alongside the walkable whole-value path. "Streaming" as a capability means a pull (or, later, push) path is available.

Methods

parse-walkable(Str $input-string)

method parse-walkable(Str $input-string --> Mu)

Parameters

  • $input-string

The external text to parse into Qwiratry data.

Parses a complete external text value into structured Raku data.

Concrete parsers override this method. Callers normally reach it through Qwiratry::Operator::IO::ParseOperator or Qwiratry::Format.make(:type<Parse>, :format(...)).

render-walkable(Mu $data, Associative :%options)

method render-walkable(Mu $data, Associative :%options --> Str)

Parameters

  • $data

The input data, root value, or rendered value handled by this operation.
  • %options

Named format options, such as rendering preferences.

Renders structured Raku data to a complete external text value.

Concrete renderers override this method and may interpret %options in a format-specific way. Non-streaming render paths may normalize lazy query results before calling this method; pull renderers that also do RenderPull receive data without that forced materialization.

Optional capability for parsers that accept a pull stream of text chunks.

When a format parser does this role, Qwiratry::Operator::IO::ParseOperator prefers parse-pull whenever its input is already a text-chunk Iterator. Otherwise the operator falls back to joining chunks (when needed) and calling parse-walkable.

parse-pull(Iterator:D $chunks, *%options)

method parse-pull(Iterator:D $chunks, *%options --> Mu)

Parameters

  • $chunks

Pull iterator of C<Str> text chunks.
  • %options

Optional format-specific named arguments.

Parses a stream of text chunks into structured data.

May return a single value or a lazy Seq/Iterator of top-level values. Concrete pull parsers override this method.

Optional capability for renderers that emit a pull stream of text chunks.

When a format renderer does this role, Qwiratry::Operator::IO::RenderOperator calls render-pull and does not force upstream lazy sequences into a list.

render-pull(Mu $data, Associative :%options)

method render-pull(Mu $data, Associative :%options --> Iterator:D)

Parameters

  • $data

Structured data to render, possibly still lazy.
  • %options

Named format options, such as rendering preferences.

Renders structured data as a pull iterator of Str chunks.

Concrete pull renderers override this method.

Qwiratry v0.10.0

Declarative query and data-walking architecture for Raku, with transformers, molds, walkers, and I/O pipelines.

Authors

  • Tim Nelson

License

Dependencies

SlangifyImplementation::Loader:ver<0.0.9+>Glob::Grammar

Test Dependencies

Provides

  • Qwiratry
  • Qwiratry::Context
  • Qwiratry::Format
  • Qwiratry::Format::Base
  • Qwiratry::Format::CSVdemo
  • Qwiratry::Format::JSONdemo
  • Qwiratry::Format::NDJSONdemo
  • Qwiratry::Location
  • Qwiratry::Location::Base
  • Qwiratry::Location::File
  • Qwiratry::Mold
  • Qwiratry::Mold::Compiler
  • Qwiratry::Mold::Registry
  • Qwiratry::Mold::Slang
  • Qwiratry::Operator::Capability
  • Qwiratry::Operator::IO
  • Qwiratry::Operator::MapReduce
  • Qwiratry::Operator::Navigation
  • Qwiratry::Operator::Set
  • Qwiratry::Query::Evaluator::Eager
  • Qwiratry::Query::Evaluator::Filter
  • Qwiratry::Query::Evaluator::Join
  • Qwiratry::Query::Evaluator::Lazy
  • Qwiratry::Query::Evaluator::MapReduce
  • Qwiratry::Query::Evaluator::Navigation
  • Qwiratry::Query::Evaluator::Relational
  • Qwiratry::Query::Evaluator::Row
  • Qwiratry::Query::Evaluator::Set
  • Qwiratry::Query::Evaluator::Union
  • Qwiratry::Query::Extract
  • Qwiratry::Query::NamedJoins
  • Qwiratry::Query::RelationCommon
  • Qwiratry::Query::Runtime
  • Qwiratry::Query::Selector
  • Qwiratry::Query::Slang
  • Qwiratry::Query::Slang::Ops
  • Qwiratry::Query::Slang::Topic
  • Qwiratry::Query::Specificity
  • Qwiratry::Query::Topic
  • Qwiratry::QueryCursor
  • Qwiratry::QueryIterator
  • Qwiratry::QueryMatch
  • Qwiratry::Setup
  • Qwiratry::Strategy
  • Qwiratry::Strategy::ControlSignal
  • Qwiratry::Strategy::FinishResult
  • Qwiratry::Strategy::RewriteSpec
  • Qwiratry::Strategy::Traversal
  • Qwiratry::Suggest
  • Qwiratry::Table
  • Qwiratry::Table::Schema
  • Qwiratry::Transformer
  • Qwiratry::Transformer::Copy
  • Qwiratry::Transformer::TreeRewrite
  • Qwiratry::Tree::Navigator
  • Qwiratry::Tree::Navigator::Base
  • Qwiratry::Tree::Navigator::Filesystem
  • Qwiratry::Tree::Navigator::Match
  • Qwiratry::Tree::Navigator::RakuAST
  • Qwiratry::Tree::Replace
  • Qwiratry::Walker
  • Qwiratry::Walker::Capabilities
  • Qwiratry::Walker::Factory
  • Qwiratry::Walker::Implementation::Table
  • Qwiratry::Walker::Implementation::Tree
  • Qwiratry::Walker::Master
  • Qwiratry::Walker::Providing
  • TypedIterator
  • WalkCursor
  • X::Qwiratry

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.