Пример #1
0
void case_352()
#line 2942 "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;
	  }
Пример #2
0
 public virtual void Visit(EnumMember em)
 {
 }
Пример #3
0
void case_351()
#line 2928 "cs-parser.jay"
{ 
		--lexer.parsing_block;
		
		var lt = (LocatedToken) yyVals[-3+yyTop];
	  	var em = new EnumMember ((Enum) current_type, 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_type).AddEnumMember (em);
		
		if (doc_support)
			em.DocComment = ConsumeStoredComment ();

		yyVal = em;
	  }
Пример #4
0
			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);
			}
Пример #5
0
		public virtual void Visit (EnumMember em)
		{
		}
Пример #6
0
 public ImplicitInitializer(EnumMember current, EnumMember prev)
 {
     this.current = current;
     this.prev    = prev;
 }
Пример #7
0
		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;
			}

			AddMember (em);
		}
Пример #8
0
			public ImplicitInitializer (EnumMember current, EnumMember prev)
			{
				this.current = current;
				this.prev = prev;
			}