Interface Kitab\Compiler\Target\Target

interface Target
{
    public function compile(Kitab\Compiler\IntermediateRepresentation\File $file);
    public function assemble(array $symbols);
}

Define a compilation target.

A compilation target works in two steps:

  1. compile to compile an intermediate representation of a file into the target,
  2. assemble to assemble of the compiled files.

Methods

public function compile(Kitab\Compiler\IntermediateRepresentation\File $file)

Compile an intermediate representation of a file into a specific target.

public function assemble(array $symbols)

Assemble the compiled files.

This step is important, it can enhance the result based on symbols. When compiling one intermediate representation of a file at a time, not all symbols are present due to the nature of the algorithm. Indeed, each time a file is opened, it is compiled and dropped. Only symbols are kept in a store.

The assemble step is here to complete, or enhance compiled file with the store of symbols.