using System.Collections; using System.Collections.Generic; using System.Text.RegularExpressions; using System.Text; using System.Globalization; using Godot; using System; namespace Rokojori; public class ASTWalker:TreeWalker { public static readonly ASTWalker instance = new ASTWalker(); public override ASTNode Parent( ASTNode node ) { return node?.parent; } public override ASTNode ChildAt( ASTNode node, int index ) { if ( node == null || index < 0 || index >= node.children.Count ) { return null; } return node.children[ index ]; } public override int NumChildren( ASTNode node ) { return node?.children.Count ?? 0; } }