public class_definition NewObjectType(class_attribute class_attributes,
                                                  token_info class_or_interface_keyword, named_type_reference_list opt_base_classes,
                                                  where_definition_list opt_where_section, class_body_list opt_not_component_list_seq_end,
                                                  LexLocation loc)
            {
                var nnof = new class_definition(opt_base_classes, opt_not_component_list_seq_end, class_keyword.Class,
                                                null, opt_where_section, class_attribute.None, false, loc);
                string kw = class_or_interface_keyword.text.ToLower();

                nnof.attribute = class_attributes;
                if (kw == "record")
                {
                    nnof.keyword = class_keyword.Record;
                }
                else if (kw == "interface")
                {
                    nnof.keyword = class_keyword.Interface;
                }
                else if (kw == "i")
                {
                    nnof.keyword = class_keyword.TemplateInterface;
                }
                else if (kw == "r")
                {
                    nnof.keyword = class_keyword.TemplateRecord;
                }
                else if (kw == "c")
                {
                    nnof.keyword = class_keyword.TemplateClass;
                }
                if (nnof.body != null && ((class_definition)nnof).body.class_def_blocks != null &&
                    ((class_definition)nnof).body.class_def_blocks.Count > 0 &&
                    ((class_definition)nnof).body.class_def_blocks[0].access_mod == null)
                {
                    if (nnof.keyword == class_keyword.Class)
                    {
                        nnof.body.class_def_blocks[0].access_mod =
                            new access_modifer_node(access_modifer.internal_modifer);
                    }
                    else
                    {
                        nnof.body.class_def_blocks[0].access_mod = new access_modifer_node(access_modifer.none);
                    }
                }

                return(nnof);
            }
Beispiel #2
0
        public class_definition NewObjectType(class_attribute class_attributes, token_info class_or_interface_keyword, named_type_reference_list opt_base_classes, where_definition_list opt_where_section, class_body opt_not_component_list_seq_end, LexLocation loc)
        {
            var nnof = new class_definition(opt_base_classes, opt_not_component_list_seq_end, class_keyword.Class, null, opt_where_section, class_attribute.None, false, loc); 
			string kw = class_or_interface_keyword.text.ToLower();
            nnof.attribute = class_attributes;
			if (kw=="record") 
				nnof.keyword=class_keyword.Record;
			else
			if (kw=="interface") 
				nnof.keyword=class_keyword.Interface;
			else
			if (kw=="i") 
				nnof.keyword=class_keyword.TemplateInterface;
			else
			if (kw=="r") 
				nnof.keyword=class_keyword.TemplateRecord;
			else
			if (kw=="c") 
				nnof.keyword=class_keyword.TemplateClass;
            if (nnof.body != null && ((class_definition)nnof).body.class_def_blocks != null &&
                ((class_definition)nnof).body.class_def_blocks.Count > 0 && ((class_definition)nnof).body.class_def_blocks[0].access_mod == null)
            {
                if (nnof.keyword == class_keyword.Class)
                    nnof.body.class_def_blocks[0].access_mod = new access_modifer_node(access_modifer.internal_modifer);
                else
                    nnof.body.class_def_blocks[0].access_mod = new access_modifer_node(access_modifer.none);
            }
            return nnof;
        }
Beispiel #3
0
		///<summary>
		///Конструктор с параметрами.
		///</summary>
		public class_definition(type_definition_attr_list _attr_list,named_type_reference_list _class_parents,class_body _body,class_keyword _keyword,ident_list _template_args,where_definition_list _where_section,class_attribute _attribute,bool _is_auto,SourceContext sc)
		{
			this._attr_list=_attr_list;
			this._class_parents=_class_parents;
			this._body=_body;
			this._keyword=_keyword;
			this._template_args=_template_args;
			this._where_section=_where_section;
			this._attribute=_attribute;
			this._is_auto=_is_auto;
			source_context = sc;
		}
Beispiel #4
0
		///<summary>
		///Конструктор с параметрами.
		///</summary>
		public class_definition(named_type_reference_list _class_parents,class_body _body,class_keyword _keyword,ident_list _template_args,where_definition_list _where_section,class_attribute _attribute,bool _is_auto)
		{
			this._class_parents=_class_parents;
			this._body=_body;
			this._keyword=_keyword;
			this._template_args=_template_args;
			this._where_section=_where_section;
			this._attribute=_attribute;
			this._is_auto=_is_auto;
		}