Current section
Files
Jump to
Current section
Files
src/bt_engine/yaml_parser/parse_root.erl
-module(parse_root).
-export([
parse/3
]).
%% yaml dictionary is a map of subtree name => unparsed subtree yaml. this
%% can be extended by reading more files.
%% args is a proplist of {param, value}
-spec parse(FilePath :: string(), TreeName :: string(), Args :: list({string(), term()}) ) -> {ParsedTree :: term(), Blackboard :: term()}.
parse(RootFilePath, TreeName, Args) ->
%% read yaml file
YAMLDictionary = parser_utils:read_file(RootFilePath),
bt_parser:parse({TreeName, [{"args", Args}, {"ref", RootFilePath}]}, parser_utils:get_namespace(), #{}, #{}, YAMLDictionary, filename:dirname(RootFilePath)).