After all that, you are probably wondering whether it was all worth the trouble. Would it have been better just to use perl after all?

Lex/Yacc programs are reasonably easy to write, but somewhat harder to get right. On the up side, we did manage to do two important things which would be difficult to do using perl or awk or some other scripting language:

These things are difficult to achieve when you are using a script-program which processes input on a line-by-line basis.

We also have some additional advantages:

We should use perl and awk whenever they are applicable, but there are some things that these line-based text scanners have trouble dealing with. Things like:

All of the above are tough to handle with perl and awk.

So, when the going gets tough - get Lex and Yacc.


Last modified: $Date: 2000/04/16 04:30:44 $

Previous: Yacc - A parser generator