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

The flows a file declares, and everything wrong with it. More...

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

Public Member Functions

bool HasErrors () const
 
const Diagnostic *absl_nullable FirstError () const
 The first error in source order, or nullptr.
 

Public Attributes

std::vector< syntax::FlowDeclarationPtr > flows
 
std::vector< syntax::DtoDeclarationPtr > dtos
 The shapes the file declares, in declaration order.
 
std::vector< Diagnostic > diagnostics
 
std::vector< size_t > value_braces
 The offset of every { that opens a value rather than a block, sorted.
 
std::vector< size_t > tagged_braces
 The offsets of the value braces that follow a type tag, sorted.
 

Detailed Description

The flows a file declares, and everything wrong with it.

Member Function Documentation

◆ FirstError()

const Diagnostic *absl_nullable a11::flow::ParseResult::FirstError ( ) const

The first error in source order, or nullptr.

This is what a strict caller turns into a refusal: flow.loads raises the Python FlowSyntaxError built from exactly this.

◆ HasErrors()

bool a11::flow::ParseResult::HasErrors ( ) const

Member Data Documentation

◆ diagnostics

std::vector<Diagnostic> a11::flow::ParseResult::diagnostics

◆ dtos

std::vector<syntax::DtoDeclarationPtr> a11::flow::ParseResult::dtos

The shapes the file declares, in declaration order.

Beside the flows rather than inside them: a struct is a sibling declaration, and a file may declare one and no flow at all – a file of types is a perfectly good thing to have, and is what flow.dto_from_schema writes.

◆ flows

std::vector<syntax::FlowDeclarationPtr> a11::flow::ParseResult::flows

◆ tagged_braces

std::vector<size_t> a11::flow::ParseResult::tagged_braces

The offsets of the value braces that follow a type tag, sorted.

A subset of [value_braces], and the other thing only the grammar knows: a11.sdk.Interaction{...} is one thing and | map {...} is a stage and a literal, so the first hugs its brace and the second takes a space.

◆ value_braces

std::vector<size_t> a11::flow::ParseResult::value_braces

The offset of every { that opens a value rather than a block, sorted.

The one thing about the token stream that cannot be worked out from the tokens: flow research { and a11.sdk.Interaction{ are a word followed by a brace either way, and only the grammar knows which. The formatter needs it to know whether a brace opens a line or a literal, so the parser – which knew at the time – writes it down.


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