Example #1
0
		public void ReplaceInList(literal el, literal newel)
		{
			literals[FindIndexInList(el)] = newel;
		}
Example #2
0
		public void InsertBefore(literal el, IEnumerable<literal> newels)
		{
			literals.InsertRange(FindIndex(el), newels);
		}
Example #3
0
		public bool Remove(literal el)
		{
			return literals.Remove(el);
		}
		public void visit(literal _literal)
		{
			bw.Write((Int16)112);
			write_literal(_literal);
		}
Example #5
0
 public override void visit(literal _literal)
 {
     AddPossibleComments(_literal, true, true);
 }
		public void visit(literal _literal)
		{
			read_literal(_literal);
		}
 public override void visit(literal _literal)
 {
     //throw new Exception("The method or operation is not implemented.");
 }
Example #8
0
		// Методы списка
		public literal_const_line Add(literal elem, SourceContext sc = null)
		{
			literals.Add(elem);
			if (sc != null)
				source_context = sc;
			return this;
		}
Example #9
0
		public void AddFirst(literal el)
		{
			literals.Insert(0, el);
		}
 public void CompareInternal(literal left, literal right)
 {
     if (left == null && right != null || left != null && right == null)
         throw_not_equal(left, right);
     if (left != null && right != null)
     {
         if (left.GetType() != right.GetType())
             throw_not_equal(left, right);
         /*Type t = left.GetType();
         MethodInfo mi = typeof(SyntaxTreeComparer).GetMethod("CompareInternal", new Type[] { t, t });
         mi.Invoke(this, new object[] { left, right });*/
         if (left is char_const)
             CompareInternal(left as char_const, right as char_const);
         else if (left is sharp_char_const)
             CompareInternal(left as sharp_char_const, right as sharp_char_const);
         else if (left is string_const)
             CompareInternal(left as string_const, right as string_const);
         else
             throw new NotImplementedException(left.GetType().ToString());
     }
 }
Example #11
0
		// Конструкторы списка
		public literal_const_line(literal elem, SourceContext sc = null)
		{
			Add(elem, sc);
		}
Example #12
0
		public literal_const_line Add(literal _literal, SourceContext sc)
		{
		    literals.Add(_literal);
		    source_context = sc;
		    return this;
		}
Example #13
0
		public literal_const_line Add(literal _literal)
		{
		    literals.Add(_literal);
		    return this;
		}
Example #14
0
		public literal_const_line(literal _literal, SourceContext sc)
		{
		    Add(_literal,sc);
		}
Example #15
0
		public void ReplaceInList(literal el, IEnumerable<literal> newels)
		{
			var ind = FindIndexInList(el);
			literals.RemoveAt(ind);
			literals.InsertRange(ind, newels);
		}
Example #16
0
		private int FindIndexInList(literal el)
		{
			var ind = literals.FindIndex(x => x == el);
			if (ind == -1)
				throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
			return ind;
		}
Example #17
0
		public override void visit(literal _literal)
		{
			
		}
Example #18
0
		public void InsertAfter(literal el, literal newel)
		{
			literals.Insert(FindIndex(el) + 1, newel);
		}
		public void read_literal(literal _literal)
		{
			read_const_node(_literal);
		}
Example #20
0
		public void InsertAfter(literal el, IEnumerable<literal> newels)
		{
			literals.InsertRange(FindIndex(el) + 1, newels);
		}
Example #21
0
 public override void visit(literal _literal)
 {
     //throw new NotImplementedException();
 }
Example #22
0
		public void InsertBefore(literal el, literal newel)
		{
			literals.Insert(FindIndex(el), newel);
		}
		public void write_literal(literal _literal)
		{
			write_const_node(_literal);
		}
		public void Replace(literal el, literal newel)
		{
			literals[FindIndex(el)] = newel;
		}