private MemoryPointer LocateByKey(VariablePointer pointer) { var d = _data.Keys .FirstOrDefault(me => me.Name == pointer.Name); return(d); }
public VariableName(ASTNode?node, IMnemonicsCompiler runtime) : base(node) { Pointer = new VariablePointer { Name = node.GetChildAndAddError(0, "LITERAL", runtime)?.Value }; }
public ValueTable(ASTNode?node, IMnemonicsCompiler runtime) : base(node) { TablePointer = new VariablePointer { Name = node .GetChildAndAddError(0, "variable_name", runtime)? .GetChildAndAddError(0, "LITERAL", runtime)?.Value }; ElementPositionInTable = runtime.Get(node.Value.Children[1]); }
public IValue Get(VariablePointer pointer) { var d = LocateByKey(pointer); if (d != null) { return(_data[d]); } return(null); }
public void Set(VariablePointer pointer, IValue value) { var m = LocateByKey(pointer); if (m == null) { m = new MemoryPointer { Name = pointer.Name }; _data.Add(m, null); } _data[m] = value; }
public DataElement Visit(VariablePointer expr) { return(_dataSet.CreateVariablePointer(expr.VariableType, expr.PointerId)); }
public ValueTable(ASTNode?node, VariablePointer tablePointer, Mnemonic positionInTable) : base(node) { this.TablePointer = tablePointer; this.ElementPositionInTable = positionInTable; }
public virtual object Visit(VariablePointer expr) { return(null); }