Example #1
0
        public void Visit(IVisitable visitable)
        {
            visitable.Accept(Tags);
            visitable.Accept(this);

            foreach (ScenarioDefinition scenario in Children)
            {
                scenario.Visit(visitable);
            }
        }
Example #2
0
 public void Accept(IVisitor visitor)
 {
     collection.Accept(visitor);
     visitor.DuringTake();
     count.Accept(visitor);
     visitor.AfterTake();
 }
Example #3
0
 public void Accept(IVisitor visitor)
 {
     visitor.BeforeSelect();
     selection.Accept(visitor);
     visitor.DuringSelect();
     @from.Accept(visitor);
 }
Example #4
0
        protected virtual bool WriteSlots(IVisitable slotChangeTree)
        {
            var ret = new BooleanByRef();

            slotChangeTree.Accept(new _IVisitor4_39(this, ret));
            return(ret.value);
        }
Example #5
0
        /// <summary>
        /// Runs all the subscribed visitors against the visitable tree
        /// parsed by the ITraverser implementation.
        /// </summary>
        /// <param name="source">The <c>RunnerSource</c> object to process.</param>
        private void RunSource(RunnerSource source)
        {
            GeneratorHost.Instance.Extender.Traverser.Initialize(GeneratorHost.Instance);

            // Build the result tree to use.
            IVisitable result =
                GeneratorHost.Instance.Extender.Traverser.Traverse(source.FileName);

            foreach (DictionaryEntry entry in GeneratorHost.Instance.Extender.Visitors)
            {
                IVisitor visitor = entry.Value as IVisitor;

                // If the element implements IHostedComponent, initialize it
                // with the GeneratorHost instance.
                if (visitor is IHostedComponent)
                {
                    ((IHostedComponent)visitor).Initialize(GeneratorHost.Instance);
                }
                // If the element implements INotifier, append the progress event handler.
                if (visitor is INotifier)
                {
                    // Remove it just in case it was already subscribed.
                    ((INotifier)visitor).Progress -= new ProgressEventHandler(OnBubbleProgress);
                    ((INotifier)visitor).Progress += new ProgressEventHandler(OnBubbleProgress);
                }

                result.Accept(visitor);
            }
        }
Example #6
0
        private int CountSlotChanges(IVisitable slotChanges)
        {
            IntByRef slotChangeCount = new IntByRef();

            slotChanges.Accept(new _IVisitor4_40(slotChangeCount));
            return(slotChangeCount.value);
        }
Example #7
0
        private LoadedDocument CreateLoadedDocument(
            IVisitable <IGenericVisitor> type,
            string namespaceName,
            Action <LoadedDocument> addToDocumentAction,
            Action <Namespace> addToNamespaceAction)
        {
            type.Accept(new FixMethodBodyVisitor());
            LoadedDocument document = new LoadedDocument();

            if (string.IsNullOrWhiteSpace(namespaceName))
            {
                addToDocumentAction(document);
            }
            else
            {
                Namespace @namespace = new Namespace()
                {
                    Name = namespaceName,
                };
                addToNamespaceAction(@namespace);
                document.Namespaces.Add(@namespace);
            }

            return(document);
        }
Example #8
0
        protected void VisitChildren(params object[] children)
        {
            foreach (object child in children)
            {
                IVisitable <IGenericVisitor> item = child as IVisitable <IGenericVisitor>;
                if (item != null)
                {
                    item.Accept(this);
                }
                else
                {
                    IEnumerable <IVisitable <IGenericVisitor> > collection = child as IEnumerable <IVisitable <IGenericVisitor> >;
                    if (collection != null)
                    {
                        foreach (IVisitable <IGenericVisitor> childItem in collection)
                        {
                            childItem.Accept(this);
                        }
                    }
                }

                if (Result != null)
                {
                    return;
                }
            }
        }
 public CodeGenerationTreeBuilder(IVisitable <IGenericVisitor> visitable)
 {
     if (visitable != null)
     {
         visitable.Accept(this);
     }
 }
Example #10
0
        private int EstimateMappingCount(IVisitable slotChanges)
        {
            IntByRef count = new IntByRef();

            count.value = _ids == null ? 0 : _ids.Size();
            slotChanges.Accept(new _IVisitor4_103(count));
            return(count.value);
        }
Example #11
0
 public void Accept(IVisitor visitor)
 {
     value.Accept(visitor);
     visitor.BeforeBetween();
     min.Accept(visitor);
     visitor.DuringBetween();
     max.Accept(visitor);
 }
Example #12
0
 public void Accept(IVisitor visitor)
 {
     visitor.BeforeWhen();
     condition.Accept(visitor);
     visitor.DuringWhen();
     value.Accept(visitor);
     visitor.AfterWhen();
 }
Example #13
0
 public void Accept(IVisitor visitor)
 {
     visitor.BeforeBinaryOperator();
     left.Accept(visitor);
     visitor.DuringBinaryOperator(this.Type);
     right.Accept(visitor);
     visitor.AfterBinaryOperator();
 }
Example #14
0
 public void Visit(IVisitable visitable)
 {
     visitable.Accept(this);
     if (Argument != null)
     {
         Argument.Visit(visitable);
     }
 }
Example #15
0
 public void VisitReferencedApplicationBinding(IVisitable <IApplicationBindingVisitor> referencedApplicationBinding)
 {
     if (referencedApplicationBinding == null)
     {
         throw new ArgumentNullException(nameof(referencedApplicationBinding));
     }
     referencedApplicationBinding.Accept(this);
 }
Example #16
0
        public void VisitNode(IVisitable visitable)
        {
            if (visitable == null)
            {
                return;
            }

            visitable.Accept(this);
        }
        public static string ToSourceCode(
            this IVisitable <IGenericVisitor> visitable,
            params ISourceCodeStyleRule[] styleRules)
        {
            SourceCodeStepsBuilder stepsBuilder = new SourceCodeStepsBuilder();

            visitable.Accept(stepsBuilder);
            return(stepsBuilder.Steps.ToSourceCode(styleRules));
        }
Example #18
0
        public Construct Visit(IVisitable <Constructs.Construct, LlvmVisitor> node)
        {
            // Ensure node is not null.
            if (node != null)
            {
                return(node.Accept(this));
            }

            throw new ArgumentNullException("Node argument cannot be null");
        }
        public string getStringForIVisitable(int y, int x)
        {
            IVisitable myVisitable = GameController.Game.getMap()[y, x];

            if (myVisitable == null)
            {
                return("   ");
            }
            myVisitable.Accept(this);
            return(objectToRepresent);
        }
Example #20
0
        public override void OnConfigured(CameraCaptureSession session)
        {
            _visitable.Accept(this);
            if (_cameraParameters.CameraDevice == null)
            {
                return;
            }

            _args.CameraCaptureSession = session;
            OnConfigured(this, _args);
        }
Example #21
0
 void IVisitable.Accept(IVisitor visitor)
 {
     foreach (T item in this)
     {
         IVisitable visitable = item as IVisitable;
         if (visitable == null)
         {
             throw new NotImplementedException("items must be implement IVistitable");
         }
         visitable.Accept(visitor);
     }
 }
Example #22
0
 // do nothing
 public virtual void Commit(IVisitable slotChanges, FreespaceCommitter freespaceCommitter
     )
 {
     var oldSlot = _slot;
     var reservedSlot = AllocateSlot(false, EstimatedSlotLength(EstimateMappingCount(
         slotChanges)));
     // No more operations against the FreespaceManager.
     // Time to free old slots.
     freespaceCommitter.Commit();
     slotChanges.Accept(new _IVisitor4_69(this));
     WriteThis(reservedSlot);
     FreeSlot(oldSlot);
 }
Example #23
0
        // do nothing
        public virtual void Commit(IVisitable slotChanges, FreespaceCommitter freespaceCommitter
                                   )
        {
            Slot oldSlot      = _slot;
            Slot reservedSlot = AllocateSlot(false, EstimatedSlotLength(EstimateMappingCount(
                                                                            slotChanges)));

            // No more operations against the FreespaceManager.
            // Time to free old slots.
            freespaceCommitter.Commit();
            slotChanges.Accept(new _IVisitor4_69(this));
            WriteThis(reservedSlot);
            FreeSlot(oldSlot);
        }
Example #24
0
        private IBankMessage FindVisitorResult(IEnumerable <IVisitor> visitors, IVisitable visitable)
        {
            foreach (IVisitor visitor in visitors)
            {
                visitable.Accept(visitor);
                if (!visitor.IsHandled)
                {
                    continue;
                }

                _configEnforcer.EnforceFieldLengthValidation(visitor);

                return(visitor.Result);
            }

            throw new ProviderMissingException();
        }
Example #25
0
 public virtual void Commit(IVisitable slotChanges, FreespaceCommitter freespaceCommitter
                            )
 {
     _container.FreespaceManager().BeginCommit();
     slotChanges.Accept(new _IVisitor4_129(this));
     // TODO: Maybe we want a BTree that doesn't allow duplicates.
     // Then we could do the following in one step without removing first.
     _bTree.Commit(Transaction());
     IdGeneratorValue(_idGenerator.PersistentGeneratorValue());
     if (_idGenerator.IsDirty())
     {
         _idGenerator.SetClean();
         _persistentState.SetStateDirty();
     }
     if (_persistentState.IsDirty())
     {
         _persistentState.Write(Transaction());
     }
     _container.FreespaceManager().EndCommit();
     _transactionalIdSystem.Commit(freespaceCommitter);
     _transactionalIdSystem.Clear();
 }
		public virtual void ReturnUnusedIds(IVisitable visitable)
		{
			visitable.Accept(new _IVisitor4_167(this));
		}
		public virtual void Commit(IVisitable slotChanges, FreespaceCommitter freespaceCommitter
			)
		{
			_container.FreespaceManager().BeginCommit();
			slotChanges.Accept(new _IVisitor4_129(this));
			// TODO: Maybe we want a BTree that doesn't allow duplicates.
			// Then we could do the following in one step without removing first.
			_bTree.Commit(Transaction());
			IdGeneratorValue(_idGenerator.PersistentGeneratorValue());
			if (_idGenerator.IsDirty())
			{
				_idGenerator.SetClean();
				_persistentState.SetStateDirty();
			}
			if (_persistentState.IsDirty())
			{
				_persistentState.Write(Transaction());
			}
			_container.FreespaceManager().EndCommit();
			_transactionalIdSystem.Commit(freespaceCommitter);
			_transactionalIdSystem.Clear();
		}
Example #28
0
 public void ReturnUnusedIds(IVisitable visitable)
 {
     visitable.Accept(new _IVisitor4_51(this));
 }
		public void ReturnUnusedIds(IVisitable visitable)
		{
			visitable.Accept(new _IVisitor4_51(this));
		}
		private int CountSlotChanges(IVisitable slotChanges)
		{
			IntByRef slotChangeCount = new IntByRef();
			slotChanges.Accept(new _IVisitor4_40(slotChangeCount));
			return slotChangeCount.value;
		}
Example #31
0
 public void Accept(IVisitor visitor)
 {
     value.Accept(visitor);
     visitor.DuringAliasDefinition(this.Alias);
 }
Example #32
0
 public virtual void ReturnUnusedIds(IVisitable visitable)
 {
     visitable.Accept(new _IVisitor4_167(this));
 }
Example #33
0
 protected void AppendSlotChanges(ByteArrayBuffer writer, IVisitable slotChangeVisitable
                                  )
 {
     slotChangeVisitable.Accept(new _IVisitor4_30(writer));
 }
Example #34
0
		private int EstimateMappingCount(IVisitable slotChanges)
		{
			IntByRef count = new IntByRef();
			count.value = _ids == null ? 0 : _ids.Size();
			slotChanges.Accept(new _IVisitor4_103(count));
			return count.value;
		}
Example #35
0
		protected void AppendSlotChanges(ByteArrayBuffer writer, IVisitable slotChangeVisitable
			)
		{
			slotChangeVisitable.Accept(new _IVisitor4_30(writer));
		}
        /// <summary>
        /// Visits the node.
        /// </summary>
        /// <param name="visitable">The visitable.</param>
        public void VisitNode(IVisitable visitable)
        {
            if (visitable == null) return;

            visitable.Accept(this);
        }
Example #37
0
 public void Accept(IVisitor visitor)
 {
     collection.Accept(visitor);
     visitor.BeforeOrderBy();
     criteria.Accept(visitor);
 }
Example #38
0
		protected virtual bool WriteSlots(IVisitable slotChangeTree)
		{
			BooleanByRef ret = new BooleanByRef();
			slotChangeTree.Accept(new _IVisitor4_39(this, ret));
			return ret.value;
		}
Example #39
0
 protected override void AcceptVisitable(IVisitable visitable)
 {
     visitable.Accept(this);
 }