public virtual IdentifierOperand Get(string name, bool inherit = true) { IdentifierOperand identifier; if (_identifiers.TryGetValue(name, out identifier)) { return(identifier); } if (inherit && Previous != null) { return(Previous.Get(name)); } return(null); }
public FunctionContext(ExpressionCompiler compiler, int frameIndex, Scope prevScope, string parentName, string name) { _instructions = new List <Instruction>(); _loopLabels = new IndexedStack <Tuple <LabelOperand, LabelOperand> >(); Compiler = compiler; FrameIndex = frameIndex; Scope = new Scope(frameIndex, prevScope); ParentName = parentName; Name = name; FullName = string.Format("{0}{1}{2}", parentName, string.IsNullOrEmpty(parentName) ? "" : ".", Name ?? ""); AssignedName = name != null?prevScope.Get(name) : null; Label = Compiler.MakeLabel("function"); IdentifierCount = 0; }
public FunctionContext(ExpressionCompiler compiler, int argIndex, int localIndex, Scope prevScope, string parentName, string name) { _instructions = new List<Instruction>(); _loopLabels = new IndexedStack<Tuple<LabelOperand, LabelOperand>>(); Compiler = compiler; ArgIndex = argIndex; LocalIndex = localIndex; Scope = prevScope; ParentName = parentName; Name = name; FullName = string.Format("{0}{1}{2}", parentName, string.IsNullOrEmpty(parentName) ? "" : ".", Name ?? ""); AssignedName = name != null ? prevScope.Get(name) : null; Label = Compiler.MakeLabel("function"); IdentifierCount = 0; }
public virtual IdentifierOperand Identifier(string name) { return(Scope.Get(name)); }
public IdentifierOperand Identifier(string name) { return(_scope.Get(name)); }