swissChili | 8a581c6 | 2021-12-07 13:29:21 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "Token.h" |
| 4 | #include "AstNode.h" |
| 5 | |
| 6 | class Sentence { |
| 7 | public: |
| 8 | Sentence() = default; |
| 9 | Sentence(QList<Token> pattern, QList<AstNode> result); |
| 10 | |
| 11 | QList<Token> pattern() const; |
| 12 | QList<AstNode> result() const; |
| 13 | |
| 14 | operator QString() const; |
| 15 | |
| 16 | protected: |
| 17 | QList<Token> _pattern; |
| 18 | QList<AstNode> _result; |
| 19 | }; |
| 20 | |
| 21 | class Function { |
| 22 | public: |
| 23 | Function() = default; |
| 24 | explicit Function(QString name); |
| 25 | Function(QString name, QList<Sentence> sentences); |
| 26 | |
| 27 | void addSentence(Sentence sentence); |
| 28 | |
| 29 | QString name() const; |
| 30 | QList<Sentence> sentences() const; |
| 31 | |
| 32 | operator QString() const; |
| 33 | |
| 34 | private: |
| 35 | QString _name; |
| 36 | QList<Sentence> _sentences; |
| 37 | }; |