Пример #1
0
        /// <inheritdoc />
        public override void Parse(string line, IList <string> tokens, IList <Binding> bindings)
        {
            if (tokens.Count < 7)
            {
                throw new ExternalCompilerException("Const has too few parameters");
            }

            var newBinding = new Const();

            newBinding.name = tokens[1];
            try
            {
                newBinding.offset   = Int32.Parse(tokens[2]);
                newBinding.type     = (DataType)Int32.Parse(tokens[3]);
                newBinding.rows     = Int32.Parse(tokens[4]);
                newBinding.cols     = Int32.Parse(tokens[5]);
                newBinding.bufferID = Int32.Parse(tokens[6]);
            }
            catch (FormatException)
            {
                throw new ExternalCompilerException("Invalid Const token");
            }
            bindings.Add(newBinding);
        }
Пример #2
0
        /// <inheritdoc />
        public override void Parse(string line, IList<string> tokens, IList<Binding> bindings)
        {
            if (tokens.Count < 7)
                throw new ExternalCompilerException("Const has too few parameters");

            var newBinding = new Const();
            newBinding.name = tokens[1];
            try
            {
                newBinding.offset = Int32.Parse(tokens[2]);
                newBinding.type = (DataType)Int32.Parse(tokens[3]);
                newBinding.rows = Int32.Parse(tokens[4]);
                newBinding.cols = Int32.Parse(tokens[5]);
                newBinding.bufferID = Int32.Parse(tokens[6]);
            }
            catch (FormatException)
            {
                throw new ExternalCompilerException("Invalid Const token");
            }
            bindings.Add(newBinding);
        }