Beispiel #1
0
        private HLLocation ProcessCreateObjectInstanceExpression(ICreateObjectInstance pExpression)
        {
            HLMethod          methodCalled        = HLDomain.GetOrCreateMethod(pExpression.MethodToCall);
            HLLocation        locationThis        = HLTemporaryLocation.Create(CreateTemporary(methodCalled.Container));
            List <HLLocation> locationsParameters = new List <HLLocation>();

            if (methodCalled.Container == HLDomain.SystemString)
            {
                locationsParameters.Add(locationThis.AddressOf());
            }
            else
            {
                mCurrentBlock.EmitNewObject(methodCalled.Container, locationThis.AddressOf());
                locationsParameters.Add(locationThis);
            }

            foreach (IExpression argument in pExpression.Arguments)
            {
                locationsParameters.Add(ProcessExpression(argument));
            }

            mCurrentBlock.EmitCall(methodCalled, false, null, locationsParameters);
            return(locationThis);
        }