@@ -180,9 +180,9 @@ def BuildLR0AnalyseTable(self):
180
180
for stat in self .action :
181
181
for sy in self .action [stat ]:
182
182
if len (self .action [stat ][sy ]) > 1 :
183
- print ("It's not a LR(0) grammer ." )
183
+ print ("It's not a LR(0) grammar ." )
184
184
return False
185
- print ("It's a LR(0) grammer ." )
185
+ print ("It's a LR(0) grammar ." )
186
186
return True
187
187
188
188
def addFirst (self , nt , sy ):
@@ -310,7 +310,7 @@ def BuildSLR1AnalyseTable(self):
310
310
else :
311
311
followj = reduction [j ]
312
312
if len (followi .intersection (followj )):
313
- print ("It's not a SLR(1) grammer ." )
313
+ print ("It's not a SLR(1) grammar ." )
314
314
return False
315
315
reduction .pop ()
316
316
@@ -328,7 +328,7 @@ def BuildSLR1AnalyseTable(self):
328
328
self .changeAction (stat , sy , '' )
329
329
movein = set ()
330
330
reduction = []
331
- print ("It's a SLR(1) grammer ." )
331
+ print ("It's a SLR(1) grammar ." )
332
332
return True
333
333
334
334
def addLATerminal (self , set_num , project , sy ):
@@ -504,9 +504,9 @@ def BuildLR1AnalyseTable(self):
504
504
for stat in self .action :
505
505
for sy in self .action [stat ]:
506
506
if len (self .action [stat ][sy ]) > 1 :
507
- print ("It's not a LR(1) grammer ." )
507
+ print ("It's not a LR(1) grammar ." )
508
508
return False
509
- print ("It's a LR(1) grammer ." )
509
+ print ("It's a LR(1) grammar ." )
510
510
return True
511
511
512
512
def BuildLALR1AnalyseTable (self ):
@@ -531,7 +531,7 @@ def BuildLALR1AnalyseTable(self):
531
531
f_num += 1
532
532
533
533
if concentric_num == 0 :
534
- print ("It's a LALR(1) grammer ." )
534
+ print ("It's a LALR(1) grammar ." )
535
535
return True
536
536
537
537
for Iid in self .projectSet :
@@ -562,9 +562,9 @@ def BuildLALR1AnalyseTable(self):
562
562
for sy in self .action [stat ]:
563
563
if len (self .action [stat ][sy ]) > 1 :
564
564
self .action , self .goto = action , goto
565
- print ("It's not a LALR(1) grammer ." )
565
+ print ("It's not a LALR(1) grammar ." )
566
566
return False
567
- print ("It's a LALR(1) grammer ." )
567
+ print ("It's a LALR(1) grammar ." )
568
568
569
569
def Analysis (self , sentence ):
570
570
statstack = [0 ]
0 commit comments