1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-03 07:24:58 +03:00
inform7/inter/final-module/Chapter 3/Final Binary Inter.w
2021-11-11 23:32:10 +00:00

19 lines
649 B
OpenEdge ABL

[BinaryTarget::] Final Binary Inter.
To create the range of possible targets into which Inter can be converted.
@ This target is very simple: when we get the message to begin generation,
we simply ask the Inter module to output some text, and return true to
tell the generator that nothing more need be done.
=
void BinaryTarget::create_generator(void) {
code_generator *binary_inter_cgt = Generators::new(I"binary");
METHOD_ADD(binary_inter_cgt, BEGIN_GENERATION_MTID, BinaryTarget::text);
}
int BinaryTarget::text(code_generator *gtr, code_generation *gen) {
if (gen->to_file) Inter::Binary::write(gen->to_file, gen->from);
return TRUE;
}