Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
b-scholz committed Jul 24, 2020
1 parent f943254 commit b0e1727
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/InterpreterEngine.cpp
Expand Up @@ -273,6 +273,7 @@ RamDomain InterpreterEngine::execute(const InterpreterNode* node, InterpreterCon
#define CASE(Kind) \
case (I_##Kind): { \
return [&]() -> RamDomain { \
const auto& shadow = *static_cast<const Interpreter##Kind*>(node); \
const auto& cur = *static_cast<const Ram##Kind*>(node->getShadow());
#define CASE_NO_CAST(Kind) \
case (I_##Kind): { \
Expand Down
1 change: 1 addition & 0 deletions src/InterpreterEngine.h
Expand Up @@ -132,4 +132,5 @@ class InterpreterEngine {
RecordTable recordTable;
};


} // namespace souffle
50 changes: 50 additions & 0 deletions src/InterpreterNode.h
Expand Up @@ -101,6 +101,7 @@ class InterpreterNode {
std::vector<size_t> data = {})
: type(ty), shadow(sdw), children(std::move(chlds)), relHandle(relHandle), data(std::move(data)) {
}
virtual ~InterpreterNode() = default;

/** @brief get node type */
inline enum InterpreterNodeType getType() const {
Expand Down Expand Up @@ -151,4 +152,53 @@ class InterpreterNode {
std::vector<size_t> data;
std::shared_ptr<InterpreterPreamble> preamble = nullptr;
};

class InterpreterConstant : public InterpreterNode { };
class InterpreterTupleElement : public InterpreterNode { };
class InterpreterAutoIncrement : public InterpreterNode { };
class InterpreterIntrinsicOperator : public InterpreterNode { };
class InterpreterUserDefinedOperator : public InterpreterNode { };
class InterpreterNestedIntrinsicOperator : public InterpreterNode { };
class InterpreterPackRecord : public InterpreterNode { };
class InterpreterSubroutineArgument : public InterpreterNode { };
class InterpreterTrue : public InterpreterNode { };
class InterpreterFalse : public InterpreterNode { };
class InterpreterConjunction : public InterpreterNode { };
class InterpreterNegation : public InterpreterNode { };
class InterpreterEmptinessCheck : public InterpreterNode { };
class InterpreterExistenceCheck : public InterpreterNode { };
class InterpreterProvenanceExistenceCheck : public InterpreterNode { };
class InterpreterConstraint : public InterpreterNode { };
class InterpreterTupleOperation : public InterpreterNode { };
class InterpreterScan : public InterpreterNode { };
class InterpreterParallelScan : public InterpreterNode { };
class InterpreterIndexScan : public InterpreterNode { };
class InterpreterParallelIndexScan : public InterpreterNode { };
class InterpreterChoice : public InterpreterNode { };
class InterpreterParallelChoice : public InterpreterNode { };
class InterpreterIndexChoice : public InterpreterNode { };
class InterpreterParallelIndexChoice : public InterpreterNode { };
class InterpreterUnpackRecord : public InterpreterNode { };
class InterpreterAggregate : public InterpreterNode { };
class InterpreterParallelAggregate : public InterpreterNode { };
class InterpreterIndexAggregate : public InterpreterNode { };
class InterpreterParallelIndexAggregate : public InterpreterNode { };
class InterpreterBreak : public InterpreterNode { };
class InterpreterFilter : public InterpreterNode { };
class InterpreterProject : public InterpreterNode { };
class InterpreterSubroutineReturn : public InterpreterNode { };
class InterpreterSequence : public InterpreterNode { };
class InterpreterParallel : public InterpreterNode { };
class InterpreterLoop : public InterpreterNode { };
class InterpreterExit : public InterpreterNode { };
class InterpreterLogRelationTimer : public InterpreterNode { };
class InterpreterLogTimer : public InterpreterNode { };
class InterpreterDebugInfo : public InterpreterNode { };
class InterpreterClear : public InterpreterNode { };
class InterpreterLogSize : public InterpreterNode { };
class InterpreterIO : public InterpreterNode { };
class InterpreterQuery : public InterpreterNode { };
class InterpreterExtend : public InterpreterNode { };
class InterpreterSwap : public InterpreterNode { };
class InterpreterCall : public InterpreterNode { };
} // namespace souffle

0 comments on commit b0e1727

Please sign in to comment.