#[derive(Debug, Clone)]
pub struct ElementDecl {
pub name: String,
pub content: ContentModel,
}
#[derive(Debug, Clone)]
pub enum ContentModel {
Empty,
Any,
Mixed { choices: Vec<String> },
Children(Group),
}
#[derive(Debug, Clone)]
pub struct Group {
pub kind: GroupKind,
pub items: Vec<Particle>,
pub occur: Occurrence,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum GroupKind { Sequence, Choice }
#[derive(Debug, Clone)]
pub struct Particle {
pub item: Item,
pub occur: Occurrence,
}
#[derive(Debug, Clone)]
pub enum Item {
Name(String),
Group(Box<Group>),
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Occurrence {
One,
ZeroOrOne,
ZeroOrMore,
OneOrMore,
}
#[derive(Debug, Clone)]
pub enum DeclRef {
Element(String),
Attlist(String),
Entity(usize),
}
#[derive(Debug, Clone)]
pub struct EntityDecl {
pub name: String,
pub parameter: bool,
pub orig: Option<String>,
pub content: Option<String>,
pub system_id: Option<String>,
pub public_id: Option<String>,
pub ndata: Option<String>,
}
#[derive(Debug, Clone)]
pub struct AttDecl {
pub name: String,
pub att_type: AttType,
pub default: AttDefault,
}
#[derive(Debug, Clone)]
pub enum AttType {
CData,
Id,
IdRef,
IdRefs,
Entity,
Entities,
Nmtoken,
Nmtokens,
Notation(Vec<String>),
Enumeration(Vec<String>),
}
#[derive(Debug, Clone)]
pub enum AttDefault {
Required,
Implied,
Fixed(String),
Default(String),
}