Added primitive code generation

Attention: file format changed!