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; }
public virtual void Visit(EnumMember em) { }
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; }
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); }
public virtual void Visit (EnumMember em) { }
public ImplicitInitializer(EnumMember current, EnumMember prev) { this.current = current; this.prev = prev; }
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); }
public ImplicitInitializer (EnumMember current, EnumMember prev) { this.current = current; this.prev = prev; }