summary refs log tree commit diff
path: root/pc-thing/the_e_programming_language/ast.json
diff options
context:
space:
mode:
authorWlodekM <[email protected]>2025-03-31 19:47:54 +0300
committerWlodekM <[email protected]>2025-03-31 19:47:54 +0300
commitcccb99226d3951fd9dfe1c4cf1c43126a1309d51 (patch)
tree518d3e965558ba313f103cee6161cd2b6aedb3b9 /pc-thing/the_e_programming_language/ast.json
parentef4e8c20719822eebd6318a878cc37902c2b85a5 (diff)
move to pc-thing/
Diffstat (limited to 'pc-thing/the_e_programming_language/ast.json')
-rw-r--r--pc-thing/the_e_programming_language/ast.json79
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