Skip to content

Commit 6c05e2e

Browse files
committed
Modified evaluator
1 parent 35da7fb commit 6c05e2e

43 files changed

Lines changed: 471 additions & 2544 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ all: $(LIB_SBGRAPH)
3131

3232
include sbg/Makefile.include
3333
include parser/Makefile.include
34-
#include eval/Makefile.include
34+
include eval/Makefile.include
3535
#include test/Makefile.include
3636

3737
$(BUILD_DIR)/%.o : %.cpp

ast/statement.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ std::ostream &operator<<(std::ostream &out, const Assign &asgn)
3939
ConfigDims::ConfigDims() : nmbr_dims_() {}
4040
ConfigDims::ConfigDims(LIB::NAT nmbr_dims) : nmbr_dims_() {
4141
if (nmbr_dims > 0)
42-
set_nmbr_dims(nmbr_dims);
42+
nmbr_dims_ = nmbr_dims;
4343

4444
else
4545
Util::ERROR("ConfigDims: dimension should be greater than 0\n");

eval/Makefile.include

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,7 @@ EVAL_SRC := \
1414
$(VISIT_DIR)/program_visitor.cpp \
1515
$(VISIT_DIR)/stm_visitor.cpp \
1616
$(VISIT_DIR)/eval_expr.cpp \
17-
$(VISIT_DIR)/eval_dsbg.cpp \
18-
$(VISIT_DIR)/eval_sbg.cpp \
19-
$(VISIT_DIR)/eval_pw.cpp \
20-
$(VISIT_DIR)/eval_map.cpp \
21-
$(VISIT_DIR)/eval_mdle.cpp \
2217
$(VISIT_DIR)/eval_le.cpp \
23-
$(VISIT_DIR)/eval_set.cpp \
24-
$(VISIT_DIR)/eval_mdi.cpp \
25-
$(VISIT_DIR)/eval_interval.cpp \
2618
$(VISIT_DIR)/eval_rat.cpp \
2719
$(VISIT_DIR)/eval_int.cpp \
2820
$(VISIT_DIR)/eval_nat.cpp \

eval/defs.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ namespace SBG {
2323

2424
namespace Eval {
2525

26+
// Types -----------------------------------------------------------------------
27+
28+
Boolean::Boolean() : b_() {}
29+
Boolean::Boolean(bool b) : b_(b) {}
30+
31+
std::ostream &operator<<(std::ostream &out, const Boolean &b)
32+
{
33+
if (b.b_)
34+
out << "true";
35+
36+
else
37+
out << "false";
38+
39+
return out;
40+
}
41+
2642
// Environments ----------------------------------------------------------------
2743

2844
VarEnv::VarEnv() : mapping_() {}

eval/defs.hpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,17 @@ namespace Eval {
4040

4141
// Type definitions ------------------------------------------------------------
4242

43-
typedef std::variant<LIB::MD_NAT
43+
struct Boolean {
44+
bool b_;
45+
46+
Boolean();
47+
Boolean(bool b);
48+
};
49+
std::ostream &operator<<(std::ostream &out, const Boolean &b);
50+
51+
typedef std::variant<Boolean
52+
, LIB::NAT
53+
, LIB::MD_NAT
4454
, LIB::RATIONAL
4555
, LIB::Interval
4656
, LIB::SetPiece

eval/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void parseEvalProgramFromFile(std::string fname, Impl impl, bool debug)
8383
break;
8484
}
8585

86-
SBG::Eval::ProgramVisitor program_visit(fact, debug);
86+
SBG::Eval::ProgramVisitor program_visit(*fact, debug);
8787
SBG::Eval::ProgramIO visit_result = boost::apply_visitor(
8888
program_visit, parser_result
8989
);

eval/visitors/eval_dsbg.cpp

Lines changed: 0 additions & 142 deletions
This file was deleted.

eval/visitors/eval_dsbg.hpp

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)