Skip to content

Commit

Permalink
Added new structures
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalashnikovni committed Nov 9, 2023
1 parent 4e23f93 commit 24e37dc
Show file tree
Hide file tree
Showing 73 changed files with 2,086 additions and 5,019 deletions.
2 changes: 1 addition & 1 deletion ast/expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ std::ostream &operator<<(std::ostream &out, const Op &op)

std::ostream &operator<<(std::ostream &out, const ExprList &el)
{
BOOST_FOREACH (Expr e, el)
for (Expr e : el)
out << e << "\n";

return out;
Expand Down
1 change: 0 additions & 1 deletion ast/expr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#ifndef PARSER_EXPR_AST_HPP
#define PARSER_EXPR_AST_HPP

#include <boost/foreach.hpp>
#include <boost/variant/variant.hpp>
#include <boost/variant/recursive_wrapper.hpp>

Expand Down
2 changes: 1 addition & 1 deletion ast/statement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ bool IsConfig::operator()(ConfigDims v) const { return true; }

std::ostream &operator<<(std::ostream &out, const StatementList &stml)
{
BOOST_FOREACH (Statement s, stml)
for (Statement s : stml)
out << s << "\n";

return out;
Expand Down
22 changes: 6 additions & 16 deletions eval/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ EVAL := bin/sbg-eval
all: $(EVAL)

EVAL_SRC := \
$(EVAL_DIR)/main.cpp \
$(EVAL_DIR)/main.cpp \
$(EVAL_DIR)/defs.cpp \
$(UTIL_DIR)/debug.cpp \
$(UTIL_DIR)/defs.cpp \
Expand All @@ -23,25 +23,15 @@ EVAL_SRC := \
$(PARSER_DIR)/statement.cpp \
$(PARSER_DIR)/sbg_program.cpp \
$(VISIT_DIR)/eval_nat.cpp \
$(VISIT_DIR)/eval_natbt.cpp \
$(VISIT_DIR)/eval_mdnat.cpp \
$(VISIT_DIR)/eval_rat.cpp \
$(VISIT_DIR)/eval_interval.cpp \
$(VISIT_DIR)/eval_mdi.cpp \
$(VISIT_DIR)/eval_unord_set.cpp \
$(VISIT_DIR)/eval_ord_set.cpp \
$(VISIT_DIR)/eval_container.cpp \
$(VISIT_DIR)/eval_set.cpp \
$(VISIT_DIR)/eval_le.cpp \
$(VISIT_DIR)/eval_mdle.cpp \
$(VISIT_DIR)/eval_linear.cpp \
$(VISIT_DIR)/eval_base_map.cpp \
$(VISIT_DIR)/eval_canon_map.cpp \
$(VISIT_DIR)/eval_base_pwmap.cpp \
$(VISIT_DIR)/eval_canon_pwmap.cpp \
$(VISIT_DIR)/eval_base_sbg.cpp \
$(VISIT_DIR)/eval_canon_sbg.cpp \
$(VISIT_DIR)/eval_base_dsbg.cpp \
$(VISIT_DIR)/eval_canon_dsbg.cpp \
$(VISIT_DIR)/eval_map.cpp \
$(VISIT_DIR)/eval_pwmap.cpp \
$(VISIT_DIR)/eval_graph.cpp \
$(VISIT_DIR)/eval_expr.cpp \
$(VISIT_DIR)/stm_visitor.cpp \
Expand All @@ -50,13 +40,13 @@ EVAL_SRC := \
$(SBG_DIR)/multidim_inter.cpp \
$(SBG_DIR)/unord_pw_mdinter.cpp \
$(SBG_DIR)/ord_pw_mdinter.cpp \
$(SBG_DIR)/set.cpp \
$(SBG_DIR)/lexp.cpp \
$(SBG_DIR)/multidim_lexp.cpp \
$(SBG_DIR)/map.cpp \
$(SBG_DIR)/pw_map.cpp \
$(SBG_DIR)/sbg.cpp \
$(SBG_DIR)/sbg_algorithms.cpp \
$(SBG_DIR)/info.cpp
$(SBG_DIR)/sbg_algorithms.cpp

# Objects
EVAL_OBJ=$(addprefix $(BUILD_DIR)/, $(EVAL_SRC:.cpp=.o))
Expand Down
2 changes: 1 addition & 1 deletion eval/defs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ std::ostream &operator<<(std::ostream &out, const ExprEval &e)

std::ostream &operator<<(std::ostream &out, const ExprEvalList &ee)
{
BOOST_FOREACH (ExprEval e, ee) out << e << "\n";
for (ExprEval e : ee) out << e << "\n";

return out;
}
Expand Down
45 changes: 5 additions & 40 deletions eval/defs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

#include "ast/expr.hpp"
#include "ast/statement.hpp"
#include "sbg/unord_pw_mdinter.hpp"
#include "sbg/ord_pw_mdinter.hpp"
#include "sbg/sbg.hpp"

namespace SBG {
Expand All @@ -43,51 +41,18 @@ namespace Eval {

// Type definitions ------------------------------------------------------------

/** @brief Types NatBaseType, ContainerBaseType, LinearBaseType and MapBaseType
* are defined to decrease the compilation memory consumption of eval_expr.cpp.
* When evaluating an AST::Call, multiple std::visit are invoked, where each
* one generates a function table with size dependent of the number types in
* the variant. Initially ExprBaseType was used.
*/

typedef std::variant<Util::NAT
, Util::MD_NAT> NatBaseType;

typedef std::variant<LIB::Interval
, LIB::SetPiece
, LIB::UnordSet
, LIB::OrdSet> ContainerBaseType;

typedef std::variant<LIB::LExp
, LIB::Exp> LinearBaseType;

typedef std::variant<LIB::BaseMap
, LIB::CanonMap
, LIB::BasePWMap
, LIB::CanonPWMap> MapBaseType;

typedef std::variant<LIB::BaseSBG
, LIB::CanonSBG
, LIB::BaseDSBG
, LIB::CanonDSBG> SBGBaseType;

typedef boost::variant<Util::NAT
, Util::MD_NAT
, Util::RATIONAL
, LIB::Interval
, LIB::SetPiece
, LIB::UnordSet
, LIB::OrdSet
, LIB::Set
, LIB::LExp
, LIB::Exp
, LIB::BaseMap
, LIB::CanonMap
, LIB::BasePWMap
, LIB::CanonPWMap
, LIB::BaseSBG
, LIB::CanonSBG
, LIB::BaseDSBG
, LIB::CanonDSBG> ExprBaseType;
, LIB::SBGMap
, LIB::PWMap
, LIB::SBGraph
, LIB::DSBGraph> ExprBaseType;
typedef std::optional<ExprBaseType> MaybeEBT;

template <typename T>
Expand Down
201 changes: 0 additions & 201 deletions eval/visitors/eval_base_dsbg.cpp

This file was deleted.

Loading

0 comments on commit 24e37dc

Please sign in to comment.