示例#1
0
        //internals
        public object transform(object parent, IndentationNode node, Scope scope)
        {
            foreach (var matcher in _matchers)
            {
                var result = matcher.transform(node, parent, scope);
                if (result != null)
                {
                    return(result);
                }
            }

            return(null);
        }
示例#2
0
            public object transform(IndentationNode node, object parent, Scope scope)
            {
                var result = Match(node.Value, parent, scope);

                if (result == null)
                {
                    return(result);
                }

                if (Children != null)
                {
                    foreach (var child in node.Children)
                    {
                        Children.transform(result, child, scope);
                    }
                }

                return(result);
            }
示例#3
0
 public void AddChild(IndentationNode result)
 {
     ((List <IndentationNode>)Children).Add(result);
 }
示例#4
0
 public IndentationNode(IndentationNode parent, int depth)
 {
     Parent   = parent;
     Depth    = depth;
     Children = new List <IndentationNode>();
 }