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

One name, what it is, and what became of it. More...

#include <cpp/a11/flow/resolve.h>

Public Attributes

SymbolKind kind = SymbolKind::kInputPort
 
std::string name
 
syntax::Location location
 
bool implicit = false
 Whether the language bound it rather than the author: the index every loop provides.
 
bool readable = true
 Whether a pipeline may read it.
 
bool writable = false
 Whether a pipe may write it.
 
std::string action
 For a call: the action named, whether it was try, and the sibling flow it resolves to if it is one.
 
bool tolerant = false
 
const FlowPlan *absl_nullable target = nullptr
 
int reads = 0
 How many times something read it, wrote it, or waited for it.
 
int writes = 0
 
int status_reads = 0
 For a call: whether anything read its status – wait x, status x, or a bound wait.
 
graph::RefId ref = graph::kNone
 The graph ref this name reads and writes, when a graph was built: a port, a node, a header, a loop variable.
 
graph::StepId step = graph::kNone
 The graph step this name is: a call, or a bound wait/drain.
 
graph::RefId value_source = graph::kNone
 For a value a let bound: the stream it took a value of, and which value of that stream it is.
 
int value_offset = 0
 
std::string pattern
 The match pattern this value came out of, where it came out of a literal one.
 
bool value_part = false
 Whether this name is one part of a value a let took apart.
 

Detailed Description

One name, what it is, and what became of it.

The usage counts are here rather than in the inspector because the resolver is the pass that walks every reference: counting as it goes costs nothing, and an inspector that walked the tree again to find out would be a second implementation of name resolution.

Member Data Documentation

◆ action

std::string a11::flow::Symbol::action

For a call: the action named, whether it was try, and the sibling flow it resolves to if it is one.

◆ implicit

bool a11::flow::Symbol::implicit = false

Whether the language bound it rather than the author: the index every loop provides.

Nothing is said about one of these going unread.

◆ kind

SymbolKind a11::flow::Symbol::kind = SymbolKind::kInputPort

◆ location

syntax::Location a11::flow::Symbol::location

◆ name

std::string a11::flow::Symbol::name

◆ pattern

std::string a11::flow::Symbol::pattern

The match pattern this value came out of, where it came out of a literal one.

A pattern names its fields, so this is how the tooling knows what a value has without the language gaining a type system: the fields are in the text that made it. Empty for everything else, including a pattern computed at run time – nothing is known about those and offering a guess would be worse than offering nothing.

◆ readable

bool a11::flow::Symbol::readable = true

Whether a pipeline may read it.

◆ reads

int a11::flow::Symbol::reads = 0

How many times something read it, wrote it, or waited for it.

◆ ref

graph::RefId a11::flow::Symbol::ref = graph::kNone

The graph ref this name reads and writes, when a graph was built: a port, a node, a header, a loop variable.

Memoised here because identity is the whole point – two mentions of one node are one stream, and skip n accumulates on it.

◆ status_reads

int a11::flow::Symbol::status_reads = 0

For a call: whether anything read its status – wait x, status x, or a bound wait.

A try whose status nobody reads is the flow ignoring the failure it just said it expected.

◆ step

graph::StepId a11::flow::Symbol::step = graph::kNone

The graph step this name is: a call, or a bound wait/drain.

◆ target

const FlowPlan* absl_nullable a11::flow::Symbol::target = nullptr

◆ tolerant

bool a11::flow::Symbol::tolerant = false

◆ value_offset

int a11::flow::Symbol::value_offset = 0

◆ value_part

bool a11::flow::Symbol::value_part = false

Whether this name is one part of a value a let took apart.

A fact rather than something inferred from value_source being absent: the editor path builds no graph, so every ref is absent there and a check that read the ref would be a check an editor never runs.

◆ value_source

graph::RefId a11::flow::Symbol::value_source = graph::kNone

For a value a let bound: the stream it took a value of, and which value of that stream it is.

advance reads both to bind the next one, which is what makes "the first use sees the first value" a fact rather than a hope.

◆ writable

bool a11::flow::Symbol::writable = false

Whether a pipe may write it.

◆ writes

int a11::flow::Symbol::writes = 0

The documentation for this struct was generated from the following file: