diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-03-07 18:38:56 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-03-07 18:38:56 +0000 |
commit | 1e0edabcca97b60371d84879ad69f569eb9127f5 (patch) | |
tree | 2357bdf40cbd3f605b591ececda6bf2785738f09 /c_compiler/src/expression.cpp | |
parent | 81c4d63a74dd2c6d7395d2d1aeae93fbd22d4b16 (diff) | |
parent | b810b59783a3dd32837fe4c458229cc771bd6877 (diff) | |
download | Compiler-1e0edabcca97b60371d84879ad69f569eb9127f5.tar.gz Compiler-1e0edabcca97b60371d84879ad69f569eb9127f5.zip |
Merge branch 'master' into compiler
Diffstat (limited to 'c_compiler/src/expression.cpp')
-rw-r--r-- | c_compiler/src/expression.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/c_compiler/src/expression.cpp b/c_compiler/src/expression.cpp index 4b09581..76a6c43 100644 --- a/c_compiler/src/expression.cpp +++ b/c_compiler/src/expression.cpp @@ -3,14 +3,30 @@ // Expression definition -Expression::Expression(const Node* expr) -{} - void Expression::print() const {} void Expression::printxml() const {} -void Expression::printasm() const + +// Identifier definition + +Identifier::Identifier(const std::string& id) + : m_id(id) +{} + +void Identifier::printasm() const {} + + +// Constant definition + +Constant::Constant(const int32_t& constant) + : m_constant(constant) +{} + +void Constant::printasm() const +{ + std::cout << "\tli\t$2," << m_constant << std::endl; +} |