void CreateFieldForClosedVars(JSFunctionImp funcImp) { foreach (var decl in funcImp.Declarations) if (decl.IsClosedOn) funcImp.SetField(decl.Name, new mdr.DVar()); //Only declarations that are closed on will become a filed. foreach (var f in funcImp.SubFunctions) { f.SetType(funcImp.DType); CreateFieldForClosedVars(f); } }
public void Execute(JSFunctionImp funcImp) { var oldFuncImp = _currFuncImp; _currFuncImp = funcImp; Visit(funcImp.Ast); foreach (var f in _currFuncImp.SubFunctions) Execute(f); if (_currFuncImp.ParentFunction == null) //This is either the program or function declaration CreateFieldForClosedVars(_currFuncImp); _currFuncImp = oldFuncImp; _currFuncImp = funcImp; }
void CreateFieldForClosedVars(JSFunctionImp funcImp) { foreach (var decl in funcImp.Declarations) { if (decl.IsClosedOn) { funcImp.SetField(decl.Name, new mdr.DVar()); //Only declarations that are closed on will become a filed. } } foreach (var f in funcImp.SubFunctions) { f.SetType(funcImp.DType); CreateFieldForClosedVars(f); } }
public void Execute(JSFunctionImp funcImp) { var oldFuncImp = _currFuncImp; _currFuncImp = funcImp; Visit(funcImp.Ast); foreach (var f in _currFuncImp.SubFunctions) { Execute(f); } if (_currFuncImp.ParentFunction == null) //This is either the program or function declaration { CreateFieldForClosedVars(_currFuncImp); } _currFuncImp = oldFuncImp; _currFuncImp = funcImp; }
public void Execute(JSFunctionImp funcImp) { var oldFuncImp = _currFuncImp; _currFuncImp = funcImp; Visit(funcImp.AST); //TODO: here we can decide whether to go further down the hierarchy foreach (var f in _currFuncImp.SubFunctions) { // Only analyze functions which have already been parsed. Laziness won't work without this; otherwise, when we analyze the // top-level function, we parse and analyze everything! if (f.IsParsed) f.Analyze(); } //if (_currFuncImp.ParentFunction == null) //This is either the program or function declaration // CreateFieldForClosedVars(_currFuncImp); _currFuncImp = oldFuncImp; }
public void Execute(JSFunctionImp funcImp) { var oldFuncImp = _currFuncImp; _currFuncImp = funcImp; Visit(funcImp.AST); //TODO: here we can decide whether to go further down the hierarchy foreach (var f in _currFuncImp.SubFunctions) { // Only analyze functions which have already been parsed. Laziness won't work without this; otherwise, when we analyze the // top-level function, we parse and analyze everything! if (f.IsParsed) { f.Analyze(); } } //if (_currFuncImp.ParentFunction == null) //This is either the program or function declaration // CreateFieldForClosedVars(_currFuncImp); _currFuncImp = oldFuncImp; }
public Symbols(JSFunctionImp funcImp, mdr.DFunction func, mdr.DObject dis) { FuncImp = funcImp; Func = func; This = dis; }