diff options
Autocommit at 14.06.2022 @ 08:03
1 files changed, 18 insertions, 0 deletions
| -rw-r--r-- | src/Models/CellFormula.cpp | 18 |
diff --git a/src/Models/CellFormula.cpp b/src/Models/CellFormula.cpp index 92bb701..4e7449c 100644 --- a/src/Models/CellFormula.cpp +++ b/src/Models/CellFormula.cpp @@ -69,6 +69,24 @@ String CellFormula::getValueForPrint() const { } } +// Rough implementation of the grammar +// +// S -> WDS | WD.DS | WRDRDS | WOS | W +// O -> + | - | * | / | ^ +// D -> D0 | D1 | ... | D9 | 0 | 1 | ... | 9 +// W -> W | epsilon +// +// over the string + +void W(const char*& str) { + while (*str == ' ') str++; +} + +void D(const char*& str, List<char>& buffer) { + while (*str >= '0' && *str <= '9') + buffer.add(*(str++)); +} + void CellFormula::parseAndSetValue(const char* str) { rawFormula = String(str); |
