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

Word sets and argument shapes shared by language frontends. More...

Classes

struct  EntryPort
 One implicit port of the entry flow. More...
 
struct  WordDoc
 Documentation for a language word, shared by editor and CLI surfaces. More...
 

Enumerations

enum class  StageArgument {
  kNone , kNumber , kExpression , kString ,
  kOptionalString , kOptionalExpression , kSortKey , kFold ,
  kDuration , kStream , kType , kLog ,
  kLogFormat
}
 What a stage takes after its name. More...
 
enum class  WordRole {
  kStage , kBuiltin , kStatement , kDeclaration ,
  kClause , kModifier , kSource , kPortModifier ,
  kFieldModifier , kType , kConstant , kOperatorWord ,
  kStatusCode , kLogLevel , kStatusField , kDurationUnit ,
  kSymbol
}
 The grammar role under which a word is documented. More...
 

Functions

std::string Canonical (std::string_view word)
 Lowercases uniformly upper-case words; leaves mixed-case words unchanged.
 
bool IsShouted (std::string_view word)
 Whether the word, canonicalised, is written entirely in upper case.
 
absl::Span< const EntryPort > EntryPorts ()
 Implicit entry-flow ports in declaration order.
 
absl::Span< const std::string_view > Stages ()
 
std::optional< StageArgument > StageTakes (std::string_view canonical_name)
 What a stage takes, or nullopt if the name is not a stage.
 
std::string_view StageArgumentName (StageArgument argument)
 The spelling of a stage argument kind in the output formats.
 
const WordDoc *absl_nullable StageDocumentation (std::string_view canonical_name)
 Stage documentation, or null for an unknown stage.
 
const WordDoc *absl_nullable BuiltinDocumentation (std::string_view canonical_name)
 Built-in function documentation, or null for an unknown function.
 
bool IsPrimitiveType (std::string_view name)
 Whether a standard type and its conversion are in the primitive prelude.
 
const WordDoc *absl_nullable AnyDocumentation (std::string_view canonical_name)
 Returns documentation under any role, or null when none exists.
 
absl::Span< const WordRole > WordRoles ()
 Every role, for something walking all of them.
 
std::string_view WordRoleName (WordRole role)
 Role name used by flow.vocabulary/v1, such as port_modifier.
 
std::vector< std::string_view > WordsOf (WordRole role)
 Words documented under role, in listing order.
 
const WordDoc *absl_nullable Documentation (WordRole role, std::string_view canonical_name)
 What one word of role does, or nullptr where that table has no entry.
 
absl::Span< const std::string_view > OrderedSymbols ()
 Punctuation and non-word operators, in listing order.
 
const absl::flat_hash_set< std::string_view > & BareStages ()
 Stages accepted without a leading |, such as hits where it.ok.
 
const absl::flat_hash_set< std::string_view > & ParallelStages ()
 Stages that accept parallel n for concurrent value processing.
 
const absl::flat_hash_set< std::string_view > & ReducingStages ()
 Stages that reduce a whole stream to one value.
 
const absl::flat_hash_set< std::string_view > & PositionalStages ()
 Stages that select or group stream values.
 
const absl::flat_hash_set< std::string_view > & Builtins ()
 Built-in functions available to flow expressions.
 
const absl::flat_hash_set< std::string_view > & TypeNames ()
 Built-in port type names. Ports also accept registered tags and media types.
 
bool IsNumericType (std::string_view name)
 
absl::Span< const int > TypeParameters (std::string_view canonical_name)
 Allowed type-parameter counts for a built-in type; empty means none.
 
absl::Span< const std::string_view > OrderedTypeNames ()
 The built-in port type names, in the order a listing reads them.
 
absl::Span< const std::string_view > OrderedBuiltins ()
 The fixed function set, in the order a listing reads it.
 
const absl::flat_hash_set< std::string_view > & StatementWords ()
 Words that open a statement, and so are not read as a name there.
 
absl::Span< const std::string_view > OrderedStatements ()
 Statement starters in completion order, most common first.
 
const absl::flat_hash_set< std::string_view > & ClauseWords ()
 Words inside statements, such as else, parallel, and max.
 
absl::Span< const std::string_view > OrderedClauseWords ()
 The same, in the order they read.
 
const absl::flat_hash_set< std::string_view > & DeclarationWords ()
 Words that declare something inside a flow.
 
absl::Span< const std::string_view > OrderedDeclarations ()
 The declarations in the order they are written in a flow.
 
const absl::flat_hash_set< std::string_view > & ModifierWords ()
 Words that may follow a call's closing parenthesis.
 
absl::Span< const std::string_view > OrderedModifiers ()
 Call modifiers in source order, including forward headers.
 
const absl::flat_hash_set< std::string_view > & SourceWords ()
 Words that open a pipeline source rather than naming one: status, zip.
 
const absl::flat_hash_set< std::string_view > & PortModifierWords ()
 What a port says about itself after its type: stream, required.
 
absl::Span< const std::string_view > OrderedPortModifiers ()
 The same, in the order a port writes them.
 
const absl::flat_hash_set< std::string_view > & FieldModifierWords ()
 Modifiers after a struct field's type.
 
absl::Span< const std::string_view > OrderedFieldModifiers ()
 Field modifiers in required source order.
 
absl::Span< const std::string_view > StatusCodes ()
 Abseil's canonical status codes, lower case, which is what fail names.
 
bool IsStatusCode (std::string_view word)
 Whether a word names a canonical status code, in either case.
 
absl::Span< const std::string_view > LogLevels ()
 Log levels accepted by log and logf, quietest first.
 
bool IsLogLevel (std::string_view word)
 Whether a word names a log level, in either case.
 
const absl::flat_hash_set< std::string_view > & StatusFields ()
 The fields of a status record: what reading an outcome gives.
 
absl::Span< const std::string_view > OrderedStatusFields ()
 The same, in the order a status record is written and read.
 
const absl::flat_hash_set< std::string_view > & ConstantWords ()
 Literals that are words: true, false, null, it.
 
const absl::flat_hash_set< std::string_view > & OperatorWords ()
 Operators that are words: and, or, not.
 
absl::Span< const std::string_view > DurationUnits ()
 Duration suffixes a number may carry, shortest unit first.
 
std::optional< double > DurationUnitSeconds (std::string_view unit)
 The seconds one of that unit is, or nullopt if it is not a unit.
 

Detailed Description

Word sets and argument shapes shared by language frontends.

Words are significant at grammar positions; none are globally reserved.

Enumeration Type Documentation

◆ StageArgument

What a stage takes after its name.

Enumerator
kNone 

Nothing: | collect, | count.

kNumber 

A whole number of values: | first 3.

kExpression 

An expression, with it bound to the value in hand: | where it.ok.

kString 

A string, required: | strformat "took {}".

kOptionalString 

A string, optional: | join, | join ", ".

kOptionalExpression 

An expression, optional, with it bound: | sum, | sum it.price.

kSortKey 

An optional by key with it bound, and an optional desc: | sort, | sort by it.score desc.

kFold 

A literal to start from, a name for what is carried, and the expression that folds one value into it: | fold 0 as total, total + it.

kDuration 

A length of time: | timeout 30s, | pace 100ms.

kStream 

Another stream to read after this one: | then other.

kType 

A named type: | as i32.

kLog 

An optional level word and an optional expression, with it bound to the value in hand: | log, | log warning it.error.

kLogFormat 

An optional level word, a format string, and the values to fill it with, with it bound to the value in hand: | logf "took %s" it.elapsed.

◆ WordRole

The grammar role under which a word is documented.

A word may appear under multiple roles with one shared description.

Enumerator
kStage 

A pipeline stage: | first 3. Same table as [StageDocumentation].

kBuiltin 

A built-in function, where it is called.

Same table as [BuiltinDocumentation].

kStatement 

A word that opens a statement: run, value, for. [StatementWords].

kDeclaration 

A word that declares something: flow, in, header.

[DeclarationWords].

kClause 

A word that continues a statement: else, parallel. [ClauseWords].

kModifier 

A word that may follow a call's ): via, timeout. [ModifierWords].

kSource 

A word that opens a pipeline source rather than naming one: status, zip.

[SourceWords].

kPortModifier 

What a port says about itself after its type. [PortModifierWords].

kFieldModifier 

What a struct field says about itself after its type.

[FieldModifierWords].

kType 

A built-in port type name. [TypeNames].

kConstant 

A literal that is a word: true, it. [ConstantWords].

kOperatorWord 

An operator that is a word: and, not. [OperatorWords].

kStatusCode 

One of Abseil's canonical status codes. [StatusCodes].

kLogLevel 

The severity a log or logf may name. [LogLevels].

kStatusField 

A field of a status record, read after a .. [StatusFields].

kDurationUnit 

A duration suffix: ms, h. [DurationUnits].

kSymbol 

Punctuation and the operators that are not words, keyed by the symbol itself: |, ->, ==, {.

[OrderedSymbols].

Function Documentation

◆ AnyDocumentation()

const WordDoc *absl_nullable a11::flow::vocabulary::AnyDocumentation ( std::string_view  canonical_name)

Returns documentation under any role, or null when none exists.

◆ BareStages()

const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::BareStages ( )

Stages accepted without a leading |, such as hits where it.ok.

◆ BuiltinDocumentation()

const WordDoc *absl_nullable a11::flow::vocabulary::BuiltinDocumentation ( std::string_view  canonical_name)

Built-in function documentation, or null for an unknown function.

A word may have separate stage and function meanings.

◆ Builtins()

const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::Builtins ( )

Built-in functions available to flow expressions.

◆ Canonical()

std::string a11::flow::vocabulary::Canonical ( std::string_view  word)

Lowercases uniformly upper-case words; leaves mixed-case words unchanged.

FOR and for are keywords; For is a name.

◆ ClauseWords()

const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::ClauseWords ( )

Words inside statements, such as else, parallel, and max.

◆ ConstantWords()

const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::ConstantWords ( )

Literals that are words: true, false, null, it.

◆ DeclarationWords()

const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::DeclarationWords ( )

Words that declare something inside a flow.

◆ Documentation()

const WordDoc *absl_nullable a11::flow::vocabulary::Documentation ( WordRole  role,
std::string_view  canonical_name 
)

What one word of role does, or nullptr where that table has no entry.

The word is the canonical form for every role but [WordRole::kSymbol], where it is the punctuation as written.

◆ DurationUnits()

absl::Span< const std::string_view > a11::flow::vocabulary::DurationUnits ( )

Duration suffixes a number may carry, shortest unit first.

◆ DurationUnitSeconds()

std::optional< double > a11::flow::vocabulary::DurationUnitSeconds ( std::string_view  unit)

The seconds one of that unit is, or nullopt if it is not a unit.

◆ EntryPorts()

absl::Span< const EntryPort > a11::flow::vocabulary::EntryPorts ( )

Implicit entry-flow ports in declaration order.

◆ FieldModifierWords()

const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::FieldModifierWords ( )

Modifiers after a struct field's type.

◆ IsLogLevel()

bool a11::flow::vocabulary::IsLogLevel ( std::string_view  word)

Whether a word names a log level, in either case.

◆ IsNumericType()

bool a11::flow::vocabulary::IsNumericType ( std::string_view  name)

◆ IsPrimitiveType()

bool a11::flow::vocabulary::IsPrimitiveType ( std::string_view  name)

Whether a standard type and its conversion are in the primitive prelude.

◆ IsShouted()

bool a11::flow::vocabulary::IsShouted ( std::string_view  word)

Whether the word, canonicalised, is written entirely in upper case.

◆ IsStatusCode()

bool a11::flow::vocabulary::IsStatusCode ( std::string_view  word)

Whether a word names a canonical status code, in either case.

◆ LogLevels()

absl::Span< const std::string_view > a11::flow::vocabulary::LogLevels ( )

Log levels accepted by log and logf, quietest first.

◆ ModifierWords()

const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::ModifierWords ( )

Words that may follow a call's closing parenthesis.

◆ OperatorWords()

const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::OperatorWords ( )

Operators that are words: and, or, not.

◆ OrderedBuiltins()

absl::Span< const std::string_view > a11::flow::vocabulary::OrderedBuiltins ( )

The fixed function set, in the order a listing reads it.

◆ OrderedClauseWords()

absl::Span< const std::string_view > a11::flow::vocabulary::OrderedClauseWords ( )

The same, in the order they read.

◆ OrderedDeclarations()

absl::Span< const std::string_view > a11::flow::vocabulary::OrderedDeclarations ( )

The declarations in the order they are written in a flow.

◆ OrderedFieldModifiers()

absl::Span< const std::string_view > a11::flow::vocabulary::OrderedFieldModifiers ( )

Field modifiers in required source order.

◆ OrderedModifiers()

absl::Span< const std::string_view > a11::flow::vocabulary::OrderedModifiers ( )

Call modifiers in source order, including forward headers.

◆ OrderedPortModifiers()

absl::Span< const std::string_view > a11::flow::vocabulary::OrderedPortModifiers ( )

The same, in the order a port writes them.

◆ OrderedStatements()

absl::Span< const std::string_view > a11::flow::vocabulary::OrderedStatements ( )

Statement starters in completion order, most common first.

◆ OrderedStatusFields()

absl::Span< const std::string_view > a11::flow::vocabulary::OrderedStatusFields ( )

The same, in the order a status record is written and read.

◆ OrderedSymbols()

absl::Span< const std::string_view > a11::flow::vocabulary::OrderedSymbols ( )

Punctuation and non-word operators, in listing order.

◆ OrderedTypeNames()

absl::Span< const std::string_view > a11::flow::vocabulary::OrderedTypeNames ( )

The built-in port type names, in the order a listing reads them.

◆ ParallelStages()

const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::ParallelStages ( )

Stages that accept parallel n for concurrent value processing.

◆ PortModifierWords()

const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::PortModifierWords ( )

What a port says about itself after its type: stream, required.

◆ PositionalStages()

const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::PositionalStages ( )

Stages that select or group stream values.

◆ ReducingStages()

const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::ReducingStages ( )

Stages that reduce a whole stream to one value.

◆ SourceWords()

const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::SourceWords ( )

Words that open a pipeline source rather than naming one: status, zip.

◆ StageArgumentName()

std::string_view a11::flow::vocabulary::StageArgumentName ( StageArgument  argument)

The spelling of a stage argument kind in the output formats.

◆ StageDocumentation()

const WordDoc *absl_nullable a11::flow::vocabulary::StageDocumentation ( std::string_view  canonical_name)

Stage documentation, or null for an unknown stage.

◆ Stages()

absl::Span< const std::string_view > a11::flow::vocabulary::Stages ( )

◆ StageTakes()

std::optional< StageArgument > a11::flow::vocabulary::StageTakes ( std::string_view  canonical_name)

What a stage takes, or nullopt if the name is not a stage.

◆ StatementWords()

const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::StatementWords ( )

Words that open a statement, and so are not read as a name there.

◆ StatusCodes()

absl::Span< const std::string_view > a11::flow::vocabulary::StatusCodes ( )

Abseil's canonical status codes, lower case, which is what fail names.

◆ StatusFields()

const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::StatusFields ( )

The fields of a status record: what reading an outcome gives.

◆ TypeNames()

const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::TypeNames ( )

Built-in port type names. Ports also accept registered tags and media types.

◆ TypeParameters()

absl::Span< const int > a11::flow::vocabulary::TypeParameters ( std::string_view  canonical_name)

Allowed type-parameter counts for a built-in type; empty means none.

◆ WordRoleName()

std::string_view a11::flow::vocabulary::WordRoleName ( WordRole  role)

Role name used by flow.vocabulary/v1, such as port_modifier.

◆ WordRoles()

absl::Span< const WordRole > a11::flow::vocabulary::WordRoles ( )

Every role, for something walking all of them.

◆ WordsOf()

std::vector< std::string_view > a11::flow::vocabulary::WordsOf ( WordRole  role)

Words documented under role, in listing order.