76 lines
1.4 KiB
C
76 lines
1.4 KiB
C
#ifndef UNDAR_EMIT_H
|
|
#define UNDAR_EMIT_H
|
|
|
|
#include "libc.h"
|
|
|
|
typedef enum expression_config_e {
|
|
PREFIX,
|
|
INFIX,
|
|
POSTFIX
|
|
} ExpressionConfig;
|
|
|
|
typedef enum output_config_e {
|
|
BINARY,
|
|
TEXT
|
|
} OutputConfig;
|
|
|
|
ExpressionConfig expression_config();
|
|
OutputConfig output_config();
|
|
|
|
/**
|
|
* Prolog is for all of the "setup" boilerplate
|
|
*/
|
|
void prolog();
|
|
|
|
/**
|
|
* Prolog is for all of the "cleanup" boilerplate
|
|
*/
|
|
void epilogue();
|
|
|
|
/**
|
|
* Emitters
|
|
*/
|
|
void emit_add();
|
|
void emit_sub();
|
|
void emit_mul();
|
|
void emit_div();
|
|
void emit_lt();
|
|
void emit_le();
|
|
void emit_gt();
|
|
void emit_ge();
|
|
void emit_ne();
|
|
void emit_eq();
|
|
void emit_false();
|
|
void emit_true();
|
|
void emit_nil();
|
|
void emit_void();
|
|
void emit_int(const char *str, i32 length);
|
|
void emit_nat(const char *str, i32 length);
|
|
void emit_real(const char *str, i32 length);
|
|
void emit_str(const char *str, i32 length);
|
|
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_array();
|
|
void emit_function();
|
|
void emit_plex();
|
|
void emit_method();
|
|
void emit_trait();
|
|
void emit_const();
|
|
void emit_print();
|
|
void emit_neg();
|
|
void emit_not();
|
|
void emit_open_paren();
|
|
void emit_close_paren();
|
|
|
|
#endif |