Skip to content

Commit 902340c

Browse files
authored
Merge pull request #18 from viabzalov/master
The first variable in cnf must be starting symbol in grammar_to_cnf result
2 parents 90ce4aa + 60dc3f0 commit 902340c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/grammar_to_cnf/grammar_to_cnf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def to_txt(cfg):
113113
variables, productions, terminals = '', '', ''
114114

115115
for var in cfg.variables:
116-
if var not in cfg.variables:
116+
if var != cfg.start_symbol:
117117
variables += f'{var.value} '
118118
for ter in cfg.terminals:
119119
terminals += f'{ter.value} '

0 commit comments

Comments
 (0)