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

Classes

struct  Abort
 abort node [code] [message] – end a node with a failure. More...
 
struct  ActionId
 id subject – the identity assigned to a run or call. More...
 
struct  Attr
 base.name – a call's port, or a key of a value. More...
 
struct  Binary
 left op right for and or == != < <= > >= in + -. More...
 
struct  Bind
 name = ... – a step the rest of the flow can refer to. More...
 
struct  Block
 [try] { ... } groups concurrent statements into one outcome. More...
 
struct  Builtin
 name(arg, ...) – one of the language's fixed functions. More...
 
struct  CallExpression
 run/call action(port: pipeline, ...) and its modifiers. More...
 
struct  CallModifiers
 The tee/via/timeout/after/with/id/id-into/forward tail. More...
 
struct  CallStatement
 A call statement whose unnamed outputs are drained. More...
 
struct  Cancel
 cancel name – ask a called action to stop, cooperatively. More...
 
struct  Carry
 name <- pipeline – what the next pass of a repeat carries. More...
 
struct  Close
 close target – hold until a node's writers are done and its buffer has landed. More...
 
struct  Constant
 A literal or folded literal expression, including nested lists and objects. More...
 
struct  Discard
 _, a pipe destination that discards its input. More...
 
struct  DtoDeclaration
 One struct name { ... } declaration: a shape a port may be typed with. More...
 
struct  ErrorNode
 A place the parser wanted a value and did not find one. More...
 
struct  ExportDeclaration
 A public alias of an existing namespace member. More...
 
struct  Fail
 fail [code] [message] – end the flow with a status. More...
 
struct  FieldDeclaration
 One name: type [modifiers] ["description"] field of a struct. More...
 
struct  FieldRange
 A field bound such as 1..200, 1.., or ..200. More...
 
struct  FlowDeclaration
 One flow name { ... } declaration, or the one flow { ... } entry point. More...
 
struct  ForEach
 for name[, name...] in pipeline [parallel n] { ... }. More...
 
struct  HeaderDeclaration
 header "x-name" [as alias] [default value]. More...
 
struct  If
 if expr { ... } else { ... }. More...
 
struct  Import
 A source module bound to a namespace or selected local symbols. More...
 
struct  ImportedSymbol
 
struct  Index
 base[i] – an element of a list, or a key of an object. More...
 
struct  It
 it – the value a where/map/group stage is looking at. More...
 
struct  ListLiteral
 [a, ...rest, c]. An item may be a [Spread]. More...
 
struct  Literal
 A number, string, boolean, null or duration written out. More...
 
struct  Location
 The start token's byte span, line, and code-point column. More...
 
struct  Log
 log [level] [what] / logf [level] "format" [args] – write to the flow's own log. More...
 
struct  LogTail
 Arguments shared by log and logf statements and stages. More...
 
struct  ModuleDeclaration
 A namespace contribution in one source document. More...
 
struct  Name
 A bare name: a port, a call, a loop variable, a header alias. More...
 
struct  Node
 Base of every syntax node: what it is, and where it started. More...
 
struct  NodeExpression
 node(id) [in map] – a node of this flow's own. More...
 
struct  NodeOf
 Assigns a fixed kind to each syntax node type. More...
 
struct  Nodes
 nodes name [{ ... }] – declare a temporary node map. More...
 
struct  ObjectLiteral
 { "key": expr, ...rest }. More...
 
struct  Outcome
 status subject; reading it waits for the subject to finish. More...
 
struct  Pipe
 pipeline -> target, target – write a stream into one or more nodes. More...
 
struct  Pipeline
 A source expression and the stages its values pass through. More...
 
struct  PipelineValue
 (stream | stage ...) used where a value is expected. More...
 
struct  PortDeclaration
 in/out name: type [stream] [required]. More...
 
struct  Repeat
 repeat [name = expr] [max n] { ... }. More...
 
struct  Skip
 skip n reference – discard the first n values for every reader. More...
 
struct  SkipTarget
 The one reference changed by a counted skip. More...
 
struct  Spread
 ...expr in a list or object literal. More...
 
struct  Stage
 One | name arg stage of a pipeline. More...
 
struct  TypedValue
 Tag{...} or expr as Tag – a value made into a type's value. More...
 
struct  TypeExpression
 
struct  Unary
 not operand. More...
 
struct  Until
 until expr / while expr – when a repeat stops. More...
 
struct  Wait
 Wait for one subject, the first of several, or all of several. More...
 
struct  Word
 
struct  Zip
 zip or interleave over stream sources. More...
 

Typedefs

using NodePtr = std::unique_ptr< Node >
 
using StagePtr = std::unique_ptr< Stage >
 
using PipelinePtr = std::unique_ptr< Pipeline >
 
using CallModifiersPtr = std::unique_ptr< CallModifiers >
 
using CallExpressionPtr = std::unique_ptr< CallExpression >
 
using PortDeclarationPtr = std::unique_ptr< PortDeclaration >
 
using HeaderDeclarationPtr = std::unique_ptr< HeaderDeclaration >
 
using FlowDeclarationPtr = std::unique_ptr< FlowDeclaration >
 
using FieldDeclarationPtr = std::unique_ptr< FieldDeclaration >
 
using DtoDeclarationPtr = std::unique_ptr< DtoDeclaration >
 

Enumerations

enum class  NodeKind {
  kError , kLiteral , kListLiteral , kObjectLiteral ,
  kSpread , kIt , kDiscard , kName ,
  kAttr , kIndex , kBuiltin , kZip ,
  kTypedValue , kUnary , kBinary , kStage ,
  kPipeline , kOutcome , kActionId , kPipelineValue ,
  kCallModifiers , kCallExpression , kBind , kBlock ,
  kCallStatement , kPipe , kSkip , kWait ,
  kClose , kCancel , kAbort , kFail ,
  kLog , kForEach , kRepeat , kCarry ,
  kUntil , kIf , kNodes , kNodeExpression ,
  kPortDeclaration , kHeaderDeclaration , kFlowDeclaration , kFieldDeclaration ,
  kDtoDeclaration
}
 Syntax node kinds, one per construct. More...
 
enum class  PortDirection { kInput , kOutput }
 Which side of the descriptor a port lands on, spelled as the plan spells it. More...
 

Functions

Location LocationOf (const Token &token)
 The location a token occupies.
 
std::string_view ConstantKindName (Constant::Kind kind)
 The spelling of a constant's kind in the output formats.
 
std::string RuntimeActionName (std::string_view name)
 
std::string ActionSource (std::string_view name)
 
std::string SourceFunctionName (std::string_view name)
 
std::string SourceTypeName (std::string_view name)
 A port or cast type, such as string, list[a11.NodeFragment], or "audio/wav".
 
std::string_view NodeKindName (NodeKind kind)
 The name of a node kind in the output formats, in kebab case.
 
bool IsAnyOf (const Node *node, std::initializer_list< NodeKind > kinds)
 Whether a node is one of the kinds given.
 
std::string_view PortDirectionName (PortDirection direction)
 "inputs" or "outputs".
 
bool IsPureLiteralExpression (const Node &node)
 Whether a bounded expression contains only literal data and pure operators.
 
std::optional< Constant > ConstantValue (const Node *node)
 Folds a literal expression, or returns nullopt for runtime values.
 
void VisitChildren (const Node &node, const std::function< void(const Node &)> &visit)
 Visits direct child nodes in source order.
 
void VisitSubtree (const Node &node, const std::function< void(const Node &)> &visit)
 Visits a subtree iteratively, starting with node.
 
std::optional< std::string > DottedName (const Node *node)
 Returns a dotted Name/Attr chain, or nullopt for other nodes.
 
void VisitMutableSubtree (Node &node, const std::function< void(Node &)> &visit)
 Walk an exclusively owned syntax tree for native linking/editing.
 
template<typename T >
const T * As (const Node *node)
 Returns node as T, or null when its kind differs.
 
template<typename T >
T * As (Node *node)
 

Typedef Documentation

◆ CallExpressionPtr

using a11::flow::syntax::CallExpressionPtr = typedef std::unique_ptr<CallExpression>

◆ CallModifiersPtr

using a11::flow::syntax::CallModifiersPtr = typedef std::unique_ptr<CallModifiers>

◆ DtoDeclarationPtr

using a11::flow::syntax::DtoDeclarationPtr = typedef std::unique_ptr<DtoDeclaration>

◆ FieldDeclarationPtr

using a11::flow::syntax::FieldDeclarationPtr = typedef std::unique_ptr<FieldDeclaration>

◆ FlowDeclarationPtr

using a11::flow::syntax::FlowDeclarationPtr = typedef std::unique_ptr<FlowDeclaration>

◆ HeaderDeclarationPtr

◆ NodePtr

using a11::flow::syntax::NodePtr = typedef std::unique_ptr<Node>

◆ PipelinePtr

using a11::flow::syntax::PipelinePtr = typedef std::unique_ptr<Pipeline>

◆ PortDeclarationPtr

using a11::flow::syntax::PortDeclarationPtr = typedef std::unique_ptr<PortDeclaration>

◆ StagePtr

using a11::flow::syntax::StagePtr = typedef std::unique_ptr<Stage>

Enumeration Type Documentation

◆ NodeKind

enum class a11::flow::syntax::NodeKind
strong

Syntax node kinds, one per construct.

Enumerator
kError 

A syntax error retained in the recovering parser's tree.

kLiteral 
kListLiteral 
kObjectLiteral 
kSpread 
kIt 
kDiscard 
kName 
kAttr 
kIndex 
kBuiltin 
kZip 
kTypedValue 
kUnary 
kBinary 
kStage 
kPipeline 
kOutcome 
kActionId 
kPipelineValue 
kCallModifiers 
kCallExpression 
kBind 
kBlock 
kCallStatement 
kPipe 
kSkip 
kWait 
kClose 
kCancel 
kAbort 
kFail 
kLog 
kForEach 
kRepeat 
kCarry 
kUntil 
kIf 
kNodes 
kNodeExpression 
kPortDeclaration 
kHeaderDeclaration 
kFlowDeclaration 
kFieldDeclaration 
kDtoDeclaration 

◆ PortDirection

Which side of the descriptor a port lands on, spelled as the plan spells it.

Enumerator
kInput 
kOutput 

Function Documentation

◆ ActionSource()

std::string a11::flow::syntax::ActionSource ( std::string_view  name)

◆ As() [1/2]

template<typename T >
const T * a11::flow::syntax::As ( const Node *  node)

Returns node as T, or null when its kind differs.

◆ As() [2/2]

template<typename T >
T * a11::flow::syntax::As ( Node *  node)

◆ ConstantKindName()

std::string_view a11::flow::syntax::ConstantKindName ( Constant::Kind  kind)

The spelling of a constant's kind in the output formats.

◆ ConstantValue()

std::optional< Constant > a11::flow::syntax::ConstantValue ( const Node *  node)

Folds a literal expression, or returns nullopt for runtime values.

◆ DottedName()

std::optional< std::string > a11::flow::syntax::DottedName ( const Node *  node)

Returns a dotted Name/Attr chain, or nullopt for other nodes.

◆ IsAnyOf()

bool a11::flow::syntax::IsAnyOf ( const Node *  node,
std::initializer_list< NodeKind >  kinds 
)

Whether a node is one of the kinds given.

◆ IsPureLiteralExpression()

bool a11::flow::syntax::IsPureLiteralExpression ( const Node &  node)

Whether a bounded expression contains only literal data and pure operators.

◆ LocationOf()

Location a11::flow::syntax::LocationOf ( const Token &  token)

The location a token occupies.

◆ NodeKindName()

std::string_view a11::flow::syntax::NodeKindName ( NodeKind  kind)

The name of a node kind in the output formats, in kebab case.

◆ PortDirectionName()

std::string_view a11::flow::syntax::PortDirectionName ( PortDirection  direction)

"inputs" or "outputs".

◆ RuntimeActionName()

std::string a11::flow::syntax::RuntimeActionName ( std::string_view  name)

◆ SourceFunctionName()

std::string a11::flow::syntax::SourceFunctionName ( std::string_view  name)

◆ SourceTypeName()

std::string a11::flow::syntax::SourceTypeName ( std::string_view  name)

A port or cast type, such as string, list[a11.NodeFragment], or "audio/wav".

name holds the base name or quoted media type.

◆ VisitChildren()

void a11::flow::syntax::VisitChildren ( const Node &  node,
const std::function< void(const Node &)> &  visit 
)

Visits direct child nodes in source order.

Type expressions are values on nodes and are not visited separately.

◆ VisitMutableSubtree()

void a11::flow::syntax::VisitMutableSubtree ( Node &  node,
const std::function< void(Node &)> &  visit 
)

Walk an exclusively owned syntax tree for native linking/editing.

◆ VisitSubtree()

void a11::flow::syntax::VisitSubtree ( const Node &  node,
const std::function< void(const Node &)> &  visit 
)

Visits a subtree iteratively, starting with node.

Parents precede children; sibling order is unspecified.