-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathparserDef.h
More file actions
49 lines (35 loc) · 807 Bytes
/
parserDef.h
File metadata and controls
49 lines (35 loc) · 807 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
/*
Batch No: 47
Gyanendra Mishra 2013A7PS126P
Prabhjyot Singh Sodhi 2013A7PS151P
Filename:parserDef.h
*/
// parserDef.h: Contains all definitions for data types such as grammar, table, parseTree etc. used in parser.c
#ifndef PARSERDEF_H_INCLUDED
#define PARSERDEF_H_INCLUDED
#include <stdio.h>
#define table_row 60
typedef int** table;
struct tree {
int id;
struct tree *parent;
struct tree *firstKid;
struct tree *siblings;
char* lexeme;
int lineNo;
};
typedef struct tree* parseTree;
parseTree next(parseTree);
struct stack;
typedef struct stack stack;
struct stack
{
int data;
stack* next;
};
stack* push_ints(stack*, int* , parseTree);
stack* push(stack*, int);
stack pop(stack*);
int* getRuleRHSrev(int);
extern char GRule[95][100];
#endif