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.
ChocoPy/pa1-tests/core/global.py.ast

63 lines
1.3 KiB

{
"kind" : "Program",
"location" : [ 1, 1, 5, 9 ],
"declarations" : [ {
"kind" : "VarDef",
"location" : [ 1, 1, 1, 9 ],
"var" : {
"kind" : "TypedVar",
"location" : [ 1, 1, 1, 5 ],
"identifier" : {
"kind" : "Identifier",
"location" : [ 1, 1, 1, 1 ],
"name" : "x"
},
"type" : {
"kind" : "ClassType",
"location" : [ 1, 3, 1, 5 ],
"className" : "int"
}
},
"value" : {
"kind" : "IntegerLiteral",
"location" : [ 1, 9, 1, 9 ],
"value" : 1
}
} ],
"statements" : [ {
"kind" : "AssignStmt",
"location" : [ 3, 1, 3, 5 ],
"targets" : [ {
"kind" : "Identifier",
"location" : [ 3, 1, 3, 1 ],
"name" : "x"
} ],
"value" : {
"kind" : "IntegerLiteral",
"location" : [ 3, 5, 3, 5 ],
"value" : 2
}
}, {
"kind" : "ExprStmt",
"location" : [ 5, 1, 5, 8 ],
"expr" : {
"kind" : "CallExpr",
"location" : [ 5, 1, 5, 8 ],
"function" : {
"kind" : "Identifier",
"location" : [ 5, 1, 5, 5 ],
"name" : "print"
},
"args" : [ {
"kind" : "Identifier",
"location" : [ 5, 7, 5, 7 ],
"name" : "x"
} ]
}
} ],
"errors" : {
"errors" : [ ],
"kind" : "Errors",
"location" : [ 0, 0, 0, 0 ]
}
}