Example #1
0
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }
            if (!(o is NewExprent))
            {
                return(false);
            }
            NewExprent ne = (NewExprent)o;

            return(InterpreterUtil.EqualObjects(newType, ne.GetNewType()) && InterpreterUtil.
                   EqualLists(lstDims, ne.GetLstDims()) && InterpreterUtil.EqualObjects(constructor
                                                                                        , ne.GetConstructor()) && directArrayInit == ne.directArrayInit && InterpreterUtil
                   .EqualLists(lstArrayElements, ne.GetLstArrayElements()));
        }
Example #2
0
        public override Exprent Copy()
        {
            List <Exprent> lst = new List <Exprent>();

            foreach (Exprent expr in lstDims)
            {
                lst.Add(expr.Copy());
            }
            NewExprent ret = new NewExprent(newType, lst, bytecode);

            ret.SetConstructor(constructor == null ? null : (InvocationExprent)constructor.Copy
                                   ());
            ret.SetLstArrayElements(lstArrayElements);
            ret.SetDirectArrayInit(directArrayInit);
            ret.SetAnonymous(anonymous);
            ret.SetEnumConst(enumConst);
            return(ret);
        }