Esempio n. 1
0
File: ast.cpp Progetto: kenpusney/ng
bool IdAccessorExpression::operator==(const ASTNode &node) const
{
    auto &idacc = dynamic_cast<const IdAccessorExpression &>(node);
    return astNodeType() == node.astNodeType() &&
           *idacc.primaryExpression == *primaryExpression &&
           *idacc.accessor == *accessor;
}
Esempio n. 2
0
File: ast.cpp Progetto: kenpusney/ng
bool BinaryExpression::operator==(const ASTNode &node) const
{
    auto &&binexpr = dynamic_cast<const BinaryExpression &>(node);
    return astNodeType() == node.astNodeType() &&
           *binexpr.optr == *optr &&
           *left == *binexpr.left &&
           *right == *binexpr.right;
}
Esempio n. 3
0
File: ast.cpp Progetto: kenpusney/ng
bool ValDefStatement::operator==(const ASTNode &node) const
{
    auto &valDef = dynamic_cast<const ValDefStatement &>(node);

    return astNodeType() == node.astNodeType() &&
           valDef.name == name &&
           *valDef.value == *value;
}
Esempio n. 4
0
File: ast.cpp Progetto: kenpusney/ng
bool AssignmentExpression::operator==(const ASTNode &node) const
{
    auto &assign = dynamic_cast<const AssignmentExpression &>(node);

    return astNodeType() == node.astNodeType() &&
           name == assign.name &&
           *value == *assign.value;
}
Esempio n. 5
0
File: ast.cpp Progetto: kenpusney/ng
bool Param::operator==(const ASTNode &node) const
{
    auto &param = dynamic_cast<const Param &>(node);
    return astNodeType() == node.astNodeType() &&
           paramName == param.paramName &&
           annotatedType == param.annotatedType &&
           type == param.type;
}
Esempio n. 6
0
File: ast.cpp Progetto: kenpusney/ng
bool CompoundStatement::operator==(const ASTNode &node) const
{
    auto &stmt = dynamic_cast<const CompoundStatement &>(node);
    return astNodeType() == node.astNodeType() &&
           std::equal(begin(statements),
                      end(statements),
                      begin(stmt.statements),
                      ASTComparator);
}
Esempio n. 7
0
File: ast.cpp Progetto: kenpusney/ng
bool IfStatement::operator==(const ASTNode &node) const
{
    auto &ifstmt = dynamic_cast<const IfStatement &>(node);
    return astNodeType() == node.astNodeType() &&
           *testing == *ifstmt.testing &&
           *consequence == *ifstmt.consequence &&
           ((alternative == nullptr &&
             ifstmt.alternative == nullptr) ||
            *alternative == *ifstmt.alternative);
}
Esempio n. 8
0
File: ast.cpp Progetto: kenpusney/ng
bool FunctionDef::operator==(const ASTNode &node) const
{
    auto &funDef = dynamic_cast<const FunctionDef &>(node);
    return astNodeType() == node.astNodeType() &&
           funDef.funName == funName &&
           std::equal(begin(params),
                      end(params),
                      begin(funDef.params),
                      ASTComparator) &&
           *funDef.body == *body;
}
Esempio n. 9
0
File: ast.cpp Progetto: kenpusney/ng
bool Module::operator==(const ASTNode &node) const
{
    auto &mod = dynamic_cast<const Module &>(node);
    return astNodeType() == node.astNodeType() &&
           name == mod.name &&
           definitions.size() == mod.definitions.size() &&
           std::equal(std::begin(definitions),
                      std::end(definitions),
                      begin(mod.definitions),
                      ASTComparator);
}
Esempio n. 10
0
File: ast.cpp Progetto: kenpusney/ng
bool FunCallExpression::operator==(const ASTNode &node) const
{
    auto &funCall = dynamic_cast<const FunCallExpression &>(node);

    return astNodeType() == node.astNodeType() &&
           *funCall.primaryExpression == *primaryExpression &&
           std::equal(begin(arguments),
                      end(arguments),
                      begin(funCall.arguments),
                      ASTComparator);
}
Esempio n. 11
0
File: ast.cpp Progetto: kenpusney/ng
bool BooleanValue::operator==(const ASTNode& node) const
{
    auto &val = dynamic_cast<const BooleanValue&>(node);
    return astNodeType() == node.astNodeType() &&
        value == val.value;
}
Esempio n. 12
0
File: ast.cpp Progetto: kenpusney/ng
bool StringValue::operator==(const ASTNode& node) const
{
    auto &strVal = dynamic_cast<const StringValue &>(node);
    return astNodeType() == node.astNodeType() &&
            strVal.value == value;
}
Esempio n. 13
0
File: ast.cpp Progetto: kenpusney/ng
bool IntegerValue::operator==(const ASTNode &node) const
{
    auto &intVal = dynamic_cast<const IntegerValue &>(node);
    return astNodeType() == node.astNodeType() &&
           intVal.value == value;
}
Esempio n. 14
0
File: ast.cpp Progetto: kenpusney/ng
bool ValDef::operator==(const ASTNode& node) const {
    auto &valDef = dynamic_cast<const ValDef&>(node);

    return astNodeType() == node.astNodeType() &&
        valDef.body->operator==(*(valDef.body));
}
Esempio n. 15
0
File: ast.cpp Progetto: kenpusney/ng
bool SimpleStatement::operator==(const ASTNode &node) const
{
    auto &simple = dynamic_cast<const SimpleStatement &>(node);
    return astNodeType() == node.astNodeType() &&
           *expression == *simple.expression;
}
Esempio n. 16
0
File: ast.cpp Progetto: kenpusney/ng
bool IdExpression::operator==(const ASTNode &node) const
{
    auto &idexpr = dynamic_cast<const IdExpression &>(node);
    return astNodeType() == node.astNodeType() &&
           idexpr.id == id;
}
Esempio n. 17
0
File: ast.cpp Progetto: kenpusney/ng
bool ReturnStatement::operator==(const ASTNode &node) const
{
    auto &ret = dynamic_cast<const ReturnStatement &>(node);
    return astNodeType() == node.astNodeType() &&
           *expression == *ret.expression;
}