コード例 #1
0
ファイル: One.cs プロジェクト: cwi-swat/jjtraveler-csharp
		public virtual IVisitable visit(IVisitable any) // throws VisitFailure
		{
			int childCount = any.getChildCount();
			for (int i = 0; i < childCount; i++) 
			{
				try 
				{ 
					return any.setChildAt(i,v.visit(any.getChildAt(i))); 
				} 
				catch(VisitFailure) {}
			}
			throw new VisitFailure();
		}
コード例 #2
0
ファイル: Some.cs プロジェクト: cwi-swat/jjtraveler-csharp
 // throws VisitFailure
 public virtual IVisitable visit(IVisitable any)
 {
     int childCount = any.getChildCount();
     int successCount = 0;
     for (int i = 0; i < childCount; i++)
     {
         try
         {
             any.setChildAt(i,v.visit(any.getChildAt(i)));
             successCount++;
         }
         catch(VisitFailure) {}
     }
     if (successCount == 0)
     {
         throw new VisitFailure("Some: None of the " +
             childCount + " arguments of " +
             any + " succeeded.");
     }
     return any;
 }