Exemplo n.º 1
0
        public static IServiceCollection AddPattern(this IServiceCollection services, Action <PatternBuilder> builderSetup = null)
        {
            var builder = new PatternBuilder(services);

            builderSetup?.Invoke(builder);

            services.AddScoped <ICommandProcessor>(provider => new CommandProcessor(provider, builder.Routes.CommandRoutes));
            services.AddScoped <IEventProcessor>(provider => new EventProcessor(provider, builder.Routes.EventRoutes));
            services.AddScoped <IQueryProcessor>(provider => new QueryProcessor(provider, builder.Routes.QueryRoutes));

            var handlerTypes = new List <Type>();

            handlerTypes.AddRange(builder.Routes.CommandRoutes.Select(x => x.HandlerType));
            handlerTypes.AddRange(builder.Routes.EventRoutes.Select(x => x.HandlerType));
            handlerTypes.AddRange(builder.Routes.QueryRoutes.Select(x => x.HandlerType));

            foreach (var handlerType in handlerTypes.Distinct())
            {
                services.AddScoped(handlerType);
            }

            services.TryAddSingleton <IEventLogStore, EventLogStore>();
            services.TryAddScoped <IEventPublisher, EventPublisher>();
            services.TryAddScoped <IEventStore, EventStore>();

            return(services);
        }
Exemplo n.º 2
0
        Regex CreateHighlightingRegex(IcuRegexOptions options)
        {
            var pb = new PatternBuilder( );

            pb.Add(@"\(\?\#.*?(\)|$)");               // comment

            if (options.UREGEX_COMMENTS)
            {
                pb.Add(@"\#.*?(\n|$)");                            // line-comment
            }
            pb.Add(@"\\Q.*?(\\E|$)");                              // quoted part

            pb.Add(@"(?'left_par'\()");                            // '('
            pb.Add(@"(?'right_par'\))");                           // ')'
            pb.Add(@"\\[NpPx]\{.*?(\}|$)");                        // (skip)
            pb.Add(@"(?'left_brace'\{).*?((?'right_brace'\})|$)"); // '{...}'

            string posix_bracket = @"(\[:.*?(:\]|$))";             // [:...:]

            pb.Add($@"
						(?'left_bracket'\[)
						\]?
						(?> {posix_bracket} | (?'left_bracket'\[)(?<c>) | (\\. | [^\[\]])+ | (?'right_bracket'\])(?<-c>))*
						(?(c)(?!))
						(?'right_bracket'\])?
						|
						(?'right_bracket'\])
						"                        );

            pb.Add(@"\\.");               // '\...'

            return(pb.ToRegex( ));
        }
Exemplo n.º 3
0
        private IRuleDefinition ChildCOnessionEligibility()
        {
            var builder = new NRules.RuleModel.Builders.RuleBuilder();

            builder.Name("Child Concession Elgibility Rule");

            PatternBuilder      passengerPattern   = builder.LeftHandSide().Pattern(typeof(Passenger), "passenger");
            ParameterExpression passengerParameter = passengerPattern.Declaration.ToParameterExpression();
            var passengerCondition = Expression.Lambda(
                Expression.LessThan(
                    Expression.Property(passengerParameter, "Age"),
                    Expression.Constant(6)),
                passengerParameter);

            passengerPattern.Condition(passengerCondition);

            //Expression<Action<IContext, Passenger>> action =
            //    (ctx, customer, order) => Console.WriteLine("Customer {0} has an order in amount of ${1}", customer.Name, order.Amount);
            //Added
            Expression <Action <IContext, Passenger> > action =
                (ctx, passenger) => ctx.Insert($"Passenger : {passenger.Name} is eligible for child concession.");

            builder.RightHandSide().Action(action);

            return(builder.Build());
        }
Exemplo n.º 4
0
        static Regex CreateHighlightingRegex(GrammarEnum grammar)
        {
            var pb = new PatternBuilder( );

            if (grammar == GrammarEnum.extended ||
                grammar == GrammarEnum.ECMAScript ||
                grammar == GrammarEnum.egrep ||
                grammar == GrammarEnum.awk)
            {
                pb.Add(@"(?'left_par'\()");                            // '('
                pb.Add(@"(?'right_par'\))");                           // ')'
                pb.Add(@"(?'left_brace'\{).*?((?'right_brace'\})|$)"); // '{...}'
            }

            if (grammar == GrammarEnum.basic ||
                grammar == GrammarEnum.grep)
            {
                pb.Add(@"(?'left_par'\\\()");                            // '\)'
                pb.Add(@"(?'right_par'\\\))");                           // '\('
                pb.Add(@"(?'left_brace'\\{).*?((?'right_brace'\\})|$)"); // '\{...\}'
            }

            pb.Add(@"((?'left_bracket'\[) ((\[:.*? (:\]|$)) | \\. | .)*? ((?'right_bracket'\])|$) )"); // [...]
            pb.Add(@"\\.");                                                                            // '\...'

            return(pb.ToRegex( ));
        }
Exemplo n.º 5
0
        internal string ToString(PatternSettings settings, RegexOptions options)
        {
            var builder = new PatternBuilder(settings, options);

            builder.Append(this);
            return(builder.ToString());
        }
Exemplo n.º 6
0
        public static LambdaExpression DslPatternExpression(this PatternBuilder builder, IEnumerable <Declaration> declarations, LambdaExpression expression)
        {
            var rewriter            = new PatternExpressionRewriter(builder.Declaration, declarations);
            var rewrittenExpression = rewriter.Rewrite(expression);

            return(rewrittenExpression);
        }
        public void SplitAtAllAnchors_Empty()
        {
            var pattern  = new PatternBuilder().Build();
            var patterns = pattern.SplitAtAllAnchors();

            CollectionAssert.IsEmpty(patterns, "Pattern splitted incorrectly.");
        }
Exemplo n.º 8
0
        /// <summary>
        /// Build the longbarge pattern.
        /// </summary>
        protected override void Build()
        {
            var line = new DiagonalLine(4);

            PatternBuilder.Place(line, Cells, 0, 1);
            PatternBuilder.Place(line, Cells, 1, 0);
        }
Exemplo n.º 9
0
        public void Chord_Interval()
        {
            var defaultNoteLength = MusicalTimeSpan.Quarter;
            var defaultVelocity   = (SevenBitNumber)90;

            var pattern = new PatternBuilder()
                          .SetNoteLength(defaultNoteLength)
                          .SetVelocity(defaultVelocity)
                          .SetRootNote(Notes.CSharp5)

                          .Chord(new[] { Interval.Two, Interval.Five }, Notes.A2)
                          .Chord(new[] { Interval.Two, -Interval.Ten }, Notes.B2)

                          .Build();

            PatternTestUtilities.TestNotes(pattern, new[]
            {
                new NoteInfo(NoteName.A, 2, null, defaultNoteLength, defaultVelocity),
                new NoteInfo(NoteName.B, 2, null, defaultNoteLength, defaultVelocity),
                new NoteInfo(NoteName.D, 3, null, defaultNoteLength, defaultVelocity),

                new NoteInfo(NoteName.B, 2, defaultNoteLength, defaultNoteLength, defaultVelocity),
                new NoteInfo(NoteName.CSharp, 3, defaultNoteLength, defaultNoteLength, defaultVelocity),
                new NoteInfo(NoteName.CSharp, 2, defaultNoteLength, defaultNoteLength, defaultVelocity),
            });
        }
        public void CombineInParallel_No_Final_Move()
        {
            var pattern1 = new PatternBuilder()
                           .Note(Notes.DSharp2)
                           .Build();

            var noteLength = MusicalTimeSpan.Sixteenth;
            var pattern2   = new PatternBuilder()
                             .SetNoteLength(noteLength)
                             .Note(Notes.A4)
                             .Note(Notes.ASharp4)
                             .Build();

            var parallelPatterns = new[] { pattern1, pattern2 }.CombineInParallel();

            var pattern = new PatternBuilder()
                          .Pattern(parallelPatterns)
                          .Note(Notes.C4) // <-- this note should play AFTER the end of the parallel patterns
                          .Build();

            PatternTestUtilities.TestNotes(pattern, new[]
            {
                new NoteInfo(NoteName.DSharp, 2, null, PatternBuilder.DefaultNoteLength),

                new NoteInfo(NoteName.A, 4, null, noteLength),
                new NoteInfo(NoteName.ASharp, 4, noteLength, noteLength),

                new NoteInfo(NoteName.C, 4, noteLength * 2, PatternBuilder.DefaultNoteLength),
            });
        }
Exemplo n.º 11
0
        public void BuildLinearPatternNegative(string sample)
        {
            var builder = new PatternBuilder();
            var pattern = builder.Build(sample) as ILinearPattern;

            Assert.Null(pattern);
        }
Exemplo n.º 12
0
        /// <summary>
        /// Build the longship pattern.
        /// </summary>
        protected override void Build()
        {
            var longboat = new Longboat();

            PatternBuilder.Place(longboat, Cells, 0, 0);
            Cells[0, 0] = true;
        }
Exemplo n.º 13
0
        public void TransformChords_Selection_SelectAll()
        {
            var noteLength = MusicalTimeSpan.Eighth;
            var velocity   = (SevenBitNumber)90;

            var pattern = new PatternBuilder()
                          .SetNoteLength(noteLength)
                          .SetVelocity(velocity)
                          .Chord(new[] { Notes.A0, Notes.CSharp2 })
                          .Chord(new[] { Notes.B2, Notes.B3, Notes.B4 })
                          .Build();

            pattern = pattern.TransformChords(
                (i, d) => true,
                d => new ChordDescriptor(
                    new[] { Notes.A2 },
                    SevenBitNumber.MinValue,
                    MusicalTimeSpan.Half));

            PatternTestUtilities.TestNotes(pattern, new[]
            {
                new NoteInfo(NoteName.A, 2, null, MusicalTimeSpan.Half, SevenBitNumber.MinValue),
                new NoteInfo(NoteName.A, 2, MusicalTimeSpan.Half, MusicalTimeSpan.Half, SevenBitNumber.MinValue),
            });
        }
Exemplo n.º 14
0
        public void TransformChords_Changed()
        {
            var noteLength = MusicalTimeSpan.Eighth;
            var velocity   = (SevenBitNumber)90;

            var pattern = new PatternBuilder()
                          .SetNoteLength(noteLength)
                          .SetVelocity(velocity)
                          .Chord(new[] { Notes.A0, Notes.CSharp2 })
                          .Chord(new[] { Notes.B2, Notes.B3, Notes.B4 })
                          .Build();

            pattern = pattern.TransformChords(d => new ChordDescriptor(
                                                  d.Notes.Count() == 2 ? d.Notes.Select(n => n.Transpose(Interval.Two)) : d.Notes.Select(n => n.Transpose(-Interval.Three)),
                                                  (SevenBitNumber)(d.Velocity - 10),
                                                  d.Length.Subtract(MusicalTimeSpan.ThirtySecond, TimeSpanMode.LengthLength)));

            PatternTestUtilities.TestNotes(pattern, new[]
            {
                new NoteInfo(NoteName.B, 0, null, 3 * MusicalTimeSpan.ThirtySecond, (SevenBitNumber)80),
                new NoteInfo(NoteName.DSharp, 2, null, 3 * MusicalTimeSpan.ThirtySecond, (SevenBitNumber)80),

                new NoteInfo(NoteName.GSharp, 2, 3 * MusicalTimeSpan.ThirtySecond, 3 * MusicalTimeSpan.ThirtySecond, (SevenBitNumber)80),
                new NoteInfo(NoteName.GSharp, 3, 3 * MusicalTimeSpan.ThirtySecond, 3 * MusicalTimeSpan.ThirtySecond, (SevenBitNumber)80),
                new NoteInfo(NoteName.GSharp, 4, 3 * MusicalTimeSpan.ThirtySecond, 3 * MusicalTimeSpan.ThirtySecond, (SevenBitNumber)80)
            });
        }
Exemplo n.º 15
0
        public void TransformChords_Changed_Pattern_NonRecursive()
        {
            var noteLength = (MidiTimeSpan)200;
            var velocity   = (SevenBitNumber)90;

            var subPattern = new PatternBuilder()
                             .Chord(new[] { Notes.A0, Notes.CSharp2 })
                             .Build();

            var pattern = new PatternBuilder()
                          .SetNoteLength(noteLength)
                          .SetVelocity(velocity)
                          .Chord(new[] { Notes.A2, Notes.C3 })
                          .Pattern(subPattern)
                          .Build();

            pattern = pattern.TransformChords(d => new ChordDescriptor(
                                                  d.Notes.Select(n => n.Transpose(Interval.One)),
                                                  (SevenBitNumber)65,
                                                  (MidiTimeSpan)100),
                                              recursive: false);

            PatternTestUtilities.TestNotes(pattern, new[]
            {
                new NoteInfo(NoteName.ASharp, 2, null, (MidiTimeSpan)100, (SevenBitNumber)65),
                new NoteInfo(NoteName.CSharp, 3, null, (MidiTimeSpan)100, (SevenBitNumber)65),

                new NoteInfo(NoteName.A, 0, new MidiTimeSpan(100), PatternBuilder.DefaultNoteLength),
                new NoteInfo(NoteName.CSharp, 2, new MidiTimeSpan(100), PatternBuilder.DefaultNoteLength)
            });
        }
Exemplo n.º 16
0
        public void SplitAtMarker_MultipleMarkers_OrdinalIgnoreCase()
        {
            var marker1 = "A";
            var marker2 = "a";

            var pattern = new PatternBuilder()
                          .Marker(marker1)
                          .Note(Notes.FSharp4)
                          .Note(Notes.DSharp1)
                          .Marker(marker2)
                          .Note(Notes.DSharp0)
                          .Marker(marker1)
                          .Build();

            var patterns = pattern.SplitAtMarker(marker1, true, System.StringComparison.OrdinalIgnoreCase).ToList();

            Assert.AreEqual(2, patterns.Count, "Sub-patterns count is invalid.");

            PatternTestUtilities.TestNotes(patterns[0], new[]
            {
                new NoteInfo(NoteName.FSharp, 4, null, PatternBuilder.DefaultNoteLength),
                new NoteInfo(NoteName.DSharp, 1, PatternBuilder.DefaultNoteLength, PatternBuilder.DefaultNoteLength)
            });

            PatternTestUtilities.TestNotes(patterns[1], new[]
            {
                new NoteInfo(NoteName.DSharp, 0, null, PatternBuilder.DefaultNoteLength)
            });
        }
Exemplo n.º 17
0
        // Name TestRule
        // When
        //    Customer name is John Do
        //    And this customer has an order in the amount > $100
        //Then
        //    Print customer's name and order amount
        private IRuleDefinition BuildRule()
        {
            //Create rule builder
            var builder = new RuleBuilder();

            builder.Name("TestRule");

            //Build conditions
            PatternBuilder customerPattern = builder.LeftHandSide().Pattern(typeof(Customer), "customer");
            Expression <Func <Customer, bool> > customerCondition =
                customer => customer.Name == "John Do";

            customerPattern.Condition(customerCondition);

            PatternBuilder orderPattern = builder.LeftHandSide().Pattern(typeof(Order), "order");
            Expression <Func <Order, Customer, bool> > orderCondition1 =
                (order, customer) => order.Customer == customer;
            Expression <Func <Order, bool> > orderCondition2 =
                order => order.Amount > 100.00m;

            orderPattern.Condition(orderCondition1);
            orderPattern.Condition(orderCondition2);

            // Build actions
            Expression <Action <IContext, Customer, Order> > action =
                (ctx, customer, order) => Console.WriteLine("Customer {0} has an order in amount of ${1}", customer.Name, order.Amount);

            builder.RightHandSide().Action(action);

            //Build rule model
            return(builder.Build());
        }
Exemplo n.º 18
0
        public TransformData(ILogger <TransformData> logger, AsyncActionSubscriptionFactory subscriptionFactory, PublisherFactory publisherFactory)
        {
            if (logger is null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            if (subscriptionFactory is null)
            {
                throw new ArgumentNullException(nameof(subscriptionFactory));
            }

            if (publisherFactory is null)
            {
                throw new ArgumentNullException(nameof(publisherFactory));
            }

            var pattern = new PatternBuilder("playground")
                          .With("data")
                          .With("rng")
                          .Build();

            this.subscription = subscriptionFactory.Create(pattern, this.TransformAsync);
            this.publisher    = publisherFactory.Create();
            this.logger       = logger;
        }
Exemplo n.º 19
0
        public void PredictReturnsCorrectResult(string patternString, string[] pushDirectory, string expectSegment, bool expectWildcard)
        {
            var builder = new PatternBuilder();
            var pattern = builder.Build(patternString) as IRaggedPattern;

            Assert.NotNull(pattern);

            var context = new PatternContextRaggedInclude(pattern);

            PatternContextHelper.PushDirectory(context, pushDirectory);

            context.Declare((segment, last) =>
            {
                if (expectSegment != null)
                {
                    var mockSegment = segment as LiteralPathSegment;

                    Assert.NotNull(mockSegment);
                    Assert.Equal(false, last);
                    Assert.Equal(expectSegment, mockSegment.Value);
                }
                else
                {
                    Assert.Equal(Microsoft.Framework.FileSystemGlobbing.Internal.PathSegments.WildcardPathSegment.MatchAll, segment);
                }
            });
        }
Exemplo n.º 20
0
        /// <summary>
        /// Returns the text representation of this instance.
        /// </summary>
        public override string ToString()
        {
            var builder = new PatternBuilder();

            AppendContentTo(builder);
            return(builder.ToString());
        }
Exemplo n.º 21
0
        public void Chord_DefaultOctave()
        {
            var defaultVelocity = (SevenBitNumber)90;
            var defaultOctave   = Octave.Get(2);

            var chordLength = MusicalTimeSpan.Sixteenth.Triplet();
            var chordTime1  = new MetricTimeSpan(0, 1, 12);
            var chordTime2  = chordTime1.Add(chordLength, TimeSpanMode.TimeLength);

            var pattern = new PatternBuilder()
                          .SetVelocity(defaultVelocity)
                          .SetOctave(defaultOctave)

                          .MoveToTime(chordTime1)
                          .Chord(new[]
            {
                NoteName.C,
                NoteName.G
            }, chordLength)
                          .Repeat()

                          .Build();

            PatternTestUtilities.TestNotes(pattern, new[]
            {
                new NoteInfo(NoteName.C, defaultOctave.Number, chordTime1, chordLength, defaultVelocity),
                new NoteInfo(NoteName.G, defaultOctave.Number, chordTime1, chordLength, defaultVelocity),
                new NoteInfo(NoteName.C, defaultOctave.Number, chordTime2, chordLength, defaultVelocity),
                new NoteInfo(NoteName.G, defaultOctave.Number, chordTime2, chordLength, defaultVelocity)
            });
        }
Exemplo n.º 22
0
        public void BuildFromPattern_Empty()
        {
            var pattern1 = new PatternBuilder().Build();
            var pattern2 = new PatternBuilder(pattern1).Build();

            CollectionAssert.IsEmpty(pattern2.Actions, "Pattern is not empty.");
        }
Exemplo n.º 23
0
        public void SplitAtMarker_Empty()
        {
            var pattern  = new PatternBuilder().Build();
            var patterns = pattern.SplitAtMarker("A");

            CollectionAssert.IsEmpty(patterns, "Pattern split incorrectly.");
        }
Exemplo n.º 24
0
        private static void CheckNotesPlayback(Func <IEnumerable <Note>, TempoMap, OutputDevice, Playback> playbackGetter,
                                               Func <FourBitNumber, IEnumerable <MidiEvent> > programEventsGetter)
        {
            var tempoMap = TempoMap.Default;
            var channel1 = (FourBitNumber)5;
            var channel2 = (FourBitNumber)7;

            var notes1 = new PatternBuilder()
                         .Note(DryWetMidi.MusicTheory.NoteName.A, new MetricTimeSpan(0, 0, 5))
                         .MoveToTime(new MetricTimeSpan(0, 0, 1))
                         .Note(DryWetMidi.MusicTheory.NoteName.B, new MetricTimeSpan(0, 0, 1))
                         .Note(DryWetMidi.MusicTheory.NoteName.C, new MetricTimeSpan(0, 0, 1))
                         .Build()
                         .ToTrackChunk(tempoMap, channel1)
                         .GetNotes();
            var notes2 = new PatternBuilder()
                         .StepForward(new MetricTimeSpan(0, 0, 2))
                         .Note(DryWetMidi.MusicTheory.NoteName.D, new MetricTimeSpan(0, 0, 5))
                         .Build()
                         .ToTrackChunk(tempoMap, channel2)
                         .GetNotes();
            var notes = notes1.Concat(notes2).ToList();

            CheckNotesPlayback(notes, (m, d) => playbackGetter(notes, m, d), programEventsGetter);
        }
 public ReplacementBuilderAndSugarEstimatorFacadeImpl(PatternBuilder patternBuilder,
     ReplacementBuilder replacementBuilder, SugarEstimator sugarEstimator)
 {
     this.patternBuilder = patternBuilder;
     this.replacementBuilder = replacementBuilder;
     this.sugarEstimator = sugarEstimator;
 }
Exemplo n.º 26
0
        Regex CreateHighlightingRegex(DRegexOptions options)
        {
            var pb = new PatternBuilder( );

            pb.Add(@"\(\?\#.*?(\)|$)");                                              // inline comment

            pb.Add(@"(?'left_par'\()");                                              // '('
            pb.Add(@"(?'right_par'\))");                                             // ')'

            pb.Add(@"\\[pP]\{.*?(\} | $)");                                          // property

            pb.Add(@"(?'left_brace'\{) (\d+(,\d*)? | ,\d+) ((?'right_brace'\})|$)"); // '{...}'

            string posix_bracket = "";                                               // Not supported: @"(\[:.*?(:\]|$))"; // [:...:]

            pb.Add($@"
						(?'left_bracket'\[)
						\]?
						(?> {posix_bracket}{( posix_bracket.Length == 0 ? "" : " |" )} (?'left_bracket'\[)(?<c>) | (\\. | [^\[\]])+ | (?'right_bracket'\])(?<-c>))*
						(?(c)(?!))
						(?'right_bracket'\])?
						|
						(?'right_bracket'\])
						"                        );

            pb.Add(@"\\.");               // '\...'

            return(pb.ToRegex( ));
        }
Exemplo n.º 27
0
        public void Pattern_Repeat()
        {
            var noteLength1 = MusicalTimeSpan.Quarter;
            var pattern1    = new PatternBuilder()
                              .SetNoteLength(noteLength1)
                              .Note(Notes.A0)
                              .Note(Notes.C1)
                              .Build();

            var noteLength2 = MusicalTimeSpan.Quarter;
            var pattern2    = new PatternBuilder()
                              .Pattern(pattern1)
                              .Repeat(2)
                              .Build();

            PatternTestUtilities.TestNotes(pattern2, new[]
            {
                new NoteInfo(NoteName.A, 0, null, noteLength1),
                new NoteInfo(NoteName.C, 1, noteLength1, noteLength1),
                new NoteInfo(NoteName.A, 0, 2 * noteLength1, noteLength1),
                new NoteInfo(NoteName.C, 1, 3 * noteLength1, noteLength1),
                new NoteInfo(NoteName.A, 0, 4 * noteLength1, noteLength1),
                new NoteInfo(NoteName.C, 1, 5 * noteLength1, noteLength1)
            });
        }
Exemplo n.º 28
0
        internal override void AppendTo(PatternBuilder builder)
        {
            builder.Append(_charBefore);

            builder.Append(_content);

            builder.Append(_charAfter);
        }
Exemplo n.º 29
0
        /// <summary>
        /// Builds the snake pattern
        /// </summary>
        protected override void Build()
        {
            var left  = new Triangle(TriangleType.BottomLeft);
            var right = new Triangle(TriangleType.UpperRight);

            PatternBuilder.Place(left, Cells, 0, 0);
            PatternBuilder.Place(right, Cells, 0, 2);
        }
Exemplo n.º 30
0
 public void ThrowExceptionForNull()
 {
     Assert.Throws <ArgumentNullException>(() =>
     {
         var builder = new PatternBuilder();
         builder.Build(null);
     });
 }
Exemplo n.º 31
0
        public void BuildLinearPattern(string sample, int segmentCount)
        {
            var builder = new PatternBuilder();
            var pattern = builder.Build(sample);

            Assert.True(pattern is ILinearPattern);
            Assert.Equal(segmentCount, (pattern as ILinearPattern).Segments.Count);
        }
Exemplo n.º 32
0
        internal PatternConverter(string dotNetPattern, RegexOptions options)
        {
            DotNetPattern = dotNetPattern;

            var isIgnorePatternWhitespace = (options & RegexOptions.IgnorePatternWhitespace) == RegexOptions.IgnorePatternWhitespace;
            var isExpicitCapture = (options & RegexOptions.ExplicitCapture) == RegexOptions.ExplicitCapture;

            var parser = new PatternParser(dotNetPattern, isIgnorePatternWhitespace, isExpicitCapture);

            var parseItems = parser.Parse();
            patternMap = new PatternMap(parseItems);

            var builder = new PatternBuilder(dotNetPattern, patternMap);
            JavaPattern = builder.Build(parseItems);
        }
Exemplo n.º 33
0
 internal override void AppendTo(PatternBuilder builder)
 {
     builder.AppendNonbacktrackingGroup(Content);
 }
Exemplo n.º 34
0
 internal override void AppendTo(PatternBuilder builder)
 {
     builder.Append(_text);
 }
Exemplo n.º 35
0
 internal override void AppendTo(PatternBuilder builder)
 {
     builder.AppendGroupReferenceInternal(GroupName);
 }
 internal override void AppendTo(PatternBuilder builder)
 {
     builder.Append(Separator);
     base.AppendTo(builder);
     builder.Append(Separator);
 }
Exemplo n.º 37
0
 internal override void AppendTo(PatternBuilder builder)
 {
     builder.AppendNegativeBackAssertion(Content);
 }
Exemplo n.º 38
0
 internal override void AppendTo(PatternBuilder builder)
 {
     builder.AppendBalancingGroup(Name1, Name2, Content);
 }
Exemplo n.º 39
0
 internal override void AppendTo(PatternBuilder builder)
 {
     builder.AppendNumberedGroup(Content);
 }
Exemplo n.º 40
0
 internal override void AppendTo(PatternBuilder builder)
 {
     builder.AppendPreviousMatchEnd();
 }
Exemplo n.º 41
0
 internal override void AppendTo(PatternBuilder builder)
 {
     builder.AppendEndOfInput();
 }
Exemplo n.º 42
0
 internal override void AppendTo(PatternBuilder builder)
 {
     builder.AppendNegativeWordBoundary();
 }
Exemplo n.º 43
0
 internal override void AppendTo(PatternBuilder builder)
 {
     builder.AppendBeginningOfInput();
 }
Exemplo n.º 44
0
 internal override void AppendTo(PatternBuilder builder)
 {
     builder.AppendNoncapturingGroup(Content);
 }
Exemplo n.º 45
0
 internal override void AppendTo(PatternBuilder builder)
 {
     builder.AppendNamedGroupInternal(Name, Content);
 }
 internal override void AppendTo(PatternBuilder builder)
 {
     builder.AppendEndOfInputOrBeforeEndingLinefeed();
 }
Exemplo n.º 47
0
 internal override void AppendTo(PatternBuilder builder)
 {
     builder.AppendAnyChar();
 }
Exemplo n.º 48
0
 internal override void AppendTo(PatternBuilder builder)
 {
     builder.AppendLazy();
 }