internal static AnalyzedTree Bind(LambdaExpression lambda) { var binder = new VariableBinder(); binder.Visit(lambda); return(binder._tree); }
private static AnalyzedTree AnalyzeLambda(ref LambdaExpression lambda) { // Spill the stack for any exception handling blocks or other // constructs which require entering with an empty stack lambda = StackSpiller.AnalyzeLambda(lambda); // Bind any variable references in this lambda return(VariableBinder.Bind(lambda)); }
/// <summary> /// Get Declared local variable /// </summary> /// Problem when scope public bool TryGetLocalVariable(string name, out IBinder binder) { var variable = GetLocalVariable(name); if (variable != null) { if (variable.Type == null) { throw new Exception(string.Concat("Use of undeclared variable ", variable)); } binder = new VariableBinder(variable); return(true); } binder = null; return(false); }