public ImplicitInitializer(EnumMember current, EnumMember prev) { this.current = current; this.prev = prev; }
public virtual void Visit (EnumMember em) { }
public override void Visit (EnumMember em) { EnumMemberDeclaration 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) { }
void case_330() #line 2728 "cs-parser.jay" { Error_SyntaxError (yyToken); var lt = (Tokenizer.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; }
void case_329() #line 2714 "cs-parser.jay" { --lexer.parsing_block; var lt = (Tokenizer.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 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; }