Beispiel #1
0
        private static WildcardNode CreateWithType(WildcardNode.WildcardType type, bool invert = false)
        {
            var node = new WildcardNode();

            node.InputType.Value       = type;
            node.InputInvert.IsChecked = invert;
            return(node);
        }
        protected internal override void VisitWildcard(WildcardNode node)
        {
            if (fail)
            {
                throw new PatternException($"Found consecutive '{Constants.Wildcard}' which is invalid.");
            }

            fail = true;
        }
Beispiel #3
0
        protected internal override void VisitWildcard(WildcardNode node)
        {
            if (fail)
            {
                throw new PatternException($"The wild-card character '{Constants.Wildcard}' cannot not follow a variable.");
            }

            base.VisitWildcard(node);
        }
Beispiel #4
0
        public override NodeAsset GenerateData()
        {
            WildcardNode data = new WildcardNode();

            if (data != null)
            {
                data.Name  = NameField.value;
                data.Speed = _speedField.value;
            }

            return(new NodeAsset {
                Data = data
            });
        }
Beispiel #5
0
        public void VisitWildcardSegmentNode(WildcardNode node, GlobVisitorContext context)
        {
            var path = context.FileSystem.GetDirectory(context.Path);

            if (context.FileSystem.Exist(path.Path))
            {
                foreach (var candidate in FindCandidates(path.Path, node, context, SearchScope.Current))
                {
                    context.Push(candidate.Path.FullPath.Substring(path.Path.FullPath.Length + 1));
                    if (node.Next != null)
                    {
                        node.Next.Accept(this, context);
                    }
                    else
                    {
                        context.AddResult(candidate);
                    }
                    context.Pop();
                }
            }
        }
 protected internal virtual void VisitWildcard(WildcardNode node)
 {
     VisitLeaf(node);
 }