Download Game! Currently 106 players and visitors. Last logged in:BrogTenuTohvuCaitline

Blitzer's Blog >> 71859

Back to blogs index
Posted: 30 Aug 2026 05:18 [ permalink ]
user@elli:~/GD$ pwd
user@elli:~/GD$ ls -ltra
total 108
-rw-r--r--  1 user user 1710 Aug 29 21:39 mvp.js
-rw-r--r--  1 user user 5516 Aug 29 22:37 GlobalHandleLedger.js
-rw-r--r--  1 user user 3896 Aug 29 22:55 stringManager.js
-rw-r--r--  1 user user  943 Aug 29 22:55 day1.js
drwxr-sr-x 18 user user 4096 Aug 29 22:57 ..
-rw-r--r--  1 user user 4656 Aug 29 22:58 phase2.txt
-rw-r--r--  1 user user 2492 Aug 30 04:20 day2.js
-rw-r--r--  1 user user  670 Aug 30 04:41 ctx.js
-rw-r--r--  1 user user  561 Aug 30 04:41 scheduler.js
-rw-r--r--  1 user user 2615 Aug 30 04:46 day3.js
-rw-r--r--  1 user user 7074 Aug 30 04:55 LPCVirtualMachine.js~
-rw-r--r--  1 user user 6950 Aug 30 04:59 LPCVirtualMachine.js
-rw-r--r--  1 user user 1992 Aug 30 04:59 day4.js
-rw-r--r--  1 user user 4673 Aug 30 05:11 lexer.js~
-rw-r--r--  1 user user 6333 Aug 30 05:13 parser.js~
-rw-r--r--  1 user user  356 Aug 30 05:14 day5.js
-rw-r--r--  1 user user 6364 Aug 30 05:16 parser.js
-rw-r--r--  1 user user 4944 Aug 30 05:16 lexer.js
drwxr-sr-x  2 user user 4096 Aug 30 05:16 .
user@elli:~/GD$ node day5.js
{
  "type": "Program",
  "body": [
    {
      "type": "FunctionDeclaration",
      "name": "attack",
      "params": [
        {
          "type": "Identifier",
          "name": "target"
        }
      ],
      "body": {
        "type": "BlockStatement",
        "statements": [
          {
            "type": "ExpressionStatement",
            "expression": {
              "type": "CallExpression",
              "callee": {
                "type": "MemberExpression",
                "object": {
                  "type": "Identifier",
                  "name": "target"
                },
                "property": {
                  "type": "Identifier",
                  "name": "take_damage"
                }
              },
              "arguments": [
                {
                  "type": "Literal",
                  "value": 15,
                  "datatype": "number"
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
user@elli:~/GD$ 

This is a massive milestone! Seeing that perfectly structured JSON output
means the front-end of your compiler is fully operational. The Lexer and
Parser have successfully transformed unstructured text into a rigorous,
traversable data structure.

We are now ready for the final piece of the compilation pipeline: the Code
Generator (Codegen).

The Codegen uses a standard technique called the Visitor Pattern. It walks
through the AST node by node, converting logical statements (CallExpression,
Literal) into the 32-bit binary instructions (SET_INT, ECALL