• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# CSharp.NamespaceEntry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Mono.CSharp.NamespaceEntry的典型用法代码示例。如果您正苦于以下问题:C# NamespaceEntry类的具体用法?C# NamespaceEntry怎么用?C# NamespaceEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NamespaceEntry类属于Mono.CSharp命名空间,在下文中一共展示了NamespaceEntry类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Class

        public Class(NamespaceEntry ns, DeclSpace parent, MemberName name, Modifiers mod,
			      Attributes attrs)
            : base(ns, parent, name, attrs, MemberKind.Class)
        {
            var accmods = (Parent == null || Parent.Parent == null) ? Modifiers.INTERNAL : Modifiers.PRIVATE;
            this.ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod, accmods, Location, Report);
            spec = new TypeSpec (Kind, null, this, null, ModFlags);
        }
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:8,代码来源:class.cs


示例2: Enum

 public Enum(NamespaceEntry ns, DeclSpace parent, TypeExpr type,
     Modifiers mod_flags, MemberName name, Attributes attrs)
     : base(ns, parent, name, attrs, MemberKind.Enum)
 {
     this.base_type = type;
     var accmods = IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE;
     ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod_flags, accmods, Location, Report);
     spec = new EnumSpec (null, this, null, null, ModFlags);
 }
开发者ID:speier,项目名称:shake,代码行数:9,代码来源:enum.cs


示例3: Delegate

 		public Delegate (NamespaceEntry ns, DeclSpace parent, FullNamedExpression type,
				 int mod_flags, MemberName name, ParametersCompiled param_list,
				 Attributes attrs)
			: base (ns, parent, name, attrs, Kind.Delegate)

		{
			this.ReturnType = type;
			ModFlags        = Modifiers.Check (AllowedModifiers, mod_flags,
							   IsTopLevel ? Modifiers.INTERNAL :
							   Modifiers.PRIVATE, name.Location, Report);
			Parameters      = param_list;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:12,代码来源:delegate.cs


示例4: Class

        public Class(NamespaceEntry ns, DeclSpace parent, MemberName name, Modifiers mod,
			      Attributes attrs)
            : base(ns, parent, name, attrs, MemberKind.Class)
        {
            var accmods = (Parent == null || Parent.Parent == null) ? Modifiers.INTERNAL : Modifiers.PRIVATE;
            this.ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod, accmods, Location, Report);
            spec = new TypeSpec (Kind, null, this, null, ModFlags);

            if (IsStatic && RootContext.Version == LanguageVersion.ISO_1) {
                Report.FeatureIsNotAvailable (Location, "static classes");
            }
        }
开发者ID:richardschneider,项目名称:ILSpy,代码行数:12,代码来源:class.cs


示例5: Delegate

        public Delegate(NamespaceEntry ns, DeclSpace parent, FullNamedExpression type,
				 Modifiers mod_flags, MemberName name, ParametersCompiled param_list,
				 Attributes attrs)
            : base(ns, parent, name, attrs, MemberKind.Delegate)
        {
            this.ReturnType = type;
            ModFlags        = ModifiersExtensions.Check (AllowedModifiers, mod_flags,
                               IsTopLevel ? Modifiers.INTERNAL :
                               Modifiers.PRIVATE, name.Location, Report);
            parameters      = param_list;
            spec = new TypeSpec (Kind, null, this, null, ModFlags | Modifiers.SEALED);
        }
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:12,代码来源:delegate.cs


示例6: LookupExtensionMethod

		public IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceEntry scope)
		{
			throw new NotImplementedException ();
		}
开发者ID:afaerber,项目名称:mono,代码行数:4,代码来源:codegen.cs


示例7: GlobalAttribute

		public GlobalAttribute (NamespaceEntry ns, string target, ATypeNameExpression expression,
					Arguments[] args, Location loc, bool nameEscaped):
			base (target, expression, args, loc, nameEscaped)
		{
			this.ns = ns;
		}
开发者ID:alisci01,项目名称:mono,代码行数:6,代码来源:attribute.cs


示例8: LookupExtensionMethod

		public override IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceEntry scope)
		{
			DeclSpace top_level = Parent;
			if (top_level != null) {
				while (top_level.Parent != null)
					top_level = top_level.Parent;

				var candidates = NamespaceEntry.NS.LookupExtensionMethod (extensionType, this, name, arity);
				if (candidates != null) {
					scope = NamespaceEntry;
					return candidates;
				}
			}

			return NamespaceEntry.LookupExtensionMethod (extensionType, name, arity, ref scope);
		}
开发者ID:famousthom,项目名称:monodevelop,代码行数:16,代码来源:class.cs


示例9: ParseString

		//
		// Parses the string @input and returns a CSharpParser if succeeful.
		//
		// if @silent is set to true then no errors are
		// reported to the user.  This is used to do various calls to the
		// parser and check if the expression is parsable.
		//
		// @partial_input: if @silent is true, then it returns whether the
		// parsed expression was partial, and more data is needed
		//
		static CSharpParser ParseString (ParseMode mode, string input, out bool partial_input)
		{
			partial_input = false;
			Reset ();
			queued_fields.Clear ();
			Tokenizer.LocatedToken.Initialize ();

			Stream s = new MemoryStream (Encoding.Default.GetBytes (input));
			SeekableStreamReader seekable = new SeekableStreamReader (s, Encoding.Default);

			InputKind kind = ToplevelOrStatement (seekable);
			if (kind == InputKind.Error){
				if (mode == ParseMode.ReportErrors)
					ctx.Report.Error (-25, "Detection Parsing Error");
				partial_input = false;
				return null;
			}

			if (kind == InputKind.EOF){
				if (mode == ParseMode.ReportErrors)
					Console.Error.WriteLine ("Internal error: EOF condition should have been detected in a previous call with silent=true");
				partial_input = true;
				return null;
				
			}
			seekable.Position = 0;

			if (ns == null)
				ns = new NamespaceEntry (RootContext.ToplevelTypes, null, Location.SourceFiles[0], null);

			CSharpParser parser = new CSharpParser (seekable, Location.SourceFiles [0], RootContext.ToplevelTypes, ns);

			if (kind == InputKind.StatementOrExpression){
				parser.Lexer.putback_char = Tokenizer.EvalStatementParserCharacter;
				RootContext.StatementMode = true;
			} else {
				parser.Lexer.putback_char = Tokenizer.EvalCompilationUnitParserCharacter;
				RootContext.StatementMode = false;
			}

			if (mode == ParseMode.GetCompletions)
				parser.Lexer.CompleteOnEOF = true;

			ReportPrinter old_printer = null;
			if ((mode == ParseMode.Silent || mode == ParseMode.GetCompletions) && CSharpParser.yacc_verbose_flag == 0)
				old_printer = SetPrinter (new StreamReportPrinter (TextWriter.Null));

			try {
				parser.parse ();
			} finally {
				if (ctx.Report.Errors != 0){
					if (mode != ParseMode.ReportErrors  && parser.UnexpectedEOF)
						partial_input = true;

					parser.undo.ExecuteUndo ();
					parser = null;
				}

				if (old_printer != null)
					SetPrinter (old_printer);
			}
			return parser;
		}
开发者ID:keith512,项目名称:mono,代码行数:73,代码来源:eval.cs


示例10: ClassOrStruct

		public ClassOrStruct (NamespaceEntry ns, DeclSpace parent,
				      MemberName name, Attributes attrs, MemberKind kind)
			: base (ns, parent, name, attrs, kind)
		{
		}
开发者ID:famousthom,项目名称:monodevelop,代码行数:5,代码来源:class.cs


示例11: NamespaceEntry

		private NamespaceEntry (NamespaceEntry parent, CompilationUnit file, Namespace ns, bool slave)
		{
			this.parent = parent;
			this.file = file;
			this.IsImplicit = true;
			this.ns = ns;
			this.SlaveDeclSpace = slave ? new RootDeclSpace (this) : null;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:8,代码来源:namespace.cs


示例12: LookupExtensionMethod

		public virtual IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceEntry scope)
		{
			return Parent.LookupExtensionMethod (extensionType, name, arity, ref scope);
		}
开发者ID:stewartwhaley,项目名称:monodevelop,代码行数:4,代码来源:decl.cs


示例13: RootDeclSpace

 public RootDeclSpace(NamespaceEntry ns)
     : base(ns, null, MemberName.Null, null, 0)
 {
     PartialContainer = RootContext.ToplevelTypes;
 }
开发者ID:speier,项目名称:shake,代码行数:5,代码来源:roottypes.cs


示例14: yyparse


//.........这里部分代码省略.........
		if (RootContext.Documentation != null)
			Lexer.doc_state = XmlCommentState.Allowed;
	  }
  break;
case 22:
#line 449 "cs-parser.jay"
  {
		var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop];
		current_namespace.AddUsingAlias (lt.Value, (MemberName) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));
	  }
  break;
case 23:
#line 453 "cs-parser.jay"
  {
		CheckIdentifierToken (yyToken, GetLocation (yyVals[0+yyTop]));
		yyVal = null;
	  }
  break;
case 24:
#line 461 "cs-parser.jay"
  {
		current_namespace.AddUsing ((MemberName) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
	  }
  break;
case 25:
#line 473 "cs-parser.jay"
  {
		MemberName name = (MemberName) yyVals[0+yyTop];

		if (yyVals[-2+yyTop] != null) {
			Report.Error(1671, name.Location, "A namespace declaration cannot have modifiers or attributes");
		}

		current_namespace = new NamespaceEntry (
			current_namespace, file, name.GetName ());
		current_class = current_namespace.SlaveDeclSpace;
		current_container = current_class.PartialContainer;
	  }
  break;
case 26:
#line 486 "cs-parser.jay"
  { 
		current_namespace = current_namespace.Parent;
		current_class = current_namespace.SlaveDeclSpace;
		current_container = current_class.PartialContainer;
	  }
  break;
case 27:
#line 495 "cs-parser.jay"
  {
		var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop];
		yyVal = new MemberName (lt.Value, lt.Location);
	  }
  break;
case 28:
#line 500 "cs-parser.jay"
  {
		var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop];
		yyVal = new MemberName ((MemberName) yyVals[-2+yyTop], lt.Value, lt.Location);		
	  }
  break;
case 29:
#line 505 "cs-parser.jay"
  {
		syntax_error (lexer.Location, "`.' expected");
		yyVal = new MemberName ("<invalid>", lexer.Location);
开发者ID:speier,项目名称:shake,代码行数:67,代码来源:cs-parser.cs


示例15: ResolveOverloadExtensions

        MethodGroupExpr ResolveOverloadExtensions(ResolveContext ec, ref Arguments arguments, NamespaceEntry ns, Location loc)
        {
            // Use normal resolve rules
            MethodGroupExpr mg = base.OverloadResolve (ec, ref arguments, ns != null, loc);
            if (mg != null)
                return mg;

            if (ns == null)
                return null;

            // Search continues
            int arity = type_arguments == null ? -1 : type_arguments.Count;
            ExtensionMethodGroupExpr e = ns.LookupExtensionMethod (type, Name, arity, loc);
            if (e == null)
                return base.OverloadResolve (ec, ref arguments, false, loc);

            e.ExtensionExpression = ExtensionExpression;
            e.SetTypeArguments (ec, type_arguments);
            return e.ResolveOverloadExtensions (ec, ref arguments, e.namespace_entry, loc);
        }
开发者ID:speier,项目名称:shake,代码行数:20,代码来源:ecore.cs


示例16: ExtensionMethodGroupExpr

 public ExtensionMethodGroupExpr(List<MethodSpec> list, NamespaceEntry n, TypeSpec extensionType, Location l)
     : base(list.Cast<MemberSpec>().ToList (), extensionType, l)
 {
     this.namespace_entry = n;
 }
开发者ID:speier,项目名称:shake,代码行数:5,代码来源:ecore.cs


示例17: LookupExtensionMethod

 public IList<MethodSpec> LookupExtensionMethod(TypeSpec extensionType, string name, int arity, ref NamespaceEntry scope)
 {
     return MemberContext.LookupExtensionMethod (extensionType, name, arity, ref scope);
 }
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:4,代码来源:context.cs


示例18: CSharpParser

public CSharpParser (SeekableStreamReader reader, CompilationUnit file, CompilerContext ctx)
{
	if (RootContext.EvalMode)
		undo = new Undo ();

	this.file = file;
	this.compiler = ctx;
	current_namespace = new NamespaceEntry (ctx, null, file, null);
	current_class = current_namespace.SlaveDeclSpace;
	current_container = current_class.PartialContainer; // == RootContest.ToplevelTypes
	oob_stack.Clear ();
	lexer = new Tokenizer (reader, file, ctx);
	
	use_global_stacks = true;
}
开发者ID:Ein,项目名称:monodevelop,代码行数:15,代码来源:cs-parser.cs


示例19: DeclSpace

		public DeclSpace (NamespaceEntry ns, DeclSpace parent, MemberName name,
				  Attributes attrs)
			: base (parent, name, attrs)
		{
			NamespaceEntry = ns;
			Basename = name.Basename;
			defined_names = new Dictionary<string, MemberCore> ();
			PartialContainer = null;
			if (name.TypeArguments != null) {
				is_generic = true;
				count_type_params = name.TypeArguments.Count;
			}
			if (parent != null)
				count_type_params += parent.count_type_params;
		}
开发者ID:stewartwhaley,项目名称:monodevelop,代码行数:15,代码来源:decl.cs


示例20: case_25

void case_25()
#line 471 "cs-parser.jay"
{
		MemberName name = (MemberName) yyVals[0+yyTop];

		if (yyVals[-2+yyTop] != null) {
			Report.Error(1671, name.Location, "A namespace declaration cannot have modifiers or attributes");
		}

		current_namespace = new NamespaceEntry (compiler,
			current_namespace, file, name.GetName ());
		current_class = current_namespace.SlaveDeclSpace;
		current_container = current_class.PartialContainer;
		ubag.DeclareNamespace (GetLocation (yyVals[-1+yyTop]), name);
	  }
开发者ID:Ein,项目名称:monodevelop,代码行数:15,代码来源:cs-parser.cs



注:本文中的Mono.CSharp.NamespaceEntry类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CSharp.New类代码示例发布时间:2022-05-26
下一篇:
C# CSharp.NamespaceContainer类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap