This repository has been archived by the owner on Aug 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
166 lines (125 loc) · 3.36 KB
/
Makefile
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
cc = gcc
cflag =
python = python3
obj = main.o nfa.o csr.o util.o dfa.o re.o
test: $(obj)
$(cc) $(cflag) -o fa $(obj)
main.o: main.c
$(cc) $(cflag) -c main.c
csr.o: csr.c
$(cc) $(cflag) -c csr.c
util.o: util.c
$(cc) $(cflag) -c util.c
nfa.o: nfa.c
$(cc) $(cflag) -c nfa.c
dfa.o: dfa.c
$(cc) $(cflag) -c dfa.c
re.o: re.c
$(cc) $(cflag) -c re.c
right: fa
@echo "The test example one:"
@echo "------------------------"
./fa -p ./dfa_test/1.dfa -f ./dfa_test/1.test
@echo "------------------------"
@echo "\n"
@echo "The test example two:"
@echo "------------------------"
./fa -p ./dfa_test/2.dfa -f ./dfa_test/2.test
@echo "------------------------"
@echo "\n"
@echo "The test example three:"
@echo "------------------------"
./fa -p ./dfa_test/3.dfa -f ./dfa_test/3.test
@echo "------------------------"
wrong: fa
@echo "The state is not in the state set:"
@echo "------------------------"
./fa -p ./dfa_test/sub.dfa
@echo "------------------------\n"
@echo "The undermined next state:"
@echo "------------------------"
./fa -p ./dfa_test/tran.dfa
@echo "-----------------------\n"
@echo "The wrong stopping:"
@echo "------------------------"
./fa -p ./dfa_test/tran2.dfa
@echo "-----------------------\n"
@echo "No init state:"
@echo "------------------------"
./fa -p ./dfa_test/init.dfa
@echo "-----------------------\n"
@echo "No acceptable state:"
@echo "------------------------"
./fa -p ./dfa_test/acc.dfa
@echo "-----------------------\n"
string: fa
@echo "The test example one:"
@echo "------------------------"
./fa -p ./dfa_test/3.dfa -f ./dfa_test/3-1.test
@echo "------------------------\n"
@echo "The test example two:"
@echo "------------------------"
./fa -p ./dfa_test/3.dfa -f ./dfa_test/3-2.test
@echo "------------------------"
1: fa
@cat ./re_test/1.re
@echo "\n"
@./fa -r ./re_test/1.re
@./fa -e ./re_test/1.nfa -i
@./fa -e ./re_test/1.nfa -v
@./fa -d ./re_test/1.dfa.fine -m
@./fa -d ./re_test/1min.dfa.fine -s bbabbab
@./fa -d ./re_test/1min.dfa.fine -s ''
@./fa -d ./re_test/1min.dfa.fine -s c
@echo "\n"
./fa -d ./re_test/1.dfa.fine -a
@echo "\n"
./fa -e ./re_test/1.nfa -a
@echo "\n"
@./fa -d "./re_test/1.dfa.fine" -a
@$(python) fa.py ./re_test/1.nfa
2: fa
@cat ./re_test/2.re
@echo "\n"
@./fa -r ./re_test/2.re
@./fa -e ./re_test/2.nfa -i
@./fa -e ./re_test/2.nfa -v
@./fa -d ./re_test/2.dfa.fine -m
@./fa -d "./re_test/2min.dfa.fine" -s aababbabb
@./fa -d "./re_test/2min.dfa.fine" -s aababbb
@echo "\n"
./fa -d ./re_test/2.dfa.fine -a
@echo "\n"
./fa -e ./re_test/2.nfa -a
@echo "\n"
@./fa -d "./re_test/2.dfa.fine" -a
@$(python) fa.py ./re_test/2.nfa
3: fa
@cat ./re_test/3.re
@echo "\n"
@./fa -r ./re_test/3.re
@./fa -e ./re_test/3.nfa -i
@./fa -e ./re_test/3.nfa -v
@./fa -d ./re_test/3.dfa.fine -m
@./fa -d "./re_test/3min.dfa.fine" -s aababba
@./fa -d "./re_test/3min.dfa.fine" -s aababbab
@echo "\n"
./fa -d ./re_test/3.dfa.fine -a
@echo "\n"
./fa -e ./re_test/3.nfa -a
@echo "\n"
@./fa -d "./re_test/3.dfa.fine" -a
@$(python) fa.py ./re_test/3.nfa
v: fa
t: fa
@cat ./re_test/t.re
@echo "\n"
@./fa -r ./re_test/t.re
@./fa -e ./re_test/t.nfa -i
@./fa -e ./re_test/t.nfa -v
@$(python) fa.py ./re_test/t.nfa
@./fa -d ./re_test/t.dfa.fine -m
@./fa -d ./re_test/t-min.dfa.fine -s ab
.PHONY:clean
clean:
rm *.o fa *.jpg *.gv