October 24th, 2014

Coroutines

PuTTY, like a lot of other terminal software, has to interpret a lot of funny grammars and syntaxes in its input.  The problem of how to do this clearly and maintainably in C is still an open problem which has no widely accepted solution.

The authors of PuTTY, however, came up with one I haven’t seen before: using the C preprocessor to break down the barriers between two cooperating functions which process grammar in their inputs.

Leave a Response

Imhotep theme designed by Chris Lin. Proudly powered by Wordpress.
XHTML | CSS | RSS | Comments RSS