evm2term
Version:
Translates from Egg Virtual Machine (JSON) to a summarized AST term
292 lines • 6.35 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": 5,
"name": "print"
},
"args": [
{
"type": "apply",
"operator": {
"type": "property",
"operator": {
"type": "property",
"operator": {
"type": "value",
"value": 4,
"line": 2,
"col": 9,
"length": 1
},
"args": [
{
"type": "value",
"value": "+",
"line": 2,
"col": 11,
"length": 3,
"raw": "\"+\""
}
]
},
"args": [
{
"type": "value",
"value": 5,
"line": 2,
"col": 16,
"length": 1
}
]
},
"args": [
{
"type": "value",
"value": 3,
"line": 2,
"col": 19,
"length": 1
}
]
}
]
},
{
"type": "apply",
"operator": {
"type": "word",
"line": 3,
"col": 3,
"length": 5,
"name": "print"
},
"args": [
{
"type": "apply",
"operator": {
"type": "property",
"operator": {
"type": "property",
"operator": {
"type": "value",
"value": 4,
"line": 3,
"col": 9,
"length": 1
},
"args": [
{
"type": "value",
"value": "+",
"line": 3,
"col": 11,
"length": 1,
"raw": "\"+\""
}
]
},
"args": [
{
"type": "value",
"value": 5,
"line": 3,
"col": 13,
"length": 1
}
]
},
"args": [
{
"type": "value",
"value": 3,
"line": 3,
"col": 16,
"length": 1
}
]
}
]
},
{
"type": "apply",
"operator": {
"type": "word",
"line": 4,
"col": 3,
"length": 5,
"name": "print"
},
"args": [
{
"type": "apply",
"operator": {
"type": "property",
"operator": {
"type": "property",
"operator": {
"type": "value",
"value": 4,
"line": 4,
"col": 9,
"length": 1
},
"args": [
{
"type": "value",
"value": "*",
"line": 4,
"col": 11,
"length": 3,
"raw": "\"*\""
}
]
},
"args": [
{
"type": "value",
"value": 5,
"line": 4,
"col": 16,
"length": 1
}
]
},
"args": [
{
"type": "value",
"value": 3,
"line": 4,
"col": 19,
"length": 1
}
]
}
]
},
{
"type": "apply",
"operator": {
"type": "word",
"line": 5,
"col": 3,
"length": 5,
"name": "print"
},
"args": [
{
"type": "apply",
"operator": {
"type": "property",
"operator": {
"type": "property",
"operator": {
"type": "value",
"value": 6,
"line": 5,
"col": 9,
"length": 1
},
"args": [
{
"type": "value",
"value": "/",
"line": 5,
"col": 11,
"length": 3,
"raw": "\"/\""
}
]
},
"args": [
{
"type": "value",
"value": 2,
"line": 5,
"col": 16,
"length": 1
}
]
},
"args": [
{
"type": "value",
"value": 3,
"line": 5,
"col": 19,
"length": 1
}
]
}
]
},
{
"type": "apply",
"operator": {
"type": "word",
"line": 6,
"col": 3,
"length": 5,
"name": "print"
},
"args": [
{
"type": "apply",
"operator": {
"type": "property",
"operator": {
"type": "property",
"operator": {
"type": "value",
"value": 6,
"line": 6,
"col": 9,
"length": 1
},
"args": [
{
"type": "value",
"value": "-",
"line": 6,
"col": 11,
"length": 3,
"raw": "\"-\""
}
]
},
"args": [
{
"type": "value",
"value": 2,
"line": 6,
"col": 16,
"length": 1
}
]
},
"args": [
{
"type": "value",
"value": 3,
"line": 6,
"col": 19,
"length": 1
}
]
}
]
}
]
}