2025-10-13 17:41:07 +11:00
|
|
|
{
|
|
|
|
|
"type": "Program",
|
|
|
|
|
"statements": [
|
|
|
|
|
{
|
2025-10-14 07:14:53 +11:00
|
|
|
"FunctionStatement": {
|
|
|
|
|
"type": "FunctionStatement",
|
2025-10-13 21:05:03 +11:00
|
|
|
"name": {
|
|
|
|
|
"type": "IdentifierLiteral",
|
2025-10-14 07:14:53 +11:00
|
|
|
"value": "main"
|
2025-10-13 21:05:03 +11:00
|
|
|
},
|
2025-10-14 07:14:53 +11:00
|
|
|
"return_type": "Int",
|
|
|
|
|
"parameters": [],
|
|
|
|
|
"body": {
|
|
|
|
|
"type": "BlockStatement",
|
|
|
|
|
"statements": [
|
|
|
|
|
{
|
|
|
|
|
"type": "AssignmentStatement",
|
|
|
|
|
"name": {
|
|
|
|
|
"type": "IdentifierLiteral",
|
|
|
|
|
"value": "x"
|
|
|
|
|
},
|
|
|
|
|
"value": {
|
|
|
|
|
"type": "IntegerLiteral",
|
2025-10-14 19:22:59 +11:00
|
|
|
"value": 0
|
2025-10-14 07:14:53 +11:00
|
|
|
},
|
|
|
|
|
"value_type": "Int"
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-10-14 19:22:59 +11:00
|
|
|
"type": "ReassignStatement",
|
|
|
|
|
"ident": {
|
|
|
|
|
"type": "IdentifierLiteral",
|
|
|
|
|
"value": "x"
|
|
|
|
|
},
|
|
|
|
|
"right_value": {
|
2025-10-14 07:14:53 +11:00
|
|
|
"type": "InfixExpression",
|
|
|
|
|
"left_node": {
|
|
|
|
|
"type": "IdentifierLiteral",
|
|
|
|
|
"value": "x"
|
|
|
|
|
},
|
2025-10-14 19:22:59 +11:00
|
|
|
"operator": "*",
|
2025-10-14 07:14:53 +11:00
|
|
|
"right_node": {
|
|
|
|
|
"type": "IntegerLiteral",
|
2025-10-14 19:22:59 +11:00
|
|
|
"value": 2
|
2025-10-14 07:14:53 +11:00
|
|
|
}
|
|
|
|
|
}
|
2025-10-14 19:22:59 +11:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "ReturnStatement",
|
|
|
|
|
"return_value": {
|
|
|
|
|
"type": "IdentifierLiteral",
|
|
|
|
|
"value": "x"
|
|
|
|
|
}
|
2025-10-14 07:14:53 +11:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
2025-10-13 17:41:07 +11:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|