Ejemplo n.º 1
0
 protected virtual T VisitChildren(Ust ust)
 {
     if (ust == null)
     {
         return(default(T));
     }
     foreach (var children in ust.Children)
     {
         if (children != null)
         {
             T result = Visit((dynamic)children);
             if (ust.Children.Length == 1)
             {
                 return(result);
             }
         }
     }
     return(default(T));
 }
Ejemplo n.º 2
0
        public static Statement ToStatementIfRequired(this Ust ust)
        {
            Statement result = ust as Statement;

            if (result == null)
            {
                if (ust is Expression expr)
                {
                    result = new ExpressionStatement(expr);
                }
                else if (ust != null)
                {
                    result = new WrapperStatement(ust);
                }
                else
                {
                    result = null;
                }
            }
            return(result);
        }
Ejemplo n.º 3
0
 public virtual T Visit(Ust ust)
 {
     if (ust == null)
     {
         return(default);