A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
a11::flow::interpreter Namespace Reference

Classes

struct  RunOptions
 How to run it. More...
 
struct  RunOutcome
 What came of it. More...
 
struct  Source
 What to run: the source, and a name for it that diagnostics will quote. More...
 

Functions

absl::Status RegisterStandardLibrary (actions::ActionRegistry &registry, const sdk::flow::CapabilitiesPtr &capabilities, bool standard_streams)
 Registers the standard library on registry, under capabilities.
 
absl::StatusOr< RunOutcome > Check (const Source &source)
 Compiles source and says what its entry flow is, running nothing.
 
absl::StatusOr< std::string > DescribeEntry (const Source &source)
 The entry flow's ports, as text a person reads. Used by --check.
 
absl::StatusOr< RunOutcome > Run (const Source &source, const RunOptions &options)
 Compiles source and runs its entry flow to completion.
 

Function Documentation

◆ Check()

absl::StatusOr< RunOutcome > a11::flow::interpreter::Check ( const Source &  source)

Compiles source and says what its entry flow is, running nothing.

What --check is, and what a host wants before offering a file to somebody: the ports the program expects, and anything the compiler had to say.

◆ DescribeEntry()

absl::StatusOr< std::string > a11::flow::interpreter::DescribeEntry ( const Source &  source)

The entry flow's ports, as text a person reads. Used by --check.

◆ RegisterStandardLibrary()

absl::Status a11::flow::interpreter::RegisterStandardLibrary ( actions::ActionRegistry &  registry,
const sdk::flow::CapabilitiesPtr &  capabilities,
bool  standard_streams 
)

Registers the standard library on registry, under capabilities.

Every name the registry already has is left as it is. Called by Run(); exposed because a host may want the actions without running anything yet.

Parameters
registryRegistry to extend with standard actions.
capabilitiesPolicy applied by capability-sensitive actions.
standard_streamsWhether to bind read_stdin, write_stdout and write_stderr, which RegisterFlowActions does not register.

◆ Run()

absl::StatusOr< RunOutcome > a11::flow::interpreter::Run ( const Source &  source,
const RunOptions &  options 
)

Compiles source and runs its entry flow to completion.

Returns
The program outcome, or a compile error with its location, a missing entry flow, an empty policy, or the flow's terminal failure.