-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.h
More file actions
executable file
·50 lines (32 loc) · 798 Bytes
/
parser.h
File metadata and controls
executable file
·50 lines (32 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef PARSER_H
#define PARSER_H
/*
*
* This is a simple parser for scicalc
*
* Friedrich Feichtinger, 09.09.2012
*
*/
#include "token.h"
class Parser
{
public:
static Token *t; // current token
static Token *la; // look-ahead token
static Token::Kind sym; // kind of look-ahead-token
static QString parse();
private:
static long double Power();
static long double Factor();
static long double Parallel();
static long double Term();
static long double Expression();
static long double Assignment();
static long double Function();
static long double divide(long double dividend, long double divisor);
static void check(Token::Kind expected);
static void scan();
static QString symbol(Token::Kind k);
static QString symbol(Token *t);
};
#endif