ArgumentScope() public method

public ArgumentScope ( ) : Scope
return Scope
Exemplo n.º 1
0
        protected EXPR CreateWraps(EXPRBOUNDLAMBDA anonmeth)
        {
            EXPR sequence = null;
            for (Symbol sym = anonmeth.ArgumentScope().firstChild; sym != null; sym = sym.nextChild)
            {
                if (!sym.IsLocalVariableSymbol())
                {
                    continue;
                }
                LocalVariableSymbol local = sym.AsLocalVariableSymbol();
                if (local.isThis)
                {
                    continue;
                }
                Debug.Assert(anonmeth.OptionalBody != null);
                EXPR create = GenerateParameter(local.name.Text, local.GetType());
                local.wrap = GetExprFactory().CreateWrapNoAutoFree(anonmeth.OptionalBody.OptionalScopeSymbol, create);
                EXPR save = GetExprFactory().CreateSave(local.wrap);
                if (sequence == null)
                {
                    sequence = save;
                }
                else
                {
                    sequence = GetExprFactory().CreateSequence(sequence, save);
                }
            }

            return sequence;
        }
Exemplo n.º 2
0
 protected EXPR DestroyWraps(EXPRBOUNDLAMBDA anonmeth, EXPR sequence)
 {
     for (Symbol sym = anonmeth.ArgumentScope(); sym != null; sym = sym.nextChild)
     {
         if (!sym.IsLocalVariableSymbol())
         {
             continue;
         }
         LocalVariableSymbol local = sym.AsLocalVariableSymbol();
         if (local.isThis)
         {
             continue;
         }
         Debug.Assert(local.wrap != null);
         Debug.Assert(anonmeth.OptionalBody != null);
         EXPR freeWrap = GetExprFactory().CreateWrap(anonmeth.OptionalBody.OptionalScopeSymbol, local.wrap);
         sequence = GetExprFactory().CreateReverseSequence(sequence, freeWrap);
     }
     return sequence;
 }
Exemplo n.º 3
0
        protected EXPR RewriteLambdaParameters(EXPRBOUNDLAMBDA anonmeth)
        {
            Debug.Assert(anonmeth != null);

            // new ParameterExpression[2] {Parameter(typeof(type1), name1), Parameter(typeof(type2), name2)}

            EXPR paramArrayInitializerArgs = null;
            EXPR paramArrayInitializerArgsTail = paramArrayInitializerArgs;

            for (Symbol sym = anonmeth.ArgumentScope(); sym != null; sym = sym.nextChild)
            {
                if (!sym.IsLocalVariableSymbol())
                {
                    continue;
                }
                LocalVariableSymbol local = sym.AsLocalVariableSymbol();
                if (local.isThis)
                {
                    continue;
                }
                GetExprFactory().AppendItemToList(local.wrap, ref paramArrayInitializerArgs, ref paramArrayInitializerArgsTail);
            }

            return GenerateParamsArray(paramArrayInitializerArgs, PredefinedType.PT_PARAMETEREXPRESSION);
        }