Skip to content

Latest commit

 

History

History

18

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Day 18 - Python, Lex and Yacc

Link to problem

Lex and Yacc are great tools for problems like this. The originals generate C source code. They have been adapted for other languages. I found a Python version named "ply" while looking at Algol interpreters, so I thought I would give it a try.

I think it should not be too hard to write a hand-made parser for this particular problem. But it is better to use the right tool for the job, and in this Pythonic form, Lex and Yacc are very suitable.