46 inputs.
append({
"math.line",
"func add x y = add x y\n"});
47 inputs.append({
"main.line",
"import math.line\nlet answer = call add 40 2\n"});
51 const bool ok =
driver.execute_sources(
inputs, Compiler_Driver_Action::Run);
53 if (
const auto * order =
driver.find_artifact(
"imports.order"); order !=
nullptr)
54 std::cout << order->text <<
'\n';
56 std::cout <<
surface->text <<
'\n';
58 std::cout <<
linkage->text <<
'\n';
59 if (
const auto * binding =
driver.find_artifact(
"modules.binding"); binding !=
nullptr)
60 std::cout << binding->text <<
'\n';
61 if (
const auto * names =
driver.find_artifact(
"modules.names"); names !=
nullptr)
62 std::cout << names->text <<
'\n';
65 if (
const auto * parse =
driver.find_artifact(
"line.parse"); parse !=
nullptr)
66 std::cout << parse->text <<
'\n';
67 if (
const auto * hir =
driver.find_artifact(
"hir"); hir !=
nullptr)
68 std::cout << hir->text <<
'\n';
69 if (
const auto * ir =
driver.find_artifact(
"ir"); ir !=
nullptr)
70 std::cout << ir->text <<
'\n';
71 if (
const auto * run =
driver.find_artifact(
"run.result"); run !=
nullptr)
72 std::cout << run->text <<
'\n';
73 if (
const auto * globals =
driver.find_artifact(
"run.globals"); globals !=
nullptr)
74 std::cout << globals->text <<
'\n';
Reusable pipeline driver that operates on any Compiler_Frontend.
Example frontend for a tiny line-oriented language built on reusable contracts.
Reusable orchestration object built on top of Compiler_Frontend.
Small example frontend for a line-oriented language.
T & append()
Allocate a new entry to the end of array.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Main namespace for Aleph-w library functions.