zuspec-arl-eval 0.0.7.13253972717rc0__cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. zsp_arl_eval/__build_num__.py +1 -0
  2. zsp_arl_eval/__init__.py +20 -0
  3. zsp_arl_eval/__version__.py +3 -0
  4. zsp_arl_eval/core.cpython-310-x86_64-linux-gnu.so +0 -0
  5. zsp_arl_eval/core.pxd +133 -0
  6. zsp_arl_eval/decl.pxd +140 -0
  7. zsp_arl_eval/libzsp-arl-eval.so +0 -0
  8. zsp_arl_eval/pkginfo.py +24 -0
  9. zsp_arl_eval/share/include/EvalBackendClosure.h +76 -0
  10. zsp_arl_eval/share/include/EvalThreadData.h +48 -0
  11. zsp_arl_eval/share/include/zsp/arl/eval/FactoryExt.h +27 -0
  12. zsp_arl_eval/share/include/zsp/arl/eval/IBuiltinFuncInfo.h +77 -0
  13. zsp_arl_eval/share/include/zsp/arl/eval/IComponentTreeData.h +49 -0
  14. zsp_arl_eval/share/include/zsp/arl/eval/IEval.h +126 -0
  15. zsp_arl_eval/share/include/zsp/arl/eval/IEvalBackend.h +82 -0
  16. zsp_arl_eval/share/include/zsp/arl/eval/IEvalContext.h +162 -0
  17. zsp_arl_eval/share/include/zsp/arl/eval/IEvalContextActivity.h +52 -0
  18. zsp_arl_eval/share/include/zsp/arl/eval/IEvalContextInt.h +65 -0
  19. zsp_arl_eval/share/include/zsp/arl/eval/IEvalFunctionData.h +40 -0
  20. zsp_arl_eval/share/include/zsp/arl/eval/IEvalListener.h +59 -0
  21. zsp_arl_eval/share/include/zsp/arl/eval/IEvalStackFrame.h +50 -0
  22. zsp_arl_eval/share/include/zsp/arl/eval/IEvalThread.h +94 -0
  23. zsp_arl_eval/share/include/zsp/arl/eval/IEvalThreadEventListener.h +42 -0
  24. zsp_arl_eval/share/include/zsp/arl/eval/IEvalThreadId.h +41 -0
  25. zsp_arl_eval/share/include/zsp/arl/eval/IEvalValProvider.h +52 -0
  26. zsp_arl_eval/share/include/zsp/arl/eval/IFactory.h +90 -0
  27. zsp_arl_eval/share/include/zsp/arl/eval/IModelAddressSpace.h +46 -0
  28. zsp_arl_eval/share/include/zsp/arl/eval/IModelEvaluator.h +42 -0
  29. zsp_arl_eval/share/include/zsp/arl/eval/impl/EvalBackendBase.h +76 -0
  30. zsp_arl_eval/share/include/zsp/arl/eval/impl/EvalListenerBase.h +59 -0
  31. zsp_arl_eval/share/include/zsp/arl/eval/impl/TaskEvalGetLval.h +148 -0
  32. zuspec_arl_eval-0.0.7.13253972717rc0.dist-info/LICENSE +201 -0
  33. zuspec_arl_eval-0.0.7.13253972717rc0.dist-info/METADATA +27 -0
  34. zuspec_arl_eval-0.0.7.13253972717rc0.dist-info/RECORD +37 -0
  35. zuspec_arl_eval-0.0.7.13253972717rc0.dist-info/WHEEL +6 -0
  36. zuspec_arl_eval-0.0.7.13253972717rc0.dist-info/entry_points.txt +2 -0
  37. zuspec_arl_eval-0.0.7.13253972717rc0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,94 @@
1
+ /**
2
+ * IEvalThread.h
3
+ *
4
+ * Copyright 2023 Matthew Ballance and Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
7
+ * not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at:
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ * Created on:
19
+ * Author:
20
+ */
21
+ #pragma once
22
+ #include <vector>
23
+ #include "dmgr/IDebugMgr.h"
24
+ #include "vsc/dm/impl/UP.h"
25
+ #include "vsc/dm/impl/ValRefInt.h"
26
+ #include "zsp/arl/dm/IDataTypeFunction.h"
27
+ #include "zsp/arl/eval/IEval.h"
28
+ #include "zsp/arl/eval/IEvalStackFrame.h"
29
+ #include "zsp/arl/eval/IEvalThreadId.h"
30
+ #include "zsp/arl/eval/IEvalValProvider.h"
31
+
32
+ namespace zsp {
33
+ namespace arl {
34
+ namespace eval {
35
+
36
+ class IEvalBackend;
37
+
38
+ class IEvalThread;
39
+ using IEvalThreadUP=vsc::dm::UP<IEvalThread>;
40
+ class IEvalThread : public virtual IEval {
41
+ public:
42
+
43
+ virtual ~IEvalThread() { }
44
+
45
+ virtual IEvalBackend *getBackend() const = 0;
46
+
47
+ /**
48
+ * @brief Push an eval-stack entry
49
+ */
50
+ virtual void pushEval(IEval *e, bool owned=false) = 0;
51
+
52
+ /**
53
+ * @brief Convert eval-stack entry to a suspended entry
54
+ */
55
+ virtual void suspendEval(IEval *e) = 0;
56
+
57
+ virtual void popEval(IEval *e) = 0;
58
+
59
+ virtual IEvalThreadId *getThreadId() const = 0;
60
+
61
+ virtual void setThreadId(IEvalThreadId *tid) = 0;
62
+
63
+ /**
64
+ * @brief Initiates a method call using this thread as context.
65
+ * If the return is '0', then the result is immediately
66
+ * available. Otherwise, subsequent calls to eval must
67
+ * be made.
68
+ *
69
+ * @param method
70
+ * @param method_ctxt
71
+ * @param params
72
+ * @return int32_t
73
+ */
74
+ virtual int32_t evalMethodCallContext(
75
+ dm::IDataTypeFunction *method,
76
+ vsc::dm::IModelField *method_ctxt,
77
+ const std::vector<vsc::dm::ITypeExpr *> &params) = 0;
78
+
79
+ virtual vsc::dm::ValRefInt getAddrHandleValue(const vsc::dm::ValRef &addr_h) = 0;
80
+
81
+ virtual dmgr::IDebugMgr *getDebugMgr() const = 0;
82
+
83
+ virtual vsc::dm::ValRefInt mkValRefInt(
84
+ int64_t value,
85
+ bool is_signed,
86
+ int32_t width) = 0;
87
+
88
+ };
89
+
90
+ } /* namespace eval */
91
+ } /* namespace arl */
92
+ } /* namespace zsp */
93
+
94
+
@@ -0,0 +1,42 @@
1
+ /**
2
+ * IEvalThreadEventListener.h
3
+ *
4
+ * Copyright 2023 Matthew Ballance and Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
7
+ * not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at:
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ * Created on:
19
+ * Author:
20
+ */
21
+ #pragma once
22
+
23
+ namespace zsp {
24
+ namespace arl {
25
+ namespace eval {
26
+
27
+
28
+
29
+ class IEvalThreadEventListener {
30
+ public:
31
+
32
+ virtual ~IEvalThreadEventListener() { }
33
+
34
+ virtual void event() = 0;
35
+
36
+ };
37
+
38
+ } /* namespace eval */
39
+ } /* namespace arl */
40
+ } /* namespace zsp */
41
+
42
+
@@ -0,0 +1,41 @@
1
+ /**
2
+ * IEvalThreadId.h
3
+ *
4
+ * Copyright 2023 Matthew Ballance and Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
7
+ * not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at:
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ * Created on:
19
+ * Author:
20
+ */
21
+ #pragma once
22
+ #include "vsc/dm/impl/UP.h"
23
+
24
+ namespace zsp {
25
+ namespace arl {
26
+ namespace eval {
27
+
28
+ class IEvalThreadId;
29
+ using IEvalThreadIdUP=vsc::dm::UP<IEvalThreadId>;
30
+ class IEvalThreadId {
31
+ public:
32
+
33
+ virtual ~IEvalThreadId() { }
34
+
35
+ };
36
+
37
+ } /* namespace eval */
38
+ } /* namespace arl */
39
+ } /* namespace zsp */
40
+
41
+
@@ -0,0 +1,52 @@
1
+ /**
2
+ * IEvalValProvider.h
3
+ *
4
+ * Copyright 2023 Matthew Ballance and Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
7
+ * not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at:
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ * Created on:
19
+ * Author:
20
+ */
21
+ #pragma once
22
+ #include "vsc/dm/ITypeExprFieldRef.h"
23
+ #include "vsc/dm/impl/ValRef.h"
24
+
25
+ namespace zsp {
26
+ namespace arl {
27
+ namespace eval {
28
+
29
+
30
+
31
+ class IEvalValProvider {
32
+ public:
33
+
34
+ virtual ~IEvalValProvider() { }
35
+
36
+ virtual vsc::dm::ValRef getImmVal(
37
+ vsc::dm::ITypeExprFieldRef::RootRefKind root_kind,
38
+ int32_t root_offset,
39
+ int32_t val_offset) = 0;
40
+
41
+ virtual vsc::dm::ValRef getMutVal(
42
+ vsc::dm::ITypeExprFieldRef::RootRefKind root_kind,
43
+ int32_t root_offset,
44
+ int32_t val_offset) = 0;
45
+
46
+ };
47
+
48
+ } /* namespace eval */
49
+ } /* namespace arl */
50
+ } /* namespace zsp */
51
+
52
+
@@ -0,0 +1,90 @@
1
+ /**
2
+ * IFactory.h
3
+ *
4
+ * Copyright 2022 Matthew Ballance and Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
7
+ * not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at:
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ * Created on:
19
+ * Author:
20
+ */
21
+ #pragma once
22
+ #include "dmgr/IDebugMgr.h"
23
+ #include "pyapi-compat-if/IPyEval.h"
24
+ #include "vsc/solvers/IFactory.h"
25
+ #include "zsp/arl/dm/IContext.h"
26
+ #include "zsp/arl/eval/IComponentTreeData.h"
27
+ #include "zsp/arl/eval/IModelEvaluator.h"
28
+ #include "zsp/arl/eval/IEvalBackend.h"
29
+ #include "zsp/arl/eval/IEvalContext.h"
30
+ #include "zsp/arl/eval/IEvalStackFrame.h"
31
+
32
+ namespace zsp {
33
+ namespace arl {
34
+ namespace eval {
35
+
36
+
37
+
38
+ class IFactory {
39
+ public:
40
+
41
+ virtual ~IFactory() { }
42
+
43
+ virtual void init(dmgr::IDebugMgr *dmgr) = 0;
44
+
45
+ virtual IComponentTreeData *mkComponentTreeData(
46
+ arl::dm::IDataTypeComponent *root_t) = 0;
47
+
48
+ virtual IModelEvaluator *mkModelEvaluator(
49
+ ModelEvaluatorKind kind,
50
+ vsc::solvers::IFactory *solvers_f,
51
+ arl::dm::IContext *ctxt) = 0;
52
+
53
+ virtual IEvalContext *mkEvalContextFullElab(
54
+ vsc::solvers::IFactory *solvers_f,
55
+ arl::dm::IContext *ctxt,
56
+ const vsc::solvers::IRandState *randstate,
57
+ pyapi::IPyEval *pyeval,
58
+ dm::IDataTypeComponent *root_comp,
59
+ dm::IDataTypeAction *root_action,
60
+ IEvalBackend *backend) = 0;
61
+
62
+ virtual IEvalThread *mkEvalThread(
63
+ IEvalBackend *backend,
64
+ IEvalThread *parent) = 0;
65
+
66
+ virtual IEvalContext *mkEvalContextFunctionStatic(
67
+ vsc::solvers::IFactory *solvers_f,
68
+ arl::dm::IContext *ctxt,
69
+ const vsc::solvers::IRandState *randstate,
70
+ IEvalBackend *backend,
71
+ dm::IDataTypeFunction *func,
72
+ const std::vector<vsc::dm::ITypeExpr *> &params) = 0;
73
+
74
+ virtual IEvalContext *mkEvalContextFunctionContext(
75
+ vsc::solvers::IFactory *solvers_f,
76
+ arl::dm::IContext *ctxt,
77
+ const vsc::solvers::IRandState *randstate,
78
+ IEvalBackend *backend,
79
+ dm::IDataTypeFunction *func,
80
+ vsc::dm::IModelField *func_ctxt,
81
+ const std::vector<vsc::dm::ITypeExpr *> &params) = 0;
82
+
83
+
84
+ };
85
+
86
+ } /* namespace eval */
87
+ } /* namespace arl */
88
+ } /* namespace zsp */
89
+
90
+
@@ -0,0 +1,46 @@
1
+ /**
2
+ * IModelAddressSpace.h
3
+ *
4
+ * Copyright 2023 Matthew Ballance and Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
7
+ * not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at:
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ * Created on:
19
+ * Author:
20
+ */
21
+ #pragma once
22
+ #include "vsc/dm/impl/ValRefStruct.h"
23
+ #include "zsp/arl/eval/IEvalThread.h"
24
+
25
+ namespace zsp {
26
+ namespace arl {
27
+ namespace eval {
28
+
29
+
30
+
31
+ class IModelAddressSpace {
32
+ public:
33
+
34
+ virtual ~IModelAddressSpace() { }
35
+
36
+ virtual void addNonallocatableRegion(
37
+ IEvalThread *thread,
38
+ const vsc::dm::ValRefStruct &region) = 0;
39
+
40
+ };
41
+
42
+ } /* namespace eval */
43
+ } /* namespace arl */
44
+ } /* namespace zsp */
45
+
46
+
@@ -0,0 +1,42 @@
1
+ /*
2
+ * IModelEvaluator.h
3
+ *
4
+ * Created on: Apr 24, 2022
5
+ * Author: mballance
6
+ */
7
+
8
+ #pragma once
9
+ #include "zsp/arl/dm/IModelEvalIterator.h"
10
+ #include "zsp/arl/dm/IModelFieldComponent.h"
11
+ #include "vsc/dm/IModelField.h"
12
+ #include "vsc/solvers/IRandState.h"
13
+
14
+ namespace zsp {
15
+ namespace arl {
16
+ namespace eval {
17
+
18
+
19
+ class IDataTypeAction;
20
+
21
+ enum class ModelEvaluatorKind {
22
+ FullElab,
23
+ IncrElab
24
+ };
25
+
26
+ class IModelEvaluator;
27
+ using IModelEvaluatorUP=vsc::dm::UP<IModelEvaluator>;
28
+ class IModelEvaluator {
29
+ public:
30
+
31
+ virtual ~IModelEvaluator() { }
32
+
33
+ virtual dm::IModelEvalIterator *eval(
34
+ const vsc::solvers::IRandState *randstate,
35
+ dm::IModelFieldComponent *root_comp,
36
+ dm::IDataTypeAction *root_action) = 0;
37
+
38
+ };
39
+
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * EvalBackendBase.h
3
+ *
4
+ * Copyright 2023 Matthew Ballance and Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
7
+ * not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at:
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ * Created on:
19
+ * Author:
20
+ */
21
+ #pragma once
22
+ #include "zsp/arl/eval/IEvalBackend.h"
23
+
24
+ namespace zsp {
25
+ namespace arl {
26
+ namespace eval {
27
+
28
+
29
+
30
+ class EvalBackendBase : public virtual IEvalBackend {
31
+ public:
32
+ EvalBackendBase() { }
33
+
34
+ virtual ~EvalBackendBase() { }
35
+
36
+ virtual void init(IEvalContext *ctxt) override {
37
+ m_ctxt = ctxt;
38
+ }
39
+
40
+ virtual void enterThreads(
41
+ const std::vector<IEvalThread *> &threads) override { }
42
+
43
+ virtual void enterThread(IEvalThread *thread) override { }
44
+
45
+ virtual void leaveThread(IEvalThread *thread) override { }
46
+
47
+ virtual void leaveThreads(
48
+ const std::vector<IEvalThread *> &threads) override { }
49
+
50
+ virtual void enterAction(
51
+ IEvalThread *thread,
52
+ dm::IDataTypeAction *action_t,
53
+ const vsc::dm::ValRef &action_v) override { }
54
+
55
+ virtual void leaveAction(
56
+ IEvalThread *thread,
57
+ dm::IDataTypeAction *action_t,
58
+ const vsc::dm::ValRef &action_v) override { }
59
+
60
+ virtual void callFuncReq(
61
+ IEvalThread *thread,
62
+ dm::IDataTypeFunction *func_t,
63
+ const std::vector<vsc::dm::ValRef> &params) override { }
64
+
65
+ virtual void emitMessage(const std::string &msg) override { }
66
+
67
+ protected:
68
+ IEvalContext *m_ctxt;
69
+
70
+ };
71
+
72
+ }
73
+ }
74
+ }
75
+
76
+
@@ -0,0 +1,59 @@
1
+ /**
2
+ * EvalListenerBase.h
3
+ *
4
+ * Copyright 2023 Matthew Ballance and Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
7
+ * not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at:
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ * Created on:
19
+ * Author:
20
+ */
21
+ #pragma once
22
+ #include "zsp/arl/eval/IEvalListener.h"
23
+
24
+ namespace zsp {
25
+ namespace arl {
26
+ namespace eval {
27
+
28
+
29
+
30
+ class EvalListenerBase : public virtual IEvalListener {
31
+ public:
32
+
33
+ EvalListenerBase() { }
34
+
35
+ virtual ~EvalListenerBase() { }
36
+
37
+ virtual void enterThreads(const std::vector<IEvalThread *> &threads) override { }
38
+
39
+ virtual void enterThread(IEvalThread *t) override { }
40
+
41
+ virtual void enterAction(
42
+ IEvalThread *t,
43
+ dm::IModelFieldAction *action) override { }
44
+
45
+ virtual void leaveAction(
46
+ IEvalThread *t,
47
+ dm::IModelFieldAction *action) override { }
48
+
49
+ virtual void leaveThread(IEvalThread *t) override { }
50
+
51
+ virtual void leaveThreads(const std::vector<IEvalThread *> &threads) override { }
52
+
53
+ };
54
+
55
+ } /* namespace eval */
56
+ } /* namespace arl */
57
+ } /* namespace zsp */
58
+
59
+
@@ -0,0 +1,148 @@
1
+ /**
2
+ * TaskEvalGetLval.h
3
+ *
4
+ * Copyright 2023 Matthew Ballance and Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
7
+ * not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at:
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ * Created on:
19
+ * Author:
20
+ */
21
+ #pragma once
22
+ #include "dmgr/impl/DebugMacros.h"
23
+ #include "vsc/dm/impl/ValRefStruct.h"
24
+ #include "zsp/arl/dm/impl/VisitorBase.h"
25
+ #include "zsp/arl/eval/IEvalThread.h"
26
+
27
+ namespace zsp {
28
+ namespace arl {
29
+ namespace eval {
30
+
31
+
32
+
33
+ class TaskEvalGetLval :
34
+ public virtual dm::VisitorBase {
35
+ public:
36
+ TaskEvalGetLval(
37
+ dmgr::IDebugMgr *dmgr,
38
+ IEvalValProvider *vp) : m_vp(vp), m_dbg(0) {
39
+ DEBUG_INIT("zsp::arl::eval::TaskEvalGetLval", dmgr);
40
+
41
+ }
42
+
43
+ virtual ~TaskEvalGetLval() { };
44
+
45
+ vsc::dm::ValRef eval(vsc::dm::ITypeExpr *expr) {
46
+ DEBUG_ENTER("eval");
47
+ m_val.reset();
48
+ expr->accept(m_this);
49
+ DEBUG_LEAVE("eval %p", m_val);
50
+ return m_val;
51
+ }
52
+
53
+ virtual void visitTypeExprArrIndex(vsc::dm::ITypeExprArrIndex *e) override {
54
+ DEBUG_ENTER("visitTypeExprArrIndex");
55
+ DEBUG("TODO: visitTypeExprArrIndex");
56
+ DEBUG_LEAVE("visitTypeExprArrIndex");
57
+ }
58
+
59
+ virtual void visitTypeExprFieldRef(vsc::dm::ITypeExprFieldRef *e) override {
60
+ int32_t path_idx = 0;
61
+ DEBUG_ENTER("visitTypeExprFieldRef");
62
+
63
+ #ifdef UNDEFINED
64
+ if (e->getPath().size() == 0) {
65
+ DEBUG_ERROR("Path is empty");
66
+ return;
67
+ }
68
+
69
+ DEBUG("root_ref_kind=%d offset=%d",
70
+ e->getRootRefKind(),
71
+ e->getRootRefOffset());
72
+ DEBUG("path.size=%d path_idx=%d index=%d",
73
+ e->getPath().size(),
74
+ path_idx,
75
+ e->getPath().at(path_idx));
76
+ DEBUG("vp=%p", m_vp);
77
+ m_val = m_vp->getMutVal(
78
+ e->getRootRefKind(),
79
+ e->getRootRefOffset(),
80
+ e->getPath().at(path_idx++)
81
+ );
82
+ // switch (e->getRootRefKind()) {
83
+ // case vsc::dm::ITypeExprFieldRef::RootRefKind::BottomUpScope: {
84
+ // IEvalStackFrame *frame = m_thread->stackFrame(e->getPath().at(path_idx++));
85
+ // var.setWeakRef(frame->getVariable(e->getPath().at(path_idx++)));
86
+ // } break;
87
+ // case vsc::dm::ITypeExprFieldRef::RootRefKind::TopDownScope: {
88
+ // vsc::dm::ValRefStruct scope_s(m_scope);
89
+ // var.setWeakRef(scope_s.getFieldRef(e->getPath().at(path_idx++)));
90
+ // } break;
91
+ // }
92
+
93
+ // vsc::dm::IModelField *field = 0;
94
+ // if (path_idx >= e->getPath().size()) {
95
+ // m_val.setWeakRef(var);
96
+ // } else {
97
+ // while (path_idx < e->getPath().size()) {
98
+ // vsc::dm::ValRefStruct val_s(var);
99
+ // var = val_s.getFieldRef(e->getPath().at(path_idx));
100
+ // DEBUG("Get field-ref @ %d", e->getPath().at(path_idx));
101
+ // path_idx++;
102
+ // }
103
+ // m_val.setWeakRef(var);
104
+ // }
105
+
106
+ #endif /* UNDEFINED */
107
+
108
+ DEBUG_LEAVE("visitTypeExprFieldRef");
109
+ }
110
+
111
+ virtual void visitTypeExprRefBottomUp(vsc::dm::ITypeExprRefBottomUp *e) override {
112
+ DEBUG_ENTER("visitTypeExprRefBottomUp");
113
+ m_val = m_vp->getMutVal(
114
+ vsc::dm::ITypeExprFieldRef::RootRefKind::BottomUpScope,
115
+ e->getScopeOffset(),
116
+ e->getSubFieldIndex());
117
+ DEBUG_LEAVE("visitTypeExprRefBottomUp");
118
+ }
119
+
120
+ virtual void visitTypeExprRefTopDown(vsc::dm::ITypeExprRefTopDown *e) override {
121
+ DEBUG_ENTER("visitTypeExprRefTopDown");
122
+ m_val = m_vp->getMutVal(
123
+ vsc::dm::ITypeExprFieldRef::RootRefKind::TopDownScope,
124
+ -1,
125
+ -1);
126
+ DEBUG_LEAVE("visitTypeExprRefTopDown");
127
+ }
128
+
129
+ virtual void visitTypeExprSubField(vsc::dm::ITypeExprSubField *e) override {
130
+ DEBUG_ENTER("visitTypeExprSubField");
131
+ e->getRootExpr()->accept(m_this);
132
+ vsc::dm::ValRefStruct val_s(m_val);
133
+ m_val = val_s.getFieldRef(e->getSubFieldIndex());
134
+ DEBUG_LEAVE("visitTypeExprSubField");
135
+ }
136
+
137
+ private:
138
+ dmgr::IDebug *m_dbg;
139
+ IEvalValProvider *m_vp;
140
+ vsc::dm::ValRef m_val;
141
+
142
+ };
143
+
144
+ }
145
+ }
146
+ }
147
+
148
+