evm2term
Version:
Translates from Egg Virtual Machine (JSON) to a summarized AST term
157 lines • 3.22 kB
JSON
{
"type": "apply",
"operator": {
"type": "word",
"line": 1,
"col": 1,
"length": 2,
"name": "do"
},
"args": [
{
"type": "apply",
"operator": {
"type": "word",
"line": 2,
"col": 3,
"length": 3,
"name": "def"
},
"args": [
{
"type": "word",
"line": 2,
"col": 8,
"length": 1,
"name": "x"
},
{
"type": "apply",
"operator": {
"type": "word",
"length": 5,
"name": "array"
},
"args": [
{
"type": "apply",
"operator": {
"type": "word",
"line": 2,
"col": 13,
"length": 5,
"name": "array"
},
"args": [
{
"type": "value",
"value": 1,
"line": 2,
"col": 13,
"length": 1
},
{
"type": "value",
"value": 2,
"line": 2,
"col": 15,
"length": 1
}
]
},
{
"type": "apply",
"operator": {
"type": "word",
"line": 2,
"col": 19,
"length": 5,
"name": "array"
},
"args": [
{
"type": "value",
"value": 3,
"line": 2,
"col": 19,
"length": 1
},
{
"type": "value",
"value": 4,
"line": 2,
"col": 21,
"length": 1
}
]
}
]
}
]
},
{
"type": "apply",
"operator": {
"type": "word",
"line": 3,
"col": 3,
"length": 1,
"name": "="
},
"args": [
{
"type": "apply",
"operator": {
"type": "word",
"line": 3,
"col": 6,
"length": 5,
"name": "array"
},
"args": [
{
"type": "word",
"line": 3,
"col": 6,
"length": 1,
"name": "x"
},
{
"type": "value",
"value": 0,
"line": 3,
"col": 9,
"length": 1
}
]
},
{
"type": "value",
"value": 9,
"line": 3,
"col": 12,
"length": 1
}
]
},
{
"type": "apply",
"operator": {
"type": "word",
"line": 4,
"col": 3,
"length": 5,
"name": "print"
},
"args": [
{
"type": "word",
"line": 4,
"col": 9,
"length": 1,
"name": "x"
}
]
}
]
}