A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
syntax.cc File Reference
#include "a11/flow/syntax.h"
#include <algorithm>
#include <optional>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include <absl/strings/str_cat.h>
#include <absl/strings/str_join.h>
#include <absl/strings/str_replace.h>
#include <nlohmann/json.hpp>
#include "a11/flow/lexer.h"
#include "a11/utf8.h"

Namespaces

namespace  a11
 
namespace  a11::flow
 
namespace  a11::flow::syntax
 

Functions

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