-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunctions.h
49 lines (42 loc) · 1.12 KB
/
functions.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
#ifndef HASHSET
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct symbol{
char letter;
int terminal;
struct symbol** firsts;
struct symbol** follow;
struct symbol** tofollow;
};
struct production{
struct symbol* sym;
struct symbol** body;
int size;
};
struct record{
struct symbol* terminal;
struct symbol* nonterminal;
struct production* prod;
};
struct stack{
int size;
int head;
struct symbol** pila;
};
struct stack* createstack(int dim);
struct symbol* top(struct stack* s);
struct symbol* pop(struct stack* s);
int isFull(struct stack* s);
int isEmpty(struct stack* s);
void addstack(struct stack* s, struct symbol* p);
void printstack(struct stack* s, FILE* ptr);
struct symbol** createset();
int add(struct symbol* s,struct symbol** set);
struct symbol* findchar(char c,struct symbol** s);
struct symbol** merge(struct symbol** s1,struct symbol** s2);
void removechar(char c, struct symbol** set);
void printset(struct symbol** s,FILE* ptr);
int equals(struct symbol** s1, struct symbol** s2);
void copy(struct symbol** source, struct symbol** dest);
#endif