Microsoft.CSharp.RuntimeBinder.Semantics.ExprFactory.CreateCast C# (CSharp) Method

CreateCast() public method

public CreateCast ( EXPRFLAG nFlags, CType pType, EXPR pArg ) : Microsoft.CSharp.RuntimeBinder.Semantics.EXPRCAST
nFlags EXPRFLAG
pType CType
pArg EXPR
return Microsoft.CSharp.RuntimeBinder.Semantics.EXPRCAST
        public EXPRCAST CreateCast(EXPRFLAG nFlags, CType pType, EXPR pArg)
        {
            return CreateCast(nFlags, CreateClass(pType, null, null), pArg);
        }

Same methods

ExprFactory::CreateCast ( EXPRFLAG nFlags, Microsoft.CSharp.RuntimeBinder.Semantics.EXPRTYPEORNAMESPACE pType, EXPR pArg ) : Microsoft.CSharp.RuntimeBinder.Semantics.EXPRCAST

Usage Example

示例#1
0
        private Expr GenerateIndexList(Expr oldIndices)
        {
            CType intType = symbolLoader.GetPredefindType(PredefinedType.PT_INT);

            Expr newIndices     = null;
            Expr newIndicesTail = newIndices;

            for (ExpressionIterator it = new ExpressionIterator(oldIndices); !it.AtEnd(); it.MoveNext())
            {
                Expr newIndex = it.Current();
                if (newIndex.Type != intType)
                {
                    newIndex        = expressionFactory.CreateCast(EXPRFLAG.EXF_INDEXEXPR, intType, newIndex);
                    newIndex.Flags |= EXPRFLAG.EXF_CHECKOVERFLOW;
                }
                Expr rewrittenIndex = Visit(newIndex);
                expressionFactory.AppendItemToList(rewrittenIndex, ref newIndices, ref newIndicesTail);
            }
            return(newIndices);
        }
All Usage Examples Of Microsoft.CSharp.RuntimeBinder.Semantics.ExprFactory::CreateCast