Esempio n. 1
0
		public class_members Add(declaration _declaration, SourceContext sc)
		{
		    members.Add(_declaration);
		    source_context = sc;
		    return this;
		}
Esempio n. 2
0
 public static class_members BuildOneMemberSection(declaration m)
 {
     var cm = new class_members(access_modifer.public_modifer);
     cm.Add(m);
     return cm;
 }
		public void visit(declaration _declaration)
		{
			bw.Write((Int16)20);
			write_declaration(_declaration);
		}
		public void visit(declaration _declaration)
		{
			read_declaration(_declaration);
		}
 public override void visit(declaration _declaration)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Esempio n. 6
0
		public bool Remove(declaration el)
		{
			return defs.Remove(el);
		}
Esempio n. 7
0
		public void ReplaceInList(declaration el, IEnumerable<declaration> newels)
		{
			var ind = FindIndexInList(el);
			defs.RemoveAt(ind);
			defs.InsertRange(ind, newels);
		}
Esempio n. 8
0
		public bool Remove(declaration el)
		{
			return members.Remove(el);
		}
Esempio n. 9
0
		// Конструкторы списка
		public function_lambda_definition(declaration elem, SourceContext sc = null)
		{
			Add(elem, sc);
		}
Esempio n. 10
0
		// Методы списка
		public class_members Add(declaration elem, SourceContext sc = null)
		{
			members.Add(elem);
			if (sc != null)
				source_context = sc;
			return this;
		}
Esempio n. 11
0
		public void AddFirst(declaration el)
		{
			members.Insert(0, el);
		}
Esempio n. 12
0
		// Конструкторы списка
		public class_members(declaration elem, SourceContext sc = null)
		{
			Add(elem, sc);
		}
Esempio n. 13
0
 public void CompareInternal(declaration left, declaration 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);
         if (left is function_header)
             CompareInternal(left as function_header, right as function_header);
         else if (left is constructor)
             CompareInternal(left as constructor, right as constructor);
         else if (left is destructor)
             CompareInternal(left as destructor, right as destructor);
         else if (left is procedure_header)
             CompareInternal(left as procedure_header, right as procedure_header);
         else if (left is procedure_definition)
             CompareInternal(left as procedure_definition, right as procedure_definition);
         else if (left is variable_definitions)
             CompareInternal(left as variable_definitions, right as variable_definitions);
         else if (left is consts_definitions_list)
             CompareInternal(left as consts_definitions_list, right as consts_definitions_list);
         else if (left is type_declarations)
             CompareInternal(left as type_declarations, right as type_declarations);
         else if (left is label_definitions)
             CompareInternal(left as label_definitions, right as label_definitions);
         else if (left is simple_property)
             CompareInternal(left as simple_property, right as simple_property);
         else if (left is var_def_statement)
             CompareInternal(left as var_def_statement, right as var_def_statement);
         else if (left is simple_const_definition)
             CompareInternal(left as simple_const_definition, right as simple_const_definition);
         else if (left is typed_const_definition)
             CompareInternal(left as typed_const_definition, right as typed_const_definition);
         else
             throw new NotImplementedException(left.GetType().ToString());
     }
 }
Esempio n. 14
0
 private bool need_to_parse(declaration _declaration)
 {
     if (!(_declaration is procedure_definition))
         return false;
     procedure_definition proc = _declaration as procedure_definition;
     if (proc.proc_header.name.class_name != null)
         return true;
     if (proc.proc_header.proc_attributes == null)
         return false;
     if (has_extensionmethod_attr(proc.proc_header.proc_attributes.proc_attributes))
         return true;
     return false;
 }
Esempio n. 15
0
		public void InsertBefore(declaration el, declaration newel)
		{
			defs.Insert(FindIndex(el), newel);
		}
Esempio n. 16
0
		// Методы списка
		public function_lambda_definition Add(declaration elem, SourceContext sc = null)
		{
			defs.Add(elem);
			if (sc != null)
				source_context = sc;
			return this;
		}
Esempio n. 17
0
		public void InsertBefore(declaration el, IEnumerable<declaration> newels)
		{
			defs.InsertRange(FindIndex(el), newels);
		}
Esempio n. 18
0
		// Конструкторы списка
		public declarations(declaration elem, SourceContext sc = null)
		{
			Add(elem, sc);
		}
Esempio n. 19
0
		public void ReplaceInList(declaration el, declaration newel)
		{
			defs[FindIndexInList(el)] = newel;
		}
Esempio n. 20
0
		// Методы списка
		public declarations Add(declaration elem, SourceContext sc = null)
		{
			defs.Add(elem);
			if (sc != null)
				source_context = sc;
			return this;
		}
Esempio n. 21
0
        public override void visit(declaration _subprogram_definition)
		{
			
		}
Esempio n. 22
0
		public void AddFirst(declaration el)
		{
			defs.Insert(0, el);
		}
		public void read_declaration(declaration _declaration)
		{
			read_syntax_tree_node(_declaration);
			_declaration.attributes = _read_node() as attribute_list;
		}
Esempio n. 24
0
		private int FindIndexInList(declaration el)
		{
			var ind = defs.FindIndex(x => x == el);
			if (ind == -1)
				throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
			return ind;
		}
Esempio n. 25
0
 public override void visit(declaration _declaration)
 {
     throw new NotImplementedException();
 }
Esempio n. 26
0
		public void InsertAfter(declaration el, declaration newel)
		{
			defs.Insert(FindIndex(el) + 1, newel);
		}
Esempio n. 27
0
 public declaration NewPropertyDefinition(attribute_list opt_attribute_declarations, declaration simple_property_definition, LexLocation loc)
 {
     var nnpd = simple_property_definition;
     nnpd.attributes = opt_attribute_declarations;
     nnpd.source_context = loc;
     return nnpd;
 }
Esempio n. 28
0
		public void InsertAfter(declaration el, IEnumerable<declaration> newels)
		{
			defs.InsertRange(FindIndex(el) + 1, newels);
		}
		public void write_declaration(declaration _declaration)
		{
			write_syntax_tree_node(_declaration);
			if (_declaration.attributes == null)
			{
				bw.Write((byte)0);
			}
			else
			{
				bw.Write((byte)1);
				_declaration.attributes.visit(this);
			}
		}
Esempio n. 30
0
		public class_members Add(declaration _declaration)
		{
		    members.Add(_declaration);
		    return this;
		}