undar-lang/emit/uxntal/emit.c

258 lines
1.7 KiB
C

#include "../../emit.h"
#include <stdio.h>
ExpressionConfig
expression_config()
{
return POSTFIX;
}
OutputConfig
output_config()
{
return TEXT;
}
void
prolog()
{
}
void
epilogue()
{
}
void
emit_add()
{
printf("+ ");
}
void
emit_sub()
{
printf("- ");
}
void
emit_mul()
{
printf("* ");
}
void
emit_div()
{
printf("/ ");
}
void
emit_lt()
{
printf("< ");
}
void
emit_le()
{
printf("<= ");
}
void
emit_gt()
{
printf("> ");
}
void
emit_ge()
{
printf(">= ");
}
void
emit_ne()
{
printf("!= ");
}
void
emit_eq()
{
printf("== ");
}
void
emit_false()
{
printf("false ");
}
void
emit_true()
{
printf("true ");
}
void
emit_nil()
{
printf("NULL ");
}
void
emit_neg()
{
printf("-");
}
void
emit_not()
{
printf("!");
}
void
emit_void()
{
}
void
emit_bool_type()
{
}
void
emit_byte_type()
{
}
void
emit_int_type()
{
}
void
emit_nat_type()
{
}
void
emit_real_type()
{
}
void
emit_str_type()
{
}
void
emit_u8_type()
{
}
void
emit_i8_type()
{
}
void
emit_i16_type()
{
}
void
emit_u16_type()
{
}
void
emit_i32_type()
{
}
void
emit_u32_type()
{
}
void
emit_f32_type()
{
}
void
emit_int(const char *str, i32 length)
{
printf("%.*s ", length, str);
}
void
emit_nat(const char *str, i32 length)
{
printf("%.*s ", length, str);
}
void
emit_real(const char *str, i32 length)
{
printf("%.*s ", length, str);
}
void
emit_str(const char *str, i32 length)
{
printf("%.*s ", length, str);
}
void
emit_array()
{
}
void
emit_function()
{
}
void
emit_plex()
{
}
void
emit_method()
{
}
void
emit_trait()
{
}
void
emit_const()
{
}
void
emit_print()
{
printf("printf(\"%%s\", ");
}
void
emit_open_paren()
{
printf("(");
}
void
emit_close_paren()
{
printf(")");
}