Remove obsolete RegNode
This commit is contained in:
@ -9,18 +9,20 @@ add_executable(lasm
|
||||
src/main.cpp
|
||||
src/lexer/Token.cpp
|
||||
src/lexer/Lexer.cpp
|
||||
src/parser/Parser.cpp
|
||||
|
||||
src/ast/Node.cpp
|
||||
src/ast/nodes/RootNode.cpp
|
||||
src/ast/nodes/ConstNode.cpp
|
||||
src/ast/nodes/RegNode.cpp
|
||||
src/ast/nodes/MovNode.cpp
|
||||
src/ast/nodes/AluNode.cpp
|
||||
src/ast/nodes/JumpNode.cpp
|
||||
|
||||
src/ast/Observer.cpp
|
||||
src/ast/PrefixObserver.cpp
|
||||
src/ast/PostfixObserver.cpp
|
||||
src/codegen/PrintObserver.cpp
|
||||
src/codegen/CodegenObserver.cpp
|
||||
src/parser/Parser.cpp)
|
||||
)
|
||||
|
||||
target_link_libraries(lasm Boost::program_options)
|
@ -6,7 +6,6 @@
|
||||
#define LOGISIMASSEMBLER_MOVNODE_H
|
||||
|
||||
#include "../Node.h"
|
||||
#include "RegNode.h"
|
||||
|
||||
class MovNode : public Node {
|
||||
public:
|
||||
|
@ -1,19 +0,0 @@
|
||||
//
|
||||
// Created by christoph on 21.03.23.
|
||||
//
|
||||
|
||||
#include "RegNode.h"
|
||||
|
||||
RegNode::RegNode(uint8_t reg) : reg(reg) {}
|
||||
|
||||
auto RegNode::compile() const -> uint8_t {
|
||||
if (reg > 0b110) {
|
||||
throw "Compile Error: Invalid Register!";
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
auto RegNode::getRegister() const -> uint8_t {
|
||||
return reg;
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
//
|
||||
// Created by christoph on 21.03.23.
|
||||
//
|
||||
|
||||
#ifndef LOGISIMASSEMBLER_REGNODE_H
|
||||
#define LOGISIMASSEMBLER_REGNODE_H
|
||||
|
||||
#include "../Node.h"
|
||||
|
||||
class RegNode : public Node {
|
||||
public:
|
||||
RegNode(uint8_t reg);
|
||||
|
||||
~RegNode() override = default;
|
||||
|
||||
[[nodiscard]] auto compile() const -> uint8_t override;
|
||||
|
||||
[[nodiscard]] auto getRegister() const -> uint8_t;
|
||||
|
||||
private:
|
||||
uint8_t reg;
|
||||
};
|
||||
|
||||
#endif //LOGISIMASSEMBLER_REGNODE_H
|
Reference in New Issue
Block a user