コード例 #1
0
ファイル: Tree.cs プロジェクト: lisiynos/pascalabcnet
		public class_members Add(declaration _declaration, SourceContext sc)
		{
		    members.Add(_declaration);
		    source_context = sc;
		    return this;
		}
コード例 #2
0
ファイル: NodesBuilder.cs プロジェクト: lisiynos/pascalabcnet
 public static class_members BuildOneMemberSection(declaration m)
 {
     var cm = new class_members(access_modifer.public_modifer);
     cm.Add(m);
     return cm;
 }
コード例 #3
0
		public void visit(declaration _declaration)
		{
			bw.Write((Int16)20);
			write_declaration(_declaration);
		}
コード例 #4
0
		public void visit(declaration _declaration)
		{
			read_declaration(_declaration);
		}
コード例 #5
0
 public override void visit(declaration _declaration)
 {
     throw new Exception("The method or operation is not implemented.");
 }
コード例 #6
0
ファイル: Tree.cs プロジェクト: Slav76/pascalabcnet
		public bool Remove(declaration el)
		{
			return defs.Remove(el);
		}
コード例 #7
0
ファイル: Tree.cs プロジェクト: Slav76/pascalabcnet
		public void ReplaceInList(declaration el, IEnumerable<declaration> newels)
		{
			var ind = FindIndexInList(el);
			defs.RemoveAt(ind);
			defs.InsertRange(ind, newels);
		}
コード例 #8
0
ファイル: Tree.cs プロジェクト: Slav76/pascalabcnet
		public bool Remove(declaration el)
		{
			return members.Remove(el);
		}
コード例 #9
0
ファイル: Tree.cs プロジェクト: Slav76/pascalabcnet
		// Конструкторы списка
		public function_lambda_definition(declaration elem, SourceContext sc = null)
		{
			Add(elem, sc);
		}
コード例 #10
0
ファイル: Tree.cs プロジェクト: Slav76/pascalabcnet
		// Методы списка
		public class_members Add(declaration elem, SourceContext sc = null)
		{
			members.Add(elem);
			if (sc != null)
				source_context = sc;
			return this;
		}
コード例 #11
0
ファイル: Tree.cs プロジェクト: Slav76/pascalabcnet
		public void AddFirst(declaration el)
		{
			members.Insert(0, el);
		}
コード例 #12
0
ファイル: Tree.cs プロジェクト: Slav76/pascalabcnet
		// Конструкторы списка
		public class_members(declaration elem, SourceContext sc = null)
		{
			Add(elem, sc);
		}
コード例 #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());
     }
 }
コード例 #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;
 }
コード例 #15
0
ファイル: Tree.cs プロジェクト: Slav76/pascalabcnet
		public void InsertBefore(declaration el, declaration newel)
		{
			defs.Insert(FindIndex(el), newel);
		}
コード例 #16
0
ファイル: Tree.cs プロジェクト: Slav76/pascalabcnet
		// Методы списка
		public function_lambda_definition Add(declaration elem, SourceContext sc = null)
		{
			defs.Add(elem);
			if (sc != null)
				source_context = sc;
			return this;
		}
コード例 #17
0
ファイル: Tree.cs プロジェクト: Slav76/pascalabcnet
		public void InsertBefore(declaration el, IEnumerable<declaration> newels)
		{
			defs.InsertRange(FindIndex(el), newels);
		}
コード例 #18
0
ファイル: Tree.cs プロジェクト: Slav76/pascalabcnet
		// Конструкторы списка
		public declarations(declaration elem, SourceContext sc = null)
		{
			Add(elem, sc);
		}
コード例 #19
0
ファイル: Tree.cs プロジェクト: Slav76/pascalabcnet
		public void ReplaceInList(declaration el, declaration newel)
		{
			defs[FindIndexInList(el)] = newel;
		}
コード例 #20
0
ファイル: Tree.cs プロジェクト: Slav76/pascalabcnet
		// Методы списка
		public declarations Add(declaration elem, SourceContext sc = null)
		{
			defs.Add(elem);
			if (sc != null)
				source_context = sc;
			return this;
		}
コード例 #21
0
ファイル: visualizator.cs プロジェクト: Slav76/pascalabcnet
        public override void visit(declaration _subprogram_definition)
		{
			
		}
コード例 #22
0
ファイル: Tree.cs プロジェクト: Slav76/pascalabcnet
		public void AddFirst(declaration el)
		{
			defs.Insert(0, el);
		}
コード例 #23
0
		public void read_declaration(declaration _declaration)
		{
			read_syntax_tree_node(_declaration);
			_declaration.attributes = _read_node() as attribute_list;
		}
コード例 #24
0
ファイル: Tree.cs プロジェクト: Slav76/pascalabcnet
		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;
		}
コード例 #25
0
 public override void visit(declaration _declaration)
 {
     throw new NotImplementedException();
 }
コード例 #26
0
ファイル: Tree.cs プロジェクト: Slav76/pascalabcnet
		public void InsertAfter(declaration el, declaration newel)
		{
			defs.Insert(FindIndex(el) + 1, newel);
		}
コード例 #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;
 }
コード例 #28
0
ファイル: Tree.cs プロジェクト: Slav76/pascalabcnet
		public void InsertAfter(declaration el, IEnumerable<declaration> newels)
		{
			defs.InsertRange(FindIndex(el) + 1, newels);
		}
コード例 #29
0
		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);
			}
		}
コード例 #30
0
ファイル: Tree.cs プロジェクト: lisiynos/pascalabcnet
		public class_members Add(declaration _declaration)
		{
		    members.Add(_declaration);
		    return this;
		}