Example #1
0
        internal void ChangeValues(IDictionary <string, string> dictionary)
        {
            for (int i = 0; i < _values.Count; ++i)
            {
                CBaseValue old_val = _values[i];
                string     val     = old_val.ToString();
                string     new_val;
                if (dictionary.TryGetValue(val, out new_val))
                {
                    ETokenType tt = Utils.GetTokenType(new_val);
                    var        t  = new CToken(tt, new_val, old_val.Position);

                    CBaseValue be = CBaseValue.CreateBaseValue(this, t); //_values + 1 to end
                    _values[i] = _values[_values.Count - 1];             //insert to need pos

                    old_val.SetParent(null);                             //_values count same
                    _values.RemoveAt(_values.Count - 1);                 //_values - 1
                }
            }

            for (int i = 0; i < _keys.Count; ++i)
            {
                _keys[i].ChangeValues(dictionary);
            }
        }
Example #2
0
        internal void AddTokenTail(CTokenLine line, ILogger inLoger)
        {
            if (line.Comments != null)
            {
                AddComments(line.Comments.Text);
            }

            if (line.IsTailEmpty)
            {
                return;
            }

            for (int i = 0; i < line.TailLength; i++)
            {
                CToken t = line.Tail[i];

                CBaseElement be = CBaseValue.CreateBaseValue(this, t);

                if (be == null)
                {
                    inLoger.LogError(EErrorCode.WrongTokenInTail, t);
                }
            }
        }