1
519
#[derive(PartialEq, Eq, Debug)]
2
pub(crate) struct TranslationUnit {
3
    pub(crate) external_decls: Vec<Decl>,
4
}
5

            
6
519
#[derive(PartialEq, Eq, Debug)]
7
pub(crate) enum Decl {
8
    Var(VarDecl),
9
    Func(FuncDecl),
10
}
11

            
12
514
#[derive(PartialEq, Eq, Debug)]
13
pub(crate) struct VarDecl {
14
    pub(crate) type_specifier: Type,
15
    // TODO(feroldi): This cannot be a string for long, it has to be a Symbol thing.
16
    pub(crate) identifier: String,
17
    pub(crate) initializer: Option<IntegerLiteral>,
18
}
19

            
20
5
#[derive(PartialEq, Eq, Debug)]
21
pub(crate) struct FuncDecl {
22
    pub(crate) ret_type_specifier: Type,
23
    // TODO(feroldi): This cannot be a string for long, it has to be a Symbol thing.
24
    pub(crate) identifier: String,
25
    pub(crate) parameters: Vec<Param>,
26
}
27

            
28
8
#[derive(PartialEq, Eq, Debug)]
29
pub(crate) struct Param {
30
    pub(crate) type_specifier: Type,
31
    // TODO(feroldi): This cannot be a string for long, it has to be a Symbol thing.
32
    pub(crate) identifier: Option<String>,
33
}
34

            
35
257
#[derive(PartialEq, Eq, Debug)]
36
pub(crate) struct IntegerLiteral {
37
    pub(crate) value: u64,
38
    pub(crate) ty: Type,
39
}
40

            
41
784
#[derive(PartialEq, Eq, Debug)]
42
pub(crate) enum Type {
43
    BuiltinType(BuiltinTypeKind),
44
}
45

            
46
784
#[derive(PartialEq, Eq, Debug)]
47
pub(crate) enum BuiltinTypeKind {
48
    Int,
49
    Long,
50
}