use super::behavior::{AssignStmt, ForLoop, InOut, ThenAction};
use super::common::{ConnectBody, DocComment, Identification, Import, ParseErrorNode, Visibility};
use super::common::TextualRepresentation;
use super::structure::{
Annotation, AttributeBody, AttributeDef, AttributeUsage, MetadataAnnotation,
MetadataKeywordUsage,
};
use super::view::ConstraintDefBodyElement;
use crate::ast::core::{Expression, Node, Span};
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RequirementDef {
pub identification: Identification,
pub specializes: Option<String>,
pub specializes_span: Option<Span>,
pub body: RequirementDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum RequirementDefBody {
Semicolon,
Brace {
elements: Vec<Node<RequirementDefBodyElement>>,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum RequirementDefBodyElement {
Error(Node<ParseErrorNode>),
Other(String),
Annotation(Node<Annotation>),
MetadataAnnotation(Node<MetadataAnnotation>),
MetadataKeywordUsage(Node<MetadataKeywordUsage>),
Import(Node<Import>),
SubjectDecl(Node<SubjectDecl>),
RequirementActorDecl(Node<RequirementActorDecl>),
Stakeholder(Node<StakeholderMember>),
Purpose(Node<PurposeMember>),
AttributeDef(Node<AttributeDef>),
AttributeUsage(Node<AttributeUsage>),
VerifyRequirement(Node<VerifyRequirementMember>),
RequireConstraint(Node<RequireConstraint>),
Frame(Node<FrameMember>),
TextualRep(Node<TextualRepresentation>),
Doc(Node<DocComment>),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct StakeholderMember {
pub target: String,
pub target_span: Span,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct PurposeMember {
pub target: String,
pub target_span: Span,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SubjectDecl {
pub name: String,
pub type_name: String,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RequirementActorDecl {
pub name: String,
pub type_name: String,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RequireConstraint {
pub body: RequireConstraintBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct VerifyRequirementMember {
pub explicit_requirement_keyword: bool,
pub requirement: Option<Node<RequirementUsage>>,
pub target: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum RequireConstraintBody {
Semicolon,
Brace {
elements: Vec<Node<ConstraintDefBodyElement>>,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Satisfy {
pub source: Node<Expression>,
pub target: Node<Expression>,
pub body: ConnectBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RequirementUsage {
pub name: String,
pub type_name: Option<String>,
pub subsets: Option<String>,
pub body: RequirementDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ItemUsage {
pub name: String,
pub type_name: Option<String>,
pub multiplicity: Option<String>,
pub body: AttributeBody,
pub direction: Option<InOut>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct EnumerationUsage {
pub name: String,
pub type_name: Option<String>,
pub multiplicity: Option<String>,
pub body: AttributeBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Dependency {
pub identification: Option<Identification>,
pub clients: Vec<String>,
pub suppliers: Vec<String>,
pub body: ConnectBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct FrameMember {
pub name: String,
pub body: RequirementDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ConcernUsage {
pub name: String,
pub type_name: Option<String>,
pub body: RequirementDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CaseDef {
pub identification: Identification,
pub specializes: Option<String>,
pub specializes_span: Option<Span>,
pub body: UseCaseDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CaseUsage {
pub name: String,
pub type_name: Option<String>,
pub body: UseCaseDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct AnalysisCaseDef {
pub identification: Identification,
pub specializes: Option<String>,
pub specializes_span: Option<Span>,
pub body: UseCaseDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct AnalysisCaseUsage {
pub name: String,
pub type_name: Option<String>,
pub body: UseCaseDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct VerificationCaseDef {
pub identification: Identification,
pub specializes: Option<String>,
pub specializes_span: Option<Span>,
pub body: UseCaseDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct VerificationCaseUsage {
pub name: String,
pub type_name: Option<String>,
pub body: UseCaseDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct UseCaseUsage {
pub name: String,
pub type_name: Option<String>,
pub body: UseCaseDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ActorDecl {
pub identification: Identification,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct UseCaseDef {
pub identification: Identification,
pub specializes: Option<String>,
pub specializes_span: Option<Span>,
pub body: UseCaseDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum UseCaseDefBody {
Semicolon,
Brace {
elements: Vec<Node<UseCaseDefBodyElement>>,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct FirstSuccession {
pub target: String,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ThenDone {}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct IncludeUseCase {
pub name: String,
pub multiplicity: Option<String>,
pub body: UseCaseDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ThenIncludeUseCase {
pub include: Node<IncludeUseCase>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ThenUseCaseUsage {
pub use_case: Node<UseCaseUsage>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SubjectRef {}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ActorRedefinitionAssignment {
pub name: String,
pub rhs: String,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RefRedefinition {
pub name: String,
pub body: String,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ReturnRef {
pub name: String,
pub multiplicity: Option<String>,
pub body: String,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum UseCaseDefBodyElement {
Error(Node<ParseErrorNode>),
Other(String),
Annotation(Node<Annotation>),
MetadataKeywordUsage(Node<MetadataKeywordUsage>),
AttributeDef(Node<AttributeDef>),
Doc(Node<DocComment>),
SubjectDecl(Node<SubjectDecl>),
SubjectRef(Node<SubjectRef>),
ActorUsage(Node<ActorUsage>),
ActorRedefinitionAssignment(Node<ActorRedefinitionAssignment>),
Objective(Node<Objective>),
FirstSuccession(Node<FirstSuccession>),
ThenIncludeUseCase(Node<ThenIncludeUseCase>),
ThenUseCaseUsage(Node<ThenUseCaseUsage>),
ThenDone(Node<ThenDone>),
IncludeUseCase(Node<IncludeUseCase>),
RefRedefinition(Node<RefRedefinition>),
ReturnRef(Node<ReturnRef>),
Assign(Node<AssignStmt>),
ForLoop(Node<ForLoop>),
ThenAction(Node<ThenAction>),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ActorUsage {
pub name: String,
pub type_name: String,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Objective {
pub visibility: Option<Visibility>,
pub requirement: Node<RequirementUsage>,
}