A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
vocabulary.cc File Reference
#include "a11/flow/vocabulary.h"
#include <algorithm>
#include <array>
#include <optional>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include <absl/container/flat_hash_map.h>
#include <absl/container/flat_hash_set.h>
#include <absl/types/span.h>

Namespaces

namespace  a11
 
namespace  a11::flow
 
namespace  a11::flow::vocabulary
 The words the language gives meaning to, and what each one may be given.
 

Functions

std::string a11::flow::vocabulary::Canonical (std::string_view word)
 The lower-case form of a uniformly-cased word, or the word unchanged.
 
bool a11::flow::vocabulary::IsShouted (std::string_view word)
 Whether the word, canonicalised, is written entirely in upper case.
 
absl::Span< const EntryPort > a11::flow::vocabulary::EntryPorts ()
 The ports the entry flow has without declaring them, in declaration order.
 
absl::Span< const std::string_view > a11::flow::vocabulary::Stages ()
 
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.
 
std::string_view a11::flow::vocabulary::StageArgumentName (StageArgument argument)
 The spelling of a stage argument kind in the output formats.
 
const WordDoc *absl_nullable a11::flow::vocabulary::StageDocumentation (std::string_view canonical_name)
 What a stage does, or nullptr where the name is not a stage.
 
const WordDoc *absl_nullable a11::flow::vocabulary::BuiltinDocumentation (std::string_view canonical_name)
 What a built-in function does, or nullptr where the name is not one.
 
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.
 
absl::Span< const std::string_view > a11::flow::vocabulary::OrderedSymbols ()
 Every punctuation mark and non-word operator the language gives meaning to, in the order a listing reads them.
 
const WordDoc *absl_nullable a11::flow::vocabulary::AnyDocumentation (std::string_view canonical_name)
 What one word does under whichever role documents it, or nullptr.
 
absl::Span< const WordRole > a11::flow::vocabulary::WordRoles ()
 Every role, for something walking all of them.
 
std::string_view a11::flow::vocabulary::WordRoleName (WordRole role)
 The name a role travels under in flow.vocabulary/v1: port_modifier.
 
std::vector< std::string_view > a11::flow::vocabulary::WordsOf (WordRole role)
 The words role documents, in the order a listing reads them.
 
const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::BareStages ()
 The two stages that may be written without their leading |.
 
const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::ReducingStages ()
 The stages that read a whole stream and yield exactly one value.
 
const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::PositionalStages ()
 The stages that choose which values of a stream to keep, or group them, rather than reshaping each one.
 
const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::ParallelStages ()
 The stages a value may pass through several at a time.
 
const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::Builtins ()
 The language's fixed function set. No user code, ever: a flow stays data.
 
absl::Span< const std::string_view > a11::flow::vocabulary::OrderedBuiltins ()
 The fixed function set, in the order a listing reads it.
 
const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::TypeNames ()
 The built-in port type names.
 
absl::Span< const std::string_view > a11::flow::vocabulary::OrderedTypeNames ()
 The built-in port type names, in the order a listing reads them.
 
absl::Span< const int > a11::flow::vocabulary::TypeParameters (std::string_view canonical_name)
 How many type parameters a built-in type may be given.
 
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.
 
absl::Span< const std::string_view > a11::flow::vocabulary::OrderedStatements ()
 The same, in the order they read: what a statement may begin with, most common first.
 
const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::ClauseWords ()
 Words that stand inside a statement without opening one.
 
absl::Span< const std::string_view > a11::flow::vocabulary::OrderedClauseWords ()
 The same, in the order they read.
 
const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::DeclarationWords ()
 Words that declare something inside a flow.
 
absl::Span< const std::string_view > a11::flow::vocabulary::OrderedDeclarations ()
 The declarations in the order they are written in a flow.
 
const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::ModifierWords ()
 Words that may follow a call's closing parenthesis.
 
absl::Span< const std::string_view > a11::flow::vocabulary::OrderedModifiers ()
 The modifiers in the order they read after a call, forward headers being the one that is two words.
 
const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::SourceWords ()
 Words that open a pipeline source rather than naming one: status, zip.
 
const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::PortModifierWords ()
 What a port says about itself after its type: stream, required.
 
absl::Span< const std::string_view > a11::flow::vocabulary::OrderedPortModifiers ()
 The same, in the order a port writes them.
 
const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::FieldModifierWords ()
 What a struct field says about itself after its type.
 
absl::Span< const std::string_view > a11::flow::vocabulary::OrderedFieldModifiers ()
 The same, in the order a field writes them, which is the order they are required to be written in.
 
absl::Span< const std::string_view > a11::flow::vocabulary::LogLevels ()
 The severities a log or logf may name, quietest first.
 
bool a11::flow::vocabulary::IsLogLevel (std::string_view word)
 Whether a word names a log level, in either case.
 
absl::Span< const std::string_view > a11::flow::vocabulary::StatusCodes ()
 Abseil's canonical status codes, lower case, which is what fail names.
 
bool a11::flow::vocabulary::IsStatusCode (std::string_view word)
 Whether a word names a canonical status code, in either case.
 
const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::StatusFields ()
 The fields of a status record: what reading an outcome gives.
 
absl::Span< const std::string_view > a11::flow::vocabulary::OrderedStatusFields ()
 The same, in the order a status record is written and read.
 
const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::ConstantWords ()
 Literals that are words: true, false, null, it.
 
const absl::flat_hash_set< std::string_view > & a11::flow::vocabulary::OperatorWords ()
 Operators that are words: and, or, not.
 
absl::Span< const std::string_view > a11::flow::vocabulary::DurationUnits ()
 Duration suffixes a number may carry, shortest unit first.
 
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.