コード例 #1
0
 internal void AddChildren(TaskInfo[] children)
 {
     foreach (var child in children)
     {
         Children.AddLast(child);
     }
 }
コード例 #2
0
ファイル: TrieNode.cs プロジェクト: maddya/web-crawler
        public TrieNode CreateChild(char c)
        {
            var child = new TrieNode(c);

            Children.AddLast(child);
            return(child);
        }
コード例 #3
0
        public CSharpGenerateType(ICSharpSetting includeSetting, IScope scope, IPath path, string name) : base(includeSetting, scope, path, name, FileExtention)
        {
            Usings     = new CSharpUsings <ICSharpSetting>(includeSetting);
            UsingsNode = Children.AddLast(Usings);

            NameSpace     = new CSharpNameSpace <ICSharpSetting>(includeSetting, scope);
            NameSpaceNode = Children.AddLast(NameSpace);

            TypeDocumentation     = new CSharpDocumentation <ICSharpSetting>(includeSetting);
            TypeDocumentationNode = NameSpace.Children.AddLast(TypeDocumentation);
        }
コード例 #4
0
 private void add(SearchTreeNode <T> node)
 {
     if (node.Father != null)
     {
         node.Father.Remove(node);
     }
     node.Father = this;
     if (Children == null)
     {
         Children = new LinkedList <SearchTreeNode <T> >();
     }
     Children.AddLast(node);
 }
コード例 #5
0
        private void PackageChildFrom(LinkedListNode <Context> current)
        {
            var newChild = new ExpressionContext();

            newChild.Parent = this;
            while (current != null)
            {
                var next = current.Next;
                Children.Remove(current);
                current.Value.Parent = newChild;
                newChild.Children.AddLast(current.Value);

                current = next;
            }
            Children.AddLast(newChild);
        }
コード例 #6
0
        /// <summary>
        /// Adds children to the element.
        /// </summary>
        /// <param name="NewChildren">New children to add.</param>
        public virtual void AddChildren(IEnumerable <MarkdownElement> NewChildren)
        {
            LinkedList <MarkdownElement> Children = this.children as LinkedList <MarkdownElement>;

            if (Children == null)
            {
                Children = new LinkedList <MarkdownElement>();
                foreach (MarkdownElement E in this.children)
                {
                    Children.AddLast(E);
                }
                this.children = Children;
            }

            foreach (MarkdownElement E in NewChildren)
            {
                Children.AddLast(E);
            }
        }
コード例 #7
0
ファイル: UIElement.cs プロジェクト: rumkex/Calcifer
 private void AddChild(UIElement element)
 {
     Children.AddLast(element);
     Invalidate();
 }
コード例 #8
0
 public void AddChild(INode child)
 {
     ((FileTreeNode)child).Parent = this;
     Children.AddLast(child);
 }
コード例 #9
0
ファイル: SceneNode.cs プロジェクト: rumkex/Calcifer
 public void AddChild(SceneNode child)
 {
     Children.AddLast(child);
 }
コード例 #10
0
 public Entity AddChild(Entity entity)
 {
     Children.AddLast(entity);
     entity.Parent = this;
     return(this);
 }
コード例 #11
0
        public override (bool, Context) Evaluate(char previous, string token, char next)
        {
            if (IsListComprehension)
            {
                if (previous == ']')
                {
                    if (Children.Count < 3)
                    {
                        throw new CompileException("Incomplete list comprenehsion");
                    }
                    return(Parent.Evaluate(previous, token, next));
                }
                if (forStatement)
                {
                    if (token.IsWhitespace())
                    {
                        return(true, this);
                    }
                    if (token == "i")
                    {
                        return(false, this);
                    }
                    forStatement = false;
                    if (token == "in")
                    {
                        return(true, RegisterChild(new ExpressionContext(new Regex("^(]|if)$"))));
                    }

                    throw new CompileException($"Unexpected character '{token}' found instead of \"in\" in list comprehension");
                }

                if (previous == 'f')
                {
                    return(RegisterChild(new ConditionalExpressionContext
                                             ("if", true, new Regex("^\\]$"))).Evaluate(previous, token, next));
                }

                if (token.IsWhitespace())
                {
                    return(true, this);
                }

                throw new CompileException("Incomplete list comprenehsion");
            }

            if (expressionComplete)
            {
                expressionComplete = false;
                if (previous == ',')
                {
                }
                else if (previous == ']')
                {
                    return(Parent.Evaluate(previous, token, next));
                }
                else if (previous == 'r')
                {
                    IsListComprehension = true;
                    forStatement        = true;
                    if (!token.IsWhitespace())
                    {
                        throw new CompileException("No space found after for in list comprehension");
                    }
                    return(true, RegisterChild(new IdentifierContext()));
                }
                else
                {
                    throw new CompileException("List declaration incomplete");
                }
            }

            //if (token == "]")
            //{
            //    if(Children.Count != 0) PackageChildren();
            //    if (!packageOnExit)
            //    {
            //        if (Parent is ListDeclarationContext) return (true, Parent);
            //        return (true, Parent.Parent);
            //    }
            //    return PackageToParent();
            //}
            //if (token.IsNewlineOrWhitespace()) return (true, this);

            //if(token == ",")
            //{
            //    if (commaPresent) throw new TokenizationException("Two commas found in a row in list declaration");
            //    if (Children.Count == 0) throw new TokenizationException("No items found before comma");
            //    commaPresent = true;

            //    PackageChildren();

            //    return (true, this);
            //}

            //if (token == "." && next == '.') return (false, this);
            //if(token == "..")
            //{
            //    PackageChildren();
            //    var newChild = new OperatorIdentifierContext();
            //    newChild.Identifier = token;
            //    newChild.Parent = this;
            //    Children.AddLast(newChild);

            //    lastPackaged = lastPackaged.Next;
            //    return (true, this);
            //}

            //commaPresent = false;

            expressionComplete = true;

            var newExpression = new ExpressionContext(new Regex("^(\\]|,|for)$"));

            newExpression.Parent = this;
            Children.AddLast(newExpression);

            return(newExpression.Evaluate(previous, token, next));

            //return ExpressionContext.CheckExpressions(previous, token, next, this, false, new Regex("^\\]$"));
        }