LLoader Class

#include <Layers/lloader.h>

Public Functions

LLoader(LLayer * scope)
void lower(const LLayerNode & root)

Detailed Description

Converts parsed tree items into live data objects and inserts them into a provided root.

The engine uses a loader internally with the preferred LEngine::load_files() method. Loading input by hand is usually not necessary.

When constructing a loader, pass a pointer to the root LLayer object serving as the scope to insert converted live data objects into.

LLayer root;
LLoader loader(&root);

With the loader ready, pass the parsed tree to lower(). (See LLexer and LParser)

LLexer lexer("Hero/Sword/Damage: 80");
LParser parser(lexer.build_tokens());

loader.lower(parser.parse_file());

LLayer* hero = root.find_layer("Hero");

Member Function Documentation

LLoader(LLayer * scope)

Constructs a loader that inserts converted data objects into scope.

void lower(const LLayerNode & root)

Converts the parsed tree into live data objects and inserts them into the associated scope.

Appearance
Theme
—