public void EnterList(OfcListType type, int capacity)
 {
     if (_compress != null)
     {
         return;                    //throw new NotSupportedException();
     }
     _compress = _algorithm.Compress(null, _config, _output, (int)type, capacity);
 }
Exemple #2
0
        private void ParseList(OfcListType type, int amount)
        {
            OfcToken c;

            _hook.EnterList(type, amount);
            var done = false;
            var d    = false;

            do
            {
                if (!Needs(1))
                {
                    throw new ParserException();
                }
                c = _buffer[_position];
                if (c.Type == OfcTokenType.PARENTHESE_CLOSE)
                {
                    d = true;
                    _hook.LeaveList();
                    Skip(1);
                    done = true;
                    break;
                }
                switch (type)
                {
                case OfcListType.Scalar:
                    ParseScalar();
                    break;

                case OfcListType.Vector:
                    ParseVector();
                    break;

                case OfcListType.Tensor:
                    ParseTensor();
                    break;

                default:
                    throw new Exception("Not supported list type: " + type);
                }
            } while (!(_eos && _length == 0));
            if (!d)
            {
                _hook.LeaveList();
            }
            if (!done)
            {
                throw new ParserException();
            }
        }
Exemple #3
0
        public void EnterList(OfcListType type, int capacity)
        {
            switch (type)
            {
            case OfcListType.Scalar:
                Console.WriteLine($" List<scalar> {capacity} (");
                break;

            case OfcListType.Vector:
                Console.WriteLine($" List<vector> {capacity} (");
                break;

            case OfcListType.Tensor:
                Console.WriteLine($" List<tensor> {capacity} (");
                break;

            case OfcListType.Anonymous:
                Console.WriteLine($" {capacity} (");
                break;
            }
        }
Exemple #4
0
 public abstract void EnterList(OfcListType type, int capacity);
Exemple #5
0
 public void EnterList(OfcListType type, int capacity)
 {
 }