blob: 52cafacca0ff1a1358491907b881c6306cc2998d [file] [log] [blame]
swissChilic71acc62021-12-07 08:03:37 -08001#pragma once
2
3#include <QString>
4
5#include "AstNode.h"
6
7class Parser
8{
9public:
10 explicit Parser(QString input);
11
12 QChar peek();
13 QChar get();
14 bool atEnd();
15
16 void skip();
17
18 bool parseSymbol(AstNode *node);
19 bool parseIdentifier(AstNode *node);
20 bool parseNumber(AstNode *node);
21 bool parseVariable(AstNode *node);
22 bool parseParens(AstNode *node);
23 bool parseFunction(AstNode *node);
24 QList<AstNode> parseMany();
25 bool parseOne(AstNode *node);
26
27private:
28 int _pos = 0;
29 QString _input;
30};