diff options
Diffstat (limited to 'pc-thing/the_e_programming_language/ast.json')
-rw-r--r-- | pc-thing/the_e_programming_language/ast.json | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/pc-thing/the_e_programming_language/ast.json b/pc-thing/the_e_programming_language/ast.json new file mode 100644 index 0000000..faf9b67 --- /dev/null +++ b/pc-thing/the_e_programming_language/ast.json @@ -0,0 +1,79 @@ +[ + { + "type": "VariableDeclaration", + "identifier": "buff", + "value": { + "type": "Number", + "value": 0 + }, + "vtype": "int", + "length": 4 + }, + { + "type": "VariableDeclaration", + "identifier": "counter", + "value": { + "type": "Number", + "value": 0 + }, + "vtype": "int", + "length": 1 + }, + { + "type": "FunctionDeclaration", + "name": "_start", + "body": [ + { + "type": "While", + "condition": { + "type": "BinaryExpression", + "operator": "<", + "left": { + "type": "Identifier", + "name": "counter" + }, + "right": { + "type": "Number", + "value": 4 + } + }, + "branch": [ + { + "type": "Assignment", + "identifier": { + "type": "Identifier", + "name": "buff", + "offset": { + "type": "Identifier", + "name": "counter" + } + }, + "value": { + "type": "Identifier", + "name": "counter" + } + }, + { + "type": "Assignment", + "identifier": { + "type": "Identifier", + "name": "counter" + }, + "value": { + "type": "BinaryExpression", + "operator": "+", + "left": { + "type": "Identifier", + "name": "counter" + }, + "right": { + "type": "Number", + "value": 1 + } + } + } + ] + } + ] + } +] \ No newline at end of file |