Enzo
Loading...
Searching...
No Matches
DasRuntime.h
1#pragma once
2#include "Engine/Core/Types.h"
3#include <memory>
4
5namespace enzo::expr {
6
7class ExpressionContext;
8
27{
28 public:
30
33 bool evalFloat(
34 const String& functionName,
35 const ExpressionContext* context,
36 floatT& result,
37 String& error
38 );
39
42 bool evalInt(
43 const String& functionName,
44 const ExpressionContext* context,
45 intT& result,
46 String& error
47 );
48
51 bool evalString(
52 const String& functionName,
53 const ExpressionContext* context,
54 String& result,
55 String& error
56 );
57
58 private:
59 friend class DasRuntime;
61
62 struct Impl;
63 std::unique_ptr<Impl> impl_;
64};
65
77{
78 public:
79 static DasRuntime& instance();
80
86 std::shared_ptr<CompiledScript>
87 compile(const String& name, const String& source, String& error);
88
89 DasRuntime(const DasRuntime&) = delete;
90 DasRuntime& operator=(const DasRuntime&) = delete;
91
92 private:
93 DasRuntime();
95};
96
97} // namespace enzo::expr
Basic attribute, parameter, and node types for Enzo.
A compiled daslang program ready to run.
Definition DasRuntime.h:27
bool evalFloat(const String &functionName, const ExpressionContext *context, floatT &result, String &error)
Evaluates an exported function as a float.
Definition DasRuntime.cpp:73
bool evalString(const String &functionName, const ExpressionContext *context, String &result, String &error)
Evaluates an exported function as a string.
Definition DasRuntime.cpp:101
bool evalInt(const String &functionName, const ExpressionContext *context, intT &result, String &error)
Evaluates an exported function as an integer.
Definition DasRuntime.cpp:87
Shared host for the daslang runtime.
Definition DasRuntime.h:77
std::shared_ptr< CompiledScript > compile(const String &name, const String &source, String &error)
Compiles source text into a reusable script.
Definition DasRuntime.cpp:134
The world a single expression evaluation reads and writes to.
Definition ExpressionContext.h:21
Definition DasRuntime.cpp:17