blob: cb3ba1c010d0292355ae0a864b4c0838634c276d [file] [log] [blame]
swissChili8a581c62021-12-07 13:29:21 -08001#pragma once
2
3#include "Token.h"
4#include "AstNode.h"
5
6class Sentence {
7public:
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
16protected:
17 QList<Token> _pattern;
18 QList<AstNode> _result;
19};
20
21class Function {
22public:
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
34private:
35 QString _name;
36 QList<Sentence> _sentences;
37};