Commit d5f614a1 authored by Kenton Varda's avatar Kenton Varda

Switch to the new compiler. All tests pass\! Need to submit bootstrap copies…

Switch to the new compiler.  All tests pass\!  Need to submit bootstrap copies of the generated code used by the compiler itself.  These bootstrap copies are still built by the old compiler at the moment.
parent d946e77b
......@@ -42,7 +42,7 @@ EXTRA_DIST = \
LICENSE.txt \
$(test_capnpc_inputs)
CLEANFILES = $(capnpc_outputs) $(test_capnpc_outputs) capnpc_middleman test_capnpc_middleman
CLEANFILES = $(test_capnpc_outputs) capnpc_middleman test_capnpc_middleman
# Deletes all the files generated by autoreconf.
MAINTAINERCLEANFILES = \
......@@ -225,7 +225,7 @@ test_capnpc_outputs = \
src/capnp/test-import.capnp.c++ \
src/capnp/test-import.capnp.h
BUILT_SOURCES = $(test_capnpc_outputs) $(capnpc_outputs)
BUILT_SOURCES = $(test_capnpc_outputs)
check_PROGRAMS = capnp-test
capnp_test_LDADD = gtest/lib/libgtest.la gtest/lib/libgtest_main.la libcapnp.la
......
// Generated code, DO NOT EDIT
#include "c++.capnp.h"
namespace capnp {
namespace annotations {
} // namespace
} // namespace
namespace capnp {
namespace schemas {
} // namespace schemas
namespace _ { // private
} // namespace _ (private)
} // namespace capnp
// Generated code, DO NOT EDIT
#ifndef CAPNP_INCLUDED_d8bf766fe2146a6566a69e5eae0af6f1
#define CAPNP_INCLUDED_d8bf766fe2146a6566a69e5eae0af6f1
#include <capnp/generated-header-support.h>
namespace capnp {
namespace annotations {
} // namespace
} // namespace
namespace capnp {
namespace schemas {
} // namespace schemas
namespace _ { // private
} // namespace capnp
} // namespace _ (private)
namespace capnp {
namespace annotations {
} // namespace
} // namespace
#endif // CAPNP_INCLUDED_d8bf766fe2146a6566a69e5eae0af6f1
......@@ -32,6 +32,15 @@ fi
INPUT=$1
case "$INPUT" in
*capnp/c++.capnp | \
*capnp/schema.capnp | \
*capnp/compiler/lexer.capnp | \
*capnp/compiler/grammar.capnp )
exit 0
;;
esac
echo findProvider special:ekam-interceptor
read INTERCEPTOR
......@@ -40,13 +49,22 @@ if test "$INTERCEPTOR" = ""; then
exit 1
fi
echo findProvider file:capnpc
read CAPNPC
echo findProvider file:capnp
read CAPNP
if test "$CAPNP" = ""; then
echo "error: couldn't find capnp." >&2
exit 1
fi
echo findProvider file:capnpc-c++
read CAPNPC_CXX
if test "$CAPNPC" = ""; then
CAPNPC=capnpc
if test "$CAPNPC_CXX" = ""; then
echo "error: couldn't find capnpc-c++." >&2
exit 1
fi
# When exception stack traces are needed, add: +RTS -xc -RTS
LD_PRELOAD=$INTERCEPTOR DYLD_FORCE_FLAT_NAMESPACE= DYLD_INSERT_LIBRARIES=$INTERCEPTOR \
$CAPNPC -I. -oc++ "$INPUT" 3>&1 4<&0 >&2
$CAPNP compile -I. -o$CAPNPC_CXX "$INPUT" 3>&1 4<&0 >&2
......@@ -34,8 +34,13 @@
#include "../dynamic.h"
#include <unistd.h>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <kj/main.h>
#include <algorithm>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#if HAVE_CONFIG_H
#include "config.h"
......@@ -54,16 +59,16 @@ static constexpr const char* FIELD_SIZE_NAMES[] = {
"VOID", "BIT", "BYTE", "TWO_BYTES", "FOUR_BYTES", "EIGHT_BYTES", "POINTER", "INLINE_COMPOSITE"
};
void enumerateDeps(schema::Type::Reader type, kj::Vector<uint64_t>& deps) {
void enumerateDeps(schema::Type::Reader type, std::set<uint64_t>& deps) {
switch (type.getBody().which()) {
case schema::Type::Body::STRUCT_TYPE:
deps.add(type.getBody().getStructType());
deps.insert(type.getBody().getStructType());
break;
case schema::Type::Body::ENUM_TYPE:
deps.add(type.getBody().getEnumType());
deps.insert(type.getBody().getEnumType());
break;
case schema::Type::Body::INTERFACE_TYPE:
deps.add(type.getBody().getInterfaceType());
deps.insert(type.getBody().getInterfaceType());
break;
case schema::Type::Body::LIST_TYPE:
enumerateDeps(type.getBody().getListType(), deps);
......@@ -73,7 +78,7 @@ void enumerateDeps(schema::Type::Reader type, kj::Vector<uint64_t>& deps) {
}
}
void enumerateDeps(schema::StructNode::Member::Reader member, kj::Vector<uint64_t>& deps) {
void enumerateDeps(schema::StructNode::Member::Reader member, std::set<uint64_t>& deps) {
switch (member.getBody().which()) {
case schema::StructNode::Member::Body::FIELD_MEMBER:
enumerateDeps(member.getBody().getFieldMember().getType(), deps);
......@@ -91,7 +96,7 @@ void enumerateDeps(schema::StructNode::Member::Reader member, kj::Vector<uint64_
}
}
void enumerateDeps(schema::Node::Reader node, kj::Vector<uint64_t>& deps) {
void enumerateDeps(schema::Node::Reader node, std::set<uint64_t>& deps) {
switch (node.getBody().which()) {
case schema::Node::Body::STRUCT_NODE:
for (auto member: node.getBody().getStructNode().getMembers()) {
......@@ -157,6 +162,15 @@ void makeMemberInfoTable(uint parent, MemberList&& members,
}
}
kj::StringPtr baseName(kj::StringPtr path) {
const char* slashPos = strrchr(path.cStr(), '/');
if (slashPos == nullptr) {
return path;
} else {
return slashPos + 1;
}
}
// =======================================================================================
class CapnpcCppMain {
......@@ -176,10 +190,12 @@ public:
private:
kj::ProcessContext& context;
SchemaLoader schemaLoader;
std::unordered_set<uint64_t> usedImports;
kj::StringTree cppFullName(Schema schema) {
auto node = schema.getProto();
if (node.getScopeId() == 0) {
usedImports.insert(node.getId());
for (auto annotation: node.getAnnotations()) {
if (annotation.getId() == NAMESPACE_ANNOTATION_ID) {
return kj::strTree(" ::", annotation.getValue().getBody().getTextValue());
......@@ -285,7 +301,7 @@ private:
kj::String ownedType;
kj::String type = typeName(field.getType()).flatten();
kj::StringPtr setterDefault; // only for void
uint64_t defaultMask = 0; // primitives only
kj::String defaultMask; // primitives only
size_t defaultOffset = 0; // pointers only: offset of the default value within the schema.
size_t defaultSize = 0; // blobs only: byte size of the default value.
......@@ -297,25 +313,47 @@ private:
setterDefault = " = ::capnp::Void::VOID";
break;
#define HANDLE_PRIMITIVE(discrim, typeName, defaultName) \
#define HANDLE_PRIMITIVE(discrim, typeName, defaultName, suffix) \
case schema::Type::Body::discrim##_TYPE: \
kind = FieldKind::PRIMITIVE; \
defaultMask = defaultBody.get##defaultName##Value(); \
if (defaultBody.get##defaultName##Value() != 0) { \
defaultMask = kj::str(defaultBody.get##defaultName##Value(), #suffix); \
} \
break;
HANDLE_PRIMITIVE(BOOL, bool, Bool);
HANDLE_PRIMITIVE(INT8 , ::int8_t , Int8 );
HANDLE_PRIMITIVE(INT16, ::int16_t, Int16);
HANDLE_PRIMITIVE(INT32, ::int32_t, Int32);
HANDLE_PRIMITIVE(INT64, ::int64_t, Int64);
HANDLE_PRIMITIVE(UINT8 , ::uint8_t , Uint8 );
HANDLE_PRIMITIVE(UINT16, ::uint16_t, Uint16);
HANDLE_PRIMITIVE(UINT32, ::uint32_t, Uint32);
HANDLE_PRIMITIVE(UINT64, ::uint64_t, Uint64);
HANDLE_PRIMITIVE(FLOAT32, float, Float32);
HANDLE_PRIMITIVE(FLOAT64, double, Float64);
HANDLE_PRIMITIVE(BOOL, bool, Bool, );
HANDLE_PRIMITIVE(INT8 , ::int8_t , Int8 , );
HANDLE_PRIMITIVE(INT16, ::int16_t, Int16, );
HANDLE_PRIMITIVE(INT32, ::int32_t, Int32, );
HANDLE_PRIMITIVE(INT64, ::int64_t, Int64, ll);
HANDLE_PRIMITIVE(UINT8 , ::uint8_t , Uint8 , u);
HANDLE_PRIMITIVE(UINT16, ::uint16_t, Uint16, u);
HANDLE_PRIMITIVE(UINT32, ::uint32_t, Uint32, u);
HANDLE_PRIMITIVE(UINT64, ::uint64_t, Uint64, ull);
#undef HANDLE_PRIMITIVE
case schema::Type::Body::FLOAT32_TYPE:
kind = FieldKind::PRIMITIVE;
if (defaultBody.getFloat32Value() != 0) {
uint32_t mask;
float value = defaultBody.getFloat32Value();
static_assert(sizeof(mask) == sizeof(value), "bug");
memcpy(&mask, &value, sizeof(mask));
defaultMask = kj::str(mask, "u");
}
break;
case schema::Type::Body::FLOAT64_TYPE:
kind = FieldKind::PRIMITIVE;
if (defaultBody.getFloat64Value() != 0) {
uint64_t mask;
double value = defaultBody.getFloat64Value();
static_assert(sizeof(mask) == sizeof(value), "bug");
memcpy(&mask, &value, sizeof(mask));
defaultMask = kj::str(mask, "ull");
}
break;
case schema::Type::Body::TEXT_TYPE:
kind = FieldKind::BLOB;
if (defaultBody.hasTextValue()) {
......@@ -333,7 +371,9 @@ private:
case schema::Type::Body::ENUM_TYPE:
kind = FieldKind::PRIMITIVE;
defaultMask = defaultBody.getEnumValue();
if (defaultBody.getEnumValue() != 0) {
defaultMask = kj::str(defaultBody.getEnumValue(), "u");
}
break;
case schema::Type::Body::STRUCT_TYPE:
......@@ -360,12 +400,8 @@ private:
}
kj::String defaultMaskParam;
if (defaultMask != 0) {
if (defaultMask > 0xffffffffu) {
defaultMaskParam = kj::str(", ", defaultMask, "ull");
} else {
defaultMaskParam = kj::str(", ", defaultMask, "u");
}
if (defaultMask.size() > 0) {
defaultMaskParam = kj::str(", ", defaultMask);
}
kj::String titleCase = toTitleCase(proto.getName());
......@@ -447,7 +483,7 @@ private:
" inline typename T::Builder init", titleCase, "(Params&&... params);\n"
" template <typename T>\n"
" inline void adopt", titleCase, "(::capnp::Orphan<T>&& value);\n"
" template <typename T>\n"
" template <typename T, typename... Params>\n"
" inline ::capnp::Orphan<T> disown", titleCase, "(Params&&... params);\n"
"\n"),
......@@ -508,7 +544,7 @@ private:
" ::capnp::_::PointerHelpers<T>::adopt(\n"
" _builder, ", offset, " * ::capnp::POINTERS, kj::mv(value));\n"
"}\n"
"template <typename T>\n"
"template <typename T, typename... Params>\n"
"inline ::capnp::Orphan<T> ", scope, "Builder::disown", titleCase, "(Params&&... params) {\n",
unionCheck,
" return ::capnp::_::PointerHelpers<T>::disown(\n"
......@@ -526,6 +562,7 @@ private:
defaultSize == 0 ? kj::strTree() : kj::strTree(", ", defaultSize));
kj::String elementReaderType;
bool isStructList = false;
if (kind == FieldKind::LIST) {
bool primitiveElement = false;
switch (typeBody.getListType().getBody().which()) {
......@@ -547,12 +584,16 @@ private:
case schema::Type::Body::TEXT_TYPE:
case schema::Type::Body::DATA_TYPE:
case schema::Type::Body::STRUCT_TYPE:
case schema::Type::Body::LIST_TYPE:
case schema::Type::Body::INTERFACE_TYPE:
case schema::Type::Body::OBJECT_TYPE:
primitiveElement = false;
break;
case schema::Type::Body::STRUCT_TYPE:
isStructList = true;
primitiveElement = false;
break;
}
elementReaderType = kj::str(
typeName(typeBody.getListType()),
......@@ -569,9 +610,9 @@ private:
" inline bool has", titleCase, "();\n"
" inline ", type, "::Builder get", titleCase, "();\n"
" inline void set", titleCase, "(", type, "::Reader value);\n",
kind == FieldKind::LIST
kind == FieldKind::LIST && !isStructList
? kj::strTree(
" inline void set", titleCase, "(std::initializer_list<", type, "> value);\n")
" inline void set", titleCase, "(std::initializer_list<", elementReaderType, "> value);\n")
: kj::strTree(),
kind == FieldKind::STRUCT
? kj::strTree(
......@@ -606,9 +647,9 @@ private:
" ::capnp::_::PointerHelpers<", type, ">::set(\n"
" _builder, ", offset, " * ::capnp::POINTERS, value);\n"
"}\n",
kind == FieldKind::LIST
kind == FieldKind::LIST && !isStructList
? kj::strTree(
"inline void ", scope, "Builder::set", titleCase, "(std::initializer_list<", type, "> value) {\n",
"inline void ", scope, "Builder::set", titleCase, "(std::initializer_list<", elementReaderType, "> value) {\n",
unionSet,
" ::capnp::_::PointerHelpers<", type, ">::set(\n"
" _builder, ", offset, " * ::capnp::POINTERS, value);\n"
......@@ -688,6 +729,8 @@ private:
"\n"
" Builder() = default;\n"
" inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}\n"
" inline operator Reader() const { return Reader(_builder.asReader()); }\n"
" inline Reader asReader() const { return *this; }\n"
"\n"
" inline size_t totalSizeInWords() { return asReader().totalSizeInWords(); }\n"
"\n",
......@@ -750,7 +793,7 @@ private:
return kj::strTree(
" ", toUpperCase(subMember.getProto().getName()), ",\n");
},
" }\n");
" };\n");
if (unionName.size() == 0) {
// Anonymous union.
......@@ -797,7 +840,7 @@ private:
"\n",
kj::mv(whichEnumDef),
kj::mv(subText.innerTypeDecls),
"}\n"
"};\n"
"\n",
kj::mv(subText.innerTypeDefs)),
......@@ -950,7 +993,7 @@ private:
auto schemaDecl = kj::strTree(
"extern const ::capnp::_::RawSchema s_", hexId, ";\n");
kj::Vector<uint64_t> deps;
std::set<uint64_t> deps;
enumerateDeps(proto, deps);
kj::Vector<capnp::_::RawSchema::MemberInfo> memberInfos;
......@@ -1018,6 +1061,7 @@ private:
kj::mv(membersText.readerMethodDecls)),
makeBuilderDef(fullName, name, "structString",
kj::mv(membersText.builderMethodDecls)),
kj::mv(membersText.innerTypeReaderBuilderDefs),
KJ_MAP(nestedTexts, n) { return kj::mv(n.readerBuilderDefs); }),
kj::strTree(
......@@ -1145,8 +1189,10 @@ private:
kj::StringTree source;
};
FileText makeFileText(uint64_t id) {
auto node = schemaLoader.get(id).getProto();
FileText makeFileText(Schema schema) {
usedImports.clear();
auto node = schema.getProto();
auto displayName = node.getDisplayName();
kj::Vector<kj::ArrayPtr<const char>> namespaceParts;
......@@ -1182,22 +1228,29 @@ private:
kj::String separator = kj::str("// ", kj::repeat('=', 87), "\n");
const char* baseName = strrchr(displayName.cStr(), '/');
if (baseName == nullptr) {
baseName = displayName.cStr();
} else {
baseName++;
kj::Vector<kj::StringPtr> includes;
for (auto import: node.getBody().getFileNode().getImports()) {
if (usedImports.count(import.getId()) > 0) {
includes.add(import.getName());
}
}
return FileText {
kj::strTree(
"// Generated by Cap'n Proto compiler, DO NOT EDIT\n"
"// source: ", baseName, "\n"
"// source: ", baseName(displayName), "\n"
"\n"
"#ifndef CAPNP_INCLUDED_", kj::hex(node.getId()), "_\n",
"#define CAPNP_INCLUDED_", kj::hex(node.getId()), "_\n"
"\n"
"#include <capnp/generated-header-support.h>\n"
"#include <capnp/generated-header-support.h>\n",
KJ_MAP(includes, path) {
if (path.startsWith("/")) {
return kj::strTree("#include <", path.slice(1), ".h>\n");
} else {
return kj::strTree("#include \"", path, ".h\"\n");
}
},
"\n",
KJ_MAP(namespaceParts, n) { return kj::strTree("namespace ", n, " {\n"); }, "\n",
......@@ -1228,9 +1281,9 @@ private:
kj::strTree(
"// Generated by Cap'n Proto compiler, DO NOT EDIT\n"
"// source: ", baseName, "\n"
"// source: ", baseName(displayName), "\n"
"\n"
"#include \"", baseName, ".h\"\n"
"#include \"", baseName(displayName), ".h\"\n"
"\n"
"namespace capnp {\n"
"namespace schemas {\n",
......@@ -1245,6 +1298,17 @@ private:
// -----------------------------------------------------------------
void writeFile(kj::StringPtr filename, const kj::StringTree& text) {
int fd;
KJ_SYSCALL(fd = open(filename.cStr(), O_CREAT | O_WRONLY | O_TRUNC, 0666), filename);
kj::FdOutputStream out((kj::AutoCloseFd(fd)));
text.visit(
[&](kj::ArrayPtr<const char> text) {
out.write(text.begin(), text.size());
});
}
kj::MainBuilder::Validity run() {
ReaderOptions options;
options.traversalLimitInWords = 1 << 30; // Don't limit.
......@@ -1259,12 +1323,11 @@ private:
kj::BufferedOutputStreamWrapper out(rawOut);
for (auto fileId: request.getRequestedFiles()) {
auto fileText = makeFileText(fileId);
auto schema = schemaLoader.get(fileId);
auto fileText = makeFileText(schema);
fileText.source.visit(
[&](kj::ArrayPtr<const char> text) {
out.write(text.begin(), text.size());
});
writeFile(kj::str(schema.getProto().getDisplayName(), ".h"), fileText.header);
writeFile(kj::str(schema.getProto().getDisplayName(), ".c++"), fileText.source);
}
return true;
......
......@@ -95,6 +95,7 @@ public:
kj::Maybe<ResolvedName> resolve(const DeclName::Reader& name) const override;
kj::Maybe<Schema> resolveBootstrapSchema(uint64_t id) const override;
kj::Maybe<schema::Node::Reader> resolveFinalSchema(uint64_t id) const override;
kj::Maybe<uint64_t> resolveImport(kj::StringPtr name) const override;
private:
const CompiledModule* module; // null iff isBuiltin is true
......@@ -804,6 +805,14 @@ kj::Maybe<schema::Node::Reader> Compiler::Node::resolveFinalSchema(uint64_t id)
}
}
kj::Maybe<uint64_t> Compiler::Node::resolveImport(kj::StringPtr name) const {
KJ_IF_MAYBE(m, module->importRelative(name)) {
return m->getRootNode().getId();
} else {
return nullptr;
}
}
// =======================================================================================
Compiler::CompiledModule::CompiledModule(
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
// Generated code, DO NOT EDIT
#include "lexer.capnp.h"
namespace capnp {
namespace compiler {
} // namespace
} // namespace
namespace capnp {
namespace schemas {
static const ::capnp::_::AlignedData<183> b_91cc55cd57de5419 = {
{ 0, 0, 0, 0, 3, 0, 4, 0,
25, 84, 222, 87, 205, 85, 204, 145,
238, 195, 31, 98, 210, 86, 57, 167,
1, 0, 0, 0, 0, 0, 0, 0,
13, 0, 0, 0, 42, 1, 0, 0,
29, 0, 0, 0, 7, 0, 0, 0,
29, 0, 0, 0, 7, 0, 0, 0,
28, 0, 0, 0, 1, 0, 1, 0,
115, 114, 99, 47, 99, 97, 112, 110,
112, 47, 99, 111, 109, 112, 105, 108,
101, 114, 47, 108, 101, 120, 101, 114,
46, 99, 97, 112, 110, 112, 58, 84,
111, 107, 101, 110, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 1, 0, 1, 0,
3, 0, 1, 0, 7, 0, 0, 0,
1, 0, 0, 0, 103, 0, 0, 0,
12, 0, 0, 0, 1, 0, 3, 0,
0, 0, 0, 0, 1, 0, 0, 0,
41, 0, 0, 0, 42, 0, 0, 0,
41, 0, 0, 0, 7, 0, 0, 0,
40, 0, 0, 0, 1, 0, 1, 0,
8, 0, 1, 0, 0, 0, 0, 0,
33, 2, 0, 0, 82, 0, 0, 0,
37, 2, 0, 0, 7, 0, 0, 0,
36, 2, 0, 0, 1, 0, 2, 0,
9, 0, 2, 0, 0, 0, 0, 0,
65, 2, 0, 0, 66, 0, 0, 0,
65, 2, 0, 0, 7, 0, 0, 0,
64, 2, 0, 0, 1, 0, 2, 0,
98, 111, 100, 121, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 231, 0, 0, 0,
28, 0, 0, 0, 1, 0, 3, 0,
1, 0, 0, 0, 0, 0, 0, 0,
105, 0, 0, 0, 90, 0, 0, 0,
109, 0, 0, 0, 7, 0, 0, 0,
108, 0, 0, 0, 1, 0, 2, 0,
2, 0, 1, 0, 0, 0, 0, 0,
137, 0, 0, 0, 114, 0, 0, 0,
141, 0, 0, 0, 7, 0, 0, 0,
140, 0, 0, 0, 1, 0, 2, 0,
3, 0, 2, 0, 0, 0, 0, 0,
169, 0, 0, 0, 122, 0, 0, 0,
173, 0, 0, 0, 7, 0, 0, 0,
172, 0, 0, 0, 1, 0, 2, 0,
4, 0, 3, 0, 0, 0, 0, 0,
201, 0, 0, 0, 106, 0, 0, 0,
205, 0, 0, 0, 7, 0, 0, 0,
204, 0, 0, 0, 1, 0, 2, 0,
5, 0, 4, 0, 0, 0, 0, 0,
233, 0, 0, 0, 74, 0, 0, 0,
237, 0, 0, 0, 7, 0, 0, 0,
236, 0, 0, 0, 1, 0, 2, 0,
6, 0, 5, 0, 0, 0, 0, 0,
9, 1, 0, 0, 146, 0, 0, 0,
17, 1, 0, 0, 7, 0, 0, 0,
16, 1, 0, 0, 1, 0, 2, 0,
7, 0, 6, 0, 0, 0, 0, 0,
69, 1, 0, 0, 114, 0, 0, 0,
73, 1, 0, 0, 7, 0, 0, 0,
72, 1, 0, 0, 1, 0, 2, 0,
105, 100, 101, 110, 116, 105, 102, 105,
101, 114, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
12, 0, 0, 0, 2, 0, 1, 0,
12, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
12, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
115, 116, 114, 105, 110, 103, 76, 105,
116, 101, 114, 97, 108, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
12, 0, 0, 0, 2, 0, 1, 0,
12, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
12, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
105, 110, 116, 101, 103, 101, 114, 76,
105, 116, 101, 114, 97, 108, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
1, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
12, 0, 0, 0, 2, 0, 1, 0,
9, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
102, 108, 111, 97, 116, 76, 105, 116,
101, 114, 97, 108, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
1, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
12, 0, 0, 0, 2, 0, 1, 0,
11, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
11, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
111, 112, 101, 114, 97, 116, 111, 114,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
12, 0, 0, 0, 2, 0, 1, 0,
12, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
12, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
112, 97, 114, 101, 110, 116, 104, 101,
115, 105, 122, 101, 100, 76, 105, 115,
116, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
36, 0, 0, 0, 2, 0, 1, 0,
14, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0, 1, 0,
14, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0, 1, 0,
16, 0, 0, 0, 0, 0, 0, 0,
25, 84, 222, 87, 205, 85, 204, 145,
0, 0, 0, 0, 0, 0, 0, 0,
14, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
98, 114, 97, 99, 107, 101, 116, 101,
100, 76, 105, 115, 116, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
36, 0, 0, 0, 2, 0, 1, 0,
14, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0, 1, 0,
14, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0, 1, 0,
16, 0, 0, 0, 0, 0, 0, 0,
25, 84, 222, 87, 205, 85, 204, 145,
0, 0, 0, 0, 0, 0, 0, 0,
14, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
115, 116, 97, 114, 116, 66, 121, 116,
101, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
1, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
12, 0, 0, 0, 2, 0, 1, 0,
8, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
8, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
101, 110, 100, 66, 121, 116, 101, 0,
0, 0, 0, 0, 1, 0, 1, 0,
4, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
12, 0, 0, 0, 2, 0, 1, 0,
8, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
8, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0 }
};
static const ::capnp::_::RawSchema* const d_91cc55cd57de5419[] = {
&s_91cc55cd57de5419,
};
static const ::capnp::_::RawSchema::MemberInfo m_91cc55cd57de5419[] = {
{ 0, 0 },
{ 0, 2 },
{ 0, 1 },
{ 1, 6 },
{ 1, 3 },
{ 1, 0 },
{ 1, 2 },
{ 1, 4 },
{ 1, 5 },
{ 1, 1 },
};
const ::capnp::_::RawSchema s_91cc55cd57de5419 = {
0x91cc55cd57de5419, b_91cc55cd57de5419.words, 183, d_91cc55cd57de5419, m_91cc55cd57de5419,
1, 10, nullptr, nullptr
};
static const ::capnp::_::AlignedData<127> b_c6725e678d60fa37 = {
{ 0, 0, 0, 0, 3, 0, 4, 0,
55, 250, 96, 141, 103, 94, 114, 198,
238, 195, 31, 98, 210, 86, 57, 167,
1, 0, 0, 0, 0, 0, 0, 0,
13, 0, 0, 0, 74, 1, 0, 0,
33, 0, 0, 0, 7, 0, 0, 0,
33, 0, 0, 0, 7, 0, 0, 0,
32, 0, 0, 0, 1, 0, 1, 0,
115, 114, 99, 47, 99, 97, 112, 110,
112, 47, 99, 111, 109, 112, 105, 108,
101, 114, 47, 108, 101, 120, 101, 114,
46, 99, 97, 112, 110, 112, 58, 83,
116, 97, 116, 101, 109, 101, 110, 116,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 1, 0, 1, 0,
2, 0, 3, 0, 7, 0, 0, 0,
1, 0, 0, 0, 167, 0, 0, 0,
20, 0, 0, 0, 1, 0, 3, 0,
0, 0, 0, 0, 0, 0, 0, 0,
73, 0, 0, 0, 58, 0, 0, 0,
73, 0, 0, 0, 7, 0, 0, 0,
72, 0, 0, 0, 1, 0, 2, 0,
1, 0, 1, 0, 1, 0, 0, 0,
113, 0, 0, 0, 50, 0, 0, 0,
113, 0, 0, 0, 7, 0, 0, 0,
112, 0, 0, 0, 1, 0, 1, 0,
4, 0, 2, 0, 0, 0, 0, 0,
253, 0, 0, 0, 90, 0, 0, 0,
1, 1, 0, 0, 7, 0, 0, 0,
0, 1, 0, 0, 1, 0, 2, 0,
5, 0, 3, 0, 0, 0, 0, 0,
29, 1, 0, 0, 82, 0, 0, 0,
33, 1, 0, 0, 7, 0, 0, 0,
32, 1, 0, 0, 1, 0, 2, 0,
6, 0, 4, 0, 0, 0, 0, 0,
61, 1, 0, 0, 66, 0, 0, 0,
61, 1, 0, 0, 7, 0, 0, 0,
60, 1, 0, 0, 1, 0, 2, 0,
116, 111, 107, 101, 110, 115, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
24, 0, 0, 0, 2, 0, 1, 0,
14, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0, 1, 0,
16, 0, 0, 0, 0, 0, 0, 0,
25, 84, 222, 87, 205, 85, 204, 145,
0, 0, 0, 0, 0, 0, 0, 0,
14, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
98, 108, 111, 99, 107, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 71, 0, 0, 0,
8, 0, 0, 0, 1, 0, 3, 0,
2, 0, 0, 0, 0, 0, 0, 0,
25, 0, 0, 0, 42, 0, 0, 0,
25, 0, 0, 0, 7, 0, 0, 0,
24, 0, 0, 0, 1, 0, 2, 0,
3, 0, 1, 0, 0, 0, 0, 0,
53, 0, 0, 0, 90, 0, 0, 0,
57, 0, 0, 0, 7, 0, 0, 0,
56, 0, 0, 0, 1, 0, 2, 0,
110, 111, 110, 101, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
12, 0, 0, 0, 2, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
9, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
115, 116, 97, 116, 101, 109, 101, 110,
116, 115, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
1, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
24, 0, 0, 0, 2, 0, 1, 0,
14, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0, 1, 0,
16, 0, 0, 0, 0, 0, 0, 0,
55, 250, 96, 141, 103, 94, 114, 198,
0, 0, 0, 0, 0, 0, 0, 0,
14, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
100, 111, 99, 67, 111, 109, 109, 101,
110, 116, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
2, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
12, 0, 0, 0, 2, 0, 1, 0,
12, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
12, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
115, 116, 97, 114, 116, 66, 121, 116,
101, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
1, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
12, 0, 0, 0, 2, 0, 1, 0,
8, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
8, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
101, 110, 100, 66, 121, 116, 101, 0,
0, 0, 0, 0, 1, 0, 1, 0,
2, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
12, 0, 0, 0, 2, 0, 1, 0,
8, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
8, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0 }
};
static const ::capnp::_::RawSchema* const d_c6725e678d60fa37[] = {
&s_91cc55cd57de5419,
&s_c6725e678d60fa37,
};
static const ::capnp::_::RawSchema::MemberInfo m_c6725e678d60fa37[] = {
{ 0, 1 },
{ 0, 2 },
{ 0, 4 },
{ 0, 3 },
{ 0, 0 },
{ 2, 0 },
{ 2, 1 },
};
const ::capnp::_::RawSchema s_c6725e678d60fa37 = {
0xc6725e678d60fa37, b_c6725e678d60fa37.words, 127, d_c6725e678d60fa37, m_c6725e678d60fa37,
2, 7, nullptr, nullptr
};
static const ::capnp::_::AlignedData<37> b_9e69a92512b19d18 = {
{ 0, 0, 0, 0, 3, 0, 4, 0,
24, 157, 177, 18, 37, 169, 105, 158,
238, 195, 31, 98, 210, 86, 57, 167,
1, 0, 0, 0, 0, 0, 0, 0,
13, 0, 0, 0, 90, 1, 0, 0,
33, 0, 0, 0, 7, 0, 0, 0,
33, 0, 0, 0, 7, 0, 0, 0,
32, 0, 0, 0, 1, 0, 1, 0,
115, 114, 99, 47, 99, 97, 112, 110,
112, 47, 99, 111, 109, 112, 105, 108,
101, 114, 47, 108, 101, 120, 101, 114,
46, 99, 97, 112, 110, 112, 58, 76,
101, 120, 101, 100, 84, 111, 107, 101,
110, 115, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 1, 0, 6, 0, 0, 0,
1, 0, 0, 0, 39, 0, 0, 0,
4, 0, 0, 0, 1, 0, 3, 0,
0, 0, 0, 0, 0, 0, 0, 0,
9, 0, 0, 0, 58, 0, 0, 0,
9, 0, 0, 0, 7, 0, 0, 0,
8, 0, 0, 0, 1, 0, 2, 0,
116, 111, 107, 101, 110, 115, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
24, 0, 0, 0, 2, 0, 1, 0,
14, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0, 1, 0,
16, 0, 0, 0, 0, 0, 0, 0,
25, 84, 222, 87, 205, 85, 204, 145,
0, 0, 0, 0, 0, 0, 0, 0,
14, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0 }
};
static const ::capnp::_::RawSchema* const d_9e69a92512b19d18[] = {
&s_91cc55cd57de5419,
};
static const ::capnp::_::RawSchema::MemberInfo m_9e69a92512b19d18[] = {
{ 0, 0 },
};
const ::capnp::_::RawSchema s_9e69a92512b19d18 = {
0x9e69a92512b19d18, b_9e69a92512b19d18.words, 37, d_9e69a92512b19d18, m_9e69a92512b19d18,
1, 1, nullptr, nullptr
};
static const ::capnp::_::AlignedData<38> b_a11f97b9d6c73dd4 = {
{ 0, 0, 0, 0, 3, 0, 4, 0,
212, 61, 199, 214, 185, 151, 31, 161,
238, 195, 31, 98, 210, 86, 57, 167,
1, 0, 0, 0, 0, 0, 0, 0,
13, 0, 0, 0, 122, 1, 0, 0,
33, 0, 0, 0, 7, 0, 0, 0,
33, 0, 0, 0, 7, 0, 0, 0,
32, 0, 0, 0, 1, 0, 1, 0,
115, 114, 99, 47, 99, 97, 112, 110,
112, 47, 99, 111, 109, 112, 105, 108,
101, 114, 47, 108, 101, 120, 101, 114,
46, 99, 97, 112, 110, 112, 58, 76,
101, 120, 101, 100, 83, 116, 97, 116,
101, 109, 101, 110, 116, 115, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 1, 0, 6, 0, 0, 0,
1, 0, 0, 0, 39, 0, 0, 0,
4, 0, 0, 0, 1, 0, 3, 0,
0, 0, 0, 0, 0, 0, 0, 0,
9, 0, 0, 0, 90, 0, 0, 0,
13, 0, 0, 0, 7, 0, 0, 0,
12, 0, 0, 0, 1, 0, 2, 0,
115, 116, 97, 116, 101, 109, 101, 110,
116, 115, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0, 1, 0,
24, 0, 0, 0, 2, 0, 1, 0,
14, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0, 1, 0,
16, 0, 0, 0, 0, 0, 0, 0,
55, 250, 96, 141, 103, 94, 114, 198,
0, 0, 0, 0, 0, 0, 0, 0,
14, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0 }
};
static const ::capnp::_::RawSchema* const d_a11f97b9d6c73dd4[] = {
&s_c6725e678d60fa37,
};
static const ::capnp::_::RawSchema::MemberInfo m_a11f97b9d6c73dd4[] = {
{ 0, 0 },
};
const ::capnp::_::RawSchema s_a11f97b9d6c73dd4 = {
0xa11f97b9d6c73dd4, b_a11f97b9d6c73dd4.words, 38, d_a11f97b9d6c73dd4, m_a11f97b9d6c73dd4,
1, 1, nullptr, nullptr
};
} // namespace schemas
namespace _ { // private
CAPNP_DEFINE_STRUCT(
::capnp::compiler::Token);
CAPNP_DEFINE_UNION(
::capnp::compiler::Token::Body);
CAPNP_DEFINE_STRUCT(
::capnp::compiler::Statement);
CAPNP_DEFINE_UNION(
::capnp::compiler::Statement::Block);
CAPNP_DEFINE_STRUCT(
::capnp::compiler::LexedTokens);
CAPNP_DEFINE_STRUCT(
::capnp::compiler::LexedStatements);
} // namespace _ (private)
} // namespace capnp
// Generated code, DO NOT EDIT
#ifndef CAPNP_INCLUDED_28e6ee28b20c751454a4280a478ff746
#define CAPNP_INCLUDED_28e6ee28b20c751454a4280a478ff746
#include <capnp/generated-header-support.h>
namespace capnp {
namespace compiler {
struct Token {
Token() = delete;
class Reader;
class Builder;
struct Body;
private:
};
struct Token::Body {
Body() = delete;
class Reader;
class Builder;
enum Which: uint16_t {
IDENTIFIER = 0,
STRING_LITERAL = 1,
INTEGER_LITERAL = 2,
FLOAT_LITERAL = 3,
OPERATOR = 4,
PARENTHESIZED_LIST = 5,
BRACKETED_LIST = 6,
};
private:
};
struct Statement {
Statement() = delete;
class Reader;
class Builder;
struct Block;
private:
};
struct Statement::Block {
Block() = delete;
class Reader;
class Builder;
enum Which: uint16_t {
NONE = 0,
STATEMENTS = 1,
};
private:
};
struct LexedTokens {
LexedTokens() = delete;
class Reader;
class Builder;
private:
};
struct LexedStatements {
LexedStatements() = delete;
class Reader;
class Builder;
private:
};
} // namespace
} // namespace
namespace capnp {
namespace schemas {
extern const ::capnp::_::RawSchema s_91cc55cd57de5419;
extern const ::capnp::_::RawSchema s_c6725e678d60fa37;
extern const ::capnp::_::RawSchema s_9e69a92512b19d18;
extern const ::capnp::_::RawSchema s_a11f97b9d6c73dd4;
} // namespace schemas
namespace _ { // private
CAPNP_DECLARE_STRUCT(
::capnp::compiler::Token, 91cc55cd57de5419,
3, 1, INLINE_COMPOSITE);
CAPNP_DECLARE_UNION(
::capnp::compiler::Token::Body,
::capnp::compiler::Token, 0);
CAPNP_DECLARE_STRUCT(
::capnp::compiler::Statement, c6725e678d60fa37,
2, 3, INLINE_COMPOSITE);
CAPNP_DECLARE_UNION(
::capnp::compiler::Statement::Block,
::capnp::compiler::Statement, 1);
CAPNP_DECLARE_STRUCT(
::capnp::compiler::LexedTokens, 9e69a92512b19d18,
0, 1, POINTER);
CAPNP_DECLARE_STRUCT(
::capnp::compiler::LexedStatements, a11f97b9d6c73dd4,
0, 1, POINTER);
} // namespace capnp
} // namespace _ (private)
namespace capnp {
namespace compiler {
class Token::Reader {
public:
typedef Token Reads;
Reader() = default;
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
inline size_t totalSizeInWords() const {
return _reader.totalSize() / ::capnp::WORDS;
}
// union body@0 { # [0, 16)
inline Body::Reader getBody() const;
// startByte@8: UInt32; # bits[32, 64)
inline ::uint32_t getStartByte() const;
// endByte@9: UInt32; # bits[128, 160)
inline ::uint32_t getEndByte() const;
private:
::capnp::_::StructReader _reader;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::ToDynamic_;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::_::PointerHelpers;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::List;
friend class ::capnp::MessageBuilder;
friend class ::capnp::Orphanage;
friend ::kj::StringTree KJ_STRINGIFY(Token::Reader reader);
};
inline ::kj::StringTree KJ_STRINGIFY(Token::Reader reader) {
return ::capnp::_::structString<Token>(reader._reader);
}
class Token::Builder {
public:
typedef Token Builds;
Builder() = default;
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
inline operator Reader() const { return Reader(_builder.asReader()); }
inline Reader asReader() const { return *this; }
inline size_t totalSizeInWords() { return asReader().totalSizeInWords(); }
// union body@0 { # [0, 16)
inline Body::Builder getBody();
// startByte@8: UInt32; # bits[32, 64)
inline ::uint32_t getStartByte();
inline void setStartByte( ::uint32_t value);
// endByte@9: UInt32; # bits[128, 160)
inline ::uint32_t getEndByte();
inline void setEndByte( ::uint32_t value);
private:
::capnp::_::StructBuilder _builder;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::ToDynamic_;
friend class ::capnp::Orphanage;
friend ::kj::StringTree KJ_STRINGIFY(Token::Builder builder);
};
inline ::kj::StringTree KJ_STRINGIFY(Token::Builder builder) {
return ::capnp::_::structString<Token>(builder._builder.asReader());
}
class Token::Body::Reader {
public:
typedef Body Reads;
Reader() = default;
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
inline Which which() const;
// identifier@1: Text; # ptr[0], union tag = 0
inline bool hasIdentifier() const;
inline ::capnp::Text::Reader getIdentifier() const;
// stringLiteral@2: Text; # ptr[0], union tag = 1
inline bool hasStringLiteral() const;
inline ::capnp::Text::Reader getStringLiteral() const;
// integerLiteral@3: UInt64; # bits[64, 128), union tag = 2
inline ::uint64_t getIntegerLiteral() const;
// floatLiteral@4: Float64; # bits[64, 128), union tag = 3
inline double getFloatLiteral() const;
// operator@5: Text; # ptr[0], union tag = 4
inline bool hasOperator() const;
inline ::capnp::Text::Reader getOperator() const;
// parenthesizedList@6: List(List(.Token)); # ptr[0], union tag = 5
inline bool hasParenthesizedList() const;
inline ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>::Reader getParenthesizedList() const;
// bracketedList@7: List(List(.Token)); # ptr[0], union tag = 6
inline bool hasBracketedList() const;
inline ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>::Reader getBracketedList() const;
private:
::capnp::_::StructReader _reader;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::ToDynamic_;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::_::PointerHelpers;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::List;
friend class ::capnp::MessageBuilder;
friend class ::capnp::Orphanage;
friend ::kj::StringTree KJ_STRINGIFY(Token::Body::Reader reader);
};
inline ::kj::StringTree KJ_STRINGIFY(Token::Body::Reader reader) {
return ::capnp::_::unionString<Token::Body>(reader._reader);
}
class Token::Body::Builder {
public:
typedef Body Builds;
Builder() = default;
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
inline operator Reader() const { return Reader(_builder.asReader()); }
inline Reader asReader() const { return *this; }
inline Which which();
// identifier@1: Text; # ptr[0], union tag = 0
inline bool hasIdentifier();
inline ::capnp::Text::Builder getIdentifier();
inline void setIdentifier( ::capnp::Text::Reader other);
inline ::capnp::Text::Builder initIdentifier(unsigned int size);
inline void adoptIdentifier(::capnp::Orphan< ::capnp::Text>&& value);
inline ::capnp::Orphan< ::capnp::Text> disownIdentifier();
// stringLiteral@2: Text; # ptr[0], union tag = 1
inline bool hasStringLiteral();
inline ::capnp::Text::Builder getStringLiteral();
inline void setStringLiteral( ::capnp::Text::Reader other);
inline ::capnp::Text::Builder initStringLiteral(unsigned int size);
inline void adoptStringLiteral(::capnp::Orphan< ::capnp::Text>&& value);
inline ::capnp::Orphan< ::capnp::Text> disownStringLiteral();
// integerLiteral@3: UInt64; # bits[64, 128), union tag = 2
inline ::uint64_t getIntegerLiteral();
inline void setIntegerLiteral( ::uint64_t value);
// floatLiteral@4: Float64; # bits[64, 128), union tag = 3
inline double getFloatLiteral();
inline void setFloatLiteral(double value);
// operator@5: Text; # ptr[0], union tag = 4
inline bool hasOperator();
inline ::capnp::Text::Builder getOperator();
inline void setOperator( ::capnp::Text::Reader other);
inline ::capnp::Text::Builder initOperator(unsigned int size);
inline void adoptOperator(::capnp::Orphan< ::capnp::Text>&& value);
inline ::capnp::Orphan< ::capnp::Text> disownOperator();
// parenthesizedList@6: List(List(.Token)); # ptr[0], union tag = 5
inline bool hasParenthesizedList();
inline ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>::Builder getParenthesizedList();
inline void setParenthesizedList( ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>::Reader other);
inline void setParenthesizedList(
std::initializer_list< ::capnp::List< ::capnp::compiler::Token>::Reader> other);
inline ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>::Builder initParenthesizedList(unsigned int size);
inline void adoptParenthesizedList(::capnp::Orphan< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>&& value);
inline ::capnp::Orphan< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>> disownParenthesizedList();
// bracketedList@7: List(List(.Token)); # ptr[0], union tag = 6
inline bool hasBracketedList();
inline ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>::Builder getBracketedList();
inline void setBracketedList( ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>::Reader other);
inline void setBracketedList(
std::initializer_list< ::capnp::List< ::capnp::compiler::Token>::Reader> other);
inline ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>::Builder initBracketedList(unsigned int size);
inline void adoptBracketedList(::capnp::Orphan< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>&& value);
inline ::capnp::Orphan< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>> disownBracketedList();
private:
::capnp::_::StructBuilder _builder;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::ToDynamic_;
friend class ::capnp::Orphanage;
friend ::kj::StringTree KJ_STRINGIFY(Token::Body::Builder builder);
};
inline ::kj::StringTree KJ_STRINGIFY(Token::Body::Builder builder) {
return ::capnp::_::unionString<Token::Body>(builder._builder.asReader());
}
class Statement::Reader {
public:
typedef Statement Reads;
Reader() = default;
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
inline size_t totalSizeInWords() const {
return _reader.totalSize() / ::capnp::WORDS;
}
// union block@1 { # [0, 16)
inline Block::Reader getBlock() const;
// tokens@0: List(.Token); # ptr[0]
inline bool hasTokens() const;
inline ::capnp::List< ::capnp::compiler::Token>::Reader getTokens() const;
// docComment@4: Text; # ptr[2]
inline bool hasDocComment() const;
inline ::capnp::Text::Reader getDocComment() const;
// startByte@5: UInt32; # bits[32, 64)
inline ::uint32_t getStartByte() const;
// endByte@6: UInt32; # bits[64, 96)
inline ::uint32_t getEndByte() const;
private:
::capnp::_::StructReader _reader;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::ToDynamic_;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::_::PointerHelpers;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::List;
friend class ::capnp::MessageBuilder;
friend class ::capnp::Orphanage;
friend ::kj::StringTree KJ_STRINGIFY(Statement::Reader reader);
};
inline ::kj::StringTree KJ_STRINGIFY(Statement::Reader reader) {
return ::capnp::_::structString<Statement>(reader._reader);
}
class Statement::Builder {
public:
typedef Statement Builds;
Builder() = default;
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
inline operator Reader() const { return Reader(_builder.asReader()); }
inline Reader asReader() const { return *this; }
inline size_t totalSizeInWords() { return asReader().totalSizeInWords(); }
// union block@1 { # [0, 16)
inline Block::Builder getBlock();
// tokens@0: List(.Token); # ptr[0]
inline bool hasTokens();
inline ::capnp::List< ::capnp::compiler::Token>::Builder getTokens();
inline void setTokens( ::capnp::List< ::capnp::compiler::Token>::Reader other);
inline ::capnp::List< ::capnp::compiler::Token>::Builder initTokens(unsigned int size);
inline void adoptTokens(::capnp::Orphan< ::capnp::List< ::capnp::compiler::Token>>&& value);
inline ::capnp::Orphan< ::capnp::List< ::capnp::compiler::Token>> disownTokens();
// docComment@4: Text; # ptr[2]
inline bool hasDocComment();
inline ::capnp::Text::Builder getDocComment();
inline void setDocComment( ::capnp::Text::Reader other);
inline ::capnp::Text::Builder initDocComment(unsigned int size);
inline void adoptDocComment(::capnp::Orphan< ::capnp::Text>&& value);
inline ::capnp::Orphan< ::capnp::Text> disownDocComment();
// startByte@5: UInt32; # bits[32, 64)
inline ::uint32_t getStartByte();
inline void setStartByte( ::uint32_t value);
// endByte@6: UInt32; # bits[64, 96)
inline ::uint32_t getEndByte();
inline void setEndByte( ::uint32_t value);
private:
::capnp::_::StructBuilder _builder;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::ToDynamic_;
friend class ::capnp::Orphanage;
friend ::kj::StringTree KJ_STRINGIFY(Statement::Builder builder);
};
inline ::kj::StringTree KJ_STRINGIFY(Statement::Builder builder) {
return ::capnp::_::structString<Statement>(builder._builder.asReader());
}
class Statement::Block::Reader {
public:
typedef Block Reads;
Reader() = default;
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
inline Which which() const;
// none@2: Void; # (none), union tag = 0
inline ::capnp::Void getNone() const;
// statements@3: List(.Statement); # ptr[1], union tag = 1
inline bool hasStatements() const;
inline ::capnp::List< ::capnp::compiler::Statement>::Reader getStatements() const;
private:
::capnp::_::StructReader _reader;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::ToDynamic_;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::_::PointerHelpers;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::List;
friend class ::capnp::MessageBuilder;
friend class ::capnp::Orphanage;
friend ::kj::StringTree KJ_STRINGIFY(Statement::Block::Reader reader);
};
inline ::kj::StringTree KJ_STRINGIFY(Statement::Block::Reader reader) {
return ::capnp::_::unionString<Statement::Block>(reader._reader);
}
class Statement::Block::Builder {
public:
typedef Block Builds;
Builder() = default;
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
inline operator Reader() const { return Reader(_builder.asReader()); }
inline Reader asReader() const { return *this; }
inline Which which();
// none@2: Void; # (none), union tag = 0
inline ::capnp::Void getNone();
inline void setNone( ::capnp::Void value);
// statements@3: List(.Statement); # ptr[1], union tag = 1
inline bool hasStatements();
inline ::capnp::List< ::capnp::compiler::Statement>::Builder getStatements();
inline void setStatements( ::capnp::List< ::capnp::compiler::Statement>::Reader other);
inline ::capnp::List< ::capnp::compiler::Statement>::Builder initStatements(unsigned int size);
inline void adoptStatements(::capnp::Orphan< ::capnp::List< ::capnp::compiler::Statement>>&& value);
inline ::capnp::Orphan< ::capnp::List< ::capnp::compiler::Statement>> disownStatements();
private:
::capnp::_::StructBuilder _builder;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::ToDynamic_;
friend class ::capnp::Orphanage;
friend ::kj::StringTree KJ_STRINGIFY(Statement::Block::Builder builder);
};
inline ::kj::StringTree KJ_STRINGIFY(Statement::Block::Builder builder) {
return ::capnp::_::unionString<Statement::Block>(builder._builder.asReader());
}
class LexedTokens::Reader {
public:
typedef LexedTokens Reads;
Reader() = default;
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
inline size_t totalSizeInWords() const {
return _reader.totalSize() / ::capnp::WORDS;
}
// tokens@0: List(.Token); # ptr[0]
inline bool hasTokens() const;
inline ::capnp::List< ::capnp::compiler::Token>::Reader getTokens() const;
private:
::capnp::_::StructReader _reader;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::ToDynamic_;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::_::PointerHelpers;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::List;
friend class ::capnp::MessageBuilder;
friend class ::capnp::Orphanage;
friend ::kj::StringTree KJ_STRINGIFY(LexedTokens::Reader reader);
};
inline ::kj::StringTree KJ_STRINGIFY(LexedTokens::Reader reader) {
return ::capnp::_::structString<LexedTokens>(reader._reader);
}
class LexedTokens::Builder {
public:
typedef LexedTokens Builds;
Builder() = default;
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
inline operator Reader() const { return Reader(_builder.asReader()); }
inline Reader asReader() const { return *this; }
inline size_t totalSizeInWords() { return asReader().totalSizeInWords(); }
// tokens@0: List(.Token); # ptr[0]
inline bool hasTokens();
inline ::capnp::List< ::capnp::compiler::Token>::Builder getTokens();
inline void setTokens( ::capnp::List< ::capnp::compiler::Token>::Reader other);
inline ::capnp::List< ::capnp::compiler::Token>::Builder initTokens(unsigned int size);
inline void adoptTokens(::capnp::Orphan< ::capnp::List< ::capnp::compiler::Token>>&& value);
inline ::capnp::Orphan< ::capnp::List< ::capnp::compiler::Token>> disownTokens();
private:
::capnp::_::StructBuilder _builder;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::ToDynamic_;
friend class ::capnp::Orphanage;
friend ::kj::StringTree KJ_STRINGIFY(LexedTokens::Builder builder);
};
inline ::kj::StringTree KJ_STRINGIFY(LexedTokens::Builder builder) {
return ::capnp::_::structString<LexedTokens>(builder._builder.asReader());
}
class LexedStatements::Reader {
public:
typedef LexedStatements Reads;
Reader() = default;
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
inline size_t totalSizeInWords() const {
return _reader.totalSize() / ::capnp::WORDS;
}
// statements@0: List(.Statement); # ptr[0]
inline bool hasStatements() const;
inline ::capnp::List< ::capnp::compiler::Statement>::Reader getStatements() const;
private:
::capnp::_::StructReader _reader;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::ToDynamic_;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::_::PointerHelpers;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::List;
friend class ::capnp::MessageBuilder;
friend class ::capnp::Orphanage;
friend ::kj::StringTree KJ_STRINGIFY(LexedStatements::Reader reader);
};
inline ::kj::StringTree KJ_STRINGIFY(LexedStatements::Reader reader) {
return ::capnp::_::structString<LexedStatements>(reader._reader);
}
class LexedStatements::Builder {
public:
typedef LexedStatements Builds;
Builder() = default;
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
inline operator Reader() const { return Reader(_builder.asReader()); }
inline Reader asReader() const { return *this; }
inline size_t totalSizeInWords() { return asReader().totalSizeInWords(); }
// statements@0: List(.Statement); # ptr[0]
inline bool hasStatements();
inline ::capnp::List< ::capnp::compiler::Statement>::Builder getStatements();
inline void setStatements( ::capnp::List< ::capnp::compiler::Statement>::Reader other);
inline ::capnp::List< ::capnp::compiler::Statement>::Builder initStatements(unsigned int size);
inline void adoptStatements(::capnp::Orphan< ::capnp::List< ::capnp::compiler::Statement>>&& value);
inline ::capnp::Orphan< ::capnp::List< ::capnp::compiler::Statement>> disownStatements();
private:
::capnp::_::StructBuilder _builder;
template <typename T, ::capnp::Kind k>
friend struct ::capnp::ToDynamic_;
friend class ::capnp::Orphanage;
friend ::kj::StringTree KJ_STRINGIFY(LexedStatements::Builder builder);
};
inline ::kj::StringTree KJ_STRINGIFY(LexedStatements::Builder builder) {
return ::capnp::_::structString<LexedStatements>(builder._builder.asReader());
}
inline Token::Body::Reader Token::Reader::getBody() const {
return Token::Body::Reader(_reader);
}
inline Token::Body::Builder Token::Builder::getBody() {
return Token::Body::Builder(_builder);
}
// Token::startByte@8: UInt32; # bits[32, 64)
inline ::uint32_t Token::Reader::getStartByte() const {
return _reader.getDataField< ::uint32_t>(
1 * ::capnp::ELEMENTS);
}
inline ::uint32_t Token::Builder::getStartByte() {
return _builder.getDataField< ::uint32_t>(
1 * ::capnp::ELEMENTS);
}
inline void Token::Builder::setStartByte( ::uint32_t value) {
_builder.setDataField< ::uint32_t>(
1 * ::capnp::ELEMENTS, value);
}
// Token::endByte@9: UInt32; # bits[128, 160)
inline ::uint32_t Token::Reader::getEndByte() const {
return _reader.getDataField< ::uint32_t>(
4 * ::capnp::ELEMENTS);
}
inline ::uint32_t Token::Builder::getEndByte() {
return _builder.getDataField< ::uint32_t>(
4 * ::capnp::ELEMENTS);
}
inline void Token::Builder::setEndByte( ::uint32_t value) {
_builder.setDataField< ::uint32_t>(
4 * ::capnp::ELEMENTS, value);
}
// Token::Body
inline Token::Body::Which Token::Body::Reader::which() const {
return _reader.getDataField<Which>(0 * ::capnp::ELEMENTS);
}
inline Token::Body::Which Token::Body::Builder::which() {
return _builder.getDataField<Which>(0 * ::capnp::ELEMENTS);
}
// Token::Body::identifier@1: Text; # ptr[0], union tag = 0
inline bool Token::Body::Reader::hasIdentifier() const {
return !_reader.isPointerFieldNull(0 * ::capnp::POINTERS);
}
inline bool Token::Body::Builder::hasIdentifier() {
return !_builder.isPointerFieldNull(0 * ::capnp::POINTERS);
}
inline ::capnp::Text::Reader Token::Body::Reader::getIdentifier() const {
KJ_IREQUIRE(which() == Body::IDENTIFIER,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(
_reader, 0 * ::capnp::POINTERS);
}
inline ::capnp::Text::Builder Token::Body::Builder::getIdentifier() {
KJ_IREQUIRE(which() == Body::IDENTIFIER,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(
_builder, 0 * ::capnp::POINTERS);
}
inline void Token::Body::Builder::setIdentifier( ::capnp::Text::Reader value) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::IDENTIFIER);
::capnp::_::PointerHelpers< ::capnp::Text>::set(
_builder, 0 * ::capnp::POINTERS, value);
}
inline ::capnp::Text::Builder Token::Body::Builder::initIdentifier(unsigned int size) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::IDENTIFIER);
return ::capnp::_::PointerHelpers< ::capnp::Text>::init(
_builder, 0 * ::capnp::POINTERS, size);
}
inline void Token::Body::Builder::adoptIdentifier(
::capnp::Orphan< ::capnp::Text>&& value) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::IDENTIFIER);
::capnp::_::PointerHelpers< ::capnp::Text>::adopt(
_builder, 0 * ::capnp::POINTERS, kj::mv(value));
}
inline ::capnp::Orphan< ::capnp::Text> Token::Body::Builder::disownIdentifier() {
KJ_IREQUIRE(which() == Body::IDENTIFIER,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(
_builder, 0 * ::capnp::POINTERS);
}
// Token::Body::stringLiteral@2: Text; # ptr[0], union tag = 1
inline bool Token::Body::Reader::hasStringLiteral() const {
return !_reader.isPointerFieldNull(0 * ::capnp::POINTERS);
}
inline bool Token::Body::Builder::hasStringLiteral() {
return !_builder.isPointerFieldNull(0 * ::capnp::POINTERS);
}
inline ::capnp::Text::Reader Token::Body::Reader::getStringLiteral() const {
KJ_IREQUIRE(which() == Body::STRING_LITERAL,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(
_reader, 0 * ::capnp::POINTERS);
}
inline ::capnp::Text::Builder Token::Body::Builder::getStringLiteral() {
KJ_IREQUIRE(which() == Body::STRING_LITERAL,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(
_builder, 0 * ::capnp::POINTERS);
}
inline void Token::Body::Builder::setStringLiteral( ::capnp::Text::Reader value) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::STRING_LITERAL);
::capnp::_::PointerHelpers< ::capnp::Text>::set(
_builder, 0 * ::capnp::POINTERS, value);
}
inline ::capnp::Text::Builder Token::Body::Builder::initStringLiteral(unsigned int size) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::STRING_LITERAL);
return ::capnp::_::PointerHelpers< ::capnp::Text>::init(
_builder, 0 * ::capnp::POINTERS, size);
}
inline void Token::Body::Builder::adoptStringLiteral(
::capnp::Orphan< ::capnp::Text>&& value) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::STRING_LITERAL);
::capnp::_::PointerHelpers< ::capnp::Text>::adopt(
_builder, 0 * ::capnp::POINTERS, kj::mv(value));
}
inline ::capnp::Orphan< ::capnp::Text> Token::Body::Builder::disownStringLiteral() {
KJ_IREQUIRE(which() == Body::STRING_LITERAL,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(
_builder, 0 * ::capnp::POINTERS);
}
// Token::Body::integerLiteral@3: UInt64; # bits[64, 128), union tag = 2
inline ::uint64_t Token::Body::Reader::getIntegerLiteral() const {
KJ_IREQUIRE(which() == Body::INTEGER_LITERAL,
"Must check which() before get()ing a union member.");
return _reader.getDataField< ::uint64_t>(
1 * ::capnp::ELEMENTS);
}
inline ::uint64_t Token::Body::Builder::getIntegerLiteral() {
KJ_IREQUIRE(which() == Body::INTEGER_LITERAL,
"Must check which() before get()ing a union member.");
return _builder.getDataField< ::uint64_t>(
1 * ::capnp::ELEMENTS);
}
inline void Token::Body::Builder::setIntegerLiteral( ::uint64_t value) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::INTEGER_LITERAL);
_builder.setDataField< ::uint64_t>(
1 * ::capnp::ELEMENTS, value);
}
// Token::Body::floatLiteral@4: Float64; # bits[64, 128), union tag = 3
inline double Token::Body::Reader::getFloatLiteral() const {
KJ_IREQUIRE(which() == Body::FLOAT_LITERAL,
"Must check which() before get()ing a union member.");
return _reader.getDataField<double>(
1 * ::capnp::ELEMENTS);
}
inline double Token::Body::Builder::getFloatLiteral() {
KJ_IREQUIRE(which() == Body::FLOAT_LITERAL,
"Must check which() before get()ing a union member.");
return _builder.getDataField<double>(
1 * ::capnp::ELEMENTS);
}
inline void Token::Body::Builder::setFloatLiteral(double value) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::FLOAT_LITERAL);
_builder.setDataField<double>(
1 * ::capnp::ELEMENTS, value);
}
// Token::Body::operator@5: Text; # ptr[0], union tag = 4
inline bool Token::Body::Reader::hasOperator() const {
return !_reader.isPointerFieldNull(0 * ::capnp::POINTERS);
}
inline bool Token::Body::Builder::hasOperator() {
return !_builder.isPointerFieldNull(0 * ::capnp::POINTERS);
}
inline ::capnp::Text::Reader Token::Body::Reader::getOperator() const {
KJ_IREQUIRE(which() == Body::OPERATOR,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(
_reader, 0 * ::capnp::POINTERS);
}
inline ::capnp::Text::Builder Token::Body::Builder::getOperator() {
KJ_IREQUIRE(which() == Body::OPERATOR,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(
_builder, 0 * ::capnp::POINTERS);
}
inline void Token::Body::Builder::setOperator( ::capnp::Text::Reader value) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::OPERATOR);
::capnp::_::PointerHelpers< ::capnp::Text>::set(
_builder, 0 * ::capnp::POINTERS, value);
}
inline ::capnp::Text::Builder Token::Body::Builder::initOperator(unsigned int size) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::OPERATOR);
return ::capnp::_::PointerHelpers< ::capnp::Text>::init(
_builder, 0 * ::capnp::POINTERS, size);
}
inline void Token::Body::Builder::adoptOperator(
::capnp::Orphan< ::capnp::Text>&& value) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::OPERATOR);
::capnp::_::PointerHelpers< ::capnp::Text>::adopt(
_builder, 0 * ::capnp::POINTERS, kj::mv(value));
}
inline ::capnp::Orphan< ::capnp::Text> Token::Body::Builder::disownOperator() {
KJ_IREQUIRE(which() == Body::OPERATOR,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(
_builder, 0 * ::capnp::POINTERS);
}
// Token::Body::parenthesizedList@6: List(List(.Token)); # ptr[0], union tag = 5
inline bool Token::Body::Reader::hasParenthesizedList() const {
return !_reader.isPointerFieldNull(0 * ::capnp::POINTERS);
}
inline bool Token::Body::Builder::hasParenthesizedList() {
return !_builder.isPointerFieldNull(0 * ::capnp::POINTERS);
}
inline ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>::Reader Token::Body::Reader::getParenthesizedList() const {
KJ_IREQUIRE(which() == Body::PARENTHESIZED_LIST,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>::get(
_reader, 0 * ::capnp::POINTERS);
}
inline ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>::Builder Token::Body::Builder::getParenthesizedList() {
KJ_IREQUIRE(which() == Body::PARENTHESIZED_LIST,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>::get(
_builder, 0 * ::capnp::POINTERS);
}
inline void Token::Body::Builder::setParenthesizedList( ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>::Reader value) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::PARENTHESIZED_LIST);
::capnp::_::PointerHelpers< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>::set(
_builder, 0 * ::capnp::POINTERS, value);
}
inline void Token::Body::Builder::setParenthesizedList(
std::initializer_list< ::capnp::List< ::capnp::compiler::Token>::Reader> value) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::PARENTHESIZED_LIST);
::capnp::_::PointerHelpers< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>::set(
_builder, 0 * ::capnp::POINTERS, value);
}
inline ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>::Builder Token::Body::Builder::initParenthesizedList(unsigned int size) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::PARENTHESIZED_LIST);
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>::init(
_builder, 0 * ::capnp::POINTERS, size);
}
inline void Token::Body::Builder::adoptParenthesizedList(
::capnp::Orphan< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>&& value) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::PARENTHESIZED_LIST);
::capnp::_::PointerHelpers< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>::adopt(
_builder, 0 * ::capnp::POINTERS, kj::mv(value));
}
inline ::capnp::Orphan< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>> Token::Body::Builder::disownParenthesizedList() {
KJ_IREQUIRE(which() == Body::PARENTHESIZED_LIST,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>::disown(
_builder, 0 * ::capnp::POINTERS);
}
// Token::Body::bracketedList@7: List(List(.Token)); # ptr[0], union tag = 6
inline bool Token::Body::Reader::hasBracketedList() const {
return !_reader.isPointerFieldNull(0 * ::capnp::POINTERS);
}
inline bool Token::Body::Builder::hasBracketedList() {
return !_builder.isPointerFieldNull(0 * ::capnp::POINTERS);
}
inline ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>::Reader Token::Body::Reader::getBracketedList() const {
KJ_IREQUIRE(which() == Body::BRACKETED_LIST,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>::get(
_reader, 0 * ::capnp::POINTERS);
}
inline ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>::Builder Token::Body::Builder::getBracketedList() {
KJ_IREQUIRE(which() == Body::BRACKETED_LIST,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>::get(
_builder, 0 * ::capnp::POINTERS);
}
inline void Token::Body::Builder::setBracketedList( ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>::Reader value) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::BRACKETED_LIST);
::capnp::_::PointerHelpers< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>::set(
_builder, 0 * ::capnp::POINTERS, value);
}
inline void Token::Body::Builder::setBracketedList(
std::initializer_list< ::capnp::List< ::capnp::compiler::Token>::Reader> value) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::BRACKETED_LIST);
::capnp::_::PointerHelpers< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>::set(
_builder, 0 * ::capnp::POINTERS, value);
}
inline ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>::Builder Token::Body::Builder::initBracketedList(unsigned int size) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::BRACKETED_LIST);
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>::init(
_builder, 0 * ::capnp::POINTERS, size);
}
inline void Token::Body::Builder::adoptBracketedList(
::capnp::Orphan< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>&& value) {
_builder.setDataField<Body::Which>(
0 * ::capnp::ELEMENTS, Body::BRACKETED_LIST);
::capnp::_::PointerHelpers< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>::adopt(
_builder, 0 * ::capnp::POINTERS, kj::mv(value));
}
inline ::capnp::Orphan< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>> Token::Body::Builder::disownBracketedList() {
KJ_IREQUIRE(which() == Body::BRACKETED_LIST,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::List< ::capnp::compiler::Token>>>::disown(
_builder, 0 * ::capnp::POINTERS);
}
inline Statement::Block::Reader Statement::Reader::getBlock() const {
return Statement::Block::Reader(_reader);
}
inline Statement::Block::Builder Statement::Builder::getBlock() {
return Statement::Block::Builder(_builder);
}
// Statement::tokens@0: List(.Token); # ptr[0]
inline bool Statement::Reader::hasTokens() const {
return !_reader.isPointerFieldNull(0 * ::capnp::POINTERS);
}
inline bool Statement::Builder::hasTokens() {
return !_builder.isPointerFieldNull(0 * ::capnp::POINTERS);
}
inline ::capnp::List< ::capnp::compiler::Token>::Reader Statement::Reader::getTokens() const {
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Token>>::get(
_reader, 0 * ::capnp::POINTERS);
}
inline ::capnp::List< ::capnp::compiler::Token>::Builder Statement::Builder::getTokens() {
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Token>>::get(
_builder, 0 * ::capnp::POINTERS);
}
inline void Statement::Builder::setTokens( ::capnp::List< ::capnp::compiler::Token>::Reader value) {
::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Token>>::set(
_builder, 0 * ::capnp::POINTERS, value);
}
inline ::capnp::List< ::capnp::compiler::Token>::Builder Statement::Builder::initTokens(unsigned int size) {
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Token>>::init(
_builder, 0 * ::capnp::POINTERS, size);
}
inline void Statement::Builder::adoptTokens(
::capnp::Orphan< ::capnp::List< ::capnp::compiler::Token>>&& value) {
::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Token>>::adopt(
_builder, 0 * ::capnp::POINTERS, kj::mv(value));
}
inline ::capnp::Orphan< ::capnp::List< ::capnp::compiler::Token>> Statement::Builder::disownTokens() {
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Token>>::disown(
_builder, 0 * ::capnp::POINTERS);
}
// Statement::docComment@4: Text; # ptr[2]
inline bool Statement::Reader::hasDocComment() const {
return !_reader.isPointerFieldNull(2 * ::capnp::POINTERS);
}
inline bool Statement::Builder::hasDocComment() {
return !_builder.isPointerFieldNull(2 * ::capnp::POINTERS);
}
inline ::capnp::Text::Reader Statement::Reader::getDocComment() const {
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(
_reader, 2 * ::capnp::POINTERS);
}
inline ::capnp::Text::Builder Statement::Builder::getDocComment() {
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(
_builder, 2 * ::capnp::POINTERS);
}
inline void Statement::Builder::setDocComment( ::capnp::Text::Reader value) {
::capnp::_::PointerHelpers< ::capnp::Text>::set(
_builder, 2 * ::capnp::POINTERS, value);
}
inline ::capnp::Text::Builder Statement::Builder::initDocComment(unsigned int size) {
return ::capnp::_::PointerHelpers< ::capnp::Text>::init(
_builder, 2 * ::capnp::POINTERS, size);
}
inline void Statement::Builder::adoptDocComment(
::capnp::Orphan< ::capnp::Text>&& value) {
::capnp::_::PointerHelpers< ::capnp::Text>::adopt(
_builder, 2 * ::capnp::POINTERS, kj::mv(value));
}
inline ::capnp::Orphan< ::capnp::Text> Statement::Builder::disownDocComment() {
return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(
_builder, 2 * ::capnp::POINTERS);
}
// Statement::startByte@5: UInt32; # bits[32, 64)
inline ::uint32_t Statement::Reader::getStartByte() const {
return _reader.getDataField< ::uint32_t>(
1 * ::capnp::ELEMENTS);
}
inline ::uint32_t Statement::Builder::getStartByte() {
return _builder.getDataField< ::uint32_t>(
1 * ::capnp::ELEMENTS);
}
inline void Statement::Builder::setStartByte( ::uint32_t value) {
_builder.setDataField< ::uint32_t>(
1 * ::capnp::ELEMENTS, value);
}
// Statement::endByte@6: UInt32; # bits[64, 96)
inline ::uint32_t Statement::Reader::getEndByte() const {
return _reader.getDataField< ::uint32_t>(
2 * ::capnp::ELEMENTS);
}
inline ::uint32_t Statement::Builder::getEndByte() {
return _builder.getDataField< ::uint32_t>(
2 * ::capnp::ELEMENTS);
}
inline void Statement::Builder::setEndByte( ::uint32_t value) {
_builder.setDataField< ::uint32_t>(
2 * ::capnp::ELEMENTS, value);
}
// Statement::Block
inline Statement::Block::Which Statement::Block::Reader::which() const {
return _reader.getDataField<Which>(0 * ::capnp::ELEMENTS);
}
inline Statement::Block::Which Statement::Block::Builder::which() {
return _builder.getDataField<Which>(0 * ::capnp::ELEMENTS);
}
// Statement::Block::none@2: Void; # (none), union tag = 0
inline ::capnp::Void Statement::Block::Reader::getNone() const {
KJ_IREQUIRE(which() == Block::NONE,
"Must check which() before get()ing a union member.");
return _reader.getDataField< ::capnp::Void>(
0 * ::capnp::ELEMENTS);
}
inline ::capnp::Void Statement::Block::Builder::getNone() {
KJ_IREQUIRE(which() == Block::NONE,
"Must check which() before get()ing a union member.");
return _builder.getDataField< ::capnp::Void>(
0 * ::capnp::ELEMENTS);
}
inline void Statement::Block::Builder::setNone( ::capnp::Void value = ::capnp::Void::VOID) {
_builder.setDataField<Block::Which>(
0 * ::capnp::ELEMENTS, Block::NONE);
_builder.setDataField< ::capnp::Void>(
0 * ::capnp::ELEMENTS, value);
}
// Statement::Block::statements@3: List(.Statement); # ptr[1], union tag = 1
inline bool Statement::Block::Reader::hasStatements() const {
return !_reader.isPointerFieldNull(1 * ::capnp::POINTERS);
}
inline bool Statement::Block::Builder::hasStatements() {
return !_builder.isPointerFieldNull(1 * ::capnp::POINTERS);
}
inline ::capnp::List< ::capnp::compiler::Statement>::Reader Statement::Block::Reader::getStatements() const {
KJ_IREQUIRE(which() == Block::STATEMENTS,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Statement>>::get(
_reader, 1 * ::capnp::POINTERS);
}
inline ::capnp::List< ::capnp::compiler::Statement>::Builder Statement::Block::Builder::getStatements() {
KJ_IREQUIRE(which() == Block::STATEMENTS,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Statement>>::get(
_builder, 1 * ::capnp::POINTERS);
}
inline void Statement::Block::Builder::setStatements( ::capnp::List< ::capnp::compiler::Statement>::Reader value) {
_builder.setDataField<Block::Which>(
0 * ::capnp::ELEMENTS, Block::STATEMENTS);
::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Statement>>::set(
_builder, 1 * ::capnp::POINTERS, value);
}
inline ::capnp::List< ::capnp::compiler::Statement>::Builder Statement::Block::Builder::initStatements(unsigned int size) {
_builder.setDataField<Block::Which>(
0 * ::capnp::ELEMENTS, Block::STATEMENTS);
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Statement>>::init(
_builder, 1 * ::capnp::POINTERS, size);
}
inline void Statement::Block::Builder::adoptStatements(
::capnp::Orphan< ::capnp::List< ::capnp::compiler::Statement>>&& value) {
_builder.setDataField<Block::Which>(
0 * ::capnp::ELEMENTS, Block::STATEMENTS);
::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Statement>>::adopt(
_builder, 1 * ::capnp::POINTERS, kj::mv(value));
}
inline ::capnp::Orphan< ::capnp::List< ::capnp::compiler::Statement>> Statement::Block::Builder::disownStatements() {
KJ_IREQUIRE(which() == Block::STATEMENTS,
"Must check which() before get()ing a union member.");
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Statement>>::disown(
_builder, 1 * ::capnp::POINTERS);
}
// LexedTokens::tokens@0: List(.Token); # ptr[0]
inline bool LexedTokens::Reader::hasTokens() const {
return !_reader.isPointerFieldNull(0 * ::capnp::POINTERS);
}
inline bool LexedTokens::Builder::hasTokens() {
return !_builder.isPointerFieldNull(0 * ::capnp::POINTERS);
}
inline ::capnp::List< ::capnp::compiler::Token>::Reader LexedTokens::Reader::getTokens() const {
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Token>>::get(
_reader, 0 * ::capnp::POINTERS);
}
inline ::capnp::List< ::capnp::compiler::Token>::Builder LexedTokens::Builder::getTokens() {
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Token>>::get(
_builder, 0 * ::capnp::POINTERS);
}
inline void LexedTokens::Builder::setTokens( ::capnp::List< ::capnp::compiler::Token>::Reader value) {
::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Token>>::set(
_builder, 0 * ::capnp::POINTERS, value);
}
inline ::capnp::List< ::capnp::compiler::Token>::Builder LexedTokens::Builder::initTokens(unsigned int size) {
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Token>>::init(
_builder, 0 * ::capnp::POINTERS, size);
}
inline void LexedTokens::Builder::adoptTokens(
::capnp::Orphan< ::capnp::List< ::capnp::compiler::Token>>&& value) {
::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Token>>::adopt(
_builder, 0 * ::capnp::POINTERS, kj::mv(value));
}
inline ::capnp::Orphan< ::capnp::List< ::capnp::compiler::Token>> LexedTokens::Builder::disownTokens() {
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Token>>::disown(
_builder, 0 * ::capnp::POINTERS);
}
// LexedStatements::statements@0: List(.Statement); # ptr[0]
inline bool LexedStatements::Reader::hasStatements() const {
return !_reader.isPointerFieldNull(0 * ::capnp::POINTERS);
}
inline bool LexedStatements::Builder::hasStatements() {
return !_builder.isPointerFieldNull(0 * ::capnp::POINTERS);
}
inline ::capnp::List< ::capnp::compiler::Statement>::Reader LexedStatements::Reader::getStatements() const {
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Statement>>::get(
_reader, 0 * ::capnp::POINTERS);
}
inline ::capnp::List< ::capnp::compiler::Statement>::Builder LexedStatements::Builder::getStatements() {
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Statement>>::get(
_builder, 0 * ::capnp::POINTERS);
}
inline void LexedStatements::Builder::setStatements( ::capnp::List< ::capnp::compiler::Statement>::Reader value) {
::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Statement>>::set(
_builder, 0 * ::capnp::POINTERS, value);
}
inline ::capnp::List< ::capnp::compiler::Statement>::Builder LexedStatements::Builder::initStatements(unsigned int size) {
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Statement>>::init(
_builder, 0 * ::capnp::POINTERS, size);
}
inline void LexedStatements::Builder::adoptStatements(
::capnp::Orphan< ::capnp::List< ::capnp::compiler::Statement>>&& value) {
::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Statement>>::adopt(
_builder, 0 * ::capnp::POINTERS, kj::mv(value));
}
inline ::capnp::Orphan< ::capnp::List< ::capnp::compiler::Statement>> LexedStatements::Builder::disownStatements() {
return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::compiler::Statement>>::disown(
_builder, 0 * ::capnp::POINTERS);
}
} // namespace
} // namespace
#endif // CAPNP_INCLUDED_28e6ee28b20c751454a4280a478ff746
......@@ -687,6 +687,10 @@ static void findImports(DynamicValue::Reader value, std::set<kj::StringPtr>& out
}
break;
case DynamicValue::UNION:
findImports(value.as<DynamicUnion>().get(), output);
break;
default:
break;
}
......@@ -699,6 +703,9 @@ void NodeTranslator::compileFile(Declaration::Reader decl, schema::FileNode::Bui
auto list = builder.initImports(imports.size());
auto iter = imports.begin();
for (auto element: list) {
KJ_IF_MAYBE(i, resolver.resolveImport(*iter)) {
element.setId(*i);
}
element.setName(*iter++);
}
KJ_ASSERT(iter == imports.end());
......
......@@ -72,6 +72,9 @@ public:
// Throws an exception if the id is not one that was found by calling resolve() or by
// traversing other schemas. Returns null if the ID is recognized, but the corresponding
// schema node failed to be built for reasons that were already reported.
virtual kj::Maybe<uint64_t> resolveImport(kj::StringPtr name) const = 0;
// Get the ID of an imported file given the import path.
};
NodeTranslator(const Resolver& resolver, const ErrorReporter& errorReporter,
......
......@@ -346,10 +346,10 @@ TEST(Encoding, UnionLayout) {
EXPECT_EQ(UnionState({0,12,0,0}, 512), INIT_UNION(getUnion1().setU1f1sp("1")));
EXPECT_EQ(UnionState({0,13,0,0}, -1), INIT_UNION(getUnion1().setU1f2s0(Void::VOID)));
EXPECT_EQ(UnionState({0,14,0,0}, 128), INIT_UNION(getUnion1().setU1f2s1(1)));
EXPECT_EQ(UnionState({0,15,0,0}, 128), INIT_UNION(getUnion1().setU1f2s8(1)));
EXPECT_EQ(UnionState({0,16,0,0}, 128), INIT_UNION(getUnion1().setU1f2s16(1)));
EXPECT_EQ(UnionState({0,17,0,0}, 128), INIT_UNION(getUnion1().setU1f2s32(1)));
EXPECT_EQ(UnionState({0,14,0,0}, 65), INIT_UNION(getUnion1().setU1f2s1(1)));
EXPECT_EQ(UnionState({0,15,0,0}, 72), INIT_UNION(getUnion1().setU1f2s8(1)));
EXPECT_EQ(UnionState({0,16,0,0}, 80), INIT_UNION(getUnion1().setU1f2s16(1)));
EXPECT_EQ(UnionState({0,17,0,0}, 96), INIT_UNION(getUnion1().setU1f2s32(1)));
EXPECT_EQ(UnionState({0,18,0,0}, 128), INIT_UNION(getUnion1().setU1f2s64(1)));
EXPECT_EQ(UnionState({0,19,0,0}, 512), INIT_UNION(getUnion1().setU1f2sp("1")));
......
......@@ -55,7 +55,7 @@ Schema Schema::getDependency(uint64_t id) const {
}
}
KJ_FAIL_REQUIRE("Requested ID not found in dependency table.", id);
KJ_FAIL_REQUIRE("Requested ID not found in dependency table.", kj::hex(id));
return Schema();
}
......
......@@ -156,17 +156,7 @@ struct FileNode {
imports @0 :List(Import);
struct Import {
id @0 :Id;
# DEPRECATED: ID of the imported file. This is no longer filled in because it is hostile to
# lazy importing: since this import list appears in the FileNode, and since the FileNode must
# necessarily be cosntructed if any schemas in the file are used, the implication of listing
# import IDs here is that if a schema file is used at all, all of its imports must be parsed,
# just to get their IDs. We'd much rather delay parsing a file until something inside it is
# actually used.
#
# In any case, this import list's main reason for existing is to make it easy to generate
# the appropriate #include statements in C++. The IDs of files aren't needed for that.
#
# TODO(someday): Perhaps provide an alternative way to identify the remote file.
# ID of the imported file.
name @1 :Text;
# Name which *this* file used to refer to the foreign file. This may be a relative name.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -216,7 +216,7 @@ struct TestUnion {
u1f0sp @30: Text;
u1f1sp @31: Text;
# Pack more stuff into union1 -- should go into same space as u1f0s64.
# Pack more stuff into union1 -- each should go into the same space as corresponding u1f0s*.
u1f2s0 @32: Void;
u1f2s1 @33: Bool;
u1f2s8 @34: Int8;
......
......@@ -233,14 +233,16 @@ void ArrayOutputStream::write(const void* src, size_t size) {
// =======================================================================================
AutoCloseFd::~AutoCloseFd() noexcept(false) {
unwindDetector.catchExceptionsIfUnwinding([&]() {
// Don't use SYSCALL() here because close() should not be repeated on EINTR.
if (fd >= 0 && close(fd) < 0) {
KJ_FAIL_SYSCALL("close", errno, fd) {
break;
if (fd >= 0) {
unwindDetector.catchExceptionsIfUnwinding([&]() {
// Don't use SYSCALL() here because close() should not be repeated on EINTR.
if (close(fd) < 0) {
KJ_FAIL_SYSCALL("close", errno, fd) {
break;
}
}
}
});
});
}
}
FdInputStream::~FdInputStream() noexcept(false) {}
......
......@@ -126,8 +126,8 @@ main = do
-- TODO(someday): We should perhaps determine the compiler binary's location and search its
-- ../include as well. Also, there should perhaps be a way to tell the compiler not to search
-- these hard-coded default paths.
let searchPath = ["/usr/local/include", "/usr/include"] ++
[dir | SearchPathOpt dir <- options]
let searchPath = [dir | SearchPathOpt dir <- options] ++
["/usr/local/include", "/usr/include"]
srcPrefixes = [addTrailingSlash prefix | SrcPrefixOpt prefix <- options]
addTrailingSlash path =
if not (null path) && last path /= '/'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment