Skip to content

Commit

Permalink
Fix silly typos and give better naming.
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaowenHu96 committed Jul 31, 2020
1 parent 0149714 commit 2ca12b3
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 55 deletions.
50 changes: 25 additions & 25 deletions src/interpreter/InterpreterEngine.cpp
Expand Up @@ -828,7 +828,7 @@ RamDomain InterpreterEngine::execute(const InterpreterNode* node, InterpreterCon
// use simple iterator
for (const RamDomain* tuple : rel) {
ctxt[cur.getTupleId()] = tuple;
if (!execute(shadow.getNestesOperation(), ctxt)) {
if (!execute(shadow.getNestedOperation(), ctxt)) {
break;
}
}
Expand All @@ -850,7 +850,7 @@ RamDomain InterpreterEngine::execute(const InterpreterNode* node, InterpreterCon
pfor(auto it = pStream.begin(); it < pStream.end(); it++) {
for (const TupleRef& val : *it) {
newCtxt[cur.getTupleId()] = val.getBase();
if (!execute(shadow.getNestesOperation(), newCtxt)) {
if (!execute(shadow.getNestedOperation(), newCtxt)) {
break;
}
}
Expand All @@ -872,7 +872,7 @@ RamDomain InterpreterEngine::execute(const InterpreterNode* node, InterpreterCon
// conduct range query
for (auto data : view->range(TupleRef(low, arity), TupleRef(high, arity))) {
ctxt[cur.getTupleId()] = &data[0];
if (!execute(shadow.getNestesOperation(), ctxt)) {
if (!execute(shadow.getNestedOperation(), ctxt)) {
break;
}
}
Expand Down Expand Up @@ -903,7 +903,7 @@ RamDomain InterpreterEngine::execute(const InterpreterNode* node, InterpreterCon
pfor(auto it = pStream.begin(); it < pStream.end(); it++) {
for (const TupleRef& val : *it) {
newCtxt[cur.getTupleId()] = val.getBase();
if (!execute(shadow.getNestesOperation(), newCtxt)) {
if (!execute(shadow.getNestedOperation(), newCtxt)) {
break;
}
}
Expand All @@ -920,8 +920,8 @@ RamDomain InterpreterEngine::execute(const InterpreterNode* node, InterpreterCon
// use simple iterator
for (const RamDomain* tuple : rel) {
ctxt[cur.getTupleId()] = tuple;
if (execute(shadow.getCondtion(), ctxt)) {
execute(shadow.getNestesOperation(), ctxt);
if (execute(shadow.getCondition(), ctxt)) {
execute(shadow.getNestedOperation(), ctxt);
break;
}
}
Expand All @@ -942,8 +942,8 @@ RamDomain InterpreterEngine::execute(const InterpreterNode* node, InterpreterCon
pfor(auto it = pStream.begin(); it < pStream.end(); it++) {
for (const TupleRef& val : *it) {
newCtxt[cur.getTupleId()] = val.getBase();
if (execute(shadow.getCondtion(), newCtxt)) {
execute(shadow.getNestesOperation(), newCtxt);
if (execute(shadow.getCondition(), newCtxt)) {
execute(shadow.getNestedOperation(), newCtxt);
break;
}
}
Expand All @@ -966,8 +966,8 @@ RamDomain InterpreterEngine::execute(const InterpreterNode* node, InterpreterCon
for (auto ip : view->range(TupleRef(low, arity), TupleRef(high, arity))) {
const RamDomain* data = &ip[0];
ctxt[cur.getTupleId()] = data;
if (execute(shadow.getCondtion(), ctxt)) {
execute(shadow.getNestesOperation(), ctxt);
if (execute(shadow.getCondition(), ctxt)) {
execute(shadow.getNestedOperation(), ctxt);
break;
}
}
Expand Down Expand Up @@ -999,8 +999,8 @@ RamDomain InterpreterEngine::execute(const InterpreterNode* node, InterpreterCon
pfor(auto it = pStream.begin(); it < pStream.end(); it++) {
for (const TupleRef& val : *it) {
newCtxt[cur.getTupleId()] = val.getBase();
if (execute(shadow.getCondtion(), newCtxt)) {
execute(shadow.getNestesOperation(), newCtxt);
if (execute(shadow.getCondition(), newCtxt)) {
execute(shadow.getNestedOperation(), newCtxt);
break;
}
}
Expand All @@ -1026,7 +1026,7 @@ RamDomain InterpreterEngine::execute(const InterpreterNode* node, InterpreterCon
ctxt[cur.getTupleId()] = tuple;

// run nested part - using base class visitor
return execute(shadow.getNestesOperation(), ctxt);
return execute(shadow.getNestedOperation(), ctxt);
ESAC(UnpackRecord)

CASE(ParallelAggregate)
Expand All @@ -1038,13 +1038,13 @@ RamDomain InterpreterEngine::execute(const InterpreterNode* node, InterpreterCon
for (const auto& info : viewInfo) {
newCtxt.createView(*getRelationHandle(info[0]), info[1], info[2]);
}
return executeAggregate(newCtxt, cur, *shadow.getCondtion(), shadow.getExpr(),
*shadow.getNestesOperation(), node->getRelation()->scan());
return executeAggregate(newCtxt, cur, *shadow.getCondition(), shadow.getExpr(),
*shadow.getNestedOperation(), node->getRelation()->scan());
ESAC(ParallelAggregate)

CASE(Aggregate)
return executeAggregate(ctxt, cur, *shadow.getCondtion(), shadow.getExpr(),
*shadow.getNestesOperation(), node->getRelation()->scan());
return executeAggregate(ctxt, cur, *shadow.getCondition(), shadow.getExpr(),
*shadow.getNestedOperation(), node->getRelation()->scan());
ESAC(Aggregate)

CASE(ParallelIndexAggregate)
Expand All @@ -1067,8 +1067,8 @@ RamDomain InterpreterEngine::execute(const InterpreterNode* node, InterpreterCon
size_t viewId = shadow.getViewId();
auto& view = newCtxt.getView(viewId);

return executeAggregate(newCtxt, cur, *shadow.getCondtion(), shadow.getExpr(),
*shadow.getNestesOperation(), view->range(TupleRef(low, arity), TupleRef(high, arity)));
return executeAggregate(newCtxt, cur, *shadow.getCondition(), shadow.getExpr(),
*shadow.getNestedOperation(), view->range(TupleRef(low, arity), TupleRef(high, arity)));
ESAC(ParallelIndexAggregate)

CASE(IndexAggregate)
Expand All @@ -1082,24 +1082,24 @@ RamDomain InterpreterEngine::execute(const InterpreterNode* node, InterpreterCon
size_t viewId = shadow.getViewId();
auto& view = ctxt.getView(viewId);

return executeAggregate(ctxt, cur, *shadow.getCondtion(), shadow.getExpr(),
*shadow.getNestesOperation(), view->range(TupleRef(low, arity), TupleRef(high, arity)));
return executeAggregate(ctxt, cur, *shadow.getCondition(), shadow.getExpr(),
*shadow.getNestedOperation(), view->range(TupleRef(low, arity), TupleRef(high, arity)));
ESAC(IndexAggregate)

CASE(Break)
// check condition
if (execute(shadow.getCondtion(), ctxt)) {
if (execute(shadow.getCondition(), ctxt)) {
return false;
}
return execute(shadow.getNestesOperation(), ctxt);
return execute(shadow.getNestedOperation(), ctxt);
ESAC(Break)

CASE(Filter)
bool result = true;
// check condition
if (execute(shadow.getCondtion(), ctxt)) {
if (execute(shadow.getCondition(), ctxt)) {
// process nested
result = execute(shadow.getNestesOperation(), ctxt);
result = execute(shadow.getNestedOperation(), ctxt);
}

if (profileEnabled && !cur.getProfileText().empty()) {
Expand Down
60 changes: 30 additions & 30 deletions src/interpreter/InterpreterNode.h
Expand Up @@ -124,14 +124,14 @@ class InterpreterNode {
};

/**
* @class InterpreterCompundNode
* @class InterpreterCompoundNode
* @brief Compound node represents interpreter node with a list of children.
*/
class InterpreterCompundNode : public InterpreterNode {
class InterpreterCompoundNode : public InterpreterNode {
using NodePtrVec = std::vector<std::unique_ptr<InterpreterNode>>;

public:
InterpreterCompundNode(enum InterpreterNodeType ty, const RamNode* sdw, NodePtrVec children = {},
InterpreterCompoundNode(enum InterpreterNodeType ty, const RamNode* sdw, NodePtrVec children = {},
RelationHandle* relHandle = nullptr)
: InterpreterNode(ty, sdw, relHandle), children(std::move(children)) {}

Expand Down Expand Up @@ -308,7 +308,7 @@ class InterpreterNestedOperation {
public:
InterpreterNestedOperation(std::unique_ptr<InterpreterNode> nested) : nested(std::move(nested)) {}

inline const InterpreterNode* getNestesOperation() const {
inline const InterpreterNode* getNestedOperation() const {
return nested.get();
};

Expand All @@ -317,14 +317,14 @@ class InterpreterNestedOperation {
};

/**
* @class InterpreterCondOperation
* @class InterpreterConditionalOperation
* @brief Encode a conditional operation for the interpreter node. E.g. Exit, Filter
*/
class InterpreterCondOperation {
class InterpreterConditionalOperation {
public:
InterpreterCondOperation(std::unique_ptr<InterpreterNode> cond) : cond(std::move(cond)) {}
InterpreterConditionalOperation(std::unique_ptr<InterpreterNode> cond) : cond(std::move(cond)) {}

inline const InterpreterNode* getCondtion() const {
inline const InterpreterNode* getCondition() const {
return cond.get();
};

Expand Down Expand Up @@ -356,29 +356,29 @@ class InterpreterAutoIncrement : public InterpreterNode {
/**
* @class InterpreterIntrinsicOperator
*/
class InterpreterIntrinsicOperator : public InterpreterCompundNode {
using InterpreterCompundNode::InterpreterCompundNode;
class InterpreterIntrinsicOperator : public InterpreterCompoundNode {
using InterpreterCompoundNode::InterpreterCompoundNode;
};

/**
* @class InterpreterUserDefinedOperator
*/
class InterpreterUserDefinedOperator : public InterpreterCompundNode {
using InterpreterCompundNode::InterpreterCompundNode;
class InterpreterUserDefinedOperator : public InterpreterCompoundNode {
using InterpreterCompoundNode::InterpreterCompoundNode;
};

/**
* @class InterpreterNestedIntrinsicOperator
*/
class InterpreterNestedIntrinsicOperator : public InterpreterCompundNode {
using InterpreterCompundNode::InterpreterCompundNode;
class InterpreterNestedIntrinsicOperator : public InterpreterCompoundNode {
using InterpreterCompoundNode::InterpreterCompoundNode;
};

/**
* @class InterpreterPackRecord
*/
class InterpreterPackRecord : public InterpreterCompundNode {
using InterpreterCompundNode::InterpreterCompundNode;
class InterpreterPackRecord : public InterpreterCompoundNode {
using InterpreterCompoundNode::InterpreterCompoundNode;
};

/**
Expand Down Expand Up @@ -512,12 +512,12 @@ class InterpreterParallelIndexScan : public InterpreterIndexScan, public Interpr
* @class InterpreterChoice
*/
class InterpreterChoice : public InterpreterNode,
public InterpreterCondOperation,
public InterpreterConditionalOperation,
public InterpreterNestedOperation {
public:
InterpreterChoice(enum InterpreterNodeType ty, const RamNode* sdw, RelationHandle* relHandle,
std::unique_ptr<InterpreterNode> cond, std::unique_ptr<InterpreterNode> nested)
: InterpreterNode(ty, sdw, relHandle), InterpreterCondOperation(std::move(cond)),
: InterpreterNode(ty, sdw, relHandle), InterpreterConditionalOperation(std::move(cond)),
InterpreterNestedOperation(std::move(nested)) {}
};

Expand Down Expand Up @@ -571,13 +571,13 @@ class InterpreterUnpackRecord : public InterpreterNode, public InterpreterNested
* @class InterpreterAggregate
*/
class InterpreterAggregate : public InterpreterNode,
public InterpreterCondOperation,
public InterpreterConditionalOperation,
public InterpreterNestedOperation {
public:
InterpreterAggregate(enum InterpreterNodeType ty, const RamNode* sdw, RelationHandle* relHandle,
std::unique_ptr<InterpreterNode> expr, std::unique_ptr<InterpreterNode> filter,
std::unique_ptr<InterpreterNode> nested)
: InterpreterNode(ty, sdw, relHandle), InterpreterCondOperation(std::move(filter)),
: InterpreterNode(ty, sdw, relHandle), InterpreterConditionalOperation(std::move(filter)),
InterpreterNestedOperation(std::move(nested)), expr(std::move(expr)) {}

inline const InterpreterNode* getExpr() const {
Expand Down Expand Up @@ -621,25 +621,25 @@ class InterpreterParallelIndexAggregate : public InterpreterIndexAggregate,
* @class InterpreterBreak
*/
class InterpreterBreak : public InterpreterNode,
public InterpreterCondOperation,
public InterpreterConditionalOperation,
public InterpreterNestedOperation {
public:
InterpreterBreak(enum InterpreterNodeType ty, const RamNode* sdw, std::unique_ptr<InterpreterNode> cond,
std::unique_ptr<InterpreterNode> nested)
: InterpreterNode(ty, sdw, nullptr), InterpreterCondOperation(std::move(cond)),
: InterpreterNode(ty, sdw, nullptr), InterpreterConditionalOperation(std::move(cond)),
InterpreterNestedOperation(std::move(nested)) {}
};

/**
* @class InterpreterFilter
*/
class InterpreterFilter : public InterpreterNode,
public InterpreterCondOperation,
public InterpreterConditionalOperation,
public InterpreterNestedOperation {
public:
InterpreterFilter(enum InterpreterNodeType ty, const RamNode* sdw, std::unique_ptr<InterpreterNode> cond,
std::unique_ptr<InterpreterNode> nested)
: InterpreterNode(ty, sdw, nullptr), InterpreterCondOperation(std::move(cond)),
: InterpreterNode(ty, sdw, nullptr), InterpreterConditionalOperation(std::move(cond)),
InterpreterNestedOperation(std::move(nested)) {}
};

Expand All @@ -656,22 +656,22 @@ class InterpreterProject : public InterpreterNode, public InterpreterSuperOperat
/**
* @class InterpreterSubroutineReturn
*/
class InterpreterSubroutineReturn : public InterpreterCompundNode {
using InterpreterCompundNode::InterpreterCompundNode;
class InterpreterSubroutineReturn : public InterpreterCompoundNode {
using InterpreterCompoundNode::InterpreterCompoundNode;
};

/**
* @class InterpreterSequence
*/
class InterpreterSequence : public InterpreterCompundNode {
using InterpreterCompundNode::InterpreterCompundNode;
class InterpreterSequence : public InterpreterCompoundNode {
using InterpreterCompoundNode::InterpreterCompoundNode;
};

/**
* @class InterpreterParallel
*/
class InterpreterParallel : public InterpreterCompundNode {
using InterpreterCompundNode::InterpreterCompundNode;
class InterpreterParallel : public InterpreterCompoundNode {
using InterpreterCompoundNode::InterpreterCompoundNode;
};

/**
Expand Down

0 comments on commit 2ca12b3

Please sign in to comment.