Skip to content

Commit

Permalink
Pedantic
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardt committed Aug 8, 2019
1 parent 8853c90 commit 2356b7b
Showing 1 changed file with 31 additions and 30 deletions.
61 changes: 31 additions & 30 deletions src/verilogAST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ std::string NumericLiteral::toString() {
}
return size_str + separator + signed_str + radix_str + value;
}
NumericLiteral::~NumericLiteral(){}
NumericLiteral::~NumericLiteral() {}

std::string Identifier::toString() { return value; }

Identifier::~Identifier(){}
Identifier::~Identifier() {}

std::string String::toString() { return "\"" + value + "\""; }
String::~String(){}
String::~String() {}

std::string Index::toString() {
return id->toString() + '[' + index->toString() + ']';
Expand All @@ -59,13 +59,13 @@ std::string Slice::toString() {
low_index->toString() + ']';
}

Slice::~Slice(){}
Slice::~Slice() {}

std::string Vector::toString() {
return "[" + msb->toString() + ':' + lsb->toString() + "] " + id->toString();
}

Vector::~Vector(){}
Vector::~Vector() {}

std::string BinaryOp::toString() {
std::string op_str;
Expand Down Expand Up @@ -116,7 +116,7 @@ std::string BinaryOp::toString() {
return left->toString() + ' ' + op_str + ' ' + right->toString();
}

BinaryOp::~BinaryOp(){}
BinaryOp::~BinaryOp() {}

std::string UnaryOp::toString() {
std::string op_str;
Expand Down Expand Up @@ -158,14 +158,14 @@ std::string UnaryOp::toString() {
return op_str + ' ' + operand->toString();
}

UnaryOp::~UnaryOp(){}
UnaryOp::~UnaryOp() {}

std::string TernaryOp::toString() {
return cond->toString() + " ? " + true_value->toString() + " : " +
false_value->toString();
}

TernaryOp::~TernaryOp(){}
TernaryOp::~TernaryOp() {}

std::string Concat::toString() {
std::vector<std::string> arg_strs;
Expand All @@ -175,13 +175,13 @@ std::string Concat::toString() {
return "{" + join(arg_strs, ",") + "}";
}

Concat::~Concat(){}
Concat::~Concat() {}

std::string NegEdge::toString() { return "negedge " + value->toString(); }
NegEdge::~NegEdge(){}
NegEdge::~NegEdge() {}

std::string PosEdge::toString() { return "posedge " + value->toString(); }
PosEdge::~PosEdge(){}
PosEdge::~PosEdge() {}

template <typename... Ts>
std::string variant_to_string(std::variant<Ts...> &value) {
Expand Down Expand Up @@ -218,15 +218,15 @@ std::string Port::toString() {
return direction_str + " " + data_type_str + value_str;
}

Port::~Port(){}
std::string StringPort::toString() { return value; };
StringPort::~StringPort(){}
Port::~Port() {}
std::string StringPort::toString() { return value; }
StringPort::~StringPort() {}

std::string SingleLineComment::toString() { return "// " + value; };
SingleLineComment::~SingleLineComment(){}
std::string SingleLineComment::toString() { return "// " + value; }
SingleLineComment::~SingleLineComment() {}

std::string BlockComment::toString() { return "/*\n" + value + "\n*/"; };
BlockComment::~BlockComment(){}
std::string BlockComment::toString() { return "/*\n" + value + "\n*/"; }
BlockComment::~BlockComment() {}

std::string Module::emitModuleHeader() {
std::string module_header_str = "module " + name;
Expand Down Expand Up @@ -266,10 +266,10 @@ std::string Module::toString() {
module_str += "endmodule\n";
return module_str;
}
Module::~Module(){}
Module::~Module() {}

std::string StringModule::toString() { return definition; }
StringModule::~StringModule(){}
StringModule::~StringModule() {}

std::string StringBodyModule::toString() {
std::string module_str = "";
Expand All @@ -279,7 +279,7 @@ std::string StringBodyModule::toString() {
return module_str;
}

StringBodyModule::~StringBodyModule(){}
StringBodyModule::~StringBodyModule() {}

std::string ModuleInstantiation::toString() {
std::string module_inst_str = "";
Expand Down Expand Up @@ -307,16 +307,16 @@ std::string ModuleInstantiation::toString() {
return module_inst_str;
}

ModuleInstantiation::~ModuleInstantiation(){}
ModuleInstantiation::~ModuleInstantiation() {}

std::string Declaration::toString() {
return decl + " " + variant_to_string(value) + ";";
}

Declaration::~Declaration(){}
Declaration::~Declaration() {}

std::string Wire::toString() { return Declaration::toString(); }
Wire::~Wire(){}
Wire::~Wire() {}

std::string Reg::toString() { return Declaration::toString(); }

Expand All @@ -329,16 +329,16 @@ Assign::~Assign() {}

// Multiple inheritance forces us to have to explicitly state this?
std::string ContinuousAssign::toString() { return Assign::toString(); }
ContinuousAssign::~ContinuousAssign(){}
ContinuousAssign::~ContinuousAssign() {}

std::string BlockingAssign::toString() { return Assign::toString(); }
BlockingAssign::~BlockingAssign(){}
BlockingAssign::~BlockingAssign() {}

std::string NonBlockingAssign::toString() { return Assign::toString(); }
NonBlockingAssign::~NonBlockingAssign(){}
NonBlockingAssign::~NonBlockingAssign() {}

std::string Star::toString() { return "*"; }
Star::~Star(){}
Star::~Star() {}

std::string Always::toString() {
std::string always_str = "";
Expand All @@ -362,7 +362,7 @@ std::string Always::toString() {
always_str += "end\n";
return always_str;
}
Always::~Always(){}
Always::~Always() {}

std::string File::toString() {
std::string file_str = "";
Expand All @@ -374,7 +374,8 @@ std::string File::toString() {

return join(file_strs, "\n");
}
File::~File(){};

File::~File() {}

std::unique_ptr<Identifier> make_id(std::string name) {
return std::make_unique<Identifier>(name);
Expand Down

0 comments on commit 2356b7b

Please sign in to comment.