This is a little throwaway project I put together one evening when I needed to give my brain a little rest from working on a particularly awkward problem with the Imp to C translator. It's a lightweight version of 'soap' - all it does is adjust the indentation, which is often enough and all that is wanted. At some point I may pad it out a little but for now that's it and there are no options. If you can't stomach 2-space indentation and want to change it, then edit the line in compile.c that says: fprintf(out, " "); :-) The source code has a lot in common with the Imp to C translator which I'm currently working on, but it is not identical to it. Comments may be out of date. And there's a lot of extra stuff in here that isn't needed for this simple program. As I said it was a quick hack, but useful enough to release. (And feedback on whether this compiles and runs on different platforms will help when I get to the stage of asking folks to try building the new ImpToC...) The hardest part of building an indenter was working out how to handle source code that contains syntax errors. It turned out to be an easy hack: I simply accept 1 more character from the input transparently, then see if parsing can resume. It generally resynchronises on a newline or semi-colon when this happens. The input file is the command-line parameter; the output goes to stdout. A useful tool to compare two files side by side is this 'sbs' script: #!/bin/bash pr -m -t -w$((2 * $(cat $1 $2|wc -L))) $1 $2 I *hope* this program is written in sufficiently portable C that it will compile anywhere. Let me know if not. The individual source files are in https://gtoal.com/compilers101/edinburgh-parser/suds/ and are together in https://gtoal.com/compilers101/edinburgh-parser/suds/suds.tgz (Extract with 'tar -xvzf suds.tgz' after downloading to an appropriate subdirectory) Graham Toal gtoal@gtoal.com 202205011613