Example #1
0
        public override RCValue Parse(RCArray <RCToken> tokens, out bool fragment, bool canonical)
        {
            fragment = false;
            _result  = new RCCube(new Timeline());
            _result.ReserveColumn("bot");
            _result.ReserveColumn("fiber");
            _result.ReserveColumn("module");
            _result.ReserveColumn("instance");
            _result.ReserveColumn("event");
            _result.ReserveColumn("message");
            _result.ReserveColumn("document");

            for (int i = 0; i < tokens.Count; ++i)
            {
                tokens[i].Type.Accept(this, tokens[i]);
            }

            if (_bot != null)
            {
                if (_builder.Length > 0)
                {
                    _document = _builder.ToString();
                }
                AppendEntry();
            }
            return(_result);
        }
Example #2
0
 public RCCube Fill(RCCube source)
 {
     _source = source;
     for (int i = 0; i < source.Cols; ++i)
     {
         _target.ReserveColumn(source.ColumnAt(i), canonical: false);
     }
     _source.VisitCellsCanonical(this, 0, _source.Axis.Count);
     return(_target);
 }
Example #3
0
 public RCCube Unplug(RCCube source)
 {
     _source = source;
     _unplug = true;
     for (int i = 0; i < _source.Cols; ++i)
     {
         _target.ReserveColumn(_source.ColumnAt(i));
     }
     _source.VisitCellsCanonical(this, 0, _source.Axis.Count);
     return(_target);
 }
Example #4
0
        public void Operators(RCRunner runner, RCClosure closure, RCBlock right)
        {
            RCCube result = new RCCube("S");

            result.ReserveColumn("module");
            result.ReserveColumn("name");
            result.ReserveColumn("method");
            result.ReserveColumn("left");
            result.ReserveColumn("right");
            foreach (KeyValuePair <RCActivator.OverloadKey,
                                   RCActivator.OverloadValue> kv in Activator._dispatch)
            {
                RCSymbolScalar sym;
                if (kv.Key.Left == null)
                {
                    sym = RCSymbolScalar.From("operator",
                                              kv.Value.Module.Name,
                                              kv.Key.Name,
                                              RCValue.TypeNameForType(kv.Key.Right));
                }
                else
                {
                    sym = RCSymbolScalar.From("operator",
                                              kv.Value.Module.Name,
                                              kv.Key.Name,
                                              RCValue.TypeNameForType(kv.Key.Left),
                                              RCValue.TypeNameForType(kv.Key.Right));
                }
                result.WriteCell("name", sym, kv.Key.Name);
                result.WriteCell("module", sym, kv.Value.Module.Name);
                result.WriteCell("method", sym, kv.Value.Implementation.Name);
                if (kv.Key.Left != null)
                {
                    result.WriteCell("left", sym, RCValue.TypeNameForType(kv.Key.Left));
                }
                result.WriteCell("right", sym, RCValue.TypeNameForType(kv.Key.Right));
                result.Axis.Write(sym);
            }
            runner.Yield(closure, result);
        }
Example #5
0
        public override void VisitNull <T> (string name, Column <T> column, int row)
        {
            if (!_accept)
            {
                return;
            }
            _target.ReserveColumn(name);
            if (!_fill)
            {
                return;
            }
            T last;

            if (column.Last(_symbol, out last))
            {
                _target.WriteCell(name, _symbol, last);
            }
        }