Example #1
0
        private MemoryPointer LocateByKey(VariablePointer pointer)
        {
            var d = _data.Keys
                    .FirstOrDefault(me => me.Name == pointer.Name);

            return(d);
        }
Example #2
0
 public VariableName(ASTNode?node, IMnemonicsCompiler runtime) : base(node)
 {
     Pointer = new VariablePointer
     {
         Name = node.GetChildAndAddError(0, "LITERAL", runtime)?.Value
     };
 }
Example #3
0
 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]);
 }
Example #4
0
        public IValue Get(VariablePointer pointer)
        {
            var d = LocateByKey(pointer);

            if (d != null)
            {
                return(_data[d]);
            }

            return(null);
        }
Example #5
0
        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;
        }
Example #6
0
 public DataElement Visit(VariablePointer expr)
 {
     return(_dataSet.CreateVariablePointer(expr.VariableType, expr.PointerId));
 }
Example #7
0
 public ValueTable(ASTNode?node, VariablePointer tablePointer, Mnemonic positionInTable) : base(node)
 {
     this.TablePointer           = tablePointer;
     this.ElementPositionInTable = positionInTable;
 }
Example #8
0
 public virtual object Visit(VariablePointer expr)
 {
     return(null);
 }