-
Notifications
You must be signed in to change notification settings - Fork 0
/
lexan.h
48 lines (38 loc) · 923 Bytes
/
lexan.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
//
// Created by Adam Zvada on 17.06.17.
//
#ifndef TESTLLVM_LEXAN_H
#define TESTLLVM_LEXAN_H
typedef enum {
IDENT,
NUMB,
PLUS, MINUS, MULTIPLY, DIVIDE,
LESS, LESS_OR_EQ, GRATHER, GRATHER_OR_EQ, EQ, NOT_EQ,
LPAR, RPAR, LBRA, RBRA,
ASSIGN,
kwPROGRAM,
kwBEGIN, kwEND,
kwVAR, kwCONST, kwINTEGER,
kwARRAY,
kwFUNC,
kwIF, kwTHEN, kwELSE,
kwSWITCH,
kwFOR, kwWHILE,
kwTO, kwDOWNTO, kwDO,
kwBREAK,
kwWRITE, kwREAD,
kwOR, kwAND,
kwMOD,
SEMICOLON, COLON, COMMA, DOT,
EOI, ERR
} LexSymbolType;
extern const char * symbTable[46];
#define MAX_IDENT_LEN 32
typedef struct LexicalSymbol {
LexSymbolType type;
char ident[MAX_IDENT_LEN]; /* atribut symbolu IDENT */
int number; /* atribut symbolu NUMB */
} LexicalSymbol;
LexicalSymbol readLexem(void);
int initLexan(const char*);
#endif //TESTLLVM_LEXAN_H