CAST Flatten - HACKT Tutorials
Description: HACKT Tutorials

Up: Legacy Compatibility

### 5.1 CAST Flatten

The old CAST tool chain uses flattened text files as input to other tools. We provide similar functionality with HACKT's `cflat` command, which is also installed under the alias `hflat`.

— Program: hflat mode [options] in-object

> Emulate the behavior of legacy cflat. Modes and options are explained below.

Instead of reading in the source file directly, it reads a compiled object file. (Later, we may add an option to read a source file directly.) If the object file is not already in the allocated state (Allocate), then it will automatically invoke the allocation phase before doing its real work. The options and modes are described in CFLAT Options.

Starting with our example from Program Examples. we compile `inv.haco` first.

         $ hackt compile inv.hac inv.haco

We then produce flattened text output with the command:

         $ hackt cflat prsim inv.haco

which results the following output, suitable for legacy `prsim`:

         "x" -> "y"-
         ~"x" -> "y"+
         = "x" "Z.a"
         = "y" "Z.b"

This can be piped directly into `prsim` or saved to a file for later use.