diff --git a/Monicelli.ll b/Monicelli.ll index d8778d1..54902cb 100644 --- a/Monicelli.ll +++ b/Monicelli.ll @@ -37,23 +37,23 @@ CHAR [a-zA-Z_] return RETURN; } "Necchi" { - monicelli_lval.typeval = TYPENAME_INT; + monicelli_lval.typeval = Type::INT; return TYPENAME; } "Mascetti" { - monicelli_lval.typeval = TYPENAME_CHAR; + monicelli_lval.typeval = Type::CHAR; return TYPENAME; } "Perozzi" { - monicelli_lval.typeval = TYPENAME_FLOAT; + monicelli_lval.typeval = Type::FLOAT; return TYPENAME; } "Melandri" { - monicelli_lval.typeval = TYPENAME_BOOL; + monicelli_lval.typeval = Type::BOOL; return TYPENAME; } "Sassaroli" { - monicelli_lval.typeval = TYPENAME_DOUBLE; + monicelli_lval.typeval = Type::DOUBLE; return TYPENAME; } "conte" { diff --git a/Nodes.cpp b/Nodes.cpp index 5e92f08..db18654 100644 --- a/Nodes.cpp +++ b/Nodes.cpp @@ -97,19 +97,19 @@ void Branch::emit(std::ostream &stream, int indent) { void VarDeclaration::emit(std::ostream &stream, int indent) { switch (type) { - case TYPENAME_INT: + case Type::INT: stream << "int"; break; - case TYPENAME_CHAR: + case Type::CHAR: stream << "char"; break; - case TYPENAME_FLOAT: + case Type::FLOAT: stream << "float"; break; - case TYPENAME_BOOL: + case Type::BOOL: stream << "bool"; break; - case TYPENAME_DOUBLE: + case Type::DOUBLE: stream << "double"; break; } diff --git a/Nodes.hpp b/Nodes.hpp index 504f2ab..d26ee34 100644 --- a/Nodes.hpp +++ b/Nodes.hpp @@ -7,13 +7,13 @@ namespace monicelli { -typedef enum { - TYPENAME_INT, - TYPENAME_CHAR, - TYPENAME_FLOAT, - TYPENAME_BOOL, - TYPENAME_DOUBLE -} Type; +enum class Type { + INT, + CHAR, + FLOAT, + BOOL, + DOUBLE +}; class Emittable {