示例#1
0
        private Types.Type VisitUnaryExpectedType(IUnary node, Types.Type expectedType)
        {
            Types.Type childType = node.GetChildExpression().Accept(this);

            if (childType.IsEqual(expectedType))
            {
                collectedNotifications.Add(new IncompatibleUnaryOperator(node.GetPosition(), node.MakeString(), childType.GetString()));
            }

            return(expectedType);
        }
示例#2
0
 /// <summary>
 /// Adds the given element to the collection
 /// </summary>
 /// <param name="item">The item to add</param>
 public override void Add(IModelElement item)
 {
     if ((this._parent.Inner == null))
     {
         IUnary innerCasted = item.As <IUnary>();
         if ((innerCasted != null))
         {
             this._parent.Inner = innerCasted;
             return;
         }
     }
 }
示例#3
0
 /// <summary>
 /// Adds the given element to the collection
 /// </summary>
 /// <param name="item">The item to add</param>
 public override void Add(IModelElement item)
 {
     if ((this._parent.Base == null))
     {
         IPower baseCasted = item.As <IPower>();
         if ((baseCasted != null))
         {
             this._parent.Base = baseCasted;
             return;
         }
     }
     if ((this._parent.Exponent == null))
     {
         IUnary exponentCasted = item.As <IUnary>();
         if ((exponentCasted != null))
         {
             this._parent.Exponent = exponentCasted;
             return;
         }
     }
 }
示例#4
0
 private Types.Type VisitUnary(IUnary node)
 {
     return(node.GetChildExpression().Accept(this));
 }
示例#5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="unary">Unary</param>
 /// <param name="index">Index of unary</param>
 public ElementaryUnaryOperation(IUnary unary, int index)
 {
     this.unary = unary;
     this.index = index;
 }
示例#6
0
 private IList <Id> VisitUnary(IUnary node)
 {
     return(node.GetChildExpression().Accept(this));
 }