當前位置: 首頁>>代碼示例>>C#>>正文


C# CSharp.EnumMember類代碼示例

本文整理匯總了C#中Mono.CSharp.EnumMember的典型用法代碼示例。如果您正苦於以下問題:C# EnumMember類的具體用法?C# EnumMember怎麽用?C# EnumMember使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EnumMember類屬於Mono.CSharp命名空間,在下文中一共展示了EnumMember類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: EnumMember

		public EnumMember (Enum parent, EnumMember prev_member, string name, Expression expr,
				   Attributes attrs, Location loc)
			: base (parent, new EnumTypeExpr (parent), name, expr, Modifiers.PUBLIC,
				attrs, loc)
		{
			this.ParentEnum = parent;
			this.ValueExpr = expr;
			this.prev_member = prev_member;
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:9,代碼來源:enum.cs

示例2: AddEnumMember

		public void AddEnumMember (EnumMember em)
		{
			if (em.Name == UnderlyingValueField) {
				Report.Error (76, em.Location, "An item in an enumeration cannot have an identifier `{0}'",
					UnderlyingValueField);
				return;
			}

			AddConstant (em);
		}
開發者ID:nylen,項目名稱:SharpDevelop,代碼行數:10,代碼來源:enum.cs

示例3: ImplicitInitializer

			public ImplicitInitializer (EnumMember current, EnumMember prev)
			{
				this.current = current;
				this.prev = prev;
			}
開發者ID:nylen,項目名稱:SharpDevelop,代碼行數:5,代碼來源:enum.cs

示例4: Visit

		public virtual void Visit (EnumMember em)
		{
		}
開發者ID:KAW0,項目名稱:Alter-Native,代碼行數:3,代碼來源:visit.cs

示例5: case_339

void case_339()
#line 2609 "cs-parser.jay"
{ 
		--lexer.parsing_block;
		
		var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop];
	  	var em = new EnumMember ((Enum) current_class, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-4+yyTop]);
	  	em.Initializer = new ConstInitializer (em, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
	  	((Enum) current_class).AddEnumMember (em);
		
		if (RootContext.Documentation != null)
			em.DocComment = ConsumeStoredComment ();

		yyVal = em;
	  }
開發者ID:Ein,項目名稱:monodevelop,代碼行數:15,代碼來源:cs-parser.cs

示例6: case_337

void case_337()
#line 2591 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{ 
		--lexer.parsing_block;
		
		var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop];
	  	var em = new EnumMember ((Enum) current_class, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-4+yyTop]);
	  	em.Initializer = new ConstInitializer (em, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
	  	((Enum) current_class).AddEnumMember (em);
		
		if (doc_support)
			em.DocComment = ConsumeStoredComment ();

		yyVal = em;
	  }
開發者ID:RainsSoft,項目名稱:MonoCompilerAsAService,代碼行數:15,代碼來源:cs-parser.cs

示例7: Visit

			public override void Visit(EnumMember em)
			{
				var newField = new EnumMemberDeclaration();
				AddAttributeSection(newField, em);
				newField.AddChild(Identifier.Create(em.Name, Convert(em.Location)), Roles.Identifier);
				if (em.Initializer != null) {
					newField.AddChild(new CSharpTokenNode(Convert(em.Initializer.Location), Roles.Assign), Roles.Assign);
					newField.AddChild((Expression)em.Initializer.Accept(this), EnumMemberDeclaration.InitializerRole);
				}
				//Console.WriteLine (newField.StartLocation +"-" + newField.EndLocation);
				
				typeStack.Peek().AddChild(newField, Roles.TypeMemberRole);
			}
開發者ID:0xb1dd1e,項目名稱:NRefactory,代碼行數:13,代碼來源:CSharpParser.cs

示例8: case_334

void case_334()
#line 2767 "cs-parser.jay"
{
		Error_SyntaxError (yyToken);
	  
		var lt = (LocatedToken) yyVals[-1+yyTop];
	  	var em = new EnumMember ((Enum) current_type, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-2+yyTop]);
	  	((Enum) current_type).AddEnumMember (em);

		if (doc_support) {
			em.DocComment = Lexer.consume_doc_comment ();
			Lexer.doc_state = XmlCommentState.Allowed;
		}

		yyVal = em;
	  }
開發者ID:segaman,項目名稱:NRefactory,代碼行數:16,代碼來源:cs-parser.cs

示例9: yyparse


//.........這裏部分代碼省略.........
		if (RootContext.Documentation != null)
			indexer.DocComment = ConsumeStoredComment ();

		current_container.AddIndexer (indexer);
		
		current_local_parameters = null;
		implicit_value_parameter_type = null;
		indexer_parameters = null;
	  }
  break;
case 314:
#line 2469 "cs-parser.jay"
  {
		if (RootContext.Documentation != null)
			enumTypeComment = Lexer.consume_doc_comment ();
	  }
  break;
case 315:
#line 2475 "cs-parser.jay"
  {
		MemberName name = (MemberName) yyVals[-4+yyTop];
		if (name.IsGeneric) {
			Report.Error (1675, name.Location, "Enums cannot have type parameters");
		}

		name = MakeName (name);
		Enum e = new Enum (current_namespace, current_class, (TypeExpr) yyVals[-3+yyTop], (Modifiers) yyVals[-6+yyTop],
				   name, (Attributes) yyVals[-7+yyTop]);
		
		if (RootContext.Documentation != null)
			e.DocComment = enumTypeComment;


		EnumMember em = null;
		foreach (VariableDeclaration ev in (IList<VariableDeclaration>) yyVals[-1+yyTop]) {
			em = new EnumMember (
				e, em, ev.identifier, ev.GetInitializer ((FullNamedExpression) yyVals[-3+yyTop]),
				ev.OptAttributes, ev.Location);

/*			if (RootContext.Documentation != null)*/
				em.DocComment = ev.DocComment;

			e.AddEnumMember (em);
		}
		if (RootContext.EvalMode)
			undo.AddTypeContainer (current_container, e);

		current_container.AddTypeContainer (e);

		yyVal = e;

	  }
  break;
case 316:
#line 2512 "cs-parser.jay"
  {
		yyVal = TypeManager.system_int32_expr;
	  }
  break;
case 317:
#line 2516 "cs-parser.jay"
  {
		if (yyVals[0+yyTop] != TypeManager.system_int32_expr && yyVals[0+yyTop] != TypeManager.system_uint32_expr &&
			yyVals[0+yyTop] != TypeManager.system_int64_expr && yyVals[0+yyTop] != TypeManager.system_uint64_expr &&
			yyVals[0+yyTop] != TypeManager.system_int16_expr && yyVals[0+yyTop] != TypeManager.system_uint16_expr &&
			yyVals[0+yyTop] != TypeManager.system_byte_expr && yyVals[0+yyTop] != TypeManager.system_sbyte_expr) {
開發者ID:speier,項目名稱:shake,代碼行數:67,代碼來源:cs-parser.cs

示例10: Visit

			public override void Visit (EnumMember em)
			{
				EnumMemberDeclaration newField = new EnumMemberDeclaration ();
				VariableInitializer variable = new VariableInitializer ();
				
				variable.AddChild (new Identifier (em.Name, Convert (em.Location)), DomNode.Roles.Identifier);
				
				if (em.Initializer != null) {
					var initializer = (DomNode)em.Initializer.Accept (this);
					if (initializer != null)
						variable.AddChild (initializer, DomNode.Roles.Initializer);
				}
				
				newField.AddChild (variable, DomNode.Roles.Initializer);
				typeStack.Peek ().AddChild (newField, TypeDeclaration.Roles.Member);
			}
開發者ID:nickname100,項目名稱:monodevelop,代碼行數:16,代碼來源:CSharpParser.cs

示例11: Visit

			public override void Visit (EnumMember em)
			{
				EnumMemberDeclaration newField = new EnumMemberDeclaration ();
				VariableInitializer variable = new VariableInitializer ();
				
				variable.AddChild (new Identifier (em.Name, Convert (em.Location)), AstNode.Roles.Identifier);
				
				if (em.Initializer != null) {
					variable.AddChild ((MonoDevelop.CSharp.Ast.Expression)em.Initializer.Accept (this), VariableInitializer.Roles.Expression);
				}
				
				newField.AddChild (variable, AstNode.Roles.Variable);
				typeStack.Peek ().AddChild (newField, TypeDeclaration.MemberRole);
			}
開發者ID:sandyarmstrong,項目名稱:monodevelop,代碼行數:14,代碼來源:CSharpParser.cs

示例12: Visit

			public override void Visit (EnumMember em)
			{
				EnumMemberDeclaration newField = new EnumMemberDeclaration ();
				// TODO: attributes, 'new' modifier
				newField.AddChild (new Identifier (em.Name, Convert (em.Location)), AstNode.Roles.Identifier);
				
				if (em.Initializer != null) {
					newField.AddChild ((Expression)em.Initializer.Accept (this), EnumMemberDeclaration.InitializerRole);
				}
				
				typeStack.Peek ().AddChild (newField, TypeDeclaration.MemberRole);
			}
開發者ID:tanujmathur,項目名稱:ILSpy,代碼行數:12,代碼來源:CSharpParser.cs

示例13: case_324

void case_324()
{
		var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop];
	  	var em = new EnumMember ((Enum) current_type, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-1+yyTop]);
	  	((Enum) current_type).AddEnumMember (em);

		if (doc_support) {
			em.DocComment = Lexer.consume_doc_comment ();
			Lexer.doc_state = XmlCommentState.Allowed;
		}

		yyVal = em;
	  }
開發者ID:animaonline,項目名稱:Portable-Mono.CSharp,代碼行數:13,代碼來源:cs-parser.cs

示例14: yyparse


//.........這裏部分代碼省略.........
	 	var te = yyVals[0+yyTop] as TypeExpression;
		if (te == null || !EnumSpec.IsValidUnderlyingType (te.Type)) {
			Enum.Error_1008 (GetLocation (yyVals[0+yyTop]), report);
			yyVal = null;
		} else {
			yyVal = yyVals[0+yyTop];
		}
	 }
  break;
case 341:
#line 2902 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
	 	Error_TypeExpected (GetLocation (yyVals[-1+yyTop]));
		yyVal = null;
	 }
  break;
case 344:
#line 2912 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
	  	lbag.AddLocation (yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop]));
	  }
  break;
case 346:
#line 2920 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
	  	lbag.AddLocation (yyVals[-2+yyTop], GetLocation (yyVals[-1+yyTop]));
	  	yyVal = yyVals[0+yyTop];
	  }
  break;
case 347:
#line 2928 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop];
	  	var em = new EnumMember ((Enum) current_class, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-1+yyTop]);
	  	((Enum) current_class).AddEnumMember (em);

		if (doc_support) {
			em.DocComment = Lexer.consume_doc_comment ();
			Lexer.doc_state = XmlCommentState.Allowed;
		}

		yyVal = em;
	  }
  break;
case 348:
#line 2941 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
	  	++lexer.parsing_block;
		if (doc_support) {
			tmpComment = Lexer.consume_doc_comment ();
			Lexer.doc_state = XmlCommentState.NotAllowed;
		}
	  }
  break;
case 349:
#line 2949 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  { 
		--lexer.parsing_block;
		
		var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop];
	  	var em = new EnumMember ((Enum) current_class, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-4+yyTop]);
	  	em.Initializer = new ConstInitializer (em, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
	  	((Enum) current_class).AddEnumMember (em);
		
		if (doc_support)
			em.DocComment = ConsumeStoredComment ();
開發者ID:runefs,項目名稱:Marvin,代碼行數:67,代碼來源:cs-parser.cs

示例15: Visit

			public override void Visit (EnumMember em)
			{
				EnumMemberDeclaration newField = new EnumMemberDeclaration ();
				AddAttributeSection (newField, em);
				newField.AddChild (Identifier.Create (em.Name, Convert (em.Location)), AstNode.Roles.Identifier);
				
				if (em.Initializer != null) {
					newField.AddChild (new CSharpTokenNode (Convert (em.Initializer.Location), 1), EnumMemberDeclaration.Roles.Assign);
					newField.AddChild ((Expression)em.Initializer.Accept (this), EnumMemberDeclaration.InitializerRole);
				}
				
				typeStack.Peek ().AddChild (newField, TypeDeclaration.MemberRole);
			}
開發者ID:severinh,項目名稱:monodevelop-vala-afrodite-update,代碼行數:13,代碼來源:CSharpParser.cs


注:本文中的Mono.CSharp.EnumMember類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。