17#ifndef A11_FLOW_RESOLVE_H_
18#define A11_FLOW_RESOLVE_H_
25#include <absl/container/flat_hash_map.h>
170 absl::flat_hash_map<const syntax::Node*, ExpressionInfo>
expressions;
191 bool build_graph =
false,
192 const Program* absl_nullable context =
nullptr,
194 CompilationBudget* absl_nullable
budget =
nullptr);
CompilationLimits limits
Definition main.cc:148
CompilationBudget budget
Definition lsp.cc:289
ParseResult parsed
Definition module.cc:50
constexpr size_t kNone
Sentinel for an absent graph ID.
Definition graph.h:45
size_t RefId
Graph IDs are indices into the owning graph's vectors.
Definition graph.h:39
size_t StepId
Definition graph.h:40
@ kSink
A virtual continuation destination and its attached writer group.
Definition catalogue.cc:29
@ kCall
A bound run/call step.
@ kHeader
A header, under its alias.
@ kNode
A node of the flow's own.
@ kBarrier
A bound wait/close.
ExpressionCategory
Native result categories used by resolution and editor queries.
Definition resolve.h:127
std::string_view SymbolKindName(SymbolKind kind)
The name of a symbol kind, for a message and for the JSON.
Definition resolve.cc:6638
SymbolKind
What a name means inside a flow.
Definition resolve.h:36
@ kOutputPort
An out port: written, never read... except by this flow, which may read back what it wrote to one onl...
@ kInputPort
An in port: read, never written.
@ kLoopVariable
A for variable, or the index every loop binds.
@ kValue
One value, read from a stream and given a name by value.
@ kCarry
What a repeat carries.
ResolveResult Resolve(std::string_view source, const ParseResult &parsed, bool build_graph, const Program *context, CompilationLimits limits, CompilationBudget *budget)
Definition resolve.cc:6666
std::uint32_t offset
Definition runtime_streams.cc:36
Host-controlled bounds shared by parsing, linking and semantic analysis.
Definition limits.h:24
Flow problem rendered by the CLI, JSON and SARIF writers, and editors.
Definition diagnostic.h:99
One compiled struct: a shape a port may be typed with.
Definition plan.h:87
The statically known interface of one expression, borrowing its program.
Definition resolve.h:138
size_t symbol
The lexical binding of a Name, when resolution establishes one.
Definition resolve.h:140
const FlowPlan *absl_nullable callable
Definition resolve.h:146
ExpressionCategory category
Definition resolve.h:141
bool writable
Definition resolve.h:151
std::string type
Definition resolve.h:142
std::string port
Definition resolve.h:144
std::vector< std::string > fields
Definition resolve.h:148
std::string description
Definition resolve.h:145
bool cardinality_known
Definition resolve.h:150
const DtoPlan *absl_nullable shape
Definition resolve.h:147
bool unary
Definition resolve.h:149
std::string action
Definition resolve.h:143
One compiled flow: what a caller sees, and what the runtime will do.
Definition plan.h:157
The flows a file declares, and everything wrong with it.
Definition parser.h:34
Every flow and shape one source file declares.
Definition plan.h:200
A whole file, resolved.
Definition resolve.h:178
Program program
Definition resolve.h:179
std::vector< ResolvedFlow > flows
Definition resolve.h:180
std::vector< Diagnostic > diagnostics
Definition resolve.h:181
const Diagnostic *absl_nullable FirstError() const
Definition resolve.cc:6634
bool HasErrors() const
Definition resolve.cc:6630
One flow, resolved: its plan, its names, and what is wrong with it.
Definition resolve.h:155
std::optional< FlowPlan > implementation
Definition resolve.h:157
absl::flat_hash_map< const syntax::Node *, ExpressionInfo > expressions
Definition resolve.h:170
const syntax::FlowDeclaration *absl_nullable declaration
The declaration this came from, borrowed.
Definition resolve.h:174
graph::FlowGraph graph
The executable graph, when [Resolve] was asked for one.
Definition resolve.h:165
bool ambiguous
Definition resolve.h:159
FlowPlan plan
Definition resolve.h:156
std::vector< Symbol > symbols
Every symbol the flow bound, in the order it bound them.
Definition resolve.h:169
std::vector< FlowPlan > contracts
Definition resolve.h:158
One name, what it is, and what became of it.
Definition resolve.h:72
syntax::Location location
Definition resolve.h:75
bool tolerant
Definition resolve.h:94
bool writable
Whether a pipe may write it.
Definition resolve.h:90
int status_reads
For a call: whether anything read its status – wait x, status x, or a bound wait.
Definition resolve.h:102
bool VisibleAt(size_t offset) const
Definition resolve.h:82
graph::StepId step
The graph step this name is: a call, or a bound wait/close.
Definition resolve.h:109
bool readable
Whether a pipeline may read it.
Definition resolve.h:88
std::string pattern
The match pattern this value came out of, where it came out of a literal one.
Definition resolve.h:121
const FlowPlan *absl_nullable target
Definition resolve.h:95
std::optional< syntax::TypeExpression > value_type
Definition resolve.h:123
graph::RefId ref
The graph ref this name reads and writes, when a graph was built: a port, a node, a header,...
Definition resolve.h:107
bool implicit
Whether the language bound it rather than the author: the index every loop provides.
Definition resolve.h:78
SymbolKind kind
Definition resolve.h:73
std::string shape
Definition resolve.h:122
std::string action
For a call: the action named, whether it was try, and the sibling flow it resolves to if it is one.
Definition resolve.h:93
std::string name
Definition resolve.h:74
int writes
Definition resolve.h:98
bool data_dependency
Whether reading this lazy value can read a data or completion stream.
Definition resolve.h:111
syntax::Location visibility
A branch-local binding's visibility, absent for unrestricted symbols.
Definition resolve.h:80
int reads
How many times something read it, wrote it, or waited for it.
Definition resolve.h:97
The executable graph of one flow.
Definition graph.h:394
One flow name { ... } declaration, or the one flow { ... } entry point.
Definition syntax.h:694
The start token's byte span, line, and code-point column.
Definition syntax.h:39
size_t end
Definition syntax.h:41
size_t start
Definition syntax.h:40