-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.h
More file actions
43 lines (43 loc) · 1019 Bytes
/
Copy pathparser.h
File metadata and controls
43 lines (43 loc) · 1019 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
#ifndef _PARSER_H_
#define _PARSER_H_
#include "token.h"
#include "define.h"
struct Node
{
char describe[30];
Type type;
char value[kTokenLen];
int children[5];
};
typedef struct Node Node;
Node* CreateNewNode(Type type, char* value);
// typedef struct ChosenPro
// {
// int line;
// int next[10];
// struct ChosenPro *pa;
// }ChosenPro;
// typedef struct ChosenPro ChosenPro;
ChosenPro* CreateNewPro(int line, ChosenPro *pa);
ChosenPro* CreateNewPro();
ChosenPro* FreePro(ChosenPro *target);
int PopNext(ChosenPro *target);
int NextPos(ChosenPro *target);
void Push(int* sta, int value);
int Pop(int* sta);
int Front(int* sta);
int IsEmpty(int* arr);
// void PrintUsage();
// void ProcessFile(int argc, char* argv[]);
void Parser(int argc, char* argv[]);
void BuildLLTable();
void PrintLLTable();
void BuildSets();
void BuildFirst();
void Print(int set[][kSetPerSize]);
void BuildFollow();
void PrintPlus();
// void PrintFollow()
void BuildFirstPlus();
int InSet(int fac, int set[]);
#endif