-
Notifications
You must be signed in to change notification settings - Fork 4
/
LnParser.h
106 lines (102 loc) · 2.21 KB
/
LnParser.h
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#ifndef __LN_PARSER__
#define __LN_PARSER__
// This file was automatically generated by EbnfStudio; don't modify it!
#include <Luon/LnToken.h>
#include <QList>
namespace Ln {
class Scanner {
public:
virtual Token next() = 0;
virtual Token peek(int offset) = 0;
};
class Parser {
public:
Parser(Scanner* s):scanner(s) {}
void RunParser();
struct Error {
QString msg;
int row, col;
QString path;
Error( const QString& m, int r, int c, const QString& p):msg(m),row(r),col(c),path(p){}
};
QList<Error> errors;
protected:
void Luon();
void number();
void qualident();
void identdef();
void ConstDeclaration();
void ConstExpression();
void TypeDeclaration();
void type();
void NamedType();
void ArrayType();
void length();
void DictType();
void RecordType();
void BaseType();
void FieldList();
void IdentList();
void enumeration();
void constEnum();
void VariableDeclaration();
void designator();
void selector();
void ExpList();
void expression();
void relation();
void SimpleExpression();
void AddOperator();
void term();
void MulOperator();
void literal();
void constructor();
void component();
void factor();
void variableOrFunctionCall();
void statement();
void assignmentOrProcedureCall();
void StatementSequence();
void IfStatement();
void ElsifStatement();
void ElseStatement();
void CaseStatement();
void Case();
void CaseLabelList();
void LabelRange();
void label();
void WhileStatement();
void RepeatStatement();
void ForStatement();
void LoopStatement();
void ExitStatement();
void procedure();
void ProcedureType();
void ProcedureDeclaration();
void ProcedureHeading();
void Receiver();
void block();
void ProcedureBody();
void DeclarationSequence();
void ReturnStatement();
void FormalParameters();
void ReturnType();
void FPSection();
void FormalType();
void module();
void ImportList();
void import();
void MetaActuals();
void MetaParams();
void MetaSection();
protected:
Token cur;
Token la;
Scanner* scanner;
void next();
Token peek(int off);
void invalid(const char* what);
bool expect(int tt, bool pkw, const char* where);
};
}
#endif // include