public override void CaseAGenericType(AGenericType node)
 {
     ContainsNestedGenerics = true;
     base.CaseAGenericType(node);
 }
Example #2
0
 internal GenericTypes_Cast(AGenericType obj)
 {
     this.obj = obj;
 }
 public virtual void OutAGenericType(AGenericType node)
 {
     DefaultOut(node);
 }
 public override void OutAGenericType(AGenericType node)
 {
     if (!(node.GetBase() is ANamedType))
     {
         errors.Add(new ErrorCollection.Error(node.GetToken(), LocRM.GetString("ErrorText44")));
         return;
     }
     ANamedType Base = (ANamedType) node.GetBase();
     if (!data.StructTypeLinks.ContainsKey(Base))
     {
         errors.Add(new ErrorCollection.Error(node.GetToken(), LocRM.GetString("ErrorText44")));
         return;
     }
     AStructDecl str = data.StructTypeLinks[Base];
     if (str.GetGenericVars().Count != node.GetGenericTypes().Count)
     {
         errors.Add(new ErrorCollection.Error(node.GetToken(), LocRM.GetString("ErrorText45"),
                                              false, new ErrorCollection.Error(str.GetName(), LocRM.GetString("ErrorText46") + Util.GetTypeName(str))));
         return;
     }
     LookForGenericVar finder = new LookForGenericVar();
     foreach (PType genericType in node.GetGenericTypes())
     {
         genericType.Apply(finder);
         if (finder.ContainsGenericVar || finder.ContainsNestedGenerics)
         {
             //if (finder.ContainsGenericVar)
                 structsWithGenerics.Add(Util.GetAncestor<AStructDecl>(node));
             if (finder.ContainsNestedGenerics)
             {
                 if (!Util.HasAncestor<AStructDecl>(node) || Util.GetAncestor<AStructDecl>(node).GetGenericVars().Count == 0)
                     needAnotherPass = true;
             }
             return;
         }
     }
     if (!Refferences.ContainsKey(str))
         Refferences[str] = new List<AGenericType>();
     Refferences[str].Add(node);
     base.OutAGenericType(node);
 }
 public virtual void CaseAGenericType(AGenericType node)
 {
     DefaultCase(node);
 }
 public virtual void InAGenericType(AGenericType node)
 {
     DefaultIn(node);
 }
 public override void CaseAGenericType(AGenericType node)
 {
     InAGenericType(node);
     {
         Object[] temp = new Object[node.GetGenericTypes().Count];
         node.GetGenericTypes().CopyTo(temp, 0);
         for (int i = temp.Length - 1; i >= 0; i--)
         {
             ((PType)temp[i]).Apply(this);
         }
     }
     if (node.GetBase() != null)
     {
         node.GetBase().Apply(this);
     }
     if (node.GetToken() != null)
     {
         node.GetToken().Apply(this);
     }
     OutAGenericType(node);
 }
 private PType LvalueToType(PLvalue lvalue, IList dynamicOpList, TLt genericToken, IList genericTypes)
 {
     PType type = LvalueToType(lvalue);
     if (genericToken != null)
     {
         type = new AGenericType(genericToken, type, new ArrayList());
         while (genericTypes.Count > 0)
         {
             ((AGenericType) type).GetGenericTypes().Add(genericTypes[0]);
         }
     }
     foreach (PShadyDynamicOps op in dynamicOpList)
     {
         if (op is APointerShadyDynamicOps)
         {
             APointerShadyDynamicOps aop = (APointerShadyDynamicOps) op;
             type = new APointerType(aop.GetToken(), type);
         }
         else if (op is AArrayShadyDynamicOps)
         {
             AArrayShadyDynamicOps aop = (AArrayShadyDynamicOps)op;
             if (aop.GetExp() == null)
                 type = new ADynamicArrayType(aop.GetToken(), type);
             else
                 type = new AArrayTempType(aop.GetToken(), type, aop.GetExp(), null);
         }
     }
     return type;
 }
Example #9
0
 ArrayList New259()
 {
     ArrayList nodeList = new ArrayList();
     ArrayList nodeArrayList4 = (ArrayList) Pop();
     ArrayList nodeArrayList3 = (ArrayList) Pop();
     ArrayList nodeArrayList2 = (ArrayList) Pop();
     ArrayList nodeArrayList1 = (ArrayList) Pop();
     TypedList listNode5 = new TypedList();
     TLt tltNode2 = (TLt)nodeArrayList2[0];
     PType ptypeNode3 = (PType)nodeArrayList1[0];
     TypedList listNode4 = (TypedList)nodeArrayList3[0];
     if ( listNode4 != null )
     {
     listNode5.AddAll(listNode4);
     }
     AGenericType ptypeNode1 = new AGenericType (
       tltNode2,
       ptypeNode3,
       listNode5
     );
     nodeList.Add(ptypeNode1);
     return nodeList;
 }