
kgu
hat-trans spends a lot of time (really a lot of time) in generate module from a module generated by alex. The original module has 330 lines of code and module generated by hat-trans has 40700 !!.
It is well-known that giving a machine-generated input to any compiler-like tool is the best way to show up its weaknesses! I suppose the output from Alex is very different from the kind of code that a human would write. Since Alex creates essentially a table-driven lexical analyser, it is possible that a large static description of the tables is where hat-trans is spending lots of time. Also, if the Alex-generated code is deeply nested, hat-trans may spend too much time trying to pretty-print its output within 80 columns, when really the formatting will not fit nicely into such a small width. Just some ideas. If you want to send a copy of the original Alex specification, we may be able to investigate further. Regards, Malcolm