Ejemplo n.º 1
0
        public AstNodeBuilder(ISequenceReader <Token> reader,
                              BreakableBlock block,
                              string[] interceptChars,
                              bool hasparent = false) : base(reader, block)

        {
            _interceptChars = interceptChars;
            _hasParent      = hasparent;
        }
Ejemplo n.º 2
0
 public AstNodeBuilder(ISequenceReader <Token> reader,
                       BreakableBlock block,
                       string[] interceptChars,
                       OperatorNode node) : base(reader, block)
 {
     _interceptChars = interceptChars;
     _hasParent      = true;
     _currentNode    = node;
 }
        /// <summary>
        ///     Adds a singleton sequence reader with an instance specified in <paramref name="implementationInstance" />
        ///     to the <see cref="Microsoft.Extensions.DependencyInjection.IServiceCollection" />.
        /// </summary>
        /// <param name="silverbackBuilder">
        ///     The <see cref="ISilverbackBuilder" /> that references the <see cref="IServiceCollection" /> to add
        ///     the services to.
        /// </param>
        /// <param name="implementationInstance">
        ///     The instance of the service.
        /// </param>
        /// <returns>
        ///     The <see cref="ISilverbackBuilder" /> so that additional calls can be chained.
        /// </returns>
        public static ISilverbackBuilder AddSingletonSequenceReader(
            this ISilverbackBuilder silverbackBuilder,
            ISequenceReader implementationInstance)
        {
            Check.NotNull(silverbackBuilder, nameof(silverbackBuilder));

            silverbackBuilder.Services.AddSingleton(typeof(ISequenceReader), implementationInstance);

            return(silverbackBuilder);
        }
Ejemplo n.º 4
0
 private static void PrintSequence(ISequenceReader <Person> sequence)
 {
     while (true)
     {
         var currentItem = sequence.GetNextItem();
         if (currentItem == null)
         {
             break;
         }
         Console.WriteLine(currentItem);
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PrSm"/> class.
 /// </summary>
 /// <param name="sequenceReader">
 /// Sequence reader for parsing sequences for the dataset this PRSM belongs to.
 /// </param>
 public PrSm(ISequenceReader sequenceReader = null)
 {
     this.sequenceReader = sequenceReader ?? new SequenceReader();
     this.RawFileName    = string.Empty;
     this.SequenceText   = string.Empty;
     this.Sequence       = new Sequence(new List <AminoAcid>());
     this.ProteinName    = string.Empty;
     this.ProteinDesc    = string.Empty;
     this.UseGolfScoring = false;
     this.Heavy          = false;
     this.lcms           = null;
     this.scan           = 0;
     this.Mass           = double.NaN;
     this.PrecursorMz    = double.NaN;
     this.QValue         = -1.0;
     this.charge         = 1;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PrSm"/> class.
 /// </summary>
 /// <param name="sequenceReader">
 /// Sequence reader for parsing sequences for the dataset this PRSM belongs to.
 /// </param>
 public PrSm(ISequenceReader sequenceReader)
 {
     this.sequenceReader = sequenceReader ?? new SequenceReader();
     RawFileName         = string.Empty;
     SequenceText        = string.Empty;
     Sequence            = new Sequence(new List <AminoAcid>());
     ProteinName         = string.Empty;
     ProteinDesc         = string.Empty;
     UseGolfScoring      = false;
     Heavy       = false;
     lcms        = null;
     scan        = 0;
     Mass        = double.NaN;
     PrecursorMz = double.NaN;
     QValue      = -1.0;
     charge      = 1;
 }
Ejemplo n.º 7
0
        private async Task <ISequence?> GetSequenceAsync(
            ConsumerPipelineContext context,
            ConsumerBehaviorHandler next,
            ISequenceReader sequenceReader)
        {
            var sequence = await sequenceReader.GetSequenceAsync(context).ConfigureAwait(false);

            if (sequence.IsComplete)
            {
                return(null);
            }

            if (sequence is IncompleteSequence incompleteSequence)
            {
                _logger.LogSkippingIncompleteSequence(incompleteSequence);
                return(null);
            }

            context.SetSequence(sequence, sequence.IsNew);

            if (sequence.IsNew)
            {
                StartActivityIfNeeded(sequence);

                await PublishSequenceAsync(context, next).ConfigureAwait(false);

                if (context.ProcessingTask != null)
                {
                    MonitorProcessingTaskPrematureCompletion(context.ProcessingTask, sequence);
                }

                _logger.LogSequenceStarted(sequence);
            }

            return(sequence);
        }
Ejemplo n.º 8
0
 public FunctionBuilder(ISequenceReader <Token> reader, BreakableBlock block) : base(reader, block)
 {
 }
Ejemplo n.º 9
0
 public TryCatchFinallyBlockBuilder(ISequenceReader <Token> reader, BreakableBlock block) : base(reader, block)
 {
 }
Ejemplo n.º 10
0
 public ParenthesisBuilder(ISequenceReader <Token> reader, BreakableBlock block) : base(reader, block)
 {
 }
Ejemplo n.º 11
0
 public DoWhileScopeBuilder(ISequenceReader <Token> reader, BreakableBlock block) : base(reader, block)
 {
 }
Ejemplo n.º 12
0
 internal Sequence(ISequenceReader stepReader, ISequenceContext context)
 {
     _stepReader = stepReader;
     _context    = context;
 }
Ejemplo n.º 13
0
 public DeclareExpressionBuilder(ISequenceReader <Token> reader, BreakableBlock block) : base(reader, block)
 {
 }
Ejemplo n.º 14
0
 public BuilderBase(ISequenceReader <Token> reader, BreakableBlock block)
 {
     _reader = reader;
     _block  = block;
 }
Ejemplo n.º 15
0
 public ExpressionBuilder(ISequenceReader <Token> reader, bool doCheck, BreakableBlock block) : base(reader, block)
 {
     _doCheck = doCheck;
 }
Ejemplo n.º 16
0
 public ObjectLiteralBuilder(ISequenceReader <Token> reader, BreakableBlock block) : base(reader, block)
 {
 }
Ejemplo n.º 17
0
 public ArrayIndexBuilder(ISequenceReader <Token> reader, BreakableBlock block) : base(reader, block)
 {
 }
Ejemplo n.º 18
0
 public ElseBlockBuilder(ISequenceReader <Token> reader, BreakableBlock block) : base(reader, block)
 {
 }
Ejemplo n.º 19
0
 public OrderedBlockBuilder(ISequenceReader <Token> reader, string parentName, BreakableBlock block) : base(reader, block)
 {
     _parentName = parentName;
 }