public abstract record XmlGrammarItem(
[property: XmlAttribute("Name")]
string Name,
[property: XmlAttribute("Base")]
string? Base,
[property: XmlAttribute("Type")]
string? Type);
[XmlType("Node")]
public sealed record NodeGrammarItem(string Name, string? Base,
[property: XmlElement]
XmlNodeMember[] Members)
: XmlGrammarItem(Name, Base, Name)
{
public NodeGrammarItem() : this(null!, null, null!) {}
}
[XmlType("Member")]
public sealed record XmlNodeMember(
[property: XmlAttribute("Name")]
string Name,
[property: XmlAttribute("Type")]
string Type,
[property: XmlAttribute("Optional")]
bool Optional,
[property: XmlElement]
XmlMemberValue[] Values)
{
public XmlNodeMember() : this(null!, null!, false, null!) {}
}
[XmlType("Value")]
public sealed record XmlMemberValue(
[property: XmlAttribute("Type")]
string Type)
{
public XmlMemberValue() : this((string)null!) {}
}
public abstract record XmlGrammarItem(
[property: XmlAttribute("Name")]
string Name,
[property: XmlAttribute("Base")]
string? Base,
[property: XmlAttribute("Type")]
string? Type);
[XmlType("Node")]
public sealed record NodeGrammarItem(string Name, string? Base,
[property: XmlElement]
XmlNodeMember[] Members)
: XmlGrammarItem(Name, Base, Name)
{
public NodeGrammarItem() : this(null!, null, null!) {}
}
[XmlType("Member")]
public sealed record XmlNodeMember(
[property: XmlAttribute("Name")]
string Name,
[property: XmlAttribute("Type")]
string Type,
[property: XmlAttribute("Optional")]
bool Optional,
[property: XmlElement]
XmlMemberValue[] Values)
{
public XmlNodeMember() : this(null!, null!, false, null!) {}
}
[XmlType("Value")]
public sealed record XmlMemberValue(
[property: XmlAttribute("Type")]
string Type)
{
public XmlMemberValue() : this((string)null!) {}
}