-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expr: Impemented basic cell referencing
- Loading branch information
Petr Laštovička
committed
May 11, 2022
1 parent
7a62030
commit 597d1ec
Showing
19 changed files
with
422 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ lastope2 | |
lastope2.zip | ||
test | ||
logs.txt | ||
err.txt | ||
*.o | ||
*.d | ||
doc/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Semestralni_prace/src/cz/lastaapps/vimxel/expr/nodes/terms.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,32 @@ | ||
#include "terms.hpp" | ||
#include <sstream> | ||
|
||
using namespace std; | ||
namespace cz::lastaapps::vimxel::expr { | ||
|
||
DoubleTerm::DoubleTerm(long double value) | ||
: mValue(value) {} | ||
long double DoubleTerm::getValue() const { return mValue; } | ||
string DoubleTerm::toString() const { | ||
ostringstream text; | ||
text.precision(6); | ||
text << mValue; | ||
return text.str(); | ||
} | ||
|
||
TextTerm::TextTerm(const string& value) | ||
: mValue(value) {} | ||
const string& TextTerm::getValue() const { return mValue; } | ||
string TextTerm::toString() const { | ||
return mValue; | ||
} | ||
|
||
AreaTerm::AreaTerm(vector<shared_ptr<SingleTerm>> value) | ||
: mValue(value) {} | ||
const vector<shared_ptr<SingleTerm>>& AreaTerm::getValue() const { | ||
return mValue; | ||
} | ||
string AreaTerm::toString() const { | ||
return "Area of "s + to_string(mValue.size()); | ||
} | ||
} // namespace cz::lastaapps::vimxel::expr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "parser.hpp" | ||
|
||
using namespace std; | ||
using namespace cz::lastaapps::vimxel::table; | ||
namespace cz::lastaapps::vimxel::expr { | ||
|
||
Parser::Parser(STokenzizer, function<ST(const table::Coordinates&)>){} | ||
shared_ptr<Term> Parser::evaulate() { | ||
return make_shared<TextTerm>("Juhu"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef H_PARSER | ||
#define H_PARSER | ||
#include <functional> | ||
#include <memory> | ||
|
||
#include "tokenizer.hpp" | ||
#include "nodes/terms.hpp" | ||
#include "../table/coordinate.hpp" | ||
|
||
using namespace std; | ||
using namespace cz::lastaapps::vimxel::table; | ||
namespace cz::lastaapps::vimxel::expr { | ||
|
||
class Parser final { | ||
using STokenzizer = shared_ptr<Tokenizer>; | ||
using ST = shared_ptr<Term>; | ||
|
||
public: | ||
Parser(STokenzizer, function<ST(const table::Coordinates&)>); | ||
ST evaulate(); | ||
}; | ||
} // namespace cz::lastaapps::vimxel::exptr | ||
|
||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.