use super::behavior::InOutDecl;
use super::common::FilterMember;
use super::common::{ConnectBody, DocComment, Identification, ParseErrorNode};
use super::requirement::RequirementDefBody;
use crate::ast::core::{Expression, Node, Span};
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ConstraintDef {
pub identification: Identification,
pub specializes: Option<String>,
pub specializes_span: Option<Span>,
pub body: ConstraintDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ConstraintDefBody {
Semicolon,
Brace {
elements: Vec<Node<ConstraintDefBodyElement>>,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ConstraintDefBodyElement {
Error(Node<ParseErrorNode>),
Doc(Node<DocComment>),
InOutDecl(Node<InOutDecl>),
Expression(Node<Expression>), Other(String),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ConstraintBody {
Semicolon,
Brace, }
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CalcDef {
pub identification: Identification,
pub body: CalcDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CalcUsage {
pub identification: Identification,
pub type_name: Option<String>,
pub body: CalcDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum CalcDefBody {
Semicolon,
Brace {
elements: Vec<Node<CalcDefBodyElement>>,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum CalcDefBodyElement {
Error(Node<ParseErrorNode>),
Doc(Node<DocComment>),
InOutDecl(Node<InOutDecl>),
ReturnDecl(Node<ReturnDecl>),
Expression(Node<Expression>), Other(String),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ReturnDecl {
pub name: String,
pub type_name: String,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ViewDef {
pub identification: Identification,
pub specializes: Option<String>,
pub specializes_span: Option<Span>,
pub body: ViewDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ViewDefBody {
Semicolon,
Brace {
elements: Vec<Node<ViewDefBodyElement>>,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ViewDefBodyElement {
Error(Node<ParseErrorNode>),
Other(String),
Doc(Node<DocComment>),
Filter(Node<FilterMember>),
ViewRendering(Node<ViewRenderingUsage>),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ViewRenderingUsage {
pub name: String,
pub type_name: Option<String>,
pub body: ConnectBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ViewpointDef {
pub identification: Identification,
pub specializes: Option<String>,
pub specializes_span: Option<Span>,
pub body: RequirementDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RenderingDef {
pub identification: Identification,
pub specializes: Option<String>,
pub specializes_span: Option<Span>,
pub body: RenderingDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum RenderingDefBody {
Semicolon,
Brace {
elements: Vec<Node<RenderingDefBodyElement>>,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum RenderingDefBodyElement {
Error(Node<ParseErrorNode>),
Doc(Node<DocComment>),
Filter(Node<FilterMember>),
ViewRendering(Node<ViewRenderingUsage>),
Other(String),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ViewUsage {
pub name: String,
pub type_name: Option<String>,
pub body: ViewBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ViewBody {
Semicolon,
Brace {
elements: Vec<Node<ViewBodyElement>>,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ViewBodyElement {
Error(Node<ParseErrorNode>),
Other(String),
Doc(Node<DocComment>),
Filter(Node<FilterMember>),
ViewRendering(Node<ViewRenderingUsage>),
Expose(Node<ExposeMember>),
Satisfy(Node<SatisfyViewMember>),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ExposeMember {
pub target: String,
pub body: ConnectBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SatisfyViewMember {
pub viewpoint_ref: String,
pub body: ConnectBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ViewpointUsage {
pub name: String,
pub type_name: String,
pub body: RequirementDefBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RenderingUsage {
pub name: String,
pub type_name: Option<String>,
pub body: ConnectBody,
}