You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
4.3 KiB
97 lines
4.3 KiB
CompUnit {
|
|
items: [
|
|
FuncDef(
|
|
FuncDef {
|
|
typ: Int,
|
|
id: "main",
|
|
params: [],
|
|
block: Block {
|
|
items: [
|
|
Decl(
|
|
VarDecl(
|
|
VarDecl {
|
|
typ: Int,
|
|
defs: [
|
|
VarDef {
|
|
id: "a",
|
|
init: Some(
|
|
Exp(
|
|
Exp {
|
|
kind: Const(
|
|
Int(
|
|
1,
|
|
),
|
|
),
|
|
typ: Some(
|
|
Int,
|
|
),
|
|
},
|
|
),
|
|
),
|
|
},
|
|
],
|
|
},
|
|
),
|
|
),
|
|
Decl(
|
|
VarDecl(
|
|
VarDecl {
|
|
typ: Int,
|
|
defs: [
|
|
VarDef {
|
|
id: "b",
|
|
init: Some(
|
|
Exp(
|
|
Exp {
|
|
kind: Const(
|
|
Int(
|
|
2,
|
|
),
|
|
),
|
|
typ: Some(
|
|
Int,
|
|
),
|
|
},
|
|
),
|
|
),
|
|
},
|
|
],
|
|
},
|
|
),
|
|
),
|
|
Stmt(
|
|
Return(
|
|
Return {
|
|
exp: Some(
|
|
Exp {
|
|
kind: Binary(
|
|
Add,
|
|
Exp {
|
|
kind: LVal(
|
|
LVal {
|
|
id: "a",
|
|
},
|
|
),
|
|
typ: None,
|
|
},
|
|
Exp {
|
|
kind: LVal(
|
|
LVal {
|
|
id: "b",
|
|
},
|
|
),
|
|
typ: None,
|
|
},
|
|
),
|
|
typ: None,
|
|
},
|
|
),
|
|
},
|
|
),
|
|
),
|
|
],
|
|
},
|
|
},
|
|
),
|
|
],
|
|
} |