aboutsummaryrefslogtreecommitdiffstats
path: root/code/4ed_translation.h
blob: 2cca58f4d381c446afbf2bebf945b61c61ee3bc5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 * Mr. 4th Dimention - Allen Webster
 *
 * 24.01.2018
 *
 * Buffer types
 *
 */

// TOP

#if !defined(FRED_TRANSLATION_H)
#define FRED_TRANSLATION_H

struct Translation_State{
    u8 fill_buffer[4];
    u32 fill_start_i;
    u8 fill_i;
    u8 fill_expected;
};

enum{
    TranLBH_None,
    TranLBH_Rebuffer,
    TranLBH_EmitAsCP,
};
struct Translation_Byte_Description{
    u8 byte_class;
    u8 last_byte_handler;
    u8 prelim_emit_type;
};

struct Translation_Emit_Rule{
    u8 byte_class;
    u8 last_byte_handler;
    u8 emit_type;
    
    u32 codepoint;
    u32 codepoint_length;
};

struct Translation_Emits{
    Buffer_Model_Step steps[5];
    u32 step_count;
};

#endif

// BOTTOM