示例#1
0
		public void ReplaceInList(variant el, variant newel)
		{
			vars[FindIndexInList(el)] = newel;
		}
示例#2
0
		public void ReplaceInList(variant el, IEnumerable<variant> newels)
		{
			var ind = FindIndexInList(el);
			vars.RemoveAt(ind);
			vars.InsertRange(ind, newels);
		}
示例#3
0
		public variant_list(variant _variant, SourceContext sc)
		{
		    Add(_variant,sc);
		}
示例#4
0
		public bool Remove(variant el)
		{
			return vars.Remove(el);
		}
 public override void visit(variant _variant)
 {
     //throw new Exception("The method or operation is not implemented.");
 }
		public void visit(variant _variant)
		{
			bw.Write((Int16)92);
			write_variant(_variant);
		}
示例#7
0
		private int FindIndexInList(variant el)
		{
			var ind = vars.FindIndex(x => x == el);
			if (ind == -1)
				throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
			return ind;
		}
		public void read_variant(variant _variant)
		{
			read_syntax_tree_node(_variant);
			_variant.vars = _read_node() as ident_list;
			_variant.vars_type = _read_node() as type_definition;
		}
示例#9
0
		// Методы списка
		public variant_list Add(variant elem, SourceContext sc = null)
		{
			vars.Add(elem);
			if (sc != null)
				source_context = sc;
			return this;
		}
示例#10
0
		public void AddFirst(variant el)
		{
			vars.Insert(0, el);
		}
示例#11
0
		// Конструкторы списка
		public variant_list(variant elem, SourceContext sc = null)
		{
			Add(elem, sc);
		}
示例#12
0
		public variant_list Add(variant _variant, SourceContext sc)
		{
		    vars.Add(_variant);
		    source_context = sc;
		    return this;
		}
示例#13
0
		public variant_list Add(variant _variant)
		{
		    vars.Add(_variant);
		    return this;
		}
示例#14
0
		public override void visit(variant _variant)
		{
			prepare_node(_variant.vars,"vars");
			prepare_node(_variant.vars_type,"vars_type");
		}
示例#15
0
		public void InsertAfter(variant el, variant newel)
		{
			vars.Insert(FindIndex(el) + 1, newel);
		}
		public void visit(variant _variant)
		{
			read_variant(_variant);
		}
示例#17
0
		public void InsertAfter(variant el, IEnumerable<variant> newels)
		{
			vars.InsertRange(FindIndex(el) + 1, newels);
		}
示例#18
0
		public override void visit(variant _variant)
		{
			throw new NotImplementedException();
		}
示例#19
0
		public void InsertBefore(variant el, variant newel)
		{
			vars.Insert(FindIndex(el), newel);
		}
示例#20
0
        public override void visit(variant _variant)
        {

        }
示例#21
0
		public void InsertBefore(variant el, IEnumerable<variant> newels)
		{
			vars.InsertRange(FindIndex(el), newels);
		}
		public void write_variant(variant _variant)
		{
			write_syntax_tree_node(_variant);
			if (_variant.vars == null)
			{
				bw.Write((byte)0);
			}
			else
			{
				bw.Write((byte)1);
				_variant.vars.visit(this);
			}
			if (_variant.vars_type == null)
			{
				bw.Write((byte)0);
			}
			else
			{
				bw.Write((byte)1);
				_variant.vars_type.visit(this);
			}
		}
		public void Replace(variant el, variant newel)
		{
			vars[FindIndex(el)] = newel;
		}