2, consequent: 3, alternate: 0 }, { name: "condition" }, { body: [4] }, { expression: 5 } ], nodes: [ // ノードを type, child, next, parentのみを持つようにして形状を統一 { type: "", child: 0, next: 0, parent: 0 }, { type: "IfStatement", child: 2, next: 0, parent: 0 }, { type: "Identifier", child: 0, next: 3, parent: 1 }, { type: "BlockStatement", child: 4, next: 0, parent: 1 }, { type: "ExpressionStatement", child: 5, next: 0, parent: 3 }, { type: "CallExpression", child: 0, next: 0, parent: 4 } ]}; プロパティの分離 ノードの巡回が簡単になる 1. IfStatement を訪問 2. 子の 2 Identifier を訪問 3. 兄弟の 3 : BlockStatement を訪問 4. 子の 4 ExpressionStatement を訪問