-
Notifications
You must be signed in to change notification settings - Fork 0
/
lexerDef.h
68 lines (53 loc) · 1.04 KB
/
lexerDef.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
// BATCH NUMBER - 57
// Authors:-
// Rishabh Singh 2012B4A7691P [email protected]
// Anchit Jain 2012B3A7570P [email protected]
#ifndef LEXERDEF_H
#define LEXERDEF_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <ctype.h>
#define LIMIT 128
#define TOKEN_LEN 20
int error1;
int error2;
int print_syntax_error;
int print_semantic_error;
typedef struct trienode1{
int num;
int isleaf;
int id;
struct trienode1 *child[90];
}trieNode1;
typedef struct state_struct
{
int state_number;
int is_final;
struct state_struct *next_state[LIMIT];
} STATE;
typedef struct charRange
{
int start;
int end;
int id;
} CHAR_RANGE;
typedef struct dfa_struct
{
int num_states;
int start_state;
int cur_state;
STATE *total_states;
} DFA;
typedef struct token_struct
{
int line_number;
char *token_id;
char *token_name;
} TOKEN_INFO;
char **hash_keyword_token;
extern int NUM_KEYWORD;
char **hashFinalToken;
trieNode1 *hashTokens;
#endif /* LEXERDEF_H */