use super::*;
use crate::builder::{AbstractLiteral, BitStringLiteral, CharLiteral, Identifier, StringLiteral};
use crate::syntax::builder::RawNodeBuilder;
use crate::tokens::{Keyword as Kw, Token, TokenKind, Trivia};
pub struct AbsolutePathnameBuilder {
dot_token: Token,
partial_pathname: PartialPathnameSyntax,
}
impl AbsolutePathnameBuilder {
pub fn new(partial_pathname: impl Into<PartialPathnameSyntax>) -> Self {
Self {
dot_token: TokenKind::Dot.canonical_token().unwrap(),
partial_pathname: partial_pathname.into(),
}
}
pub fn with_dot_token(mut self, t: impl Into<Token>) -> Self {
self.dot_token = t.into();
self
}
pub fn with_dot_token_trivia(mut self, trivia: Trivia) -> Self {
self.dot_token.set_leading_trivia(trivia);
self
}
pub fn with_partial_pathname(mut self, n: impl Into<PartialPathnameSyntax>) -> Self {
self.partial_pathname = n.into();
self
}
pub fn build(self) -> AbsolutePathnameSyntax {
RawNodeBuilder::new()
.push_token(self.dot_token)
.push_node(self.partial_pathname)
.finish()
}
}
impl From<AbsolutePathnameBuilder> for AbsolutePathnameSyntax {
fn from(value: AbsolutePathnameBuilder) -> Self {
value.build()
}
}
pub struct AccessTypeDefinitionBuilder {
access_token: Token,
subtype_indication: SubtypeIndicationSyntax,
}
impl AccessTypeDefinitionBuilder {
pub fn new(subtype_indication: impl Into<SubtypeIndicationSyntax>) -> Self {
Self {
access_token: Kw::Access.canonical_token(),
subtype_indication: subtype_indication.into(),
}
}
pub fn with_access_token(mut self, t: impl Into<Token>) -> Self {
self.access_token = t.into();
self
}
pub fn with_access_token_trivia(mut self, trivia: Trivia) -> Self {
self.access_token.set_leading_trivia(trivia);
self
}
pub fn with_subtype_indication(mut self, n: impl Into<SubtypeIndicationSyntax>) -> Self {
self.subtype_indication = n.into();
self
}
pub fn build(self) -> AccessTypeDefinitionSyntax {
RawNodeBuilder::new()
.push_token(self.access_token)
.push_node(self.subtype_indication)
.finish()
}
}
impl From<AccessTypeDefinitionBuilder> for AccessTypeDefinitionSyntax {
fn from(value: AccessTypeDefinitionBuilder) -> Self {
value.build()
}
}
pub struct ActualPartBuilder {
inertial_token: Option<Token>,
actual_part_body: ActualPartBodySyntax,
}
impl ActualPartBuilder {
pub fn new(actual_part_body: impl Into<ActualPartBodySyntax>) -> Self {
Self {
inertial_token: None,
actual_part_body: actual_part_body.into(),
}
}
pub fn with_inertial_token(mut self, t: impl Into<Token>) -> Self {
self.inertial_token = Some(t.into());
self
}
pub fn with_inertial_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.inertial_token
.get_or_insert_with(|| Kw::Inertial.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_actual_part_body(mut self, n: impl Into<ActualPartBodySyntax>) -> Self {
self.actual_part_body = n.into();
self
}
pub fn build(self) -> ActualPartSyntax {
RawNodeBuilder::new()
.push_opt_token(self.inertial_token)
.push_node(self.actual_part_body)
.finish()
}
}
impl From<ActualPartBuilder> for ActualPartSyntax {
fn from(value: ActualPartBuilder) -> Self {
value.build()
}
}
pub struct ActualPartExpressionBuilder {
expression: ExpressionSyntax,
}
impl ActualPartExpressionBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
expression: expression.into(),
}
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn build(self) -> ActualPartExpressionSyntax {
RawNodeBuilder::new().push_node(self.expression).finish()
}
}
impl From<ActualPartExpressionBuilder> for ActualPartExpressionSyntax {
fn from(value: ActualPartExpressionBuilder) -> Self {
value.build()
}
}
pub struct ActualPartOpenBuilder {
open_token: Token,
}
impl Default for ActualPartOpenBuilder {
fn default() -> Self {
Self::new()
}
}
impl ActualPartOpenBuilder {
pub fn new() -> Self {
Self {
open_token: Kw::Open.canonical_token(),
}
}
pub fn with_open_token(mut self, t: impl Into<Token>) -> Self {
self.open_token = t.into();
self
}
pub fn with_open_token_trivia(mut self, trivia: Trivia) -> Self {
self.open_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ActualPartOpenSyntax {
RawNodeBuilder::new().push_token(self.open_token).finish()
}
}
impl From<ActualPartOpenBuilder> for ActualPartOpenSyntax {
fn from(value: ActualPartOpenBuilder) -> Self {
value.build()
}
}
pub struct ActualPartSubtypeIndicationBuilder {
subtype_indication: SubtypeIndicationSyntax,
}
impl ActualPartSubtypeIndicationBuilder {
pub fn new(subtype_indication: impl Into<SubtypeIndicationSyntax>) -> Self {
Self {
subtype_indication: subtype_indication.into(),
}
}
pub fn with_subtype_indication(mut self, n: impl Into<SubtypeIndicationSyntax>) -> Self {
self.subtype_indication = n.into();
self
}
pub fn build(self) -> ActualPartSubtypeIndicationSyntax {
RawNodeBuilder::new()
.push_node(self.subtype_indication)
.finish()
}
}
impl From<ActualPartSubtypeIndicationBuilder> for ActualPartSubtypeIndicationSyntax {
fn from(value: ActualPartSubtypeIndicationBuilder) -> Self {
value.build()
}
}
pub struct AfterClauseBuilder {
after_token: Token,
expression: ExpressionSyntax,
}
impl AfterClauseBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
after_token: Kw::After.canonical_token(),
expression: expression.into(),
}
}
pub fn with_after_token(mut self, t: impl Into<Token>) -> Self {
self.after_token = t.into();
self
}
pub fn with_after_token_trivia(mut self, trivia: Trivia) -> Self {
self.after_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn build(self) -> AfterClauseSyntax {
RawNodeBuilder::new()
.push_token(self.after_token)
.push_node(self.expression)
.finish()
}
}
impl From<AfterClauseBuilder> for AfterClauseSyntax {
fn from(value: AfterClauseBuilder) -> Self {
value.build()
}
}
pub struct AggregateBuilder {
left_par_token: Token,
element_association_list: ElementAssociationListSyntax,
right_par_token: Token,
}
impl AggregateBuilder {
pub fn new(element_association_list: impl Into<ElementAssociationListSyntax>) -> Self {
Self {
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
element_association_list: element_association_list.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
}
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_element_association_list(
mut self,
n: impl Into<ElementAssociationListSyntax>,
) -> Self {
self.element_association_list = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> AggregateSyntax {
RawNodeBuilder::new()
.push_token(self.left_par_token)
.push_node(self.element_association_list)
.push_token(self.right_par_token)
.finish()
}
}
impl From<AggregateBuilder> for AggregateSyntax {
fn from(value: AggregateBuilder) -> Self {
value.build()
}
}
pub struct AggregateTargetBuilder {
aggregate: AggregateSyntax,
}
impl AggregateTargetBuilder {
pub fn new(aggregate: impl Into<AggregateSyntax>) -> Self {
Self {
aggregate: aggregate.into(),
}
}
pub fn with_aggregate(mut self, n: impl Into<AggregateSyntax>) -> Self {
self.aggregate = n.into();
self
}
pub fn build(self) -> AggregateTargetSyntax {
RawNodeBuilder::new().push_node(self.aggregate).finish()
}
}
impl From<AggregateTargetBuilder> for AggregateTargetSyntax {
fn from(value: AggregateTargetBuilder) -> Self {
value.build()
}
}
pub struct AliasDeclarationBuilder {
alias_token: Token,
alias_designator: AliasDesignatorToken,
alias_subtype: Option<AliasSubtypeSyntax>,
is_token: Token,
name: NameSyntax,
signature: Option<SignatureSyntax>,
semi_colon_token: Token,
}
impl AliasDeclarationBuilder {
pub fn new(
alias_designator: impl Into<AliasDesignatorToken>,
name: impl Into<NameSyntax>,
) -> Self {
Self {
alias_token: Kw::Alias.canonical_token(),
alias_designator: alias_designator.into(),
alias_subtype: None,
is_token: Kw::Is.canonical_token(),
name: name.into(),
signature: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_alias_token(mut self, t: impl Into<Token>) -> Self {
self.alias_token = t.into();
self
}
pub fn with_alias_token_trivia(mut self, trivia: Trivia) -> Self {
self.alias_token.set_leading_trivia(trivia);
self
}
pub fn with_alias_designator(mut self, n: impl Into<AliasDesignatorToken>) -> Self {
self.alias_designator = n.into();
self
}
pub fn with_alias_subtype(mut self, n: impl Into<AliasSubtypeSyntax>) -> Self {
self.alias_subtype = Some(n.into());
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn with_signature(mut self, n: impl Into<SignatureSyntax>) -> Self {
self.signature = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> AliasDeclarationSyntax {
RawNodeBuilder::new()
.push_token(self.alias_token)
.push_token(self.alias_designator.0)
.push_opt_node(self.alias_subtype)
.push_token(self.is_token)
.push_node(self.name)
.push_opt_node(self.signature)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<AliasDeclarationBuilder> for AliasDeclarationSyntax {
fn from(value: AliasDeclarationBuilder) -> Self {
value.build()
}
}
pub struct AliasSubtypeBuilder {
colon_token: Token,
subtype_indication: SubtypeIndicationSyntax,
}
impl AliasSubtypeBuilder {
pub fn new(subtype_indication: impl Into<SubtypeIndicationSyntax>) -> Self {
Self {
colon_token: TokenKind::Colon.canonical_token().unwrap(),
subtype_indication: subtype_indication.into(),
}
}
pub fn with_colon_token(mut self, t: impl Into<Token>) -> Self {
self.colon_token = t.into();
self
}
pub fn with_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_token.set_leading_trivia(trivia);
self
}
pub fn with_subtype_indication(mut self, n: impl Into<SubtypeIndicationSyntax>) -> Self {
self.subtype_indication = n.into();
self
}
pub fn build(self) -> AliasSubtypeSyntax {
RawNodeBuilder::new()
.push_token(self.colon_token)
.push_node(self.subtype_indication)
.finish()
}
}
impl From<AliasSubtypeBuilder> for AliasSubtypeSyntax {
fn from(value: AliasSubtypeBuilder) -> Self {
value.build()
}
}
pub struct AllSensitivityListBuilder {
all_token: Token,
}
impl Default for AllSensitivityListBuilder {
fn default() -> Self {
Self::new()
}
}
impl AllSensitivityListBuilder {
pub fn new() -> Self {
Self {
all_token: Kw::All.canonical_token(),
}
}
pub fn with_all_token(mut self, t: impl Into<Token>) -> Self {
self.all_token = t.into();
self
}
pub fn with_all_token_trivia(mut self, trivia: Trivia) -> Self {
self.all_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> AllSensitivityListSyntax {
RawNodeBuilder::new().push_token(self.all_token).finish()
}
}
impl From<AllSensitivityListBuilder> for AllSensitivityListSyntax {
fn from(value: AllSensitivityListBuilder) -> Self {
value.build()
}
}
pub struct AllocatorBuilder {
new_token: Token,
expression: ExpressionSyntax,
}
impl AllocatorBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
new_token: Kw::New.canonical_token(),
expression: expression.into(),
}
}
pub fn with_new_token(mut self, t: impl Into<Token>) -> Self {
self.new_token = t.into();
self
}
pub fn with_new_token_trivia(mut self, trivia: Trivia) -> Self {
self.new_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn build(self) -> AllocatorSyntax {
RawNodeBuilder::new()
.push_token(self.new_token)
.push_node(self.expression)
.finish()
}
}
impl From<AllocatorBuilder> for AllocatorSyntax {
fn from(value: AllocatorBuilder) -> Self {
value.build()
}
}
pub struct ArchitectureBodyBuilder {
architecture_preamble: ArchitecturePreambleSyntax,
architecture_declarative_part: Option<ArchitectureDeclarativePartSyntax>,
declaration_statement_separator: DeclarationStatementSeparatorSyntax,
architecture_statement_part: Option<ArchitectureStatementPartSyntax>,
architecture_epilogue: ArchitectureEpilogueSyntax,
}
impl ArchitectureBodyBuilder {
pub fn new(architecture_preamble: impl Into<ArchitecturePreambleSyntax>) -> Self {
Self {
architecture_preamble: architecture_preamble.into(),
architecture_declarative_part: None,
declaration_statement_separator: DeclarationStatementSeparatorBuilder::default()
.build(),
architecture_statement_part: None,
architecture_epilogue: ArchitectureEpilogueBuilder::default().build(),
}
}
pub fn with_architecture_preamble(mut self, n: impl Into<ArchitecturePreambleSyntax>) -> Self {
self.architecture_preamble = n.into();
self
}
pub fn with_architecture_declarative_part(
mut self,
n: impl Into<ArchitectureDeclarativePartSyntax>,
) -> Self {
self.architecture_declarative_part = Some(n.into());
self
}
pub fn with_declaration_statement_separator(
mut self,
n: impl Into<DeclarationStatementSeparatorSyntax>,
) -> Self {
self.declaration_statement_separator = n.into();
self
}
pub fn with_architecture_statement_part(
mut self,
n: impl Into<ArchitectureStatementPartSyntax>,
) -> Self {
self.architecture_statement_part = Some(n.into());
self
}
pub fn with_architecture_epilogue(mut self, n: impl Into<ArchitectureEpilogueSyntax>) -> Self {
self.architecture_epilogue = n.into();
self
}
pub fn build(self) -> ArchitectureBodySyntax {
RawNodeBuilder::new()
.push_node(self.architecture_preamble)
.push_opt_node(self.architecture_declarative_part)
.push_node(self.declaration_statement_separator)
.push_opt_node(self.architecture_statement_part)
.push_node(self.architecture_epilogue)
.finish()
}
}
impl From<ArchitectureBodyBuilder> for ArchitectureBodySyntax {
fn from(value: ArchitectureBodyBuilder) -> Self {
value.build()
}
}
pub struct ArchitectureDeclarativePartBuilder {
block_declarative_items: Vec<BlockDeclarativeItemSyntax>,
}
impl Default for ArchitectureDeclarativePartBuilder {
fn default() -> Self {
Self::new()
}
}
impl ArchitectureDeclarativePartBuilder {
pub fn new() -> Self {
Self {
block_declarative_items: Vec::new(),
}
}
pub fn add_block_declarative_items(mut self, n: impl Into<BlockDeclarativeItemSyntax>) -> Self {
self.block_declarative_items.push(n.into());
self
}
pub fn build(self) -> ArchitectureDeclarativePartSyntax {
RawNodeBuilder::new()
.push_nodes(self.block_declarative_items)
.finish()
}
}
impl From<ArchitectureDeclarativePartBuilder> for ArchitectureDeclarativePartSyntax {
fn from(value: ArchitectureDeclarativePartBuilder) -> Self {
value.build()
}
}
pub struct ArchitectureEpilogueBuilder {
end_token: Token,
architecture_token: Option<Token>,
simple_name: Option<Token>,
semi_colon_token: Token,
}
impl Default for ArchitectureEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl ArchitectureEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
architecture_token: None,
simple_name: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_architecture_token(mut self, t: impl Into<Token>) -> Self {
self.architecture_token = Some(t.into());
self
}
pub fn with_architecture_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.architecture_token
.get_or_insert_with(|| Kw::Architecture.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_simple_name(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.simple_name = Some(t.into().into());
self
}
pub fn with_simple_name_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.simple_name {
t.set_leading_trivia(trivia);
}
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ArchitectureEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_opt_token(self.architecture_token)
.push_opt_token(self.simple_name)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ArchitectureEpilogueBuilder> for ArchitectureEpilogueSyntax {
fn from(value: ArchitectureEpilogueBuilder) -> Self {
value.build()
}
}
pub struct ArchitecturePreambleBuilder {
architecture_token: Token,
identifier_token: Token,
of_token: Token,
name: NameSyntax,
is_token: Token,
}
impl ArchitecturePreambleBuilder {
pub fn new(
identifier_token: impl Into<crate::builder::Identifier>,
name: impl Into<NameSyntax>,
) -> Self {
Self {
architecture_token: Kw::Architecture.canonical_token(),
identifier_token: identifier_token.into().into(),
of_token: Kw::Of.canonical_token(),
name: name.into(),
is_token: Kw::Is.canonical_token(),
}
}
pub fn with_architecture_token(mut self, t: impl Into<Token>) -> Self {
self.architecture_token = t.into();
self
}
pub fn with_architecture_token_trivia(mut self, trivia: Trivia) -> Self {
self.architecture_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_of_token(mut self, t: impl Into<Token>) -> Self {
self.of_token = t.into();
self
}
pub fn with_of_token_trivia(mut self, trivia: Trivia) -> Self {
self.of_token.set_leading_trivia(trivia);
self
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ArchitecturePreambleSyntax {
RawNodeBuilder::new()
.push_token(self.architecture_token)
.push_token(self.identifier_token)
.push_token(self.of_token)
.push_node(self.name)
.push_token(self.is_token)
.finish()
}
}
impl From<ArchitecturePreambleBuilder> for ArchitecturePreambleSyntax {
fn from(value: ArchitecturePreambleBuilder) -> Self {
value.build()
}
}
pub struct ArchitectureStatementPartBuilder {
concurrent_statements: Vec<ConcurrentStatementSyntax>,
}
impl Default for ArchitectureStatementPartBuilder {
fn default() -> Self {
Self::new()
}
}
impl ArchitectureStatementPartBuilder {
pub fn new() -> Self {
Self {
concurrent_statements: Vec::new(),
}
}
pub fn add_concurrent_statements(mut self, n: impl Into<ConcurrentStatementSyntax>) -> Self {
self.concurrent_statements.push(n.into());
self
}
pub fn build(self) -> ArchitectureStatementPartSyntax {
RawNodeBuilder::new()
.push_nodes(self.concurrent_statements)
.finish()
}
}
impl From<ArchitectureStatementPartBuilder> for ArchitectureStatementPartSyntax {
fn from(value: ArchitectureStatementPartBuilder) -> Self {
value.build()
}
}
pub struct AssertionBuilder {
assert_token: Token,
condition: ExpressionSyntax,
report_clause: Option<ReportClauseSyntax>,
severity_clause: Option<SeverityClauseSyntax>,
}
impl AssertionBuilder {
pub fn new(condition: impl Into<ExpressionSyntax>) -> Self {
Self {
assert_token: Kw::Assert.canonical_token(),
condition: condition.into(),
report_clause: None,
severity_clause: None,
}
}
pub fn with_assert_token(mut self, t: impl Into<Token>) -> Self {
self.assert_token = t.into();
self
}
pub fn with_assert_token_trivia(mut self, trivia: Trivia) -> Self {
self.assert_token.set_leading_trivia(trivia);
self
}
pub fn with_condition(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.condition = n.into();
self
}
pub fn with_report_clause(mut self, n: impl Into<ReportClauseSyntax>) -> Self {
self.report_clause = Some(n.into());
self
}
pub fn with_severity_clause(mut self, n: impl Into<SeverityClauseSyntax>) -> Self {
self.severity_clause = Some(n.into());
self
}
pub fn build(self) -> AssertionSyntax {
RawNodeBuilder::new()
.push_token(self.assert_token)
.push_node(self.condition)
.push_opt_node(self.report_clause)
.push_opt_node(self.severity_clause)
.finish()
}
}
impl From<AssertionBuilder> for AssertionSyntax {
fn from(value: AssertionBuilder) -> Self {
value.build()
}
}
pub struct AssertionStatementBuilder {
stmt_label: Option<StmtLabelSyntax>,
assertion: AssertionSyntax,
semi_colon_token: Token,
}
impl AssertionStatementBuilder {
pub fn new(assertion: impl Into<AssertionSyntax>) -> Self {
Self {
stmt_label: None,
assertion: assertion.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_assertion(mut self, n: impl Into<AssertionSyntax>) -> Self {
self.assertion = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> AssertionStatementSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_node(self.assertion)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<AssertionStatementBuilder> for AssertionStatementSyntax {
fn from(value: AssertionStatementBuilder) -> Self {
value.build()
}
}
pub struct AssociationElementBuilder {
formal: Option<FormalSyntax>,
actual_part: ActualPartSyntax,
}
impl AssociationElementBuilder {
pub fn new(actual_part: impl Into<ActualPartSyntax>) -> Self {
Self {
formal: None,
actual_part: actual_part.into(),
}
}
pub fn with_formal(mut self, n: impl Into<FormalSyntax>) -> Self {
self.formal = Some(n.into());
self
}
pub fn with_actual_part(mut self, n: impl Into<ActualPartSyntax>) -> Self {
self.actual_part = n.into();
self
}
pub fn build(self) -> AssociationElementSyntax {
RawNodeBuilder::new()
.push_opt_node(self.formal)
.push_node(self.actual_part)
.finish()
}
}
impl From<AssociationElementBuilder> for AssociationElementSyntax {
fn from(value: AssociationElementBuilder) -> Self {
value.build()
}
}
pub struct AttributeDeclarationBuilder {
attribute_token: Token,
identifier_token: Token,
colon_token: Token,
type_mark: NameSyntax,
semi_colon_token: Token,
}
impl AttributeDeclarationBuilder {
pub fn new(
identifier_token: impl Into<crate::builder::Identifier>,
type_mark: impl Into<NameSyntax>,
) -> Self {
Self {
attribute_token: Kw::Attribute.canonical_token(),
identifier_token: identifier_token.into().into(),
colon_token: TokenKind::Colon.canonical_token().unwrap(),
type_mark: type_mark.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_attribute_token(mut self, t: impl Into<Token>) -> Self {
self.attribute_token = t.into();
self
}
pub fn with_attribute_token_trivia(mut self, trivia: Trivia) -> Self {
self.attribute_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_colon_token(mut self, t: impl Into<Token>) -> Self {
self.colon_token = t.into();
self
}
pub fn with_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_token.set_leading_trivia(trivia);
self
}
pub fn with_type_mark(mut self, n: impl Into<NameSyntax>) -> Self {
self.type_mark = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> AttributeDeclarationSyntax {
RawNodeBuilder::new()
.push_token(self.attribute_token)
.push_token(self.identifier_token)
.push_token(self.colon_token)
.push_node(self.type_mark)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<AttributeDeclarationBuilder> for AttributeDeclarationSyntax {
fn from(value: AttributeDeclarationBuilder) -> Self {
value.build()
}
}
pub struct AttributeNameBuilder {
signature: Option<SignatureSyntax>,
tick_token: Token,
attribute_designator: AttributeDesignatorToken,
}
impl AttributeNameBuilder {
pub fn new(attribute_designator: impl Into<AttributeDesignatorToken>) -> Self {
Self {
signature: None,
tick_token: TokenKind::Tick.canonical_token().unwrap(),
attribute_designator: attribute_designator.into(),
}
}
pub fn with_signature(mut self, n: impl Into<SignatureSyntax>) -> Self {
self.signature = Some(n.into());
self
}
pub fn with_tick_token(mut self, t: impl Into<Token>) -> Self {
self.tick_token = t.into();
self
}
pub fn with_tick_token_trivia(mut self, trivia: Trivia) -> Self {
self.tick_token.set_leading_trivia(trivia);
self
}
pub fn with_attribute_designator(mut self, n: impl Into<AttributeDesignatorToken>) -> Self {
self.attribute_designator = n.into();
self
}
pub fn build(self) -> AttributeNameSyntax {
RawNodeBuilder::new()
.push_opt_node(self.signature)
.push_token(self.tick_token)
.push_token(self.attribute_designator.0)
.finish()
}
}
impl From<AttributeNameBuilder> for AttributeNameSyntax {
fn from(value: AttributeNameBuilder) -> Self {
value.build()
}
}
pub struct AttributeSpecificationBuilder {
attribute_token: Token,
identifier_token: Token,
of_token: Token,
entity_specification: EntitySpecificationSyntax,
is_token: Token,
expression: ExpressionSyntax,
semi_colon_token: Token,
}
impl AttributeSpecificationBuilder {
pub fn new(
identifier_token: impl Into<crate::builder::Identifier>,
entity_specification: impl Into<EntitySpecificationSyntax>,
expression: impl Into<ExpressionSyntax>,
) -> Self {
Self {
attribute_token: Kw::Attribute.canonical_token(),
identifier_token: identifier_token.into().into(),
of_token: Kw::Of.canonical_token(),
entity_specification: entity_specification.into(),
is_token: Kw::Is.canonical_token(),
expression: expression.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_attribute_token(mut self, t: impl Into<Token>) -> Self {
self.attribute_token = t.into();
self
}
pub fn with_attribute_token_trivia(mut self, trivia: Trivia) -> Self {
self.attribute_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_of_token(mut self, t: impl Into<Token>) -> Self {
self.of_token = t.into();
self
}
pub fn with_of_token_trivia(mut self, trivia: Trivia) -> Self {
self.of_token.set_leading_trivia(trivia);
self
}
pub fn with_entity_specification(mut self, n: impl Into<EntitySpecificationSyntax>) -> Self {
self.entity_specification = n.into();
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> AttributeSpecificationSyntax {
RawNodeBuilder::new()
.push_token(self.attribute_token)
.push_token(self.identifier_token)
.push_token(self.of_token)
.push_node(self.entity_specification)
.push_token(self.is_token)
.push_node(self.expression)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<AttributeSpecificationBuilder> for AttributeSpecificationSyntax {
fn from(value: AttributeSpecificationBuilder) -> Self {
value.build()
}
}
pub struct BinaryExpressionBuilder {
lhs: ExpressionSyntax,
binary_operator: BinaryOperatorToken,
rhs: ExpressionSyntax,
}
impl BinaryExpressionBuilder {
pub fn new(
lhs: impl Into<ExpressionSyntax>,
binary_operator: impl Into<BinaryOperatorToken>,
rhs: impl Into<ExpressionSyntax>,
) -> Self {
Self {
lhs: lhs.into(),
binary_operator: binary_operator.into(),
rhs: rhs.into(),
}
}
pub fn with_lhs(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.lhs = n.into();
self
}
pub fn with_binary_operator(mut self, n: impl Into<BinaryOperatorToken>) -> Self {
self.binary_operator = n.into();
self
}
pub fn with_rhs(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.rhs = n.into();
self
}
pub fn build(self) -> BinaryExpressionSyntax {
RawNodeBuilder::new()
.push_node(self.lhs)
.push_token(self.binary_operator.0)
.push_node(self.rhs)
.finish()
}
}
impl From<BinaryExpressionBuilder> for BinaryExpressionSyntax {
fn from(value: BinaryExpressionBuilder) -> Self {
value.build()
}
}
pub struct BindingBuilder {
binding_indication: Option<BindingIndicationSyntax>,
semi_colon_token: Token,
}
impl Default for BindingBuilder {
fn default() -> Self {
Self::new()
}
}
impl BindingBuilder {
pub fn new() -> Self {
Self {
binding_indication: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_binding_indication(mut self, n: impl Into<BindingIndicationSyntax>) -> Self {
self.binding_indication = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> BindingSyntax {
RawNodeBuilder::new()
.push_opt_node(self.binding_indication)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<BindingBuilder> for BindingSyntax {
fn from(value: BindingBuilder) -> Self {
value.build()
}
}
pub struct BindingIndicationBuilder {
binding_use_clause: Option<BindingUseClauseSyntax>,
generic_map_aspect: Option<GenericMapAspectSyntax>,
port_map_aspect: Option<PortMapAspectSyntax>,
}
impl Default for BindingIndicationBuilder {
fn default() -> Self {
Self::new()
}
}
impl BindingIndicationBuilder {
pub fn new() -> Self {
Self {
binding_use_clause: None,
generic_map_aspect: None,
port_map_aspect: None,
}
}
pub fn with_binding_use_clause(mut self, n: impl Into<BindingUseClauseSyntax>) -> Self {
self.binding_use_clause = Some(n.into());
self
}
pub fn with_generic_map_aspect(mut self, n: impl Into<GenericMapAspectSyntax>) -> Self {
self.generic_map_aspect = Some(n.into());
self
}
pub fn with_port_map_aspect(mut self, n: impl Into<PortMapAspectSyntax>) -> Self {
self.port_map_aspect = Some(n.into());
self
}
pub fn build(self) -> BindingIndicationSyntax {
RawNodeBuilder::new()
.push_opt_node(self.binding_use_clause)
.push_opt_node(self.generic_map_aspect)
.push_opt_node(self.port_map_aspect)
.finish()
}
}
impl From<BindingIndicationBuilder> for BindingIndicationSyntax {
fn from(value: BindingIndicationBuilder) -> Self {
value.build()
}
}
pub struct BindingUseClauseBuilder {
use_token: Token,
entity_aspect: EntityAspectSyntax,
}
impl BindingUseClauseBuilder {
pub fn new(entity_aspect: impl Into<EntityAspectSyntax>) -> Self {
Self {
use_token: Kw::Use.canonical_token(),
entity_aspect: entity_aspect.into(),
}
}
pub fn with_use_token(mut self, t: impl Into<Token>) -> Self {
self.use_token = t.into();
self
}
pub fn with_use_token_trivia(mut self, trivia: Trivia) -> Self {
self.use_token.set_leading_trivia(trivia);
self
}
pub fn with_entity_aspect(mut self, n: impl Into<EntityAspectSyntax>) -> Self {
self.entity_aspect = n.into();
self
}
pub fn build(self) -> BindingUseClauseSyntax {
RawNodeBuilder::new()
.push_token(self.use_token)
.push_node(self.entity_aspect)
.finish()
}
}
impl From<BindingUseClauseBuilder> for BindingUseClauseSyntax {
fn from(value: BindingUseClauseBuilder) -> Self {
value.build()
}
}
pub struct BlockConfigurationBuilder {
block_configuration_preamble: BlockConfigurationPreambleSyntax,
use_clauses: Vec<UseClauseSyntax>,
configuration_items: Vec<ConfigurationItemSyntax>,
block_configuration_epilogue: BlockConfigurationEpilogueSyntax,
}
impl BlockConfigurationBuilder {
pub fn new(block_configuration_preamble: impl Into<BlockConfigurationPreambleSyntax>) -> Self {
Self {
block_configuration_preamble: block_configuration_preamble.into(),
use_clauses: Vec::new(),
configuration_items: Vec::new(),
block_configuration_epilogue: BlockConfigurationEpilogueBuilder::default().build(),
}
}
pub fn with_block_configuration_preamble(
mut self,
n: impl Into<BlockConfigurationPreambleSyntax>,
) -> Self {
self.block_configuration_preamble = n.into();
self
}
pub fn add_use_clauses(mut self, n: impl Into<UseClauseSyntax>) -> Self {
self.use_clauses.push(n.into());
self
}
pub fn add_configuration_items(mut self, n: impl Into<ConfigurationItemSyntax>) -> Self {
self.configuration_items.push(n.into());
self
}
pub fn with_block_configuration_epilogue(
mut self,
n: impl Into<BlockConfigurationEpilogueSyntax>,
) -> Self {
self.block_configuration_epilogue = n.into();
self
}
pub fn build(self) -> BlockConfigurationSyntax {
RawNodeBuilder::new()
.push_node(self.block_configuration_preamble)
.push_nodes(self.use_clauses)
.push_nodes(self.configuration_items)
.push_node(self.block_configuration_epilogue)
.finish()
}
}
impl From<BlockConfigurationBuilder> for BlockConfigurationSyntax {
fn from(value: BlockConfigurationBuilder) -> Self {
value.build()
}
}
pub struct BlockConfigurationEpilogueBuilder {
end_token: Token,
for_token: Token,
semi_colon_token: Token,
}
impl Default for BlockConfigurationEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl BlockConfigurationEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
for_token: Kw::For.canonical_token(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_for_token(mut self, t: impl Into<Token>) -> Self {
self.for_token = t.into();
self
}
pub fn with_for_token_trivia(mut self, trivia: Trivia) -> Self {
self.for_token.set_leading_trivia(trivia);
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> BlockConfigurationEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_token(self.for_token)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<BlockConfigurationEpilogueBuilder> for BlockConfigurationEpilogueSyntax {
fn from(value: BlockConfigurationEpilogueBuilder) -> Self {
value.build()
}
}
pub struct BlockConfigurationItemBuilder {
block_configuration: BlockConfigurationSyntax,
}
impl BlockConfigurationItemBuilder {
pub fn new(block_configuration: impl Into<BlockConfigurationSyntax>) -> Self {
Self {
block_configuration: block_configuration.into(),
}
}
pub fn with_block_configuration(mut self, n: impl Into<BlockConfigurationSyntax>) -> Self {
self.block_configuration = n.into();
self
}
pub fn build(self) -> BlockConfigurationItemSyntax {
RawNodeBuilder::new()
.push_node(self.block_configuration)
.finish()
}
}
impl From<BlockConfigurationItemBuilder> for BlockConfigurationItemSyntax {
fn from(value: BlockConfigurationItemBuilder) -> Self {
value.build()
}
}
pub struct BlockConfigurationPreambleBuilder {
for_token: Token,
block_specification: NameSyntax,
}
impl BlockConfigurationPreambleBuilder {
pub fn new(block_specification: impl Into<NameSyntax>) -> Self {
Self {
for_token: Kw::For.canonical_token(),
block_specification: block_specification.into(),
}
}
pub fn with_for_token(mut self, t: impl Into<Token>) -> Self {
self.for_token = t.into();
self
}
pub fn with_for_token_trivia(mut self, trivia: Trivia) -> Self {
self.for_token.set_leading_trivia(trivia);
self
}
pub fn with_block_specification(mut self, n: impl Into<NameSyntax>) -> Self {
self.block_specification = n.into();
self
}
pub fn build(self) -> BlockConfigurationPreambleSyntax {
RawNodeBuilder::new()
.push_token(self.for_token)
.push_node(self.block_specification)
.finish()
}
}
impl From<BlockConfigurationPreambleBuilder> for BlockConfigurationPreambleSyntax {
fn from(value: BlockConfigurationPreambleBuilder) -> Self {
value.build()
}
}
pub struct BlockDeclarativePartBuilder {
block_declarative_items: Vec<BlockDeclarativeItemSyntax>,
}
impl Default for BlockDeclarativePartBuilder {
fn default() -> Self {
Self::new()
}
}
impl BlockDeclarativePartBuilder {
pub fn new() -> Self {
Self {
block_declarative_items: Vec::new(),
}
}
pub fn add_block_declarative_items(mut self, n: impl Into<BlockDeclarativeItemSyntax>) -> Self {
self.block_declarative_items.push(n.into());
self
}
pub fn build(self) -> BlockDeclarativePartSyntax {
RawNodeBuilder::new()
.push_nodes(self.block_declarative_items)
.finish()
}
}
impl From<BlockDeclarativePartBuilder> for BlockDeclarativePartSyntax {
fn from(value: BlockDeclarativePartBuilder) -> Self {
value.build()
}
}
pub struct BlockEpilogueBuilder {
end_token: Token,
block_token: Token,
label: Option<Token>,
semi_colon_token: Token,
}
impl Default for BlockEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl BlockEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
block_token: Kw::Block.canonical_token(),
label: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_block_token(mut self, t: impl Into<Token>) -> Self {
self.block_token = t.into();
self
}
pub fn with_block_token_trivia(mut self, trivia: Trivia) -> Self {
self.block_token.set_leading_trivia(trivia);
self
}
pub fn with_label(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.label = Some(t.into().into());
self
}
pub fn with_label_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.label {
t.set_leading_trivia(trivia);
}
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> BlockEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_token(self.block_token)
.push_opt_token(self.label)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<BlockEpilogueBuilder> for BlockEpilogueSyntax {
fn from(value: BlockEpilogueBuilder) -> Self {
value.build()
}
}
pub struct BlockHeaderBuilder {
generic_part: Option<GenericPartSyntax>,
port_part: Option<PortPartSyntax>,
}
impl Default for BlockHeaderBuilder {
fn default() -> Self {
Self::new()
}
}
impl BlockHeaderBuilder {
pub fn new() -> Self {
Self {
generic_part: None,
port_part: None,
}
}
pub fn with_generic_part(mut self, n: impl Into<GenericPartSyntax>) -> Self {
self.generic_part = Some(n.into());
self
}
pub fn with_port_part(mut self, n: impl Into<PortPartSyntax>) -> Self {
self.port_part = Some(n.into());
self
}
pub fn build(self) -> BlockHeaderSyntax {
RawNodeBuilder::new()
.push_opt_node(self.generic_part)
.push_opt_node(self.port_part)
.finish()
}
}
impl From<BlockHeaderBuilder> for BlockHeaderSyntax {
fn from(value: BlockHeaderBuilder) -> Self {
value.build()
}
}
pub struct BlockPreambleBuilder {
block_token: Token,
parenthesized_condition: Option<ParenthesizedConditionSyntax>,
is_token: Option<Token>,
}
impl Default for BlockPreambleBuilder {
fn default() -> Self {
Self::new()
}
}
impl BlockPreambleBuilder {
pub fn new() -> Self {
Self {
block_token: Kw::Block.canonical_token(),
parenthesized_condition: None,
is_token: None,
}
}
pub fn with_block_token(mut self, t: impl Into<Token>) -> Self {
self.block_token = t.into();
self
}
pub fn with_block_token_trivia(mut self, trivia: Trivia) -> Self {
self.block_token.set_leading_trivia(trivia);
self
}
pub fn with_parenthesized_condition(
mut self,
n: impl Into<ParenthesizedConditionSyntax>,
) -> Self {
self.parenthesized_condition = Some(n.into());
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = Some(t.into());
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.is_token
.get_or_insert_with(|| Kw::Is.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn build(self) -> BlockPreambleSyntax {
RawNodeBuilder::new()
.push_token(self.block_token)
.push_opt_node(self.parenthesized_condition)
.push_opt_token(self.is_token)
.finish()
}
}
impl From<BlockPreambleBuilder> for BlockPreambleSyntax {
fn from(value: BlockPreambleBuilder) -> Self {
value.build()
}
}
pub struct BlockStatementBuilder {
stmt_label: StmtLabelSyntax,
block_preamble: BlockPreambleSyntax,
block_header: Option<BlockHeaderSyntax>,
block_declarative_part: Option<BlockDeclarativePartSyntax>,
declaration_statement_separator: DeclarationStatementSeparatorSyntax,
block_statement_part: Option<BlockStatementPartSyntax>,
block_epilogue: BlockEpilogueSyntax,
}
impl BlockStatementBuilder {
pub fn new(stmt_label: impl Into<StmtLabelSyntax>) -> Self {
Self {
stmt_label: stmt_label.into(),
block_preamble: BlockPreambleBuilder::default().build(),
block_header: None,
block_declarative_part: None,
declaration_statement_separator: DeclarationStatementSeparatorBuilder::default()
.build(),
block_statement_part: None,
block_epilogue: BlockEpilogueBuilder::default().build(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = n.into();
self
}
pub fn with_block_preamble(mut self, n: impl Into<BlockPreambleSyntax>) -> Self {
self.block_preamble = n.into();
self
}
pub fn with_block_header(mut self, n: impl Into<BlockHeaderSyntax>) -> Self {
self.block_header = Some(n.into());
self
}
pub fn with_block_declarative_part(mut self, n: impl Into<BlockDeclarativePartSyntax>) -> Self {
self.block_declarative_part = Some(n.into());
self
}
pub fn with_declaration_statement_separator(
mut self,
n: impl Into<DeclarationStatementSeparatorSyntax>,
) -> Self {
self.declaration_statement_separator = n.into();
self
}
pub fn with_block_statement_part(mut self, n: impl Into<BlockStatementPartSyntax>) -> Self {
self.block_statement_part = Some(n.into());
self
}
pub fn with_block_epilogue(mut self, n: impl Into<BlockEpilogueSyntax>) -> Self {
self.block_epilogue = n.into();
self
}
pub fn build(self) -> BlockStatementSyntax {
RawNodeBuilder::new()
.push_node(self.stmt_label)
.push_node(self.block_preamble)
.push_opt_node(self.block_header)
.push_opt_node(self.block_declarative_part)
.push_node(self.declaration_statement_separator)
.push_opt_node(self.block_statement_part)
.push_node(self.block_epilogue)
.finish()
}
}
impl From<BlockStatementBuilder> for BlockStatementSyntax {
fn from(value: BlockStatementBuilder) -> Self {
value.build()
}
}
pub struct BlockStatementPartBuilder {
concurrent_statements: Vec<ConcurrentStatementSyntax>,
}
impl Default for BlockStatementPartBuilder {
fn default() -> Self {
Self::new()
}
}
impl BlockStatementPartBuilder {
pub fn new() -> Self {
Self {
concurrent_statements: Vec::new(),
}
}
pub fn add_concurrent_statements(mut self, n: impl Into<ConcurrentStatementSyntax>) -> Self {
self.concurrent_statements.push(n.into());
self
}
pub fn build(self) -> BlockStatementPartSyntax {
RawNodeBuilder::new()
.push_nodes(self.concurrent_statements)
.finish()
}
}
impl From<BlockStatementPartBuilder> for BlockStatementPartSyntax {
fn from(value: BlockStatementPartBuilder) -> Self {
value.build()
}
}
pub struct CaseGenerateAlternativeBuilder {
when_token: Token,
stmt_label: Option<StmtLabelSyntax>,
choices: ChoicesSyntax,
right_arrow_token: Token,
generate_statement_body: Option<GenerateStatementBodySyntax>,
}
impl CaseGenerateAlternativeBuilder {
pub fn new(choices: impl Into<ChoicesSyntax>) -> Self {
Self {
when_token: Kw::When.canonical_token(),
stmt_label: None,
choices: choices.into(),
right_arrow_token: TokenKind::RightArrow.canonical_token().unwrap(),
generate_statement_body: None,
}
}
pub fn with_when_token(mut self, t: impl Into<Token>) -> Self {
self.when_token = t.into();
self
}
pub fn with_when_token_trivia(mut self, trivia: Trivia) -> Self {
self.when_token.set_leading_trivia(trivia);
self
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_choices(mut self, n: impl Into<ChoicesSyntax>) -> Self {
self.choices = n.into();
self
}
pub fn with_right_arrow_token(mut self, t: impl Into<Token>) -> Self {
self.right_arrow_token = t.into();
self
}
pub fn with_right_arrow_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_arrow_token.set_leading_trivia(trivia);
self
}
pub fn with_generate_statement_body(
mut self,
n: impl Into<GenerateStatementBodySyntax>,
) -> Self {
self.generate_statement_body = Some(n.into());
self
}
pub fn build(self) -> CaseGenerateAlternativeSyntax {
RawNodeBuilder::new()
.push_token(self.when_token)
.push_opt_node(self.stmt_label)
.push_node(self.choices)
.push_token(self.right_arrow_token)
.push_opt_node(self.generate_statement_body)
.finish()
}
}
impl From<CaseGenerateAlternativeBuilder> for CaseGenerateAlternativeSyntax {
fn from(value: CaseGenerateAlternativeBuilder) -> Self {
value.build()
}
}
pub struct CaseGeneratePreambleBuilder {
case_token: Token,
expression: ExpressionSyntax,
generate_token: Token,
}
impl CaseGeneratePreambleBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
case_token: Kw::Case.canonical_token(),
expression: expression.into(),
generate_token: Kw::Generate.canonical_token(),
}
}
pub fn with_case_token(mut self, t: impl Into<Token>) -> Self {
self.case_token = t.into();
self
}
pub fn with_case_token_trivia(mut self, trivia: Trivia) -> Self {
self.case_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn with_generate_token(mut self, t: impl Into<Token>) -> Self {
self.generate_token = t.into();
self
}
pub fn with_generate_token_trivia(mut self, trivia: Trivia) -> Self {
self.generate_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> CaseGeneratePreambleSyntax {
RawNodeBuilder::new()
.push_token(self.case_token)
.push_node(self.expression)
.push_token(self.generate_token)
.finish()
}
}
impl From<CaseGeneratePreambleBuilder> for CaseGeneratePreambleSyntax {
fn from(value: CaseGeneratePreambleBuilder) -> Self {
value.build()
}
}
pub struct CaseGenerateStatementBuilder {
stmt_label: StmtLabelSyntax,
case_generate_preamble: CaseGeneratePreambleSyntax,
case_generate_alternatives: Vec<CaseGenerateAlternativeSyntax>,
generate_epilogue: GenerateEpilogueSyntax,
}
impl CaseGenerateStatementBuilder {
pub fn new(
stmt_label: impl Into<StmtLabelSyntax>,
case_generate_preamble: impl Into<CaseGeneratePreambleSyntax>,
case_generate_alternatives: impl Into<CaseGenerateAlternativeSyntax>,
) -> Self {
Self {
stmt_label: stmt_label.into(),
case_generate_preamble: case_generate_preamble.into(),
case_generate_alternatives: vec![case_generate_alternatives.into()],
generate_epilogue: GenerateEpilogueBuilder::default().build(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = n.into();
self
}
pub fn with_case_generate_preamble(mut self, n: impl Into<CaseGeneratePreambleSyntax>) -> Self {
self.case_generate_preamble = n.into();
self
}
pub fn add_case_generate_alternatives(
mut self,
n: impl Into<CaseGenerateAlternativeSyntax>,
) -> Self {
self.case_generate_alternatives.push(n.into());
self
}
pub fn with_generate_epilogue(mut self, n: impl Into<GenerateEpilogueSyntax>) -> Self {
self.generate_epilogue = n.into();
self
}
pub fn build(self) -> CaseGenerateStatementSyntax {
RawNodeBuilder::new()
.push_node(self.stmt_label)
.push_node(self.case_generate_preamble)
.push_nodes(self.case_generate_alternatives)
.push_node(self.generate_epilogue)
.finish()
}
}
impl From<CaseGenerateStatementBuilder> for CaseGenerateStatementSyntax {
fn from(value: CaseGenerateStatementBuilder) -> Self {
value.build()
}
}
pub struct CaseStatementBuilder {
case_statement_preamble: CaseStatementPreambleSyntax,
case_statement_alternatives: Vec<CaseStatementAlternativeSyntax>,
case_statement_epilogue: CaseStatementEpilogueSyntax,
}
impl CaseStatementBuilder {
pub fn new(
case_statement_preamble: impl Into<CaseStatementPreambleSyntax>,
case_statement_alternatives: impl Into<CaseStatementAlternativeSyntax>,
) -> Self {
Self {
case_statement_preamble: case_statement_preamble.into(),
case_statement_alternatives: vec![case_statement_alternatives.into()],
case_statement_epilogue: CaseStatementEpilogueBuilder::default().build(),
}
}
pub fn with_case_statement_preamble(
mut self,
n: impl Into<CaseStatementPreambleSyntax>,
) -> Self {
self.case_statement_preamble = n.into();
self
}
pub fn add_case_statement_alternatives(
mut self,
n: impl Into<CaseStatementAlternativeSyntax>,
) -> Self {
self.case_statement_alternatives.push(n.into());
self
}
pub fn with_case_statement_epilogue(
mut self,
n: impl Into<CaseStatementEpilogueSyntax>,
) -> Self {
self.case_statement_epilogue = n.into();
self
}
pub fn build(self) -> CaseStatementSyntax {
RawNodeBuilder::new()
.push_node(self.case_statement_preamble)
.push_nodes(self.case_statement_alternatives)
.push_node(self.case_statement_epilogue)
.finish()
}
}
impl From<CaseStatementBuilder> for CaseStatementSyntax {
fn from(value: CaseStatementBuilder) -> Self {
value.build()
}
}
pub struct CaseStatementAlternativeBuilder {
case_statement_alternative_preamble: CaseStatementAlternativePreambleSyntax,
sequence_of_statements: Option<SequenceOfStatementsSyntax>,
}
impl CaseStatementAlternativeBuilder {
pub fn new(
case_statement_alternative_preamble: impl Into<CaseStatementAlternativePreambleSyntax>,
) -> Self {
Self {
case_statement_alternative_preamble: case_statement_alternative_preamble.into(),
sequence_of_statements: None,
}
}
pub fn with_case_statement_alternative_preamble(
mut self,
n: impl Into<CaseStatementAlternativePreambleSyntax>,
) -> Self {
self.case_statement_alternative_preamble = n.into();
self
}
pub fn with_sequence_of_statements(mut self, n: impl Into<SequenceOfStatementsSyntax>) -> Self {
self.sequence_of_statements = Some(n.into());
self
}
pub fn build(self) -> CaseStatementAlternativeSyntax {
RawNodeBuilder::new()
.push_node(self.case_statement_alternative_preamble)
.push_opt_node(self.sequence_of_statements)
.finish()
}
}
impl From<CaseStatementAlternativeBuilder> for CaseStatementAlternativeSyntax {
fn from(value: CaseStatementAlternativeBuilder) -> Self {
value.build()
}
}
pub struct CaseStatementAlternativePreambleBuilder {
when_token: Token,
choices: ChoicesSyntax,
right_arrow_token: Token,
}
impl CaseStatementAlternativePreambleBuilder {
pub fn new(choices: impl Into<ChoicesSyntax>) -> Self {
Self {
when_token: Kw::When.canonical_token(),
choices: choices.into(),
right_arrow_token: TokenKind::RightArrow.canonical_token().unwrap(),
}
}
pub fn with_when_token(mut self, t: impl Into<Token>) -> Self {
self.when_token = t.into();
self
}
pub fn with_when_token_trivia(mut self, trivia: Trivia) -> Self {
self.when_token.set_leading_trivia(trivia);
self
}
pub fn with_choices(mut self, n: impl Into<ChoicesSyntax>) -> Self {
self.choices = n.into();
self
}
pub fn with_right_arrow_token(mut self, t: impl Into<Token>) -> Self {
self.right_arrow_token = t.into();
self
}
pub fn with_right_arrow_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_arrow_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> CaseStatementAlternativePreambleSyntax {
RawNodeBuilder::new()
.push_token(self.when_token)
.push_node(self.choices)
.push_token(self.right_arrow_token)
.finish()
}
}
impl From<CaseStatementAlternativePreambleBuilder> for CaseStatementAlternativePreambleSyntax {
fn from(value: CaseStatementAlternativePreambleBuilder) -> Self {
value.build()
}
}
pub struct CaseStatementEpilogueBuilder {
end_token: Token,
case_token: Token,
que_token: Option<Token>,
label: Option<Token>,
semi_colon_token: Token,
}
impl Default for CaseStatementEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl CaseStatementEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
case_token: Kw::Case.canonical_token(),
que_token: None,
label: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_case_token(mut self, t: impl Into<Token>) -> Self {
self.case_token = t.into();
self
}
pub fn with_case_token_trivia(mut self, trivia: Trivia) -> Self {
self.case_token.set_leading_trivia(trivia);
self
}
pub fn with_que_token(mut self, t: impl Into<Token>) -> Self {
self.que_token = Some(t.into());
self
}
pub fn with_que_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.que_token
.get_or_insert_with(|| TokenKind::Que.canonical_token().unwrap());
tok.set_leading_trivia(trivia);
self
}
pub fn with_label(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.label = Some(t.into().into());
self
}
pub fn with_label_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.label {
t.set_leading_trivia(trivia);
}
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> CaseStatementEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_token(self.case_token)
.push_opt_token(self.que_token)
.push_opt_token(self.label)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<CaseStatementEpilogueBuilder> for CaseStatementEpilogueSyntax {
fn from(value: CaseStatementEpilogueBuilder) -> Self {
value.build()
}
}
pub struct CaseStatementPreambleBuilder {
stmt_label: Option<StmtLabelSyntax>,
case_token: Token,
que_token: Option<Token>,
expression: ExpressionSyntax,
is_token: Token,
}
impl CaseStatementPreambleBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
stmt_label: None,
case_token: Kw::Case.canonical_token(),
que_token: None,
expression: expression.into(),
is_token: Kw::Is.canonical_token(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_case_token(mut self, t: impl Into<Token>) -> Self {
self.case_token = t.into();
self
}
pub fn with_case_token_trivia(mut self, trivia: Trivia) -> Self {
self.case_token.set_leading_trivia(trivia);
self
}
pub fn with_que_token(mut self, t: impl Into<Token>) -> Self {
self.que_token = Some(t.into());
self
}
pub fn with_que_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.que_token
.get_or_insert_with(|| TokenKind::Que.canonical_token().unwrap());
tok.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> CaseStatementPreambleSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_token(self.case_token)
.push_opt_token(self.que_token)
.push_node(self.expression)
.push_token(self.is_token)
.finish()
}
}
impl From<CaseStatementPreambleBuilder> for CaseStatementPreambleSyntax {
fn from(value: CaseStatementPreambleBuilder) -> Self {
value.build()
}
}
pub struct ComponentConfigurationBuilder {
component_configuration_preamble: ComponentConfigurationPreambleSyntax,
binding: Option<BindingSyntax>,
verification_unit_bindings: Vec<VerificationUnitBindingSyntax>,
block_configuration: Option<BlockConfigurationSyntax>,
component_configuration_epilogue: ComponentConfigurationEpilogueSyntax,
}
impl ComponentConfigurationBuilder {
pub fn new(
component_configuration_preamble: impl Into<ComponentConfigurationPreambleSyntax>,
) -> Self {
Self {
component_configuration_preamble: component_configuration_preamble.into(),
binding: None,
verification_unit_bindings: Vec::new(),
block_configuration: None,
component_configuration_epilogue: ComponentConfigurationEpilogueBuilder::default()
.build(),
}
}
pub fn with_component_configuration_preamble(
mut self,
n: impl Into<ComponentConfigurationPreambleSyntax>,
) -> Self {
self.component_configuration_preamble = n.into();
self
}
pub fn with_binding(mut self, n: impl Into<BindingSyntax>) -> Self {
self.binding = Some(n.into());
self
}
pub fn add_verification_unit_bindings(
mut self,
n: impl Into<VerificationUnitBindingSyntax>,
) -> Self {
self.verification_unit_bindings.push(n.into());
self
}
pub fn with_block_configuration(mut self, n: impl Into<BlockConfigurationSyntax>) -> Self {
self.block_configuration = Some(n.into());
self
}
pub fn with_component_configuration_epilogue(
mut self,
n: impl Into<ComponentConfigurationEpilogueSyntax>,
) -> Self {
self.component_configuration_epilogue = n.into();
self
}
pub fn build(self) -> ComponentConfigurationSyntax {
RawNodeBuilder::new()
.push_node(self.component_configuration_preamble)
.push_opt_node(self.binding)
.push_nodes(self.verification_unit_bindings)
.push_opt_node(self.block_configuration)
.push_node(self.component_configuration_epilogue)
.finish()
}
}
impl From<ComponentConfigurationBuilder> for ComponentConfigurationSyntax {
fn from(value: ComponentConfigurationBuilder) -> Self {
value.build()
}
}
pub struct ComponentConfigurationEpilogueBuilder {
end_token: Token,
for_token: Token,
semi_colon_token: Token,
}
impl Default for ComponentConfigurationEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl ComponentConfigurationEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
for_token: Kw::For.canonical_token(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_for_token(mut self, t: impl Into<Token>) -> Self {
self.for_token = t.into();
self
}
pub fn with_for_token_trivia(mut self, trivia: Trivia) -> Self {
self.for_token.set_leading_trivia(trivia);
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ComponentConfigurationEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_token(self.for_token)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ComponentConfigurationEpilogueBuilder> for ComponentConfigurationEpilogueSyntax {
fn from(value: ComponentConfigurationEpilogueBuilder) -> Self {
value.build()
}
}
pub struct ComponentConfigurationPreambleBuilder {
for_token: Token,
component_specification: ComponentSpecificationSyntax,
}
impl ComponentConfigurationPreambleBuilder {
pub fn new(component_specification: impl Into<ComponentSpecificationSyntax>) -> Self {
Self {
for_token: Kw::For.canonical_token(),
component_specification: component_specification.into(),
}
}
pub fn with_for_token(mut self, t: impl Into<Token>) -> Self {
self.for_token = t.into();
self
}
pub fn with_for_token_trivia(mut self, trivia: Trivia) -> Self {
self.for_token.set_leading_trivia(trivia);
self
}
pub fn with_component_specification(
mut self,
n: impl Into<ComponentSpecificationSyntax>,
) -> Self {
self.component_specification = n.into();
self
}
pub fn build(self) -> ComponentConfigurationPreambleSyntax {
RawNodeBuilder::new()
.push_token(self.for_token)
.push_node(self.component_specification)
.finish()
}
}
impl From<ComponentConfigurationPreambleBuilder> for ComponentConfigurationPreambleSyntax {
fn from(value: ComponentConfigurationPreambleBuilder) -> Self {
value.build()
}
}
pub struct ComponentDeclarationBuilder {
component_declaration_preamble: ComponentDeclarationPreambleSyntax,
generic_clause: Option<GenericClauseSyntax>,
port_clause: Option<PortClauseSyntax>,
component_declaration_epilogue: ComponentDeclarationEpilogueSyntax,
}
impl ComponentDeclarationBuilder {
pub fn new(
component_declaration_preamble: impl Into<ComponentDeclarationPreambleSyntax>,
) -> Self {
Self {
component_declaration_preamble: component_declaration_preamble.into(),
generic_clause: None,
port_clause: None,
component_declaration_epilogue: ComponentDeclarationEpilogueBuilder::default().build(),
}
}
pub fn with_component_declaration_preamble(
mut self,
n: impl Into<ComponentDeclarationPreambleSyntax>,
) -> Self {
self.component_declaration_preamble = n.into();
self
}
pub fn with_generic_clause(mut self, n: impl Into<GenericClauseSyntax>) -> Self {
self.generic_clause = Some(n.into());
self
}
pub fn with_port_clause(mut self, n: impl Into<PortClauseSyntax>) -> Self {
self.port_clause = Some(n.into());
self
}
pub fn with_component_declaration_epilogue(
mut self,
n: impl Into<ComponentDeclarationEpilogueSyntax>,
) -> Self {
self.component_declaration_epilogue = n.into();
self
}
pub fn build(self) -> ComponentDeclarationSyntax {
RawNodeBuilder::new()
.push_node(self.component_declaration_preamble)
.push_opt_node(self.generic_clause)
.push_opt_node(self.port_clause)
.push_node(self.component_declaration_epilogue)
.finish()
}
}
impl From<ComponentDeclarationBuilder> for ComponentDeclarationSyntax {
fn from(value: ComponentDeclarationBuilder) -> Self {
value.build()
}
}
pub struct ComponentDeclarationEpilogueBuilder {
end_token: Token,
component_token: Token,
simple_name: Option<Token>,
semi_colon_token: Token,
}
impl Default for ComponentDeclarationEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl ComponentDeclarationEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
component_token: Kw::Component.canonical_token(),
simple_name: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_component_token(mut self, t: impl Into<Token>) -> Self {
self.component_token = t.into();
self
}
pub fn with_component_token_trivia(mut self, trivia: Trivia) -> Self {
self.component_token.set_leading_trivia(trivia);
self
}
pub fn with_simple_name(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.simple_name = Some(t.into().into());
self
}
pub fn with_simple_name_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.simple_name {
t.set_leading_trivia(trivia);
}
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ComponentDeclarationEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_token(self.component_token)
.push_opt_token(self.simple_name)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ComponentDeclarationEpilogueBuilder> for ComponentDeclarationEpilogueSyntax {
fn from(value: ComponentDeclarationEpilogueBuilder) -> Self {
value.build()
}
}
pub struct ComponentDeclarationPreambleBuilder {
component_token: Token,
identifier_token: Token,
is_token: Option<Token>,
}
impl ComponentDeclarationPreambleBuilder {
pub fn new(identifier_token: impl Into<crate::builder::Identifier>) -> Self {
Self {
component_token: Kw::Component.canonical_token(),
identifier_token: identifier_token.into().into(),
is_token: None,
}
}
pub fn with_component_token(mut self, t: impl Into<Token>) -> Self {
self.component_token = t.into();
self
}
pub fn with_component_token_trivia(mut self, trivia: Trivia) -> Self {
self.component_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = Some(t.into());
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.is_token
.get_or_insert_with(|| Kw::Is.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ComponentDeclarationPreambleSyntax {
RawNodeBuilder::new()
.push_token(self.component_token)
.push_token(self.identifier_token)
.push_opt_token(self.is_token)
.finish()
}
}
impl From<ComponentDeclarationPreambleBuilder> for ComponentDeclarationPreambleSyntax {
fn from(value: ComponentDeclarationPreambleBuilder) -> Self {
value.build()
}
}
pub struct ComponentInstantiationStatementBuilder {
stmt_label: StmtLabelSyntax,
instantiated_unit: InstantiatedUnitSyntax,
generic_map_aspect: Option<GenericMapAspectSyntax>,
port_map_aspect: Option<PortMapAspectSyntax>,
semi_colon_token: Token,
}
impl ComponentInstantiationStatementBuilder {
pub fn new(
stmt_label: impl Into<StmtLabelSyntax>,
instantiated_unit: impl Into<InstantiatedUnitSyntax>,
) -> Self {
Self {
stmt_label: stmt_label.into(),
instantiated_unit: instantiated_unit.into(),
generic_map_aspect: None,
port_map_aspect: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = n.into();
self
}
pub fn with_instantiated_unit(mut self, n: impl Into<InstantiatedUnitSyntax>) -> Self {
self.instantiated_unit = n.into();
self
}
pub fn with_generic_map_aspect(mut self, n: impl Into<GenericMapAspectSyntax>) -> Self {
self.generic_map_aspect = Some(n.into());
self
}
pub fn with_port_map_aspect(mut self, n: impl Into<PortMapAspectSyntax>) -> Self {
self.port_map_aspect = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ComponentInstantiationStatementSyntax {
RawNodeBuilder::new()
.push_node(self.stmt_label)
.push_node(self.instantiated_unit)
.push_opt_node(self.generic_map_aspect)
.push_opt_node(self.port_map_aspect)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ComponentInstantiationStatementBuilder> for ComponentInstantiationStatementSyntax {
fn from(value: ComponentInstantiationStatementBuilder) -> Self {
value.build()
}
}
pub struct ComponentSpecificationBuilder {
instantiation_list: InstantiationListSyntax,
colon_token: Token,
name: NameSyntax,
}
impl ComponentSpecificationBuilder {
pub fn new(
instantiation_list: impl Into<InstantiationListSyntax>,
name: impl Into<NameSyntax>,
) -> Self {
Self {
instantiation_list: instantiation_list.into(),
colon_token: TokenKind::Colon.canonical_token().unwrap(),
name: name.into(),
}
}
pub fn with_instantiation_list(mut self, n: impl Into<InstantiationListSyntax>) -> Self {
self.instantiation_list = n.into();
self
}
pub fn with_colon_token(mut self, t: impl Into<Token>) -> Self {
self.colon_token = t.into();
self
}
pub fn with_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_token.set_leading_trivia(trivia);
self
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn build(self) -> ComponentSpecificationSyntax {
RawNodeBuilder::new()
.push_node(self.instantiation_list)
.push_token(self.colon_token)
.push_node(self.name)
.finish()
}
}
impl From<ComponentSpecificationBuilder> for ComponentSpecificationSyntax {
fn from(value: ComponentSpecificationBuilder) -> Self {
value.build()
}
}
pub struct CompoundConfigurationSpecificationBuilder {
component_configuration_preamble: ComponentConfigurationPreambleSyntax,
binding_indication: Option<BindingIndicationSyntax>,
semi_colon_token: Token,
verification_unit_bindings: Vec<VerificationUnitBindingSyntax>,
component_configuration_epilogue: ComponentConfigurationEpilogueSyntax,
}
impl CompoundConfigurationSpecificationBuilder {
pub fn new(
component_configuration_preamble: impl Into<ComponentConfigurationPreambleSyntax>,
verification_unit_bindings: impl Into<VerificationUnitBindingSyntax>,
) -> Self {
Self {
component_configuration_preamble: component_configuration_preamble.into(),
binding_indication: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
verification_unit_bindings: vec![verification_unit_bindings.into()],
component_configuration_epilogue: ComponentConfigurationEpilogueBuilder::default()
.build(),
}
}
pub fn with_component_configuration_preamble(
mut self,
n: impl Into<ComponentConfigurationPreambleSyntax>,
) -> Self {
self.component_configuration_preamble = n.into();
self
}
pub fn with_binding_indication(mut self, n: impl Into<BindingIndicationSyntax>) -> Self {
self.binding_indication = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn add_verification_unit_bindings(
mut self,
n: impl Into<VerificationUnitBindingSyntax>,
) -> Self {
self.verification_unit_bindings.push(n.into());
self
}
pub fn with_component_configuration_epilogue(
mut self,
n: impl Into<ComponentConfigurationEpilogueSyntax>,
) -> Self {
self.component_configuration_epilogue = n.into();
self
}
pub fn build(self) -> CompoundConfigurationSpecificationSyntax {
RawNodeBuilder::new()
.push_node(self.component_configuration_preamble)
.push_opt_node(self.binding_indication)
.push_token(self.semi_colon_token)
.push_nodes(self.verification_unit_bindings)
.push_node(self.component_configuration_epilogue)
.finish()
}
}
impl From<CompoundConfigurationSpecificationBuilder> for CompoundConfigurationSpecificationSyntax {
fn from(value: CompoundConfigurationSpecificationBuilder) -> Self {
value.build()
}
}
pub struct ConcurrentAssertionStatementBuilder {
stmt_label: Option<StmtLabelSyntax>,
postponed_token: Option<Token>,
assertion: AssertionSyntax,
semi_colon_token: Token,
}
impl ConcurrentAssertionStatementBuilder {
pub fn new(assertion: impl Into<AssertionSyntax>) -> Self {
Self {
stmt_label: None,
postponed_token: None,
assertion: assertion.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_postponed_token(mut self, t: impl Into<Token>) -> Self {
self.postponed_token = Some(t.into());
self
}
pub fn with_postponed_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.postponed_token
.get_or_insert_with(|| Kw::Postponed.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_assertion(mut self, n: impl Into<AssertionSyntax>) -> Self {
self.assertion = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ConcurrentAssertionStatementSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_opt_token(self.postponed_token)
.push_node(self.assertion)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ConcurrentAssertionStatementBuilder> for ConcurrentAssertionStatementSyntax {
fn from(value: ConcurrentAssertionStatementBuilder) -> Self {
value.build()
}
}
pub struct ConcurrentConditionalSignalAssignmentBuilder {
stmt_label: Option<StmtLabelSyntax>,
postponed_token: Option<Token>,
target: TargetSyntax,
lte_token: Token,
guarded_token: Option<Token>,
delay_mechanism: Option<DelayMechanismSyntax>,
conditional_waveforms: ConditionalWaveformsSyntax,
semi_colon_token: Token,
}
impl ConcurrentConditionalSignalAssignmentBuilder {
pub fn new(
target: impl Into<TargetSyntax>,
conditional_waveforms: impl Into<ConditionalWaveformsSyntax>,
) -> Self {
Self {
stmt_label: None,
postponed_token: None,
target: target.into(),
lte_token: TokenKind::LTE.canonical_token().unwrap(),
guarded_token: None,
delay_mechanism: None,
conditional_waveforms: conditional_waveforms.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_postponed_token(mut self, t: impl Into<Token>) -> Self {
self.postponed_token = Some(t.into());
self
}
pub fn with_postponed_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.postponed_token
.get_or_insert_with(|| Kw::Postponed.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_target(mut self, n: impl Into<TargetSyntax>) -> Self {
self.target = n.into();
self
}
pub fn with_lte_token(mut self, t: impl Into<Token>) -> Self {
self.lte_token = t.into();
self
}
pub fn with_lte_token_trivia(mut self, trivia: Trivia) -> Self {
self.lte_token.set_leading_trivia(trivia);
self
}
pub fn with_guarded_token(mut self, t: impl Into<Token>) -> Self {
self.guarded_token = Some(t.into());
self
}
pub fn with_guarded_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.guarded_token
.get_or_insert_with(|| Kw::Guarded.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_delay_mechanism(mut self, n: impl Into<DelayMechanismSyntax>) -> Self {
self.delay_mechanism = Some(n.into());
self
}
pub fn with_conditional_waveforms(mut self, n: impl Into<ConditionalWaveformsSyntax>) -> Self {
self.conditional_waveforms = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ConcurrentConditionalSignalAssignmentSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_opt_token(self.postponed_token)
.push_node(self.target)
.push_token(self.lte_token)
.push_opt_token(self.guarded_token)
.push_opt_node(self.delay_mechanism)
.push_node(self.conditional_waveforms)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ConcurrentConditionalSignalAssignmentBuilder>
for ConcurrentConditionalSignalAssignmentSyntax
{
fn from(value: ConcurrentConditionalSignalAssignmentBuilder) -> Self {
value.build()
}
}
pub struct ConcurrentProcedureCallOrComponentInstantiationStatementBuilder {
stmt_label: Option<StmtLabelSyntax>,
postponed_token: Option<Token>,
name: NameSyntax,
semi_colon_token: Token,
}
impl ConcurrentProcedureCallOrComponentInstantiationStatementBuilder {
pub fn new(name: impl Into<NameSyntax>) -> Self {
Self {
stmt_label: None,
postponed_token: None,
name: name.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_postponed_token(mut self, t: impl Into<Token>) -> Self {
self.postponed_token = Some(t.into());
self
}
pub fn with_postponed_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.postponed_token
.get_or_insert_with(|| Kw::Postponed.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ConcurrentProcedureCallOrComponentInstantiationStatementSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_opt_token(self.postponed_token)
.push_node(self.name)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ConcurrentProcedureCallOrComponentInstantiationStatementBuilder>
for ConcurrentProcedureCallOrComponentInstantiationStatementSyntax
{
fn from(value: ConcurrentProcedureCallOrComponentInstantiationStatementBuilder) -> Self {
value.build()
}
}
pub struct ConcurrentSelectedSignalAssignmentBuilder {
stmt_label: Option<StmtLabelSyntax>,
postponed_token: Option<Token>,
selected_assignment_preamble: SelectedAssignmentPreambleSyntax,
target: TargetSyntax,
lte_token: Token,
guarded_token: Option<Token>,
delay_mechanism: Option<DelayMechanismSyntax>,
selected_waveforms: SelectedWaveformsSyntax,
semi_colon_token: Token,
}
impl ConcurrentSelectedSignalAssignmentBuilder {
pub fn new(
selected_assignment_preamble: impl Into<SelectedAssignmentPreambleSyntax>,
target: impl Into<TargetSyntax>,
selected_waveforms: impl Into<SelectedWaveformsSyntax>,
) -> Self {
Self {
stmt_label: None,
postponed_token: None,
selected_assignment_preamble: selected_assignment_preamble.into(),
target: target.into(),
lte_token: TokenKind::LTE.canonical_token().unwrap(),
guarded_token: None,
delay_mechanism: None,
selected_waveforms: selected_waveforms.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_postponed_token(mut self, t: impl Into<Token>) -> Self {
self.postponed_token = Some(t.into());
self
}
pub fn with_postponed_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.postponed_token
.get_or_insert_with(|| Kw::Postponed.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_selected_assignment_preamble(
mut self,
n: impl Into<SelectedAssignmentPreambleSyntax>,
) -> Self {
self.selected_assignment_preamble = n.into();
self
}
pub fn with_target(mut self, n: impl Into<TargetSyntax>) -> Self {
self.target = n.into();
self
}
pub fn with_lte_token(mut self, t: impl Into<Token>) -> Self {
self.lte_token = t.into();
self
}
pub fn with_lte_token_trivia(mut self, trivia: Trivia) -> Self {
self.lte_token.set_leading_trivia(trivia);
self
}
pub fn with_guarded_token(mut self, t: impl Into<Token>) -> Self {
self.guarded_token = Some(t.into());
self
}
pub fn with_guarded_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.guarded_token
.get_or_insert_with(|| Kw::Guarded.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_delay_mechanism(mut self, n: impl Into<DelayMechanismSyntax>) -> Self {
self.delay_mechanism = Some(n.into());
self
}
pub fn with_selected_waveforms(mut self, n: impl Into<SelectedWaveformsSyntax>) -> Self {
self.selected_waveforms = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ConcurrentSelectedSignalAssignmentSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_opt_token(self.postponed_token)
.push_node(self.selected_assignment_preamble)
.push_node(self.target)
.push_token(self.lte_token)
.push_opt_token(self.guarded_token)
.push_opt_node(self.delay_mechanism)
.push_node(self.selected_waveforms)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ConcurrentSelectedSignalAssignmentBuilder> for ConcurrentSelectedSignalAssignmentSyntax {
fn from(value: ConcurrentSelectedSignalAssignmentBuilder) -> Self {
value.build()
}
}
pub struct ConcurrentSimpleSignalAssignmentBuilder {
stmt_label: Option<StmtLabelSyntax>,
postponed_token: Option<Token>,
target: TargetSyntax,
lte_token: Token,
guarded_token: Option<Token>,
delay_mechanism: Option<DelayMechanismSyntax>,
waveform: WaveformSyntax,
semi_colon_token: Token,
}
impl ConcurrentSimpleSignalAssignmentBuilder {
pub fn new(target: impl Into<TargetSyntax>, waveform: impl Into<WaveformSyntax>) -> Self {
Self {
stmt_label: None,
postponed_token: None,
target: target.into(),
lte_token: TokenKind::LTE.canonical_token().unwrap(),
guarded_token: None,
delay_mechanism: None,
waveform: waveform.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_postponed_token(mut self, t: impl Into<Token>) -> Self {
self.postponed_token = Some(t.into());
self
}
pub fn with_postponed_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.postponed_token
.get_or_insert_with(|| Kw::Postponed.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_target(mut self, n: impl Into<TargetSyntax>) -> Self {
self.target = n.into();
self
}
pub fn with_lte_token(mut self, t: impl Into<Token>) -> Self {
self.lte_token = t.into();
self
}
pub fn with_lte_token_trivia(mut self, trivia: Trivia) -> Self {
self.lte_token.set_leading_trivia(trivia);
self
}
pub fn with_guarded_token(mut self, t: impl Into<Token>) -> Self {
self.guarded_token = Some(t.into());
self
}
pub fn with_guarded_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.guarded_token
.get_or_insert_with(|| Kw::Guarded.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_delay_mechanism(mut self, n: impl Into<DelayMechanismSyntax>) -> Self {
self.delay_mechanism = Some(n.into());
self
}
pub fn with_waveform(mut self, n: impl Into<WaveformSyntax>) -> Self {
self.waveform = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ConcurrentSimpleSignalAssignmentSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_opt_token(self.postponed_token)
.push_node(self.target)
.push_token(self.lte_token)
.push_opt_token(self.guarded_token)
.push_opt_node(self.delay_mechanism)
.push_node(self.waveform)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ConcurrentSimpleSignalAssignmentBuilder> for ConcurrentSimpleSignalAssignmentSyntax {
fn from(value: ConcurrentSimpleSignalAssignmentBuilder) -> Self {
value.build()
}
}
pub struct ConditionClauseBuilder {
until_token: Token,
condition: ExpressionSyntax,
}
impl ConditionClauseBuilder {
pub fn new(condition: impl Into<ExpressionSyntax>) -> Self {
Self {
until_token: Kw::Until.canonical_token(),
condition: condition.into(),
}
}
pub fn with_until_token(mut self, t: impl Into<Token>) -> Self {
self.until_token = t.into();
self
}
pub fn with_until_token_trivia(mut self, trivia: Trivia) -> Self {
self.until_token.set_leading_trivia(trivia);
self
}
pub fn with_condition(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.condition = n.into();
self
}
pub fn build(self) -> ConditionClauseSyntax {
RawNodeBuilder::new()
.push_token(self.until_token)
.push_node(self.condition)
.finish()
}
}
impl From<ConditionClauseBuilder> for ConditionClauseSyntax {
fn from(value: ConditionClauseBuilder) -> Self {
value.build()
}
}
pub struct ConditionalExpressionsBuilder {
when_expression: WhenExpressionSyntax,
else_when_expressions: Vec<ElseWhenExpressionSyntax>,
else_expression: Option<ElseExpressionSyntax>,
}
impl ConditionalExpressionsBuilder {
pub fn new(when_expression: impl Into<WhenExpressionSyntax>) -> Self {
Self {
when_expression: when_expression.into(),
else_when_expressions: Vec::new(),
else_expression: None,
}
}
pub fn with_when_expression(mut self, n: impl Into<WhenExpressionSyntax>) -> Self {
self.when_expression = n.into();
self
}
pub fn add_else_when_expressions(mut self, n: impl Into<ElseWhenExpressionSyntax>) -> Self {
self.else_when_expressions.push(n.into());
self
}
pub fn with_else_expression(mut self, n: impl Into<ElseExpressionSyntax>) -> Self {
self.else_expression = Some(n.into());
self
}
pub fn build(self) -> ConditionalExpressionsSyntax {
RawNodeBuilder::new()
.push_node(self.when_expression)
.push_nodes(self.else_when_expressions)
.push_opt_node(self.else_expression)
.finish()
}
}
impl From<ConditionalExpressionsBuilder> for ConditionalExpressionsSyntax {
fn from(value: ConditionalExpressionsBuilder) -> Self {
value.build()
}
}
pub struct ConditionalForceAssignmentBuilder {
stmt_label: Option<StmtLabelSyntax>,
target: TargetSyntax,
lte_token: Token,
force_token: Token,
force_mode: Option<ForceModeToken>,
conditional_expressions: ConditionalExpressionsSyntax,
semi_colon_token: Token,
}
impl ConditionalForceAssignmentBuilder {
pub fn new(
target: impl Into<TargetSyntax>,
conditional_expressions: impl Into<ConditionalExpressionsSyntax>,
) -> Self {
Self {
stmt_label: None,
target: target.into(),
lte_token: TokenKind::LTE.canonical_token().unwrap(),
force_token: Kw::Force.canonical_token(),
force_mode: None,
conditional_expressions: conditional_expressions.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_target(mut self, n: impl Into<TargetSyntax>) -> Self {
self.target = n.into();
self
}
pub fn with_lte_token(mut self, t: impl Into<Token>) -> Self {
self.lte_token = t.into();
self
}
pub fn with_lte_token_trivia(mut self, trivia: Trivia) -> Self {
self.lte_token.set_leading_trivia(trivia);
self
}
pub fn with_force_token(mut self, t: impl Into<Token>) -> Self {
self.force_token = t.into();
self
}
pub fn with_force_token_trivia(mut self, trivia: Trivia) -> Self {
self.force_token.set_leading_trivia(trivia);
self
}
pub fn with_force_mode(mut self, n: impl Into<ForceModeToken>) -> Self {
self.force_mode = Some(n.into());
self
}
pub fn with_conditional_expressions(
mut self,
n: impl Into<ConditionalExpressionsSyntax>,
) -> Self {
self.conditional_expressions = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ConditionalForceAssignmentSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_node(self.target)
.push_token(self.lte_token)
.push_token(self.force_token)
.push_opt_token(self.force_mode.map(|t| t.0))
.push_node(self.conditional_expressions)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ConditionalForceAssignmentBuilder> for ConditionalForceAssignmentSyntax {
fn from(value: ConditionalForceAssignmentBuilder) -> Self {
value.build()
}
}
pub struct ConditionalVariableAssignmentBuilder {
stmt_label: Option<StmtLabelSyntax>,
target: TargetSyntax,
colon_eq_token: Token,
conditional_expressions: ConditionalExpressionsSyntax,
semi_colon_token: Token,
}
impl ConditionalVariableAssignmentBuilder {
pub fn new(
target: impl Into<TargetSyntax>,
conditional_expressions: impl Into<ConditionalExpressionsSyntax>,
) -> Self {
Self {
stmt_label: None,
target: target.into(),
colon_eq_token: TokenKind::ColonEq.canonical_token().unwrap(),
conditional_expressions: conditional_expressions.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_target(mut self, n: impl Into<TargetSyntax>) -> Self {
self.target = n.into();
self
}
pub fn with_colon_eq_token(mut self, t: impl Into<Token>) -> Self {
self.colon_eq_token = t.into();
self
}
pub fn with_colon_eq_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_eq_token.set_leading_trivia(trivia);
self
}
pub fn with_conditional_expressions(
mut self,
n: impl Into<ConditionalExpressionsSyntax>,
) -> Self {
self.conditional_expressions = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ConditionalVariableAssignmentSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_node(self.target)
.push_token(self.colon_eq_token)
.push_node(self.conditional_expressions)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ConditionalVariableAssignmentBuilder> for ConditionalVariableAssignmentSyntax {
fn from(value: ConditionalVariableAssignmentBuilder) -> Self {
value.build()
}
}
pub struct ConditionalWaveformAssignmentBuilder {
stmt_label: Option<StmtLabelSyntax>,
target: TargetSyntax,
lte_token: Token,
delay_mechanism: Option<DelayMechanismSyntax>,
conditional_waveforms: ConditionalWaveformsSyntax,
semi_colon_token: Token,
}
impl ConditionalWaveformAssignmentBuilder {
pub fn new(
target: impl Into<TargetSyntax>,
conditional_waveforms: impl Into<ConditionalWaveformsSyntax>,
) -> Self {
Self {
stmt_label: None,
target: target.into(),
lte_token: TokenKind::LTE.canonical_token().unwrap(),
delay_mechanism: None,
conditional_waveforms: conditional_waveforms.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_target(mut self, n: impl Into<TargetSyntax>) -> Self {
self.target = n.into();
self
}
pub fn with_lte_token(mut self, t: impl Into<Token>) -> Self {
self.lte_token = t.into();
self
}
pub fn with_lte_token_trivia(mut self, trivia: Trivia) -> Self {
self.lte_token.set_leading_trivia(trivia);
self
}
pub fn with_delay_mechanism(mut self, n: impl Into<DelayMechanismSyntax>) -> Self {
self.delay_mechanism = Some(n.into());
self
}
pub fn with_conditional_waveforms(mut self, n: impl Into<ConditionalWaveformsSyntax>) -> Self {
self.conditional_waveforms = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ConditionalWaveformAssignmentSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_node(self.target)
.push_token(self.lte_token)
.push_opt_node(self.delay_mechanism)
.push_node(self.conditional_waveforms)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ConditionalWaveformAssignmentBuilder> for ConditionalWaveformAssignmentSyntax {
fn from(value: ConditionalWaveformAssignmentBuilder) -> Self {
value.build()
}
}
pub struct ConditionalWaveformsBuilder {
when_waveform: WhenWaveformSyntax,
else_when_waveforms: Vec<ElseWhenWaveformSyntax>,
else_waveform: Option<ElseWaveformSyntax>,
}
impl ConditionalWaveformsBuilder {
pub fn new(when_waveform: impl Into<WhenWaveformSyntax>) -> Self {
Self {
when_waveform: when_waveform.into(),
else_when_waveforms: Vec::new(),
else_waveform: None,
}
}
pub fn with_when_waveform(mut self, n: impl Into<WhenWaveformSyntax>) -> Self {
self.when_waveform = n.into();
self
}
pub fn add_else_when_waveforms(mut self, n: impl Into<ElseWhenWaveformSyntax>) -> Self {
self.else_when_waveforms.push(n.into());
self
}
pub fn with_else_waveform(mut self, n: impl Into<ElseWaveformSyntax>) -> Self {
self.else_waveform = Some(n.into());
self
}
pub fn build(self) -> ConditionalWaveformsSyntax {
RawNodeBuilder::new()
.push_node(self.when_waveform)
.push_nodes(self.else_when_waveforms)
.push_opt_node(self.else_waveform)
.finish()
}
}
impl From<ConditionalWaveformsBuilder> for ConditionalWaveformsSyntax {
fn from(value: ConditionalWaveformsBuilder) -> Self {
value.build()
}
}
pub struct ConfigurationDeclarationBuilder {
configuration_declaration_preamble: ConfigurationDeclarationPreambleSyntax,
configuration_declarative_part: Option<ConfigurationDeclarativePartSyntax>,
verification_unit_bindings: Vec<VerificationUnitBindingSyntax>,
block_configuration: BlockConfigurationSyntax,
configuration_declaration_epilogue: ConfigurationDeclarationEpilogueSyntax,
}
impl ConfigurationDeclarationBuilder {
pub fn new(
configuration_declaration_preamble: impl Into<ConfigurationDeclarationPreambleSyntax>,
block_configuration: impl Into<BlockConfigurationSyntax>,
) -> Self {
Self {
configuration_declaration_preamble: configuration_declaration_preamble.into(),
configuration_declarative_part: None,
verification_unit_bindings: Vec::new(),
block_configuration: block_configuration.into(),
configuration_declaration_epilogue: ConfigurationDeclarationEpilogueBuilder::default()
.build(),
}
}
pub fn with_configuration_declaration_preamble(
mut self,
n: impl Into<ConfigurationDeclarationPreambleSyntax>,
) -> Self {
self.configuration_declaration_preamble = n.into();
self
}
pub fn with_configuration_declarative_part(
mut self,
n: impl Into<ConfigurationDeclarativePartSyntax>,
) -> Self {
self.configuration_declarative_part = Some(n.into());
self
}
pub fn add_verification_unit_bindings(
mut self,
n: impl Into<VerificationUnitBindingSyntax>,
) -> Self {
self.verification_unit_bindings.push(n.into());
self
}
pub fn with_block_configuration(mut self, n: impl Into<BlockConfigurationSyntax>) -> Self {
self.block_configuration = n.into();
self
}
pub fn with_configuration_declaration_epilogue(
mut self,
n: impl Into<ConfigurationDeclarationEpilogueSyntax>,
) -> Self {
self.configuration_declaration_epilogue = n.into();
self
}
pub fn build(self) -> ConfigurationDeclarationSyntax {
RawNodeBuilder::new()
.push_node(self.configuration_declaration_preamble)
.push_opt_node(self.configuration_declarative_part)
.push_nodes(self.verification_unit_bindings)
.push_node(self.block_configuration)
.push_node(self.configuration_declaration_epilogue)
.finish()
}
}
impl From<ConfigurationDeclarationBuilder> for ConfigurationDeclarationSyntax {
fn from(value: ConfigurationDeclarationBuilder) -> Self {
value.build()
}
}
pub struct ConfigurationDeclarationEpilogueBuilder {
end_token: Token,
configuration_token: Option<Token>,
simple_name: Option<Token>,
semi_colon_token: Token,
}
impl Default for ConfigurationDeclarationEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl ConfigurationDeclarationEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
configuration_token: None,
simple_name: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_configuration_token(mut self, t: impl Into<Token>) -> Self {
self.configuration_token = Some(t.into());
self
}
pub fn with_configuration_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.configuration_token
.get_or_insert_with(|| Kw::Configuration.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_simple_name(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.simple_name = Some(t.into().into());
self
}
pub fn with_simple_name_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.simple_name {
t.set_leading_trivia(trivia);
}
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ConfigurationDeclarationEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_opt_token(self.configuration_token)
.push_opt_token(self.simple_name)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ConfigurationDeclarationEpilogueBuilder> for ConfigurationDeclarationEpilogueSyntax {
fn from(value: ConfigurationDeclarationEpilogueBuilder) -> Self {
value.build()
}
}
pub struct ConfigurationDeclarationPreambleBuilder {
configuration_token: Token,
identifier_token: Token,
of_token: Token,
name: NameSyntax,
is_token: Token,
}
impl ConfigurationDeclarationPreambleBuilder {
pub fn new(
identifier_token: impl Into<crate::builder::Identifier>,
name: impl Into<NameSyntax>,
) -> Self {
Self {
configuration_token: Kw::Configuration.canonical_token(),
identifier_token: identifier_token.into().into(),
of_token: Kw::Of.canonical_token(),
name: name.into(),
is_token: Kw::Is.canonical_token(),
}
}
pub fn with_configuration_token(mut self, t: impl Into<Token>) -> Self {
self.configuration_token = t.into();
self
}
pub fn with_configuration_token_trivia(mut self, trivia: Trivia) -> Self {
self.configuration_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_of_token(mut self, t: impl Into<Token>) -> Self {
self.of_token = t.into();
self
}
pub fn with_of_token_trivia(mut self, trivia: Trivia) -> Self {
self.of_token.set_leading_trivia(trivia);
self
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ConfigurationDeclarationPreambleSyntax {
RawNodeBuilder::new()
.push_token(self.configuration_token)
.push_token(self.identifier_token)
.push_token(self.of_token)
.push_node(self.name)
.push_token(self.is_token)
.finish()
}
}
impl From<ConfigurationDeclarationPreambleBuilder> for ConfigurationDeclarationPreambleSyntax {
fn from(value: ConfigurationDeclarationPreambleBuilder) -> Self {
value.build()
}
}
pub struct ConfigurationDeclarativePartBuilder {
configuration_declarative_items: Vec<ConfigurationDeclarativeItemSyntax>,
}
impl Default for ConfigurationDeclarativePartBuilder {
fn default() -> Self {
Self::new()
}
}
impl ConfigurationDeclarativePartBuilder {
pub fn new() -> Self {
Self {
configuration_declarative_items: Vec::new(),
}
}
pub fn add_configuration_declarative_items(
mut self,
n: impl Into<ConfigurationDeclarativeItemSyntax>,
) -> Self {
self.configuration_declarative_items.push(n.into());
self
}
pub fn build(self) -> ConfigurationDeclarativePartSyntax {
RawNodeBuilder::new()
.push_nodes(self.configuration_declarative_items)
.finish()
}
}
impl From<ConfigurationDeclarativePartBuilder> for ConfigurationDeclarativePartSyntax {
fn from(value: ConfigurationDeclarativePartBuilder) -> Self {
value.build()
}
}
pub struct ConstantDeclarationBuilder {
constant_token: Token,
identifier_list: IdentifierListSyntax,
colon_token: Token,
subtype_indication: SubtypeIndicationSyntax,
initial_value: Option<InitialValueSyntax>,
semi_colon_token: Token,
}
impl ConstantDeclarationBuilder {
pub fn new(
identifier_list: impl Into<IdentifierListSyntax>,
subtype_indication: impl Into<SubtypeIndicationSyntax>,
) -> Self {
Self {
constant_token: Kw::Constant.canonical_token(),
identifier_list: identifier_list.into(),
colon_token: TokenKind::Colon.canonical_token().unwrap(),
subtype_indication: subtype_indication.into(),
initial_value: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_constant_token(mut self, t: impl Into<Token>) -> Self {
self.constant_token = t.into();
self
}
pub fn with_constant_token_trivia(mut self, trivia: Trivia) -> Self {
self.constant_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_list(mut self, n: impl Into<IdentifierListSyntax>) -> Self {
self.identifier_list = n.into();
self
}
pub fn with_colon_token(mut self, t: impl Into<Token>) -> Self {
self.colon_token = t.into();
self
}
pub fn with_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_token.set_leading_trivia(trivia);
self
}
pub fn with_subtype_indication(mut self, n: impl Into<SubtypeIndicationSyntax>) -> Self {
self.subtype_indication = n.into();
self
}
pub fn with_initial_value(mut self, n: impl Into<InitialValueSyntax>) -> Self {
self.initial_value = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ConstantDeclarationSyntax {
RawNodeBuilder::new()
.push_token(self.constant_token)
.push_node(self.identifier_list)
.push_token(self.colon_token)
.push_node(self.subtype_indication)
.push_opt_node(self.initial_value)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ConstantDeclarationBuilder> for ConstantDeclarationSyntax {
fn from(value: ConstantDeclarationBuilder) -> Self {
value.build()
}
}
pub struct ConstrainedArrayDefinitionBuilder {
array_token: Token,
index_constraint: IndexConstraintSyntax,
of_token: Token,
subtype_indication: SubtypeIndicationSyntax,
}
impl ConstrainedArrayDefinitionBuilder {
pub fn new(
index_constraint: impl Into<IndexConstraintSyntax>,
subtype_indication: impl Into<SubtypeIndicationSyntax>,
) -> Self {
Self {
array_token: Kw::Array.canonical_token(),
index_constraint: index_constraint.into(),
of_token: Kw::Of.canonical_token(),
subtype_indication: subtype_indication.into(),
}
}
pub fn with_array_token(mut self, t: impl Into<Token>) -> Self {
self.array_token = t.into();
self
}
pub fn with_array_token_trivia(mut self, trivia: Trivia) -> Self {
self.array_token.set_leading_trivia(trivia);
self
}
pub fn with_index_constraint(mut self, n: impl Into<IndexConstraintSyntax>) -> Self {
self.index_constraint = n.into();
self
}
pub fn with_of_token(mut self, t: impl Into<Token>) -> Self {
self.of_token = t.into();
self
}
pub fn with_of_token_trivia(mut self, trivia: Trivia) -> Self {
self.of_token.set_leading_trivia(trivia);
self
}
pub fn with_subtype_indication(mut self, n: impl Into<SubtypeIndicationSyntax>) -> Self {
self.subtype_indication = n.into();
self
}
pub fn build(self) -> ConstrainedArrayDefinitionSyntax {
RawNodeBuilder::new()
.push_token(self.array_token)
.push_node(self.index_constraint)
.push_token(self.of_token)
.push_node(self.subtype_indication)
.finish()
}
}
impl From<ConstrainedArrayDefinitionBuilder> for ConstrainedArrayDefinitionSyntax {
fn from(value: ConstrainedArrayDefinitionBuilder) -> Self {
value.build()
}
}
pub struct ContextClauseBuilder {
context_items: Vec<ContextItemSyntax>,
}
impl Default for ContextClauseBuilder {
fn default() -> Self {
Self::new()
}
}
impl ContextClauseBuilder {
pub fn new() -> Self {
Self {
context_items: Vec::new(),
}
}
pub fn add_context_items(mut self, n: impl Into<ContextItemSyntax>) -> Self {
self.context_items.push(n.into());
self
}
pub fn build(self) -> ContextClauseSyntax {
RawNodeBuilder::new()
.push_nodes(self.context_items)
.finish()
}
}
impl From<ContextClauseBuilder> for ContextClauseSyntax {
fn from(value: ContextClauseBuilder) -> Self {
value.build()
}
}
pub struct ContextDeclarationBuilder {
context_declaration_preamble: ContextDeclarationPreambleSyntax,
context_clause: Option<ContextClauseSyntax>,
context_declaration_epilogue: ContextDeclarationEpilogueSyntax,
}
impl ContextDeclarationBuilder {
pub fn new(context_declaration_preamble: impl Into<ContextDeclarationPreambleSyntax>) -> Self {
Self {
context_declaration_preamble: context_declaration_preamble.into(),
context_clause: None,
context_declaration_epilogue: ContextDeclarationEpilogueBuilder::default().build(),
}
}
pub fn with_context_declaration_preamble(
mut self,
n: impl Into<ContextDeclarationPreambleSyntax>,
) -> Self {
self.context_declaration_preamble = n.into();
self
}
pub fn with_context_clause(mut self, n: impl Into<ContextClauseSyntax>) -> Self {
self.context_clause = Some(n.into());
self
}
pub fn with_context_declaration_epilogue(
mut self,
n: impl Into<ContextDeclarationEpilogueSyntax>,
) -> Self {
self.context_declaration_epilogue = n.into();
self
}
pub fn build(self) -> ContextDeclarationSyntax {
RawNodeBuilder::new()
.push_node(self.context_declaration_preamble)
.push_opt_node(self.context_clause)
.push_node(self.context_declaration_epilogue)
.finish()
}
}
impl From<ContextDeclarationBuilder> for ContextDeclarationSyntax {
fn from(value: ContextDeclarationBuilder) -> Self {
value.build()
}
}
pub struct ContextDeclarationEpilogueBuilder {
end_token: Token,
context_token: Option<Token>,
simple_name: Option<Token>,
semi_colon_token: Token,
}
impl Default for ContextDeclarationEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl ContextDeclarationEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
context_token: None,
simple_name: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_context_token(mut self, t: impl Into<Token>) -> Self {
self.context_token = Some(t.into());
self
}
pub fn with_context_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.context_token
.get_or_insert_with(|| Kw::Context.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_simple_name(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.simple_name = Some(t.into().into());
self
}
pub fn with_simple_name_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.simple_name {
t.set_leading_trivia(trivia);
}
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ContextDeclarationEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_opt_token(self.context_token)
.push_opt_token(self.simple_name)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ContextDeclarationEpilogueBuilder> for ContextDeclarationEpilogueSyntax {
fn from(value: ContextDeclarationEpilogueBuilder) -> Self {
value.build()
}
}
pub struct ContextDeclarationPreambleBuilder {
context_token: Token,
identifier_token: Token,
is_token: Token,
}
impl ContextDeclarationPreambleBuilder {
pub fn new(identifier_token: impl Into<crate::builder::Identifier>) -> Self {
Self {
context_token: Kw::Context.canonical_token(),
identifier_token: identifier_token.into().into(),
is_token: Kw::Is.canonical_token(),
}
}
pub fn with_context_token(mut self, t: impl Into<Token>) -> Self {
self.context_token = t.into();
self
}
pub fn with_context_token_trivia(mut self, trivia: Trivia) -> Self {
self.context_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ContextDeclarationPreambleSyntax {
RawNodeBuilder::new()
.push_token(self.context_token)
.push_token(self.identifier_token)
.push_token(self.is_token)
.finish()
}
}
impl From<ContextDeclarationPreambleBuilder> for ContextDeclarationPreambleSyntax {
fn from(value: ContextDeclarationPreambleBuilder) -> Self {
value.build()
}
}
pub struct ContextReferenceBuilder {
context_token: Token,
name_list: NameListSyntax,
semi_colon_token: Token,
}
impl ContextReferenceBuilder {
pub fn new(name_list: impl Into<NameListSyntax>) -> Self {
Self {
context_token: Kw::Context.canonical_token(),
name_list: name_list.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_context_token(mut self, t: impl Into<Token>) -> Self {
self.context_token = t.into();
self
}
pub fn with_context_token_trivia(mut self, trivia: Trivia) -> Self {
self.context_token.set_leading_trivia(trivia);
self
}
pub fn with_name_list(mut self, n: impl Into<NameListSyntax>) -> Self {
self.name_list = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ContextReferenceSyntax {
RawNodeBuilder::new()
.push_token(self.context_token)
.push_node(self.name_list)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ContextReferenceBuilder> for ContextReferenceSyntax {
fn from(value: ContextReferenceBuilder) -> Self {
value.build()
}
}
pub struct DeclarationStatementSeparatorBuilder {
begin_token: Token,
}
impl Default for DeclarationStatementSeparatorBuilder {
fn default() -> Self {
Self::new()
}
}
impl DeclarationStatementSeparatorBuilder {
pub fn new() -> Self {
Self {
begin_token: Kw::Begin.canonical_token(),
}
}
pub fn with_begin_token(mut self, t: impl Into<Token>) -> Self {
self.begin_token = t.into();
self
}
pub fn with_begin_token_trivia(mut self, trivia: Trivia) -> Self {
self.begin_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> DeclarationStatementSeparatorSyntax {
RawNodeBuilder::new().push_token(self.begin_token).finish()
}
}
impl From<DeclarationStatementSeparatorBuilder> for DeclarationStatementSeparatorSyntax {
fn from(value: DeclarationStatementSeparatorBuilder) -> Self {
value.build()
}
}
pub struct DesignFileBuilder {
design_units: Vec<DesignUnitSyntax>,
eof_token: Token,
}
impl DesignFileBuilder {
pub fn new(design_units: impl Into<DesignUnitSyntax>) -> Self {
Self {
design_units: vec![design_units.into()],
eof_token: TokenKind::Eof.canonical_token().unwrap(),
}
}
pub fn add_design_units(mut self, n: impl Into<DesignUnitSyntax>) -> Self {
self.design_units.push(n.into());
self
}
pub fn with_eof_token(mut self, t: impl Into<Token>) -> Self {
self.eof_token = t.into();
self
}
pub fn with_eof_token_trivia(mut self, trivia: Trivia) -> Self {
self.eof_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> DesignFileSyntax {
RawNodeBuilder::new()
.push_nodes(self.design_units)
.push_token(self.eof_token)
.finish()
}
}
impl From<DesignFileBuilder> for DesignFileSyntax {
fn from(value: DesignFileBuilder) -> Self {
value.build()
}
}
pub struct DesignUnitBuilder {
context_clause: Option<ContextClauseSyntax>,
library_unit: LibraryUnitSyntax,
}
impl DesignUnitBuilder {
pub fn new(library_unit: impl Into<LibraryUnitSyntax>) -> Self {
Self {
context_clause: None,
library_unit: library_unit.into(),
}
}
pub fn with_context_clause(mut self, n: impl Into<ContextClauseSyntax>) -> Self {
self.context_clause = Some(n.into());
self
}
pub fn with_library_unit(mut self, n: impl Into<LibraryUnitSyntax>) -> Self {
self.library_unit = n.into();
self
}
pub fn build(self) -> DesignUnitSyntax {
RawNodeBuilder::new()
.push_opt_node(self.context_clause)
.push_node(self.library_unit)
.finish()
}
}
impl From<DesignUnitBuilder> for DesignUnitSyntax {
fn from(value: DesignUnitBuilder) -> Self {
value.build()
}
}
pub struct DisconnectionSpecificationBuilder {
disconnect_token: Token,
guarded_signal_specification: GuardedSignalSpecificationSyntax,
after_token: Token,
expression: ExpressionSyntax,
semi_colon_token: Token,
}
impl DisconnectionSpecificationBuilder {
pub fn new(
guarded_signal_specification: impl Into<GuardedSignalSpecificationSyntax>,
expression: impl Into<ExpressionSyntax>,
) -> Self {
Self {
disconnect_token: Kw::Disconnect.canonical_token(),
guarded_signal_specification: guarded_signal_specification.into(),
after_token: Kw::After.canonical_token(),
expression: expression.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_disconnect_token(mut self, t: impl Into<Token>) -> Self {
self.disconnect_token = t.into();
self
}
pub fn with_disconnect_token_trivia(mut self, trivia: Trivia) -> Self {
self.disconnect_token.set_leading_trivia(trivia);
self
}
pub fn with_guarded_signal_specification(
mut self,
n: impl Into<GuardedSignalSpecificationSyntax>,
) -> Self {
self.guarded_signal_specification = n.into();
self
}
pub fn with_after_token(mut self, t: impl Into<Token>) -> Self {
self.after_token = t.into();
self
}
pub fn with_after_token_trivia(mut self, trivia: Trivia) -> Self {
self.after_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> DisconnectionSpecificationSyntax {
RawNodeBuilder::new()
.push_token(self.disconnect_token)
.push_node(self.guarded_signal_specification)
.push_token(self.after_token)
.push_node(self.expression)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<DisconnectionSpecificationBuilder> for DisconnectionSpecificationSyntax {
fn from(value: DisconnectionSpecificationBuilder) -> Self {
value.build()
}
}
pub struct ElementAssociationBuilder {
element_choices: Option<ElementChoicesSyntax>,
expression: ExpressionSyntax,
}
impl ElementAssociationBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
element_choices: None,
expression: expression.into(),
}
}
pub fn with_element_choices(mut self, n: impl Into<ElementChoicesSyntax>) -> Self {
self.element_choices = Some(n.into());
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn build(self) -> ElementAssociationSyntax {
RawNodeBuilder::new()
.push_opt_node(self.element_choices)
.push_node(self.expression)
.finish()
}
}
impl From<ElementAssociationBuilder> for ElementAssociationSyntax {
fn from(value: ElementAssociationBuilder) -> Self {
value.build()
}
}
pub struct ElementChoicesBuilder {
choices: ChoicesSyntax,
right_arrow_token: Token,
}
impl ElementChoicesBuilder {
pub fn new(choices: impl Into<ChoicesSyntax>) -> Self {
Self {
choices: choices.into(),
right_arrow_token: TokenKind::RightArrow.canonical_token().unwrap(),
}
}
pub fn with_choices(mut self, n: impl Into<ChoicesSyntax>) -> Self {
self.choices = n.into();
self
}
pub fn with_right_arrow_token(mut self, t: impl Into<Token>) -> Self {
self.right_arrow_token = t.into();
self
}
pub fn with_right_arrow_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_arrow_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ElementChoicesSyntax {
RawNodeBuilder::new()
.push_node(self.choices)
.push_token(self.right_arrow_token)
.finish()
}
}
impl From<ElementChoicesBuilder> for ElementChoicesSyntax {
fn from(value: ElementChoicesBuilder) -> Self {
value.build()
}
}
pub struct ElementDeclarationBuilder {
identifier_list: IdentifierListSyntax,
colon_token: Token,
element_subtype_definition: SubtypeIndicationSyntax,
semi_colon_token: Token,
}
impl ElementDeclarationBuilder {
pub fn new(
identifier_list: impl Into<IdentifierListSyntax>,
element_subtype_definition: impl Into<SubtypeIndicationSyntax>,
) -> Self {
Self {
identifier_list: identifier_list.into(),
colon_token: TokenKind::Colon.canonical_token().unwrap(),
element_subtype_definition: element_subtype_definition.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_identifier_list(mut self, n: impl Into<IdentifierListSyntax>) -> Self {
self.identifier_list = n.into();
self
}
pub fn with_colon_token(mut self, t: impl Into<Token>) -> Self {
self.colon_token = t.into();
self
}
pub fn with_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_token.set_leading_trivia(trivia);
self
}
pub fn with_element_subtype_definition(
mut self,
n: impl Into<SubtypeIndicationSyntax>,
) -> Self {
self.element_subtype_definition = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ElementDeclarationSyntax {
RawNodeBuilder::new()
.push_node(self.identifier_list)
.push_token(self.colon_token)
.push_node(self.element_subtype_definition)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ElementDeclarationBuilder> for ElementDeclarationSyntax {
fn from(value: ElementDeclarationBuilder) -> Self {
value.build()
}
}
pub struct ElementResolutionResolutionIndicationBuilder {
element_resolution: ElementResolutionSyntax,
}
impl ElementResolutionResolutionIndicationBuilder {
pub fn new(element_resolution: impl Into<ElementResolutionSyntax>) -> Self {
Self {
element_resolution: element_resolution.into(),
}
}
pub fn with_element_resolution(mut self, n: impl Into<ElementResolutionSyntax>) -> Self {
self.element_resolution = n.into();
self
}
pub fn build(self) -> ElementResolutionResolutionIndicationSyntax {
RawNodeBuilder::new()
.push_node(self.element_resolution)
.finish()
}
}
impl From<ElementResolutionResolutionIndicationBuilder>
for ElementResolutionResolutionIndicationSyntax
{
fn from(value: ElementResolutionResolutionIndicationBuilder) -> Self {
value.build()
}
}
pub struct ElseExpressionBuilder {
else_token: Token,
expression: ExpressionSyntax,
}
impl ElseExpressionBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
else_token: Kw::Else.canonical_token(),
expression: expression.into(),
}
}
pub fn with_else_token(mut self, t: impl Into<Token>) -> Self {
self.else_token = t.into();
self
}
pub fn with_else_token_trivia(mut self, trivia: Trivia) -> Self {
self.else_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn build(self) -> ElseExpressionSyntax {
RawNodeBuilder::new()
.push_token(self.else_token)
.push_node(self.expression)
.finish()
}
}
impl From<ElseExpressionBuilder> for ElseExpressionSyntax {
fn from(value: ElseExpressionBuilder) -> Self {
value.build()
}
}
pub struct ElseWaveformBuilder {
else_token: Token,
waveform: WaveformSyntax,
}
impl ElseWaveformBuilder {
pub fn new(waveform: impl Into<WaveformSyntax>) -> Self {
Self {
else_token: Kw::Else.canonical_token(),
waveform: waveform.into(),
}
}
pub fn with_else_token(mut self, t: impl Into<Token>) -> Self {
self.else_token = t.into();
self
}
pub fn with_else_token_trivia(mut self, trivia: Trivia) -> Self {
self.else_token.set_leading_trivia(trivia);
self
}
pub fn with_waveform(mut self, n: impl Into<WaveformSyntax>) -> Self {
self.waveform = n.into();
self
}
pub fn build(self) -> ElseWaveformSyntax {
RawNodeBuilder::new()
.push_token(self.else_token)
.push_node(self.waveform)
.finish()
}
}
impl From<ElseWaveformBuilder> for ElseWaveformSyntax {
fn from(value: ElseWaveformBuilder) -> Self {
value.build()
}
}
pub struct ElseWhenExpressionBuilder {
else_token: Token,
expression: ExpressionSyntax,
when_token: Token,
condition: ExpressionSyntax,
}
impl ElseWhenExpressionBuilder {
pub fn new(
expression: impl Into<ExpressionSyntax>,
condition: impl Into<ExpressionSyntax>,
) -> Self {
Self {
else_token: Kw::Else.canonical_token(),
expression: expression.into(),
when_token: Kw::When.canonical_token(),
condition: condition.into(),
}
}
pub fn with_else_token(mut self, t: impl Into<Token>) -> Self {
self.else_token = t.into();
self
}
pub fn with_else_token_trivia(mut self, trivia: Trivia) -> Self {
self.else_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn with_when_token(mut self, t: impl Into<Token>) -> Self {
self.when_token = t.into();
self
}
pub fn with_when_token_trivia(mut self, trivia: Trivia) -> Self {
self.when_token.set_leading_trivia(trivia);
self
}
pub fn with_condition(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.condition = n.into();
self
}
pub fn build(self) -> ElseWhenExpressionSyntax {
RawNodeBuilder::new()
.push_token(self.else_token)
.push_node(self.expression)
.push_token(self.when_token)
.push_node(self.condition)
.finish()
}
}
impl From<ElseWhenExpressionBuilder> for ElseWhenExpressionSyntax {
fn from(value: ElseWhenExpressionBuilder) -> Self {
value.build()
}
}
pub struct ElseWhenWaveformBuilder {
else_token: Token,
waveform: WaveformSyntax,
when_token: Token,
condition: ExpressionSyntax,
}
impl ElseWhenWaveformBuilder {
pub fn new(
waveform: impl Into<WaveformSyntax>,
condition: impl Into<ExpressionSyntax>,
) -> Self {
Self {
else_token: Kw::Else.canonical_token(),
waveform: waveform.into(),
when_token: Kw::When.canonical_token(),
condition: condition.into(),
}
}
pub fn with_else_token(mut self, t: impl Into<Token>) -> Self {
self.else_token = t.into();
self
}
pub fn with_else_token_trivia(mut self, trivia: Trivia) -> Self {
self.else_token.set_leading_trivia(trivia);
self
}
pub fn with_waveform(mut self, n: impl Into<WaveformSyntax>) -> Self {
self.waveform = n.into();
self
}
pub fn with_when_token(mut self, t: impl Into<Token>) -> Self {
self.when_token = t.into();
self
}
pub fn with_when_token_trivia(mut self, trivia: Trivia) -> Self {
self.when_token.set_leading_trivia(trivia);
self
}
pub fn with_condition(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.condition = n.into();
self
}
pub fn build(self) -> ElseWhenWaveformSyntax {
RawNodeBuilder::new()
.push_token(self.else_token)
.push_node(self.waveform)
.push_token(self.when_token)
.push_node(self.condition)
.finish()
}
}
impl From<ElseWhenWaveformBuilder> for ElseWhenWaveformSyntax {
fn from(value: ElseWhenWaveformBuilder) -> Self {
value.build()
}
}
pub struct EndPackageBodyBuilder {
package_token: Token,
body_token: Token,
}
impl Default for EndPackageBodyBuilder {
fn default() -> Self {
Self::new()
}
}
impl EndPackageBodyBuilder {
pub fn new() -> Self {
Self {
package_token: Kw::Package.canonical_token(),
body_token: Kw::Body.canonical_token(),
}
}
pub fn with_package_token(mut self, t: impl Into<Token>) -> Self {
self.package_token = t.into();
self
}
pub fn with_package_token_trivia(mut self, trivia: Trivia) -> Self {
self.package_token.set_leading_trivia(trivia);
self
}
pub fn with_body_token(mut self, t: impl Into<Token>) -> Self {
self.body_token = t.into();
self
}
pub fn with_body_token_trivia(mut self, trivia: Trivia) -> Self {
self.body_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> EndPackageBodySyntax {
RawNodeBuilder::new()
.push_token(self.package_token)
.push_token(self.body_token)
.finish()
}
}
impl From<EndPackageBodyBuilder> for EndPackageBodySyntax {
fn from(value: EndPackageBodyBuilder) -> Self {
value.build()
}
}
pub struct EntityClassEntryBuilder {
entity_class: EntityClassToken,
box_token: Option<Token>,
}
impl EntityClassEntryBuilder {
pub fn new(entity_class: impl Into<EntityClassToken>) -> Self {
Self {
entity_class: entity_class.into(),
box_token: None,
}
}
pub fn with_entity_class(mut self, n: impl Into<EntityClassToken>) -> Self {
self.entity_class = n.into();
self
}
pub fn with_box_token(mut self, t: impl Into<Token>) -> Self {
self.box_token = Some(t.into());
self
}
pub fn with_box_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.box_token
.get_or_insert_with(|| TokenKind::BOX.canonical_token().unwrap());
tok.set_leading_trivia(trivia);
self
}
pub fn build(self) -> EntityClassEntrySyntax {
RawNodeBuilder::new()
.push_token(self.entity_class.0)
.push_opt_token(self.box_token)
.finish()
}
}
impl From<EntityClassEntryBuilder> for EntityClassEntrySyntax {
fn from(value: EntityClassEntryBuilder) -> Self {
value.build()
}
}
pub struct EntityConfigurationAspectBuilder {
configuration_token: Token,
name: NameSyntax,
}
impl EntityConfigurationAspectBuilder {
pub fn new(name: impl Into<NameSyntax>) -> Self {
Self {
configuration_token: Kw::Configuration.canonical_token(),
name: name.into(),
}
}
pub fn with_configuration_token(mut self, t: impl Into<Token>) -> Self {
self.configuration_token = t.into();
self
}
pub fn with_configuration_token_trivia(mut self, trivia: Trivia) -> Self {
self.configuration_token.set_leading_trivia(trivia);
self
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn build(self) -> EntityConfigurationAspectSyntax {
RawNodeBuilder::new()
.push_token(self.configuration_token)
.push_node(self.name)
.finish()
}
}
impl From<EntityConfigurationAspectBuilder> for EntityConfigurationAspectSyntax {
fn from(value: EntityConfigurationAspectBuilder) -> Self {
value.build()
}
}
pub struct EntityDeclarationBuilder {
entity_declaration_preamble: EntityDeclarationPreambleSyntax,
entity_header: Option<EntityHeaderSyntax>,
entity_declarative_part: Option<EntityDeclarativePartSyntax>,
entity_statements: Option<EntityStatementsSyntax>,
entity_declaration_epilogue: EntityDeclarationEpilogueSyntax,
}
impl EntityDeclarationBuilder {
pub fn new(entity_declaration_preamble: impl Into<EntityDeclarationPreambleSyntax>) -> Self {
Self {
entity_declaration_preamble: entity_declaration_preamble.into(),
entity_header: None,
entity_declarative_part: None,
entity_statements: None,
entity_declaration_epilogue: EntityDeclarationEpilogueBuilder::default().build(),
}
}
pub fn with_entity_declaration_preamble(
mut self,
n: impl Into<EntityDeclarationPreambleSyntax>,
) -> Self {
self.entity_declaration_preamble = n.into();
self
}
pub fn with_entity_header(mut self, n: impl Into<EntityHeaderSyntax>) -> Self {
self.entity_header = Some(n.into());
self
}
pub fn with_entity_declarative_part(
mut self,
n: impl Into<EntityDeclarativePartSyntax>,
) -> Self {
self.entity_declarative_part = Some(n.into());
self
}
pub fn with_entity_statements(mut self, n: impl Into<EntityStatementsSyntax>) -> Self {
self.entity_statements = Some(n.into());
self
}
pub fn with_entity_declaration_epilogue(
mut self,
n: impl Into<EntityDeclarationEpilogueSyntax>,
) -> Self {
self.entity_declaration_epilogue = n.into();
self
}
pub fn build(self) -> EntityDeclarationSyntax {
RawNodeBuilder::new()
.push_node(self.entity_declaration_preamble)
.push_opt_node(self.entity_header)
.push_opt_node(self.entity_declarative_part)
.push_opt_node(self.entity_statements)
.push_node(self.entity_declaration_epilogue)
.finish()
}
}
impl From<EntityDeclarationBuilder> for EntityDeclarationSyntax {
fn from(value: EntityDeclarationBuilder) -> Self {
value.build()
}
}
pub struct EntityDeclarationEpilogueBuilder {
end_token: Token,
entity_token: Option<Token>,
simple_name: Option<Token>,
semi_colon_token: Token,
}
impl Default for EntityDeclarationEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl EntityDeclarationEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
entity_token: None,
simple_name: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_entity_token(mut self, t: impl Into<Token>) -> Self {
self.entity_token = Some(t.into());
self
}
pub fn with_entity_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.entity_token
.get_or_insert_with(|| Kw::Entity.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_simple_name(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.simple_name = Some(t.into().into());
self
}
pub fn with_simple_name_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.simple_name {
t.set_leading_trivia(trivia);
}
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> EntityDeclarationEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_opt_token(self.entity_token)
.push_opt_token(self.simple_name)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<EntityDeclarationEpilogueBuilder> for EntityDeclarationEpilogueSyntax {
fn from(value: EntityDeclarationEpilogueBuilder) -> Self {
value.build()
}
}
pub struct EntityDeclarationPreambleBuilder {
entity_token: Token,
identifier_token: Token,
is_token: Token,
}
impl EntityDeclarationPreambleBuilder {
pub fn new(identifier_token: impl Into<crate::builder::Identifier>) -> Self {
Self {
entity_token: Kw::Entity.canonical_token(),
identifier_token: identifier_token.into().into(),
is_token: Kw::Is.canonical_token(),
}
}
pub fn with_entity_token(mut self, t: impl Into<Token>) -> Self {
self.entity_token = t.into();
self
}
pub fn with_entity_token_trivia(mut self, trivia: Trivia) -> Self {
self.entity_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> EntityDeclarationPreambleSyntax {
RawNodeBuilder::new()
.push_token(self.entity_token)
.push_token(self.identifier_token)
.push_token(self.is_token)
.finish()
}
}
impl From<EntityDeclarationPreambleBuilder> for EntityDeclarationPreambleSyntax {
fn from(value: EntityDeclarationPreambleBuilder) -> Self {
value.build()
}
}
pub struct EntityDeclarativePartBuilder {
entity_declarative_items: Vec<EntityDeclarativeItemSyntax>,
}
impl Default for EntityDeclarativePartBuilder {
fn default() -> Self {
Self::new()
}
}
impl EntityDeclarativePartBuilder {
pub fn new() -> Self {
Self {
entity_declarative_items: Vec::new(),
}
}
pub fn add_entity_declarative_items(
mut self,
n: impl Into<EntityDeclarativeItemSyntax>,
) -> Self {
self.entity_declarative_items.push(n.into());
self
}
pub fn build(self) -> EntityDeclarativePartSyntax {
RawNodeBuilder::new()
.push_nodes(self.entity_declarative_items)
.finish()
}
}
impl From<EntityDeclarativePartBuilder> for EntityDeclarativePartSyntax {
fn from(value: EntityDeclarativePartBuilder) -> Self {
value.build()
}
}
pub struct EntityDesignatorBuilder {
entity_tag: EntityTagToken,
signature: Option<SignatureSyntax>,
}
impl EntityDesignatorBuilder {
pub fn new(entity_tag: impl Into<EntityTagToken>) -> Self {
Self {
entity_tag: entity_tag.into(),
signature: None,
}
}
pub fn with_entity_tag(mut self, n: impl Into<EntityTagToken>) -> Self {
self.entity_tag = n.into();
self
}
pub fn with_signature(mut self, n: impl Into<SignatureSyntax>) -> Self {
self.signature = Some(n.into());
self
}
pub fn build(self) -> EntityDesignatorSyntax {
RawNodeBuilder::new()
.push_token(self.entity_tag.0)
.push_opt_node(self.signature)
.finish()
}
}
impl From<EntityDesignatorBuilder> for EntityDesignatorSyntax {
fn from(value: EntityDesignatorBuilder) -> Self {
value.build()
}
}
pub struct EntityEntityAspectBuilder {
entity_token: Token,
name: NameSyntax,
}
impl EntityEntityAspectBuilder {
pub fn new(name: impl Into<NameSyntax>) -> Self {
Self {
entity_token: Kw::Entity.canonical_token(),
name: name.into(),
}
}
pub fn with_entity_token(mut self, t: impl Into<Token>) -> Self {
self.entity_token = t.into();
self
}
pub fn with_entity_token_trivia(mut self, trivia: Trivia) -> Self {
self.entity_token.set_leading_trivia(trivia);
self
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn build(self) -> EntityEntityAspectSyntax {
RawNodeBuilder::new()
.push_token(self.entity_token)
.push_node(self.name)
.finish()
}
}
impl From<EntityEntityAspectBuilder> for EntityEntityAspectSyntax {
fn from(value: EntityEntityAspectBuilder) -> Self {
value.build()
}
}
pub struct EntityHeaderBuilder {
generic_clause: Option<GenericClauseSyntax>,
port_clause: Option<PortClauseSyntax>,
}
impl Default for EntityHeaderBuilder {
fn default() -> Self {
Self::new()
}
}
impl EntityHeaderBuilder {
pub fn new() -> Self {
Self {
generic_clause: None,
port_clause: None,
}
}
pub fn with_generic_clause(mut self, n: impl Into<GenericClauseSyntax>) -> Self {
self.generic_clause = Some(n.into());
self
}
pub fn with_port_clause(mut self, n: impl Into<PortClauseSyntax>) -> Self {
self.port_clause = Some(n.into());
self
}
pub fn build(self) -> EntityHeaderSyntax {
RawNodeBuilder::new()
.push_opt_node(self.generic_clause)
.push_opt_node(self.port_clause)
.finish()
}
}
impl From<EntityHeaderBuilder> for EntityHeaderSyntax {
fn from(value: EntityHeaderBuilder) -> Self {
value.build()
}
}
pub struct EntityNameListAllBuilder {
all_token: Token,
}
impl Default for EntityNameListAllBuilder {
fn default() -> Self {
Self::new()
}
}
impl EntityNameListAllBuilder {
pub fn new() -> Self {
Self {
all_token: Kw::All.canonical_token(),
}
}
pub fn with_all_token(mut self, t: impl Into<Token>) -> Self {
self.all_token = t.into();
self
}
pub fn with_all_token_trivia(mut self, trivia: Trivia) -> Self {
self.all_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> EntityNameListAllSyntax {
RawNodeBuilder::new().push_token(self.all_token).finish()
}
}
impl From<EntityNameListAllBuilder> for EntityNameListAllSyntax {
fn from(value: EntityNameListAllBuilder) -> Self {
value.build()
}
}
pub struct EntityNameListOthersBuilder {
others_token: Token,
}
impl Default for EntityNameListOthersBuilder {
fn default() -> Self {
Self::new()
}
}
impl EntityNameListOthersBuilder {
pub fn new() -> Self {
Self {
others_token: Kw::Others.canonical_token(),
}
}
pub fn with_others_token(mut self, t: impl Into<Token>) -> Self {
self.others_token = t.into();
self
}
pub fn with_others_token_trivia(mut self, trivia: Trivia) -> Self {
self.others_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> EntityNameListOthersSyntax {
RawNodeBuilder::new().push_token(self.others_token).finish()
}
}
impl From<EntityNameListOthersBuilder> for EntityNameListOthersSyntax {
fn from(value: EntityNameListOthersBuilder) -> Self {
value.build()
}
}
pub struct EntityOpenAspectBuilder {
open_token: Token,
}
impl Default for EntityOpenAspectBuilder {
fn default() -> Self {
Self::new()
}
}
impl EntityOpenAspectBuilder {
pub fn new() -> Self {
Self {
open_token: Kw::Open.canonical_token(),
}
}
pub fn with_open_token(mut self, t: impl Into<Token>) -> Self {
self.open_token = t.into();
self
}
pub fn with_open_token_trivia(mut self, trivia: Trivia) -> Self {
self.open_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> EntityOpenAspectSyntax {
RawNodeBuilder::new().push_token(self.open_token).finish()
}
}
impl From<EntityOpenAspectBuilder> for EntityOpenAspectSyntax {
fn from(value: EntityOpenAspectBuilder) -> Self {
value.build()
}
}
pub struct EntitySpecificationBuilder {
entity_name_list: EntityNameListSyntax,
colon_token: Token,
entity_class: EntityClassToken,
}
impl EntitySpecificationBuilder {
pub fn new(
entity_name_list: impl Into<EntityNameListSyntax>,
entity_class: impl Into<EntityClassToken>,
) -> Self {
Self {
entity_name_list: entity_name_list.into(),
colon_token: TokenKind::Colon.canonical_token().unwrap(),
entity_class: entity_class.into(),
}
}
pub fn with_entity_name_list(mut self, n: impl Into<EntityNameListSyntax>) -> Self {
self.entity_name_list = n.into();
self
}
pub fn with_colon_token(mut self, t: impl Into<Token>) -> Self {
self.colon_token = t.into();
self
}
pub fn with_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_token.set_leading_trivia(trivia);
self
}
pub fn with_entity_class(mut self, n: impl Into<EntityClassToken>) -> Self {
self.entity_class = n.into();
self
}
pub fn build(self) -> EntitySpecificationSyntax {
RawNodeBuilder::new()
.push_node(self.entity_name_list)
.push_token(self.colon_token)
.push_token(self.entity_class.0)
.finish()
}
}
impl From<EntitySpecificationBuilder> for EntitySpecificationSyntax {
fn from(value: EntitySpecificationBuilder) -> Self {
value.build()
}
}
pub struct EntityStatementPartBuilder {
entity_statements: Vec<EntityStatementSyntax>,
}
impl Default for EntityStatementPartBuilder {
fn default() -> Self {
Self::new()
}
}
impl EntityStatementPartBuilder {
pub fn new() -> Self {
Self {
entity_statements: Vec::new(),
}
}
pub fn add_entity_statements(mut self, n: impl Into<EntityStatementSyntax>) -> Self {
self.entity_statements.push(n.into());
self
}
pub fn build(self) -> EntityStatementPartSyntax {
RawNodeBuilder::new()
.push_nodes(self.entity_statements)
.finish()
}
}
impl From<EntityStatementPartBuilder> for EntityStatementPartSyntax {
fn from(value: EntityStatementPartBuilder) -> Self {
value.build()
}
}
pub struct EntityStatementsBuilder {
declaration_statement_separator: DeclarationStatementSeparatorSyntax,
entity_statement_part: Option<EntityStatementPartSyntax>,
}
impl Default for EntityStatementsBuilder {
fn default() -> Self {
Self::new()
}
}
impl EntityStatementsBuilder {
pub fn new() -> Self {
Self {
declaration_statement_separator: DeclarationStatementSeparatorBuilder::default()
.build(),
entity_statement_part: None,
}
}
pub fn with_declaration_statement_separator(
mut self,
n: impl Into<DeclarationStatementSeparatorSyntax>,
) -> Self {
self.declaration_statement_separator = n.into();
self
}
pub fn with_entity_statement_part(mut self, n: impl Into<EntityStatementPartSyntax>) -> Self {
self.entity_statement_part = Some(n.into());
self
}
pub fn build(self) -> EntityStatementsSyntax {
RawNodeBuilder::new()
.push_node(self.declaration_statement_separator)
.push_opt_node(self.entity_statement_part)
.finish()
}
}
impl From<EntityStatementsBuilder> for EntityStatementsSyntax {
fn from(value: EntityStatementsBuilder) -> Self {
value.build()
}
}
pub struct EnumerationTypeDefinitionBuilder {
left_par_token: Token,
enumeration_list: EnumerationListSyntax,
right_par_token: Token,
}
impl EnumerationTypeDefinitionBuilder {
pub fn new(enumeration_list: impl Into<EnumerationListSyntax>) -> Self {
Self {
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
enumeration_list: enumeration_list.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
}
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_enumeration_list(mut self, n: impl Into<EnumerationListSyntax>) -> Self {
self.enumeration_list = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> EnumerationTypeDefinitionSyntax {
RawNodeBuilder::new()
.push_token(self.left_par_token)
.push_node(self.enumeration_list)
.push_token(self.right_par_token)
.finish()
}
}
impl From<EnumerationTypeDefinitionBuilder> for EnumerationTypeDefinitionSyntax {
fn from(value: EnumerationTypeDefinitionBuilder) -> Self {
value.build()
}
}
pub struct ExitStatementBuilder {
stmt_label: Option<StmtLabelSyntax>,
exit_token: Token,
label: Option<Token>,
when_clause: Option<WhenClauseSyntax>,
semi_colon_token: Token,
}
impl Default for ExitStatementBuilder {
fn default() -> Self {
Self::new()
}
}
impl ExitStatementBuilder {
pub fn new() -> Self {
Self {
stmt_label: None,
exit_token: Kw::Exit.canonical_token(),
label: None,
when_clause: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_exit_token(mut self, t: impl Into<Token>) -> Self {
self.exit_token = t.into();
self
}
pub fn with_exit_token_trivia(mut self, trivia: Trivia) -> Self {
self.exit_token.set_leading_trivia(trivia);
self
}
pub fn with_label(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.label = Some(t.into().into());
self
}
pub fn with_label_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.label {
t.set_leading_trivia(trivia);
}
self
}
pub fn with_when_clause(mut self, n: impl Into<WhenClauseSyntax>) -> Self {
self.when_clause = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ExitStatementSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_token(self.exit_token)
.push_opt_token(self.label)
.push_opt_node(self.when_clause)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ExitStatementBuilder> for ExitStatementSyntax {
fn from(value: ExitStatementBuilder) -> Self {
value.build()
}
}
pub struct ExpressionChoiceBuilder {
expression: ExpressionSyntax,
}
impl ExpressionChoiceBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
expression: expression.into(),
}
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn build(self) -> ExpressionChoiceSyntax {
RawNodeBuilder::new().push_node(self.expression).finish()
}
}
impl From<ExpressionChoiceBuilder> for ExpressionChoiceSyntax {
fn from(value: ExpressionChoiceBuilder) -> Self {
value.build()
}
}
pub struct ExternalConstantNameBuilder {
lt_lt_token: Token,
constant_token: Token,
external_pathname: ExternalPathnameSyntax,
colon_token: Token,
subtype_indication: SubtypeIndicationSyntax,
gt_gt_token: Token,
}
impl ExternalConstantNameBuilder {
pub fn new(
external_pathname: impl Into<ExternalPathnameSyntax>,
subtype_indication: impl Into<SubtypeIndicationSyntax>,
) -> Self {
Self {
lt_lt_token: TokenKind::LtLt.canonical_token().unwrap(),
constant_token: Kw::Constant.canonical_token(),
external_pathname: external_pathname.into(),
colon_token: TokenKind::Colon.canonical_token().unwrap(),
subtype_indication: subtype_indication.into(),
gt_gt_token: TokenKind::GtGt.canonical_token().unwrap(),
}
}
pub fn with_lt_lt_token(mut self, t: impl Into<Token>) -> Self {
self.lt_lt_token = t.into();
self
}
pub fn with_lt_lt_token_trivia(mut self, trivia: Trivia) -> Self {
self.lt_lt_token.set_leading_trivia(trivia);
self
}
pub fn with_constant_token(mut self, t: impl Into<Token>) -> Self {
self.constant_token = t.into();
self
}
pub fn with_constant_token_trivia(mut self, trivia: Trivia) -> Self {
self.constant_token.set_leading_trivia(trivia);
self
}
pub fn with_external_pathname(mut self, n: impl Into<ExternalPathnameSyntax>) -> Self {
self.external_pathname = n.into();
self
}
pub fn with_colon_token(mut self, t: impl Into<Token>) -> Self {
self.colon_token = t.into();
self
}
pub fn with_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_token.set_leading_trivia(trivia);
self
}
pub fn with_subtype_indication(mut self, n: impl Into<SubtypeIndicationSyntax>) -> Self {
self.subtype_indication = n.into();
self
}
pub fn with_gt_gt_token(mut self, t: impl Into<Token>) -> Self {
self.gt_gt_token = t.into();
self
}
pub fn with_gt_gt_token_trivia(mut self, trivia: Trivia) -> Self {
self.gt_gt_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ExternalConstantNameSyntax {
RawNodeBuilder::new()
.push_token(self.lt_lt_token)
.push_token(self.constant_token)
.push_node(self.external_pathname)
.push_token(self.colon_token)
.push_node(self.subtype_indication)
.push_token(self.gt_gt_token)
.finish()
}
}
impl From<ExternalConstantNameBuilder> for ExternalConstantNameSyntax {
fn from(value: ExternalConstantNameBuilder) -> Self {
value.build()
}
}
pub struct ExternalSignalNameBuilder {
lt_lt_token: Token,
signal_token: Token,
external_pathname: ExternalPathnameSyntax,
colon_token: Token,
subtype_indication: SubtypeIndicationSyntax,
gt_gt_token: Token,
}
impl ExternalSignalNameBuilder {
pub fn new(
external_pathname: impl Into<ExternalPathnameSyntax>,
subtype_indication: impl Into<SubtypeIndicationSyntax>,
) -> Self {
Self {
lt_lt_token: TokenKind::LtLt.canonical_token().unwrap(),
signal_token: Kw::Signal.canonical_token(),
external_pathname: external_pathname.into(),
colon_token: TokenKind::Colon.canonical_token().unwrap(),
subtype_indication: subtype_indication.into(),
gt_gt_token: TokenKind::GtGt.canonical_token().unwrap(),
}
}
pub fn with_lt_lt_token(mut self, t: impl Into<Token>) -> Self {
self.lt_lt_token = t.into();
self
}
pub fn with_lt_lt_token_trivia(mut self, trivia: Trivia) -> Self {
self.lt_lt_token.set_leading_trivia(trivia);
self
}
pub fn with_signal_token(mut self, t: impl Into<Token>) -> Self {
self.signal_token = t.into();
self
}
pub fn with_signal_token_trivia(mut self, trivia: Trivia) -> Self {
self.signal_token.set_leading_trivia(trivia);
self
}
pub fn with_external_pathname(mut self, n: impl Into<ExternalPathnameSyntax>) -> Self {
self.external_pathname = n.into();
self
}
pub fn with_colon_token(mut self, t: impl Into<Token>) -> Self {
self.colon_token = t.into();
self
}
pub fn with_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_token.set_leading_trivia(trivia);
self
}
pub fn with_subtype_indication(mut self, n: impl Into<SubtypeIndicationSyntax>) -> Self {
self.subtype_indication = n.into();
self
}
pub fn with_gt_gt_token(mut self, t: impl Into<Token>) -> Self {
self.gt_gt_token = t.into();
self
}
pub fn with_gt_gt_token_trivia(mut self, trivia: Trivia) -> Self {
self.gt_gt_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ExternalSignalNameSyntax {
RawNodeBuilder::new()
.push_token(self.lt_lt_token)
.push_token(self.signal_token)
.push_node(self.external_pathname)
.push_token(self.colon_token)
.push_node(self.subtype_indication)
.push_token(self.gt_gt_token)
.finish()
}
}
impl From<ExternalSignalNameBuilder> for ExternalSignalNameSyntax {
fn from(value: ExternalSignalNameBuilder) -> Self {
value.build()
}
}
pub struct ExternalVariableNameBuilder {
lt_lt_token: Token,
variable_token: Token,
external_pathname: ExternalPathnameSyntax,
colon_token: Token,
subtype_indication: SubtypeIndicationSyntax,
gt_gt_token: Token,
}
impl ExternalVariableNameBuilder {
pub fn new(
external_pathname: impl Into<ExternalPathnameSyntax>,
subtype_indication: impl Into<SubtypeIndicationSyntax>,
) -> Self {
Self {
lt_lt_token: TokenKind::LtLt.canonical_token().unwrap(),
variable_token: Kw::Variable.canonical_token(),
external_pathname: external_pathname.into(),
colon_token: TokenKind::Colon.canonical_token().unwrap(),
subtype_indication: subtype_indication.into(),
gt_gt_token: TokenKind::GtGt.canonical_token().unwrap(),
}
}
pub fn with_lt_lt_token(mut self, t: impl Into<Token>) -> Self {
self.lt_lt_token = t.into();
self
}
pub fn with_lt_lt_token_trivia(mut self, trivia: Trivia) -> Self {
self.lt_lt_token.set_leading_trivia(trivia);
self
}
pub fn with_variable_token(mut self, t: impl Into<Token>) -> Self {
self.variable_token = t.into();
self
}
pub fn with_variable_token_trivia(mut self, trivia: Trivia) -> Self {
self.variable_token.set_leading_trivia(trivia);
self
}
pub fn with_external_pathname(mut self, n: impl Into<ExternalPathnameSyntax>) -> Self {
self.external_pathname = n.into();
self
}
pub fn with_colon_token(mut self, t: impl Into<Token>) -> Self {
self.colon_token = t.into();
self
}
pub fn with_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_token.set_leading_trivia(trivia);
self
}
pub fn with_subtype_indication(mut self, n: impl Into<SubtypeIndicationSyntax>) -> Self {
self.subtype_indication = n.into();
self
}
pub fn with_gt_gt_token(mut self, t: impl Into<Token>) -> Self {
self.gt_gt_token = t.into();
self
}
pub fn with_gt_gt_token_trivia(mut self, trivia: Trivia) -> Self {
self.gt_gt_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ExternalVariableNameSyntax {
RawNodeBuilder::new()
.push_token(self.lt_lt_token)
.push_token(self.variable_token)
.push_node(self.external_pathname)
.push_token(self.colon_token)
.push_node(self.subtype_indication)
.push_token(self.gt_gt_token)
.finish()
}
}
impl From<ExternalVariableNameBuilder> for ExternalVariableNameSyntax {
fn from(value: ExternalVariableNameBuilder) -> Self {
value.build()
}
}
pub struct FileDeclarationBuilder {
file_token: Token,
identifier_list: IdentifierListSyntax,
colon_token: Token,
subtype_indication: SubtypeIndicationSyntax,
file_open_information: Option<FileOpenInformationSyntax>,
semi_colon_token: Token,
}
impl FileDeclarationBuilder {
pub fn new(
identifier_list: impl Into<IdentifierListSyntax>,
subtype_indication: impl Into<SubtypeIndicationSyntax>,
) -> Self {
Self {
file_token: Kw::File.canonical_token(),
identifier_list: identifier_list.into(),
colon_token: TokenKind::Colon.canonical_token().unwrap(),
subtype_indication: subtype_indication.into(),
file_open_information: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_file_token(mut self, t: impl Into<Token>) -> Self {
self.file_token = t.into();
self
}
pub fn with_file_token_trivia(mut self, trivia: Trivia) -> Self {
self.file_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_list(mut self, n: impl Into<IdentifierListSyntax>) -> Self {
self.identifier_list = n.into();
self
}
pub fn with_colon_token(mut self, t: impl Into<Token>) -> Self {
self.colon_token = t.into();
self
}
pub fn with_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_token.set_leading_trivia(trivia);
self
}
pub fn with_subtype_indication(mut self, n: impl Into<SubtypeIndicationSyntax>) -> Self {
self.subtype_indication = n.into();
self
}
pub fn with_file_open_information(mut self, n: impl Into<FileOpenInformationSyntax>) -> Self {
self.file_open_information = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> FileDeclarationSyntax {
RawNodeBuilder::new()
.push_token(self.file_token)
.push_node(self.identifier_list)
.push_token(self.colon_token)
.push_node(self.subtype_indication)
.push_opt_node(self.file_open_information)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<FileDeclarationBuilder> for FileDeclarationSyntax {
fn from(value: FileDeclarationBuilder) -> Self {
value.build()
}
}
pub struct FileOpenInformationBuilder {
file_open_kind: Option<FileOpenKindSyntax>,
is_token: Token,
file_logical_name: ExpressionSyntax,
}
impl FileOpenInformationBuilder {
pub fn new(file_logical_name: impl Into<ExpressionSyntax>) -> Self {
Self {
file_open_kind: None,
is_token: Kw::Is.canonical_token(),
file_logical_name: file_logical_name.into(),
}
}
pub fn with_file_open_kind(mut self, n: impl Into<FileOpenKindSyntax>) -> Self {
self.file_open_kind = Some(n.into());
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn with_file_logical_name(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.file_logical_name = n.into();
self
}
pub fn build(self) -> FileOpenInformationSyntax {
RawNodeBuilder::new()
.push_opt_node(self.file_open_kind)
.push_token(self.is_token)
.push_node(self.file_logical_name)
.finish()
}
}
impl From<FileOpenInformationBuilder> for FileOpenInformationSyntax {
fn from(value: FileOpenInformationBuilder) -> Self {
value.build()
}
}
pub struct FileOpenKindBuilder {
open_token: Token,
expression: ExpressionSyntax,
}
impl FileOpenKindBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
open_token: Kw::Open.canonical_token(),
expression: expression.into(),
}
}
pub fn with_open_token(mut self, t: impl Into<Token>) -> Self {
self.open_token = t.into();
self
}
pub fn with_open_token_trivia(mut self, trivia: Trivia) -> Self {
self.open_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn build(self) -> FileOpenKindSyntax {
RawNodeBuilder::new()
.push_token(self.open_token)
.push_node(self.expression)
.finish()
}
}
impl From<FileOpenKindBuilder> for FileOpenKindSyntax {
fn from(value: FileOpenKindBuilder) -> Self {
value.build()
}
}
pub struct FileTypeDefinitionBuilder {
file_token: Token,
of_token: Token,
type_mark: NameSyntax,
}
impl FileTypeDefinitionBuilder {
pub fn new(type_mark: impl Into<NameSyntax>) -> Self {
Self {
file_token: Kw::File.canonical_token(),
of_token: Kw::Of.canonical_token(),
type_mark: type_mark.into(),
}
}
pub fn with_file_token(mut self, t: impl Into<Token>) -> Self {
self.file_token = t.into();
self
}
pub fn with_file_token_trivia(mut self, trivia: Trivia) -> Self {
self.file_token.set_leading_trivia(trivia);
self
}
pub fn with_of_token(mut self, t: impl Into<Token>) -> Self {
self.of_token = t.into();
self
}
pub fn with_of_token_trivia(mut self, trivia: Trivia) -> Self {
self.of_token.set_leading_trivia(trivia);
self
}
pub fn with_type_mark(mut self, n: impl Into<NameSyntax>) -> Self {
self.type_mark = n.into();
self
}
pub fn build(self) -> FileTypeDefinitionSyntax {
RawNodeBuilder::new()
.push_token(self.file_token)
.push_token(self.of_token)
.push_node(self.type_mark)
.finish()
}
}
impl From<FileTypeDefinitionBuilder> for FileTypeDefinitionSyntax {
fn from(value: FileTypeDefinitionBuilder) -> Self {
value.build()
}
}
pub struct ForGeneratePreambleBuilder {
for_token: Token,
parameter_specification: ParameterSpecificationSyntax,
generate_token: Token,
}
impl ForGeneratePreambleBuilder {
pub fn new(parameter_specification: impl Into<ParameterSpecificationSyntax>) -> Self {
Self {
for_token: Kw::For.canonical_token(),
parameter_specification: parameter_specification.into(),
generate_token: Kw::Generate.canonical_token(),
}
}
pub fn with_for_token(mut self, t: impl Into<Token>) -> Self {
self.for_token = t.into();
self
}
pub fn with_for_token_trivia(mut self, trivia: Trivia) -> Self {
self.for_token.set_leading_trivia(trivia);
self
}
pub fn with_parameter_specification(
mut self,
n: impl Into<ParameterSpecificationSyntax>,
) -> Self {
self.parameter_specification = n.into();
self
}
pub fn with_generate_token(mut self, t: impl Into<Token>) -> Self {
self.generate_token = t.into();
self
}
pub fn with_generate_token_trivia(mut self, trivia: Trivia) -> Self {
self.generate_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ForGeneratePreambleSyntax {
RawNodeBuilder::new()
.push_token(self.for_token)
.push_node(self.parameter_specification)
.push_token(self.generate_token)
.finish()
}
}
impl From<ForGeneratePreambleBuilder> for ForGeneratePreambleSyntax {
fn from(value: ForGeneratePreambleBuilder) -> Self {
value.build()
}
}
pub struct ForGenerateStatementBuilder {
stmt_label: StmtLabelSyntax,
for_generate_preamble: ForGeneratePreambleSyntax,
generate_statement_body: Option<GenerateStatementBodySyntax>,
generate_epilogue: GenerateEpilogueSyntax,
}
impl ForGenerateStatementBuilder {
pub fn new(
stmt_label: impl Into<StmtLabelSyntax>,
for_generate_preamble: impl Into<ForGeneratePreambleSyntax>,
) -> Self {
Self {
stmt_label: stmt_label.into(),
for_generate_preamble: for_generate_preamble.into(),
generate_statement_body: None,
generate_epilogue: GenerateEpilogueBuilder::default().build(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = n.into();
self
}
pub fn with_for_generate_preamble(mut self, n: impl Into<ForGeneratePreambleSyntax>) -> Self {
self.for_generate_preamble = n.into();
self
}
pub fn with_generate_statement_body(
mut self,
n: impl Into<GenerateStatementBodySyntax>,
) -> Self {
self.generate_statement_body = Some(n.into());
self
}
pub fn with_generate_epilogue(mut self, n: impl Into<GenerateEpilogueSyntax>) -> Self {
self.generate_epilogue = n.into();
self
}
pub fn build(self) -> ForGenerateStatementSyntax {
RawNodeBuilder::new()
.push_node(self.stmt_label)
.push_node(self.for_generate_preamble)
.push_opt_node(self.generate_statement_body)
.push_node(self.generate_epilogue)
.finish()
}
}
impl From<ForGenerateStatementBuilder> for ForGenerateStatementSyntax {
fn from(value: ForGenerateStatementBuilder) -> Self {
value.build()
}
}
pub struct ForSchemeBuilder {
for_token: Token,
parameter_specification: ParameterSpecificationSyntax,
}
impl ForSchemeBuilder {
pub fn new(parameter_specification: impl Into<ParameterSpecificationSyntax>) -> Self {
Self {
for_token: Kw::For.canonical_token(),
parameter_specification: parameter_specification.into(),
}
}
pub fn with_for_token(mut self, t: impl Into<Token>) -> Self {
self.for_token = t.into();
self
}
pub fn with_for_token_trivia(mut self, trivia: Trivia) -> Self {
self.for_token.set_leading_trivia(trivia);
self
}
pub fn with_parameter_specification(
mut self,
n: impl Into<ParameterSpecificationSyntax>,
) -> Self {
self.parameter_specification = n.into();
self
}
pub fn build(self) -> ForSchemeSyntax {
RawNodeBuilder::new()
.push_token(self.for_token)
.push_node(self.parameter_specification)
.finish()
}
}
impl From<ForSchemeBuilder> for ForSchemeSyntax {
fn from(value: ForSchemeBuilder) -> Self {
value.build()
}
}
pub struct FormalBuilder {
formal_part: NameSyntax,
right_arrow_token: Token,
}
impl FormalBuilder {
pub fn new(formal_part: impl Into<NameSyntax>) -> Self {
Self {
formal_part: formal_part.into(),
right_arrow_token: TokenKind::RightArrow.canonical_token().unwrap(),
}
}
pub fn with_formal_part(mut self, n: impl Into<NameSyntax>) -> Self {
self.formal_part = n.into();
self
}
pub fn with_right_arrow_token(mut self, t: impl Into<Token>) -> Self {
self.right_arrow_token = t.into();
self
}
pub fn with_right_arrow_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_arrow_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> FormalSyntax {
RawNodeBuilder::new()
.push_node(self.formal_part)
.push_token(self.right_arrow_token)
.finish()
}
}
impl From<FormalBuilder> for FormalSyntax {
fn from(value: FormalBuilder) -> Self {
value.build()
}
}
pub struct FullTypeDeclarationBuilder {
type_token: Token,
identifier_token: Token,
is_token: Token,
type_definition: TypeDefinitionSyntax,
semi_colon_token: Token,
}
impl FullTypeDeclarationBuilder {
pub fn new(
identifier_token: impl Into<crate::builder::Identifier>,
type_definition: impl Into<TypeDefinitionSyntax>,
) -> Self {
Self {
type_token: Kw::Type.canonical_token(),
identifier_token: identifier_token.into().into(),
is_token: Kw::Is.canonical_token(),
type_definition: type_definition.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_type_token(mut self, t: impl Into<Token>) -> Self {
self.type_token = t.into();
self
}
pub fn with_type_token_trivia(mut self, trivia: Trivia) -> Self {
self.type_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn with_type_definition(mut self, n: impl Into<TypeDefinitionSyntax>) -> Self {
self.type_definition = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> FullTypeDeclarationSyntax {
RawNodeBuilder::new()
.push_token(self.type_token)
.push_token(self.identifier_token)
.push_token(self.is_token)
.push_node(self.type_definition)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<FullTypeDeclarationBuilder> for FullTypeDeclarationSyntax {
fn from(value: FullTypeDeclarationBuilder) -> Self {
value.build()
}
}
pub struct FunctionSpecificationBuilder {
purity: Option<PurityToken>,
function_token: Token,
designator: DesignatorToken,
subprogram_header: Option<SubprogramHeaderSyntax>,
parameter_list: Option<ParameterListSyntax>,
return_token: Token,
type_mark: NameSyntax,
}
impl FunctionSpecificationBuilder {
pub fn new(designator: impl Into<DesignatorToken>, type_mark: impl Into<NameSyntax>) -> Self {
Self {
purity: None,
function_token: Kw::Function.canonical_token(),
designator: designator.into(),
subprogram_header: None,
parameter_list: None,
return_token: Kw::Return.canonical_token(),
type_mark: type_mark.into(),
}
}
pub fn with_purity(mut self, n: impl Into<PurityToken>) -> Self {
self.purity = Some(n.into());
self
}
pub fn with_function_token(mut self, t: impl Into<Token>) -> Self {
self.function_token = t.into();
self
}
pub fn with_function_token_trivia(mut self, trivia: Trivia) -> Self {
self.function_token.set_leading_trivia(trivia);
self
}
pub fn with_designator(mut self, n: impl Into<DesignatorToken>) -> Self {
self.designator = n.into();
self
}
pub fn with_subprogram_header(mut self, n: impl Into<SubprogramHeaderSyntax>) -> Self {
self.subprogram_header = Some(n.into());
self
}
pub fn with_parameter_list(mut self, n: impl Into<ParameterListSyntax>) -> Self {
self.parameter_list = Some(n.into());
self
}
pub fn with_return_token(mut self, t: impl Into<Token>) -> Self {
self.return_token = t.into();
self
}
pub fn with_return_token_trivia(mut self, trivia: Trivia) -> Self {
self.return_token.set_leading_trivia(trivia);
self
}
pub fn with_type_mark(mut self, n: impl Into<NameSyntax>) -> Self {
self.type_mark = n.into();
self
}
pub fn build(self) -> FunctionSpecificationSyntax {
RawNodeBuilder::new()
.push_opt_token(self.purity.map(|t| t.0))
.push_token(self.function_token)
.push_token(self.designator.0)
.push_opt_node(self.subprogram_header)
.push_opt_node(self.parameter_list)
.push_token(self.return_token)
.push_node(self.type_mark)
.finish()
}
}
impl From<FunctionSpecificationBuilder> for FunctionSpecificationSyntax {
fn from(value: FunctionSpecificationBuilder) -> Self {
value.build()
}
}
pub struct GenerateBodyDeclarationsBuilder {
block_declarative_part: Option<BlockDeclarativePartSyntax>,
declaration_statement_separator: DeclarationStatementSeparatorSyntax,
}
impl Default for GenerateBodyDeclarationsBuilder {
fn default() -> Self {
Self::new()
}
}
impl GenerateBodyDeclarationsBuilder {
pub fn new() -> Self {
Self {
block_declarative_part: None,
declaration_statement_separator: DeclarationStatementSeparatorBuilder::default()
.build(),
}
}
pub fn with_block_declarative_part(mut self, n: impl Into<BlockDeclarativePartSyntax>) -> Self {
self.block_declarative_part = Some(n.into());
self
}
pub fn with_declaration_statement_separator(
mut self,
n: impl Into<DeclarationStatementSeparatorSyntax>,
) -> Self {
self.declaration_statement_separator = n.into();
self
}
pub fn build(self) -> GenerateBodyDeclarationsSyntax {
RawNodeBuilder::new()
.push_opt_node(self.block_declarative_part)
.push_node(self.declaration_statement_separator)
.finish()
}
}
impl From<GenerateBodyDeclarationsBuilder> for GenerateBodyDeclarationsSyntax {
fn from(value: GenerateBodyDeclarationsBuilder) -> Self {
value.build()
}
}
pub struct GenerateBodyEpilogueBuilder {
end_token: Token,
label: Option<Token>,
semi_colon_token: Token,
}
impl Default for GenerateBodyEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl GenerateBodyEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
label: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_label(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.label = Some(t.into().into());
self
}
pub fn with_label_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.label {
t.set_leading_trivia(trivia);
}
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> GenerateBodyEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_opt_token(self.label)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<GenerateBodyEpilogueBuilder> for GenerateBodyEpilogueSyntax {
fn from(value: GenerateBodyEpilogueBuilder) -> Self {
value.build()
}
}
pub struct GenerateEpilogueBuilder {
end_token: Token,
generate_token: Token,
label: Option<Token>,
semi_colon_token: Token,
}
impl Default for GenerateEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl GenerateEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
generate_token: Kw::Generate.canonical_token(),
label: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_generate_token(mut self, t: impl Into<Token>) -> Self {
self.generate_token = t.into();
self
}
pub fn with_generate_token_trivia(mut self, trivia: Trivia) -> Self {
self.generate_token.set_leading_trivia(trivia);
self
}
pub fn with_label(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.label = Some(t.into().into());
self
}
pub fn with_label_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.label {
t.set_leading_trivia(trivia);
}
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> GenerateEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_token(self.generate_token)
.push_opt_token(self.label)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<GenerateEpilogueBuilder> for GenerateEpilogueSyntax {
fn from(value: GenerateEpilogueBuilder) -> Self {
value.build()
}
}
pub struct GenerateStatementBodyBuilder {
generate_body_declarations: Option<GenerateBodyDeclarationsSyntax>,
concurrent_statements: Vec<ConcurrentStatementSyntax>,
generate_body_epilogue: Option<GenerateBodyEpilogueSyntax>,
}
impl Default for GenerateStatementBodyBuilder {
fn default() -> Self {
Self::new()
}
}
impl GenerateStatementBodyBuilder {
pub fn new() -> Self {
Self {
generate_body_declarations: None,
concurrent_statements: Vec::new(),
generate_body_epilogue: None,
}
}
pub fn with_generate_body_declarations(
mut self,
n: impl Into<GenerateBodyDeclarationsSyntax>,
) -> Self {
self.generate_body_declarations = Some(n.into());
self
}
pub fn add_concurrent_statements(mut self, n: impl Into<ConcurrentStatementSyntax>) -> Self {
self.concurrent_statements.push(n.into());
self
}
pub fn with_generate_body_epilogue(mut self, n: impl Into<GenerateBodyEpilogueSyntax>) -> Self {
self.generate_body_epilogue = Some(n.into());
self
}
pub fn build(self) -> GenerateStatementBodySyntax {
RawNodeBuilder::new()
.push_opt_node(self.generate_body_declarations)
.push_nodes(self.concurrent_statements)
.push_opt_node(self.generate_body_epilogue)
.finish()
}
}
impl From<GenerateStatementBodyBuilder> for GenerateStatementBodySyntax {
fn from(value: GenerateStatementBodyBuilder) -> Self {
value.build()
}
}
pub struct GenericClauseBuilder {
generic_token: Token,
left_par_token: Token,
generic_list: InterfaceListSyntax,
right_par_token: Token,
semi_colon_token: Token,
}
impl GenericClauseBuilder {
pub fn new(generic_list: impl Into<InterfaceListSyntax>) -> Self {
Self {
generic_token: Kw::Generic.canonical_token(),
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
generic_list: generic_list.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_generic_token(mut self, t: impl Into<Token>) -> Self {
self.generic_token = t.into();
self
}
pub fn with_generic_token_trivia(mut self, trivia: Trivia) -> Self {
self.generic_token.set_leading_trivia(trivia);
self
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_generic_list(mut self, n: impl Into<InterfaceListSyntax>) -> Self {
self.generic_list = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> GenericClauseSyntax {
RawNodeBuilder::new()
.push_token(self.generic_token)
.push_token(self.left_par_token)
.push_node(self.generic_list)
.push_token(self.right_par_token)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<GenericClauseBuilder> for GenericClauseSyntax {
fn from(value: GenericClauseBuilder) -> Self {
value.build()
}
}
pub struct GenericMapBuilder {
generic_map_aspect: GenericMapAspectSyntax,
semi_colon_token: Token,
}
impl GenericMapBuilder {
pub fn new(generic_map_aspect: impl Into<GenericMapAspectSyntax>) -> Self {
Self {
generic_map_aspect: generic_map_aspect.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_generic_map_aspect(mut self, n: impl Into<GenericMapAspectSyntax>) -> Self {
self.generic_map_aspect = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> GenericMapSyntax {
RawNodeBuilder::new()
.push_node(self.generic_map_aspect)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<GenericMapBuilder> for GenericMapSyntax {
fn from(value: GenericMapBuilder) -> Self {
value.build()
}
}
pub struct GenericMapAspectBuilder {
generic_token: Token,
map_token: Token,
left_par_token: Token,
association_list: AssociationListSyntax,
right_par_token: Token,
}
impl GenericMapAspectBuilder {
pub fn new(association_list: impl Into<AssociationListSyntax>) -> Self {
Self {
generic_token: Kw::Generic.canonical_token(),
map_token: Kw::Map.canonical_token(),
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
association_list: association_list.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
}
}
pub fn with_generic_token(mut self, t: impl Into<Token>) -> Self {
self.generic_token = t.into();
self
}
pub fn with_generic_token_trivia(mut self, trivia: Trivia) -> Self {
self.generic_token.set_leading_trivia(trivia);
self
}
pub fn with_map_token(mut self, t: impl Into<Token>) -> Self {
self.map_token = t.into();
self
}
pub fn with_map_token_trivia(mut self, trivia: Trivia) -> Self {
self.map_token.set_leading_trivia(trivia);
self
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_association_list(mut self, n: impl Into<AssociationListSyntax>) -> Self {
self.association_list = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> GenericMapAspectSyntax {
RawNodeBuilder::new()
.push_token(self.generic_token)
.push_token(self.map_token)
.push_token(self.left_par_token)
.push_node(self.association_list)
.push_token(self.right_par_token)
.finish()
}
}
impl From<GenericMapAspectBuilder> for GenericMapAspectSyntax {
fn from(value: GenericMapAspectBuilder) -> Self {
value.build()
}
}
pub struct GenericPartBuilder {
generic_clause: GenericClauseSyntax,
generic_map: Option<GenericMapSyntax>,
}
impl GenericPartBuilder {
pub fn new(generic_clause: impl Into<GenericClauseSyntax>) -> Self {
Self {
generic_clause: generic_clause.into(),
generic_map: None,
}
}
pub fn with_generic_clause(mut self, n: impl Into<GenericClauseSyntax>) -> Self {
self.generic_clause = n.into();
self
}
pub fn with_generic_map(mut self, n: impl Into<GenericMapSyntax>) -> Self {
self.generic_map = Some(n.into());
self
}
pub fn build(self) -> GenericPartSyntax {
RawNodeBuilder::new()
.push_node(self.generic_clause)
.push_opt_node(self.generic_map)
.finish()
}
}
impl From<GenericPartBuilder> for GenericPartSyntax {
fn from(value: GenericPartBuilder) -> Self {
value.build()
}
}
pub struct GroupDeclarationBuilder {
group_token: Token,
identifier_token: Token,
colon_token: Token,
name: NameSyntax,
semi_colon_token: Token,
}
impl GroupDeclarationBuilder {
pub fn new(
identifier_token: impl Into<crate::builder::Identifier>,
name: impl Into<NameSyntax>,
) -> Self {
Self {
group_token: Kw::Group.canonical_token(),
identifier_token: identifier_token.into().into(),
colon_token: TokenKind::Colon.canonical_token().unwrap(),
name: name.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_group_token(mut self, t: impl Into<Token>) -> Self {
self.group_token = t.into();
self
}
pub fn with_group_token_trivia(mut self, trivia: Trivia) -> Self {
self.group_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_colon_token(mut self, t: impl Into<Token>) -> Self {
self.colon_token = t.into();
self
}
pub fn with_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_token.set_leading_trivia(trivia);
self
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> GroupDeclarationSyntax {
RawNodeBuilder::new()
.push_token(self.group_token)
.push_token(self.identifier_token)
.push_token(self.colon_token)
.push_node(self.name)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<GroupDeclarationBuilder> for GroupDeclarationSyntax {
fn from(value: GroupDeclarationBuilder) -> Self {
value.build()
}
}
pub struct GroupTemplateDeclarationBuilder {
group_token: Token,
identifier_token: Token,
is_token: Token,
left_par_token: Token,
entity_class_entry_list: EntityClassEntryListSyntax,
right_par_token: Token,
semi_colon_token: Token,
}
impl GroupTemplateDeclarationBuilder {
pub fn new(
identifier_token: impl Into<crate::builder::Identifier>,
entity_class_entry_list: impl Into<EntityClassEntryListSyntax>,
) -> Self {
Self {
group_token: Kw::Group.canonical_token(),
identifier_token: identifier_token.into().into(),
is_token: Kw::Is.canonical_token(),
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
entity_class_entry_list: entity_class_entry_list.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_group_token(mut self, t: impl Into<Token>) -> Self {
self.group_token = t.into();
self
}
pub fn with_group_token_trivia(mut self, trivia: Trivia) -> Self {
self.group_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_entity_class_entry_list(
mut self,
n: impl Into<EntityClassEntryListSyntax>,
) -> Self {
self.entity_class_entry_list = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> GroupTemplateDeclarationSyntax {
RawNodeBuilder::new()
.push_token(self.group_token)
.push_token(self.identifier_token)
.push_token(self.is_token)
.push_token(self.left_par_token)
.push_node(self.entity_class_entry_list)
.push_token(self.right_par_token)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<GroupTemplateDeclarationBuilder> for GroupTemplateDeclarationSyntax {
fn from(value: GroupTemplateDeclarationBuilder) -> Self {
value.build()
}
}
pub struct GuardedSignalSpecificationBuilder {
signal_list: SignalListSyntax,
colon_token: Token,
type_mark: NameSyntax,
}
impl GuardedSignalSpecificationBuilder {
pub fn new(signal_list: impl Into<SignalListSyntax>, type_mark: impl Into<NameSyntax>) -> Self {
Self {
signal_list: signal_list.into(),
colon_token: TokenKind::Colon.canonical_token().unwrap(),
type_mark: type_mark.into(),
}
}
pub fn with_signal_list(mut self, n: impl Into<SignalListSyntax>) -> Self {
self.signal_list = n.into();
self
}
pub fn with_colon_token(mut self, t: impl Into<Token>) -> Self {
self.colon_token = t.into();
self
}
pub fn with_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_token.set_leading_trivia(trivia);
self
}
pub fn with_type_mark(mut self, n: impl Into<NameSyntax>) -> Self {
self.type_mark = n.into();
self
}
pub fn build(self) -> GuardedSignalSpecificationSyntax {
RawNodeBuilder::new()
.push_node(self.signal_list)
.push_token(self.colon_token)
.push_node(self.type_mark)
.finish()
}
}
impl From<GuardedSignalSpecificationBuilder> for GuardedSignalSpecificationSyntax {
fn from(value: GuardedSignalSpecificationBuilder) -> Self {
value.build()
}
}
pub struct IfGenerateElseBuilder {
else_token: Token,
stmt_label: Option<StmtLabelSyntax>,
generate_token: Token,
generate_statement_body: Option<GenerateStatementBodySyntax>,
}
impl Default for IfGenerateElseBuilder {
fn default() -> Self {
Self::new()
}
}
impl IfGenerateElseBuilder {
pub fn new() -> Self {
Self {
else_token: Kw::Else.canonical_token(),
stmt_label: None,
generate_token: Kw::Generate.canonical_token(),
generate_statement_body: None,
}
}
pub fn with_else_token(mut self, t: impl Into<Token>) -> Self {
self.else_token = t.into();
self
}
pub fn with_else_token_trivia(mut self, trivia: Trivia) -> Self {
self.else_token.set_leading_trivia(trivia);
self
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_generate_token(mut self, t: impl Into<Token>) -> Self {
self.generate_token = t.into();
self
}
pub fn with_generate_token_trivia(mut self, trivia: Trivia) -> Self {
self.generate_token.set_leading_trivia(trivia);
self
}
pub fn with_generate_statement_body(
mut self,
n: impl Into<GenerateStatementBodySyntax>,
) -> Self {
self.generate_statement_body = Some(n.into());
self
}
pub fn build(self) -> IfGenerateElseSyntax {
RawNodeBuilder::new()
.push_token(self.else_token)
.push_opt_node(self.stmt_label)
.push_token(self.generate_token)
.push_opt_node(self.generate_statement_body)
.finish()
}
}
impl From<IfGenerateElseBuilder> for IfGenerateElseSyntax {
fn from(value: IfGenerateElseBuilder) -> Self {
value.build()
}
}
pub struct IfGenerateElsifBuilder {
elsif_token: Token,
stmt_label: Option<StmtLabelSyntax>,
condition: ExpressionSyntax,
generate_token: Token,
generate_statement_body: Option<GenerateStatementBodySyntax>,
}
impl IfGenerateElsifBuilder {
pub fn new(condition: impl Into<ExpressionSyntax>) -> Self {
Self {
elsif_token: Kw::Elsif.canonical_token(),
stmt_label: None,
condition: condition.into(),
generate_token: Kw::Generate.canonical_token(),
generate_statement_body: None,
}
}
pub fn with_elsif_token(mut self, t: impl Into<Token>) -> Self {
self.elsif_token = t.into();
self
}
pub fn with_elsif_token_trivia(mut self, trivia: Trivia) -> Self {
self.elsif_token.set_leading_trivia(trivia);
self
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_condition(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.condition = n.into();
self
}
pub fn with_generate_token(mut self, t: impl Into<Token>) -> Self {
self.generate_token = t.into();
self
}
pub fn with_generate_token_trivia(mut self, trivia: Trivia) -> Self {
self.generate_token.set_leading_trivia(trivia);
self
}
pub fn with_generate_statement_body(
mut self,
n: impl Into<GenerateStatementBodySyntax>,
) -> Self {
self.generate_statement_body = Some(n.into());
self
}
pub fn build(self) -> IfGenerateElsifSyntax {
RawNodeBuilder::new()
.push_token(self.elsif_token)
.push_opt_node(self.stmt_label)
.push_node(self.condition)
.push_token(self.generate_token)
.push_opt_node(self.generate_statement_body)
.finish()
}
}
impl From<IfGenerateElsifBuilder> for IfGenerateElsifSyntax {
fn from(value: IfGenerateElsifBuilder) -> Self {
value.build()
}
}
pub struct IfGenerateIfBuilder {
if_token: Token,
stmt_label: Option<StmtLabelSyntax>,
condition: ExpressionSyntax,
generate_token: Token,
generate_statement_body: Option<GenerateStatementBodySyntax>,
}
impl IfGenerateIfBuilder {
pub fn new(condition: impl Into<ExpressionSyntax>) -> Self {
Self {
if_token: Kw::If.canonical_token(),
stmt_label: None,
condition: condition.into(),
generate_token: Kw::Generate.canonical_token(),
generate_statement_body: None,
}
}
pub fn with_if_token(mut self, t: impl Into<Token>) -> Self {
self.if_token = t.into();
self
}
pub fn with_if_token_trivia(mut self, trivia: Trivia) -> Self {
self.if_token.set_leading_trivia(trivia);
self
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_condition(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.condition = n.into();
self
}
pub fn with_generate_token(mut self, t: impl Into<Token>) -> Self {
self.generate_token = t.into();
self
}
pub fn with_generate_token_trivia(mut self, trivia: Trivia) -> Self {
self.generate_token.set_leading_trivia(trivia);
self
}
pub fn with_generate_statement_body(
mut self,
n: impl Into<GenerateStatementBodySyntax>,
) -> Self {
self.generate_statement_body = Some(n.into());
self
}
pub fn build(self) -> IfGenerateIfSyntax {
RawNodeBuilder::new()
.push_token(self.if_token)
.push_opt_node(self.stmt_label)
.push_node(self.condition)
.push_token(self.generate_token)
.push_opt_node(self.generate_statement_body)
.finish()
}
}
impl From<IfGenerateIfBuilder> for IfGenerateIfSyntax {
fn from(value: IfGenerateIfBuilder) -> Self {
value.build()
}
}
pub struct IfGenerateStatementBuilder {
stmt_label: StmtLabelSyntax,
if_generate_if: IfGenerateIfSyntax,
if_generate_elsifs: Vec<IfGenerateElsifSyntax>,
if_generate_else: Option<IfGenerateElseSyntax>,
generate_epilogue: GenerateEpilogueSyntax,
}
impl IfGenerateStatementBuilder {
pub fn new(
stmt_label: impl Into<StmtLabelSyntax>,
if_generate_if: impl Into<IfGenerateIfSyntax>,
) -> Self {
Self {
stmt_label: stmt_label.into(),
if_generate_if: if_generate_if.into(),
if_generate_elsifs: Vec::new(),
if_generate_else: None,
generate_epilogue: GenerateEpilogueBuilder::default().build(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = n.into();
self
}
pub fn with_if_generate_if(mut self, n: impl Into<IfGenerateIfSyntax>) -> Self {
self.if_generate_if = n.into();
self
}
pub fn add_if_generate_elsifs(mut self, n: impl Into<IfGenerateElsifSyntax>) -> Self {
self.if_generate_elsifs.push(n.into());
self
}
pub fn with_if_generate_else(mut self, n: impl Into<IfGenerateElseSyntax>) -> Self {
self.if_generate_else = Some(n.into());
self
}
pub fn with_generate_epilogue(mut self, n: impl Into<GenerateEpilogueSyntax>) -> Self {
self.generate_epilogue = n.into();
self
}
pub fn build(self) -> IfGenerateStatementSyntax {
RawNodeBuilder::new()
.push_node(self.stmt_label)
.push_node(self.if_generate_if)
.push_nodes(self.if_generate_elsifs)
.push_opt_node(self.if_generate_else)
.push_node(self.generate_epilogue)
.finish()
}
}
impl From<IfGenerateStatementBuilder> for IfGenerateStatementSyntax {
fn from(value: IfGenerateStatementBuilder) -> Self {
value.build()
}
}
pub struct IfStatementBuilder {
if_statement_preamble: IfStatementPreambleSyntax,
sequence_of_statements: Option<SequenceOfStatementsSyntax>,
if_statement_elsifs: Vec<IfStatementElsifSyntax>,
if_statement_else: Option<IfStatementElseSyntax>,
if_statement_epilogue: IfStatementEpilogueSyntax,
}
impl IfStatementBuilder {
pub fn new(if_statement_preamble: impl Into<IfStatementPreambleSyntax>) -> Self {
Self {
if_statement_preamble: if_statement_preamble.into(),
sequence_of_statements: None,
if_statement_elsifs: Vec::new(),
if_statement_else: None,
if_statement_epilogue: IfStatementEpilogueBuilder::default().build(),
}
}
pub fn with_if_statement_preamble(mut self, n: impl Into<IfStatementPreambleSyntax>) -> Self {
self.if_statement_preamble = n.into();
self
}
pub fn with_sequence_of_statements(mut self, n: impl Into<SequenceOfStatementsSyntax>) -> Self {
self.sequence_of_statements = Some(n.into());
self
}
pub fn add_if_statement_elsifs(mut self, n: impl Into<IfStatementElsifSyntax>) -> Self {
self.if_statement_elsifs.push(n.into());
self
}
pub fn with_if_statement_else(mut self, n: impl Into<IfStatementElseSyntax>) -> Self {
self.if_statement_else = Some(n.into());
self
}
pub fn with_if_statement_epilogue(mut self, n: impl Into<IfStatementEpilogueSyntax>) -> Self {
self.if_statement_epilogue = n.into();
self
}
pub fn build(self) -> IfStatementSyntax {
RawNodeBuilder::new()
.push_node(self.if_statement_preamble)
.push_opt_node(self.sequence_of_statements)
.push_nodes(self.if_statement_elsifs)
.push_opt_node(self.if_statement_else)
.push_node(self.if_statement_epilogue)
.finish()
}
}
impl From<IfStatementBuilder> for IfStatementSyntax {
fn from(value: IfStatementBuilder) -> Self {
value.build()
}
}
pub struct IfStatementElseBuilder {
else_token: Token,
sequence_of_statements: Option<SequenceOfStatementsSyntax>,
}
impl Default for IfStatementElseBuilder {
fn default() -> Self {
Self::new()
}
}
impl IfStatementElseBuilder {
pub fn new() -> Self {
Self {
else_token: Kw::Else.canonical_token(),
sequence_of_statements: None,
}
}
pub fn with_else_token(mut self, t: impl Into<Token>) -> Self {
self.else_token = t.into();
self
}
pub fn with_else_token_trivia(mut self, trivia: Trivia) -> Self {
self.else_token.set_leading_trivia(trivia);
self
}
pub fn with_sequence_of_statements(mut self, n: impl Into<SequenceOfStatementsSyntax>) -> Self {
self.sequence_of_statements = Some(n.into());
self
}
pub fn build(self) -> IfStatementElseSyntax {
RawNodeBuilder::new()
.push_token(self.else_token)
.push_opt_node(self.sequence_of_statements)
.finish()
}
}
impl From<IfStatementElseBuilder> for IfStatementElseSyntax {
fn from(value: IfStatementElseBuilder) -> Self {
value.build()
}
}
pub struct IfStatementElsifBuilder {
elsif_token: Token,
condition: ExpressionSyntax,
then_token: Token,
sequence_of_statements: Option<SequenceOfStatementsSyntax>,
}
impl IfStatementElsifBuilder {
pub fn new(condition: impl Into<ExpressionSyntax>) -> Self {
Self {
elsif_token: Kw::Elsif.canonical_token(),
condition: condition.into(),
then_token: Kw::Then.canonical_token(),
sequence_of_statements: None,
}
}
pub fn with_elsif_token(mut self, t: impl Into<Token>) -> Self {
self.elsif_token = t.into();
self
}
pub fn with_elsif_token_trivia(mut self, trivia: Trivia) -> Self {
self.elsif_token.set_leading_trivia(trivia);
self
}
pub fn with_condition(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.condition = n.into();
self
}
pub fn with_then_token(mut self, t: impl Into<Token>) -> Self {
self.then_token = t.into();
self
}
pub fn with_then_token_trivia(mut self, trivia: Trivia) -> Self {
self.then_token.set_leading_trivia(trivia);
self
}
pub fn with_sequence_of_statements(mut self, n: impl Into<SequenceOfStatementsSyntax>) -> Self {
self.sequence_of_statements = Some(n.into());
self
}
pub fn build(self) -> IfStatementElsifSyntax {
RawNodeBuilder::new()
.push_token(self.elsif_token)
.push_node(self.condition)
.push_token(self.then_token)
.push_opt_node(self.sequence_of_statements)
.finish()
}
}
impl From<IfStatementElsifBuilder> for IfStatementElsifSyntax {
fn from(value: IfStatementElsifBuilder) -> Self {
value.build()
}
}
pub struct IfStatementEpilogueBuilder {
end_token: Token,
if_token: Token,
label: Option<Token>,
semi_colon_token: Token,
}
impl Default for IfStatementEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl IfStatementEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
if_token: Kw::If.canonical_token(),
label: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_if_token(mut self, t: impl Into<Token>) -> Self {
self.if_token = t.into();
self
}
pub fn with_if_token_trivia(mut self, trivia: Trivia) -> Self {
self.if_token.set_leading_trivia(trivia);
self
}
pub fn with_label(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.label = Some(t.into().into());
self
}
pub fn with_label_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.label {
t.set_leading_trivia(trivia);
}
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> IfStatementEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_token(self.if_token)
.push_opt_token(self.label)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<IfStatementEpilogueBuilder> for IfStatementEpilogueSyntax {
fn from(value: IfStatementEpilogueBuilder) -> Self {
value.build()
}
}
pub struct IfStatementPreambleBuilder {
stmt_label: Option<StmtLabelSyntax>,
if_token: Token,
condition: ExpressionSyntax,
then_token: Token,
}
impl IfStatementPreambleBuilder {
pub fn new(condition: impl Into<ExpressionSyntax>) -> Self {
Self {
stmt_label: None,
if_token: Kw::If.canonical_token(),
condition: condition.into(),
then_token: Kw::Then.canonical_token(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_if_token(mut self, t: impl Into<Token>) -> Self {
self.if_token = t.into();
self
}
pub fn with_if_token_trivia(mut self, trivia: Trivia) -> Self {
self.if_token.set_leading_trivia(trivia);
self
}
pub fn with_condition(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.condition = n.into();
self
}
pub fn with_then_token(mut self, t: impl Into<Token>) -> Self {
self.then_token = t.into();
self
}
pub fn with_then_token_trivia(mut self, trivia: Trivia) -> Self {
self.then_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> IfStatementPreambleSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_token(self.if_token)
.push_node(self.condition)
.push_token(self.then_token)
.finish()
}
}
impl From<IfStatementPreambleBuilder> for IfStatementPreambleSyntax {
fn from(value: IfStatementPreambleBuilder) -> Self {
value.build()
}
}
pub struct IncompleteTypeDeclarationBuilder {
type_token: Token,
identifier_token: Token,
semi_colon_token: Token,
}
impl IncompleteTypeDeclarationBuilder {
pub fn new(identifier_token: impl Into<crate::builder::Identifier>) -> Self {
Self {
type_token: Kw::Type.canonical_token(),
identifier_token: identifier_token.into().into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_type_token(mut self, t: impl Into<Token>) -> Self {
self.type_token = t.into();
self
}
pub fn with_type_token_trivia(mut self, trivia: Trivia) -> Self {
self.type_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> IncompleteTypeDeclarationSyntax {
RawNodeBuilder::new()
.push_token(self.type_token)
.push_token(self.identifier_token)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<IncompleteTypeDeclarationBuilder> for IncompleteTypeDeclarationSyntax {
fn from(value: IncompleteTypeDeclarationBuilder) -> Self {
value.build()
}
}
pub struct IndexConstraintBuilder {
left_par_token: Token,
expression_list: ExpressionListSyntax,
right_par_token: Token,
}
impl IndexConstraintBuilder {
pub fn new(expression_list: impl Into<ExpressionListSyntax>) -> Self {
Self {
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
expression_list: expression_list.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
}
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_expression_list(mut self, n: impl Into<ExpressionListSyntax>) -> Self {
self.expression_list = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> IndexConstraintSyntax {
RawNodeBuilder::new()
.push_token(self.left_par_token)
.push_node(self.expression_list)
.push_token(self.right_par_token)
.finish()
}
}
impl From<IndexConstraintBuilder> for IndexConstraintSyntax {
fn from(value: IndexConstraintBuilder) -> Self {
value.build()
}
}
pub struct IndexSubtypeDefinitionBuilder {
type_mark: NameSyntax,
range_token: Token,
box_token: Token,
}
impl IndexSubtypeDefinitionBuilder {
pub fn new(type_mark: impl Into<NameSyntax>) -> Self {
Self {
type_mark: type_mark.into(),
range_token: Kw::Range.canonical_token(),
box_token: TokenKind::BOX.canonical_token().unwrap(),
}
}
pub fn with_type_mark(mut self, n: impl Into<NameSyntax>) -> Self {
self.type_mark = n.into();
self
}
pub fn with_range_token(mut self, t: impl Into<Token>) -> Self {
self.range_token = t.into();
self
}
pub fn with_range_token_trivia(mut self, trivia: Trivia) -> Self {
self.range_token.set_leading_trivia(trivia);
self
}
pub fn with_box_token(mut self, t: impl Into<Token>) -> Self {
self.box_token = t.into();
self
}
pub fn with_box_token_trivia(mut self, trivia: Trivia) -> Self {
self.box_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> IndexSubtypeDefinitionSyntax {
RawNodeBuilder::new()
.push_node(self.type_mark)
.push_token(self.range_token)
.push_token(self.box_token)
.finish()
}
}
impl From<IndexSubtypeDefinitionBuilder> for IndexSubtypeDefinitionSyntax {
fn from(value: IndexSubtypeDefinitionBuilder) -> Self {
value.build()
}
}
pub struct InertialDelayMechanismBuilder {
reject_clause: Option<RejectClauseSyntax>,
inertial_token: Token,
}
impl Default for InertialDelayMechanismBuilder {
fn default() -> Self {
Self::new()
}
}
impl InertialDelayMechanismBuilder {
pub fn new() -> Self {
Self {
reject_clause: None,
inertial_token: Kw::Inertial.canonical_token(),
}
}
pub fn with_reject_clause(mut self, n: impl Into<RejectClauseSyntax>) -> Self {
self.reject_clause = Some(n.into());
self
}
pub fn with_inertial_token(mut self, t: impl Into<Token>) -> Self {
self.inertial_token = t.into();
self
}
pub fn with_inertial_token_trivia(mut self, trivia: Trivia) -> Self {
self.inertial_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> InertialDelayMechanismSyntax {
RawNodeBuilder::new()
.push_opt_node(self.reject_clause)
.push_token(self.inertial_token)
.finish()
}
}
impl From<InertialDelayMechanismBuilder> for InertialDelayMechanismSyntax {
fn from(value: InertialDelayMechanismBuilder) -> Self {
value.build()
}
}
pub struct InitialValueBuilder {
colon_eq_token: Token,
expression: ExpressionSyntax,
}
impl InitialValueBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
colon_eq_token: TokenKind::ColonEq.canonical_token().unwrap(),
expression: expression.into(),
}
}
pub fn with_colon_eq_token(mut self, t: impl Into<Token>) -> Self {
self.colon_eq_token = t.into();
self
}
pub fn with_colon_eq_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_eq_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn build(self) -> InitialValueSyntax {
RawNodeBuilder::new()
.push_token(self.colon_eq_token)
.push_node(self.expression)
.finish()
}
}
impl From<InitialValueBuilder> for InitialValueSyntax {
fn from(value: InitialValueBuilder) -> Self {
value.build()
}
}
pub struct InstantiatedComponentBuilder {
component_token: Option<Token>,
name: NameSyntax,
}
impl InstantiatedComponentBuilder {
pub fn new(name: impl Into<NameSyntax>) -> Self {
Self {
component_token: None,
name: name.into(),
}
}
pub fn with_component_token(mut self, t: impl Into<Token>) -> Self {
self.component_token = Some(t.into());
self
}
pub fn with_component_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.component_token
.get_or_insert_with(|| Kw::Component.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn build(self) -> InstantiatedComponentSyntax {
RawNodeBuilder::new()
.push_opt_token(self.component_token)
.push_node(self.name)
.finish()
}
}
impl From<InstantiatedComponentBuilder> for InstantiatedComponentSyntax {
fn from(value: InstantiatedComponentBuilder) -> Self {
value.build()
}
}
pub struct InstantiatedConfigurationBuilder {
configuration_token: Token,
name: NameSyntax,
}
impl InstantiatedConfigurationBuilder {
pub fn new(name: impl Into<NameSyntax>) -> Self {
Self {
configuration_token: Kw::Configuration.canonical_token(),
name: name.into(),
}
}
pub fn with_configuration_token(mut self, t: impl Into<Token>) -> Self {
self.configuration_token = t.into();
self
}
pub fn with_configuration_token_trivia(mut self, trivia: Trivia) -> Self {
self.configuration_token.set_leading_trivia(trivia);
self
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn build(self) -> InstantiatedConfigurationSyntax {
RawNodeBuilder::new()
.push_token(self.configuration_token)
.push_node(self.name)
.finish()
}
}
impl From<InstantiatedConfigurationBuilder> for InstantiatedConfigurationSyntax {
fn from(value: InstantiatedConfigurationBuilder) -> Self {
value.build()
}
}
pub struct InstantiatedEntityBuilder {
entity_token: Token,
name: NameSyntax,
}
impl InstantiatedEntityBuilder {
pub fn new(name: impl Into<NameSyntax>) -> Self {
Self {
entity_token: Kw::Entity.canonical_token(),
name: name.into(),
}
}
pub fn with_entity_token(mut self, t: impl Into<Token>) -> Self {
self.entity_token = t.into();
self
}
pub fn with_entity_token_trivia(mut self, trivia: Trivia) -> Self {
self.entity_token.set_leading_trivia(trivia);
self
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn build(self) -> InstantiatedEntitySyntax {
RawNodeBuilder::new()
.push_token(self.entity_token)
.push_node(self.name)
.finish()
}
}
impl From<InstantiatedEntityBuilder> for InstantiatedEntitySyntax {
fn from(value: InstantiatedEntityBuilder) -> Self {
value.build()
}
}
pub struct InstantiationListAllBuilder {
all_token: Token,
}
impl Default for InstantiationListAllBuilder {
fn default() -> Self {
Self::new()
}
}
impl InstantiationListAllBuilder {
pub fn new() -> Self {
Self {
all_token: Kw::All.canonical_token(),
}
}
pub fn with_all_token(mut self, t: impl Into<Token>) -> Self {
self.all_token = t.into();
self
}
pub fn with_all_token_trivia(mut self, trivia: Trivia) -> Self {
self.all_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> InstantiationListAllSyntax {
RawNodeBuilder::new().push_token(self.all_token).finish()
}
}
impl From<InstantiationListAllBuilder> for InstantiationListAllSyntax {
fn from(value: InstantiationListAllBuilder) -> Self {
value.build()
}
}
pub struct InstantiationListOthersBuilder {
others_token: Token,
}
impl Default for InstantiationListOthersBuilder {
fn default() -> Self {
Self::new()
}
}
impl InstantiationListOthersBuilder {
pub fn new() -> Self {
Self {
others_token: Kw::Others.canonical_token(),
}
}
pub fn with_others_token(mut self, t: impl Into<Token>) -> Self {
self.others_token = t.into();
self
}
pub fn with_others_token_trivia(mut self, trivia: Trivia) -> Self {
self.others_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> InstantiationListOthersSyntax {
RawNodeBuilder::new().push_token(self.others_token).finish()
}
}
impl From<InstantiationListOthersBuilder> for InstantiationListOthersSyntax {
fn from(value: InstantiationListOthersBuilder) -> Self {
value.build()
}
}
pub struct InterfaceFileDeclarationBuilder {
file_token: Token,
identifier_list: IdentifierListSyntax,
colon_token: Token,
subtype_indication: SubtypeIndicationSyntax,
}
impl InterfaceFileDeclarationBuilder {
pub fn new(
identifier_list: impl Into<IdentifierListSyntax>,
subtype_indication: impl Into<SubtypeIndicationSyntax>,
) -> Self {
Self {
file_token: Kw::File.canonical_token(),
identifier_list: identifier_list.into(),
colon_token: TokenKind::Colon.canonical_token().unwrap(),
subtype_indication: subtype_indication.into(),
}
}
pub fn with_file_token(mut self, t: impl Into<Token>) -> Self {
self.file_token = t.into();
self
}
pub fn with_file_token_trivia(mut self, trivia: Trivia) -> Self {
self.file_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_list(mut self, n: impl Into<IdentifierListSyntax>) -> Self {
self.identifier_list = n.into();
self
}
pub fn with_colon_token(mut self, t: impl Into<Token>) -> Self {
self.colon_token = t.into();
self
}
pub fn with_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_token.set_leading_trivia(trivia);
self
}
pub fn with_subtype_indication(mut self, n: impl Into<SubtypeIndicationSyntax>) -> Self {
self.subtype_indication = n.into();
self
}
pub fn build(self) -> InterfaceFileDeclarationSyntax {
RawNodeBuilder::new()
.push_token(self.file_token)
.push_node(self.identifier_list)
.push_token(self.colon_token)
.push_node(self.subtype_indication)
.finish()
}
}
impl From<InterfaceFileDeclarationBuilder> for InterfaceFileDeclarationSyntax {
fn from(value: InterfaceFileDeclarationBuilder) -> Self {
value.build()
}
}
pub struct InterfaceFunctionSpecificationBuilder {
purity: Option<PurityToken>,
function_token: Token,
designator: DesignatorToken,
parameter_list: Option<ParameterListSyntax>,
return_token: Token,
type_mark: NameSyntax,
}
impl InterfaceFunctionSpecificationBuilder {
pub fn new(designator: impl Into<DesignatorToken>, type_mark: impl Into<NameSyntax>) -> Self {
Self {
purity: None,
function_token: Kw::Function.canonical_token(),
designator: designator.into(),
parameter_list: None,
return_token: Kw::Return.canonical_token(),
type_mark: type_mark.into(),
}
}
pub fn with_purity(mut self, n: impl Into<PurityToken>) -> Self {
self.purity = Some(n.into());
self
}
pub fn with_function_token(mut self, t: impl Into<Token>) -> Self {
self.function_token = t.into();
self
}
pub fn with_function_token_trivia(mut self, trivia: Trivia) -> Self {
self.function_token.set_leading_trivia(trivia);
self
}
pub fn with_designator(mut self, n: impl Into<DesignatorToken>) -> Self {
self.designator = n.into();
self
}
pub fn with_parameter_list(mut self, n: impl Into<ParameterListSyntax>) -> Self {
self.parameter_list = Some(n.into());
self
}
pub fn with_return_token(mut self, t: impl Into<Token>) -> Self {
self.return_token = t.into();
self
}
pub fn with_return_token_trivia(mut self, trivia: Trivia) -> Self {
self.return_token.set_leading_trivia(trivia);
self
}
pub fn with_type_mark(mut self, n: impl Into<NameSyntax>) -> Self {
self.type_mark = n.into();
self
}
pub fn build(self) -> InterfaceFunctionSpecificationSyntax {
RawNodeBuilder::new()
.push_opt_token(self.purity.map(|t| t.0))
.push_token(self.function_token)
.push_token(self.designator.0)
.push_opt_node(self.parameter_list)
.push_token(self.return_token)
.push_node(self.type_mark)
.finish()
}
}
impl From<InterfaceFunctionSpecificationBuilder> for InterfaceFunctionSpecificationSyntax {
fn from(value: InterfaceFunctionSpecificationBuilder) -> Self {
value.build()
}
}
pub struct InterfaceIncompleteTypeDeclarationBuilder {
type_token: Token,
identifier_token: Token,
}
impl InterfaceIncompleteTypeDeclarationBuilder {
pub fn new(identifier_token: impl Into<crate::builder::Identifier>) -> Self {
Self {
type_token: Kw::Type.canonical_token(),
identifier_token: identifier_token.into().into(),
}
}
pub fn with_type_token(mut self, t: impl Into<Token>) -> Self {
self.type_token = t.into();
self
}
pub fn with_type_token_trivia(mut self, trivia: Trivia) -> Self {
self.type_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> InterfaceIncompleteTypeDeclarationSyntax {
RawNodeBuilder::new()
.push_token(self.type_token)
.push_token(self.identifier_token)
.finish()
}
}
impl From<InterfaceIncompleteTypeDeclarationBuilder> for InterfaceIncompleteTypeDeclarationSyntax {
fn from(value: InterfaceIncompleteTypeDeclarationBuilder) -> Self {
value.build()
}
}
pub struct InterfaceObjectDeclarationBuilder {
interface_object_class: Option<InterfaceObjectClassToken>,
identifier_list: IdentifierListSyntax,
colon_token: Token,
mode: Option<ModeToken>,
subtype_indication: SubtypeIndicationSyntax,
bus_token: Option<Token>,
initial_value: Option<InitialValueSyntax>,
}
impl InterfaceObjectDeclarationBuilder {
pub fn new(
identifier_list: impl Into<IdentifierListSyntax>,
subtype_indication: impl Into<SubtypeIndicationSyntax>,
) -> Self {
Self {
interface_object_class: None,
identifier_list: identifier_list.into(),
colon_token: TokenKind::Colon.canonical_token().unwrap(),
mode: None,
subtype_indication: subtype_indication.into(),
bus_token: None,
initial_value: None,
}
}
pub fn with_interface_object_class(mut self, n: impl Into<InterfaceObjectClassToken>) -> Self {
self.interface_object_class = Some(n.into());
self
}
pub fn with_identifier_list(mut self, n: impl Into<IdentifierListSyntax>) -> Self {
self.identifier_list = n.into();
self
}
pub fn with_colon_token(mut self, t: impl Into<Token>) -> Self {
self.colon_token = t.into();
self
}
pub fn with_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_token.set_leading_trivia(trivia);
self
}
pub fn with_mode(mut self, n: impl Into<ModeToken>) -> Self {
self.mode = Some(n.into());
self
}
pub fn with_subtype_indication(mut self, n: impl Into<SubtypeIndicationSyntax>) -> Self {
self.subtype_indication = n.into();
self
}
pub fn with_bus_token(mut self, t: impl Into<Token>) -> Self {
self.bus_token = Some(t.into());
self
}
pub fn with_bus_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.bus_token
.get_or_insert_with(|| Kw::Bus.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_initial_value(mut self, n: impl Into<InitialValueSyntax>) -> Self {
self.initial_value = Some(n.into());
self
}
pub fn build(self) -> InterfaceObjectDeclarationSyntax {
RawNodeBuilder::new()
.push_opt_token(self.interface_object_class.map(|t| t.0))
.push_node(self.identifier_list)
.push_token(self.colon_token)
.push_opt_token(self.mode.map(|t| t.0))
.push_node(self.subtype_indication)
.push_opt_token(self.bus_token)
.push_opt_node(self.initial_value)
.finish()
}
}
impl From<InterfaceObjectDeclarationBuilder> for InterfaceObjectDeclarationSyntax {
fn from(value: InterfaceObjectDeclarationBuilder) -> Self {
value.build()
}
}
pub struct InterfacePackageDeclarationBuilder {
interface_package_declaration_preamble: InterfacePackageDeclarationPreambleSyntax,
new_token: Token,
name: NameSyntax,
interface_package_generic_map_aspect: InterfacePackageGenericMapAspectSyntax,
}
impl InterfacePackageDeclarationBuilder {
pub fn new(
interface_package_declaration_preamble: impl Into<InterfacePackageDeclarationPreambleSyntax>,
name: impl Into<NameSyntax>,
interface_package_generic_map_aspect: impl Into<InterfacePackageGenericMapAspectSyntax>,
) -> Self {
Self {
interface_package_declaration_preamble: interface_package_declaration_preamble.into(),
new_token: Kw::New.canonical_token(),
name: name.into(),
interface_package_generic_map_aspect: interface_package_generic_map_aspect.into(),
}
}
pub fn with_interface_package_declaration_preamble(
mut self,
n: impl Into<InterfacePackageDeclarationPreambleSyntax>,
) -> Self {
self.interface_package_declaration_preamble = n.into();
self
}
pub fn with_new_token(mut self, t: impl Into<Token>) -> Self {
self.new_token = t.into();
self
}
pub fn with_new_token_trivia(mut self, trivia: Trivia) -> Self {
self.new_token.set_leading_trivia(trivia);
self
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn with_interface_package_generic_map_aspect(
mut self,
n: impl Into<InterfacePackageGenericMapAspectSyntax>,
) -> Self {
self.interface_package_generic_map_aspect = n.into();
self
}
pub fn build(self) -> InterfacePackageDeclarationSyntax {
RawNodeBuilder::new()
.push_node(self.interface_package_declaration_preamble)
.push_token(self.new_token)
.push_node(self.name)
.push_node(self.interface_package_generic_map_aspect)
.finish()
}
}
impl From<InterfacePackageDeclarationBuilder> for InterfacePackageDeclarationSyntax {
fn from(value: InterfacePackageDeclarationBuilder) -> Self {
value.build()
}
}
pub struct InterfacePackageDeclarationPreambleBuilder {
package_token: Token,
identifier_token: Token,
is_token: Token,
}
impl InterfacePackageDeclarationPreambleBuilder {
pub fn new(identifier_token: impl Into<crate::builder::Identifier>) -> Self {
Self {
package_token: Kw::Package.canonical_token(),
identifier_token: identifier_token.into().into(),
is_token: Kw::Is.canonical_token(),
}
}
pub fn with_package_token(mut self, t: impl Into<Token>) -> Self {
self.package_token = t.into();
self
}
pub fn with_package_token_trivia(mut self, trivia: Trivia) -> Self {
self.package_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> InterfacePackageDeclarationPreambleSyntax {
RawNodeBuilder::new()
.push_token(self.package_token)
.push_token(self.identifier_token)
.push_token(self.is_token)
.finish()
}
}
impl From<InterfacePackageDeclarationPreambleBuilder>
for InterfacePackageDeclarationPreambleSyntax
{
fn from(value: InterfacePackageDeclarationPreambleBuilder) -> Self {
value.build()
}
}
pub struct InterfacePackageGenericMapAspectBuilder {
generic_token: Token,
map_token: Token,
left_par_token: Token,
interface_package_generic_map_aspect_inner: InterfacePackageGenericMapAspectInnerSyntax,
right_par_token: Token,
}
impl InterfacePackageGenericMapAspectBuilder {
pub fn new(
interface_package_generic_map_aspect_inner: impl Into<
InterfacePackageGenericMapAspectInnerSyntax,
>,
) -> Self {
Self {
generic_token: Kw::Generic.canonical_token(),
map_token: Kw::Map.canonical_token(),
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
interface_package_generic_map_aspect_inner: interface_package_generic_map_aspect_inner
.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
}
}
pub fn with_generic_token(mut self, t: impl Into<Token>) -> Self {
self.generic_token = t.into();
self
}
pub fn with_generic_token_trivia(mut self, trivia: Trivia) -> Self {
self.generic_token.set_leading_trivia(trivia);
self
}
pub fn with_map_token(mut self, t: impl Into<Token>) -> Self {
self.map_token = t.into();
self
}
pub fn with_map_token_trivia(mut self, trivia: Trivia) -> Self {
self.map_token.set_leading_trivia(trivia);
self
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_interface_package_generic_map_aspect_inner(
mut self,
n: impl Into<InterfacePackageGenericMapAspectInnerSyntax>,
) -> Self {
self.interface_package_generic_map_aspect_inner = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> InterfacePackageGenericMapAspectSyntax {
RawNodeBuilder::new()
.push_token(self.generic_token)
.push_token(self.map_token)
.push_token(self.left_par_token)
.push_node(self.interface_package_generic_map_aspect_inner)
.push_token(self.right_par_token)
.finish()
}
}
impl From<InterfacePackageGenericMapAspectBuilder> for InterfacePackageGenericMapAspectSyntax {
fn from(value: InterfacePackageGenericMapAspectBuilder) -> Self {
value.build()
}
}
pub struct InterfacePackageGenericMapAspectAssociationsBuilder {
association_list: AssociationListSyntax,
}
impl InterfacePackageGenericMapAspectAssociationsBuilder {
pub fn new(association_list: impl Into<AssociationListSyntax>) -> Self {
Self {
association_list: association_list.into(),
}
}
pub fn with_association_list(mut self, n: impl Into<AssociationListSyntax>) -> Self {
self.association_list = n.into();
self
}
pub fn build(self) -> InterfacePackageGenericMapAspectAssociationsSyntax {
RawNodeBuilder::new()
.push_node(self.association_list)
.finish()
}
}
impl From<InterfacePackageGenericMapAspectAssociationsBuilder>
for InterfacePackageGenericMapAspectAssociationsSyntax
{
fn from(value: InterfacePackageGenericMapAspectAssociationsBuilder) -> Self {
value.build()
}
}
pub struct InterfacePackageGenericMapAspectBoxBuilder {
box_token: Token,
}
impl Default for InterfacePackageGenericMapAspectBoxBuilder {
fn default() -> Self {
Self::new()
}
}
impl InterfacePackageGenericMapAspectBoxBuilder {
pub fn new() -> Self {
Self {
box_token: TokenKind::BOX.canonical_token().unwrap(),
}
}
pub fn with_box_token(mut self, t: impl Into<Token>) -> Self {
self.box_token = t.into();
self
}
pub fn with_box_token_trivia(mut self, trivia: Trivia) -> Self {
self.box_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> InterfacePackageGenericMapAspectBoxSyntax {
RawNodeBuilder::new().push_token(self.box_token).finish()
}
}
impl From<InterfacePackageGenericMapAspectBoxBuilder>
for InterfacePackageGenericMapAspectBoxSyntax
{
fn from(value: InterfacePackageGenericMapAspectBoxBuilder) -> Self {
value.build()
}
}
pub struct InterfacePackageGenericMapAspectDefaultBuilder {
default_token: Token,
}
impl Default for InterfacePackageGenericMapAspectDefaultBuilder {
fn default() -> Self {
Self::new()
}
}
impl InterfacePackageGenericMapAspectDefaultBuilder {
pub fn new() -> Self {
Self {
default_token: Kw::Default.canonical_token(),
}
}
pub fn with_default_token(mut self, t: impl Into<Token>) -> Self {
self.default_token = t.into();
self
}
pub fn with_default_token_trivia(mut self, trivia: Trivia) -> Self {
self.default_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> InterfacePackageGenericMapAspectDefaultSyntax {
RawNodeBuilder::new()
.push_token(self.default_token)
.finish()
}
}
impl From<InterfacePackageGenericMapAspectDefaultBuilder>
for InterfacePackageGenericMapAspectDefaultSyntax
{
fn from(value: InterfacePackageGenericMapAspectDefaultBuilder) -> Self {
value.build()
}
}
pub struct InterfaceProcedureSpecificationBuilder {
procedure_token: Token,
designator: DesignatorToken,
parameter_list: Option<ParameterListSyntax>,
}
impl InterfaceProcedureSpecificationBuilder {
pub fn new(designator: impl Into<DesignatorToken>) -> Self {
Self {
procedure_token: Kw::Procedure.canonical_token(),
designator: designator.into(),
parameter_list: None,
}
}
pub fn with_procedure_token(mut self, t: impl Into<Token>) -> Self {
self.procedure_token = t.into();
self
}
pub fn with_procedure_token_trivia(mut self, trivia: Trivia) -> Self {
self.procedure_token.set_leading_trivia(trivia);
self
}
pub fn with_designator(mut self, n: impl Into<DesignatorToken>) -> Self {
self.designator = n.into();
self
}
pub fn with_parameter_list(mut self, n: impl Into<ParameterListSyntax>) -> Self {
self.parameter_list = Some(n.into());
self
}
pub fn build(self) -> InterfaceProcedureSpecificationSyntax {
RawNodeBuilder::new()
.push_token(self.procedure_token)
.push_token(self.designator.0)
.push_opt_node(self.parameter_list)
.finish()
}
}
impl From<InterfaceProcedureSpecificationBuilder> for InterfaceProcedureSpecificationSyntax {
fn from(value: InterfaceProcedureSpecificationBuilder) -> Self {
value.build()
}
}
pub struct InterfaceSubprogramDeclarationBuilder {
interface_subprogram_specification: InterfaceSubprogramSpecificationSyntax,
subprogram_default: Option<SubprogramDefaultSyntax>,
}
impl InterfaceSubprogramDeclarationBuilder {
pub fn new(
interface_subprogram_specification: impl Into<InterfaceSubprogramSpecificationSyntax>,
) -> Self {
Self {
interface_subprogram_specification: interface_subprogram_specification.into(),
subprogram_default: None,
}
}
pub fn with_interface_subprogram_specification(
mut self,
n: impl Into<InterfaceSubprogramSpecificationSyntax>,
) -> Self {
self.interface_subprogram_specification = n.into();
self
}
pub fn with_subprogram_default(mut self, n: impl Into<SubprogramDefaultSyntax>) -> Self {
self.subprogram_default = Some(n.into());
self
}
pub fn build(self) -> InterfaceSubprogramDeclarationSyntax {
RawNodeBuilder::new()
.push_node(self.interface_subprogram_specification)
.push_opt_node(self.subprogram_default)
.finish()
}
}
impl From<InterfaceSubprogramDeclarationBuilder> for InterfaceSubprogramDeclarationSyntax {
fn from(value: InterfaceSubprogramDeclarationBuilder) -> Self {
value.build()
}
}
pub struct InterfaceSubprogramDefaultBoxBuilder {
box_token: Token,
}
impl Default for InterfaceSubprogramDefaultBoxBuilder {
fn default() -> Self {
Self::new()
}
}
impl InterfaceSubprogramDefaultBoxBuilder {
pub fn new() -> Self {
Self {
box_token: TokenKind::BOX.canonical_token().unwrap(),
}
}
pub fn with_box_token(mut self, t: impl Into<Token>) -> Self {
self.box_token = t.into();
self
}
pub fn with_box_token_trivia(mut self, trivia: Trivia) -> Self {
self.box_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> InterfaceSubprogramDefaultBoxSyntax {
RawNodeBuilder::new().push_token(self.box_token).finish()
}
}
impl From<InterfaceSubprogramDefaultBoxBuilder> for InterfaceSubprogramDefaultBoxSyntax {
fn from(value: InterfaceSubprogramDefaultBoxBuilder) -> Self {
value.build()
}
}
pub struct InterfaceSubprogramDefaultNameBuilder {
name: NameSyntax,
}
impl InterfaceSubprogramDefaultNameBuilder {
pub fn new(name: impl Into<NameSyntax>) -> Self {
Self { name: name.into() }
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn build(self) -> InterfaceSubprogramDefaultNameSyntax {
RawNodeBuilder::new().push_node(self.name).finish()
}
}
impl From<InterfaceSubprogramDefaultNameBuilder> for InterfaceSubprogramDefaultNameSyntax {
fn from(value: InterfaceSubprogramDefaultNameBuilder) -> Self {
value.build()
}
}
pub struct LibraryClauseBuilder {
library_token: Token,
logical_name_list: LogicalNameListSyntax,
semi_colon_token: Token,
}
impl LibraryClauseBuilder {
pub fn new(logical_name_list: impl Into<LogicalNameListSyntax>) -> Self {
Self {
library_token: Kw::Library.canonical_token(),
logical_name_list: logical_name_list.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_library_token(mut self, t: impl Into<Token>) -> Self {
self.library_token = t.into();
self
}
pub fn with_library_token_trivia(mut self, trivia: Trivia) -> Self {
self.library_token.set_leading_trivia(trivia);
self
}
pub fn with_logical_name_list(mut self, n: impl Into<LogicalNameListSyntax>) -> Self {
self.logical_name_list = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> LibraryClauseSyntax {
RawNodeBuilder::new()
.push_token(self.library_token)
.push_node(self.logical_name_list)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<LibraryClauseBuilder> for LibraryClauseSyntax {
fn from(value: LibraryClauseBuilder) -> Self {
value.build()
}
}
pub struct LiteralExpressionBuilder {
literal: LiteralToken,
}
impl LiteralExpressionBuilder {
pub fn new(literal: impl Into<LiteralToken>) -> Self {
Self {
literal: literal.into(),
}
}
pub fn with_literal(mut self, n: impl Into<LiteralToken>) -> Self {
self.literal = n.into();
self
}
pub fn build(self) -> LiteralExpressionSyntax {
RawNodeBuilder::new().push_token(self.literal.0).finish()
}
}
impl From<LiteralExpressionBuilder> for LiteralExpressionSyntax {
fn from(value: LiteralExpressionBuilder) -> Self {
value.build()
}
}
pub struct LoopStatementBuilder {
loop_statement_preamble: LoopStatementPreambleSyntax,
sequence_of_statements: Option<SequenceOfStatementsSyntax>,
loop_statement_epilogue: LoopStatementEpilogueSyntax,
}
impl Default for LoopStatementBuilder {
fn default() -> Self {
Self::new()
}
}
impl LoopStatementBuilder {
pub fn new() -> Self {
Self {
loop_statement_preamble: LoopStatementPreambleBuilder::default().build(),
sequence_of_statements: None,
loop_statement_epilogue: LoopStatementEpilogueBuilder::default().build(),
}
}
pub fn with_loop_statement_preamble(
mut self,
n: impl Into<LoopStatementPreambleSyntax>,
) -> Self {
self.loop_statement_preamble = n.into();
self
}
pub fn with_sequence_of_statements(mut self, n: impl Into<SequenceOfStatementsSyntax>) -> Self {
self.sequence_of_statements = Some(n.into());
self
}
pub fn with_loop_statement_epilogue(
mut self,
n: impl Into<LoopStatementEpilogueSyntax>,
) -> Self {
self.loop_statement_epilogue = n.into();
self
}
pub fn build(self) -> LoopStatementSyntax {
RawNodeBuilder::new()
.push_node(self.loop_statement_preamble)
.push_opt_node(self.sequence_of_statements)
.push_node(self.loop_statement_epilogue)
.finish()
}
}
impl From<LoopStatementBuilder> for LoopStatementSyntax {
fn from(value: LoopStatementBuilder) -> Self {
value.build()
}
}
pub struct LoopStatementEpilogueBuilder {
end_token: Token,
loop_token: Token,
label: Option<Token>,
semi_colon_token: Token,
}
impl Default for LoopStatementEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl LoopStatementEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
loop_token: Kw::Loop.canonical_token(),
label: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_loop_token(mut self, t: impl Into<Token>) -> Self {
self.loop_token = t.into();
self
}
pub fn with_loop_token_trivia(mut self, trivia: Trivia) -> Self {
self.loop_token.set_leading_trivia(trivia);
self
}
pub fn with_label(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.label = Some(t.into().into());
self
}
pub fn with_label_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.label {
t.set_leading_trivia(trivia);
}
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> LoopStatementEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_token(self.loop_token)
.push_opt_token(self.label)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<LoopStatementEpilogueBuilder> for LoopStatementEpilogueSyntax {
fn from(value: LoopStatementEpilogueBuilder) -> Self {
value.build()
}
}
pub struct LoopStatementPreambleBuilder {
stmt_label: Option<StmtLabelSyntax>,
iteration_scheme: Option<IterationSchemeSyntax>,
loop_token: Token,
}
impl Default for LoopStatementPreambleBuilder {
fn default() -> Self {
Self::new()
}
}
impl LoopStatementPreambleBuilder {
pub fn new() -> Self {
Self {
stmt_label: None,
iteration_scheme: None,
loop_token: Kw::Loop.canonical_token(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_iteration_scheme(mut self, n: impl Into<IterationSchemeSyntax>) -> Self {
self.iteration_scheme = Some(n.into());
self
}
pub fn with_loop_token(mut self, t: impl Into<Token>) -> Self {
self.loop_token = t.into();
self
}
pub fn with_loop_token_trivia(mut self, trivia: Trivia) -> Self {
self.loop_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> LoopStatementPreambleSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_opt_node(self.iteration_scheme)
.push_token(self.loop_token)
.finish()
}
}
impl From<LoopStatementPreambleBuilder> for LoopStatementPreambleSyntax {
fn from(value: LoopStatementPreambleBuilder) -> Self {
value.build()
}
}
pub struct NameBuilder {
prefix: PrefixSyntax,
name_tails: Vec<NameTailSyntax>,
range_constraint: Option<RangeConstraintSyntax>,
}
impl NameBuilder {
pub fn new(prefix: impl Into<PrefixSyntax>) -> Self {
Self {
prefix: prefix.into(),
name_tails: Vec::new(),
range_constraint: None,
}
}
pub fn with_prefix(mut self, n: impl Into<PrefixSyntax>) -> Self {
self.prefix = n.into();
self
}
pub fn add_name_tails(mut self, n: impl Into<NameTailSyntax>) -> Self {
self.name_tails.push(n.into());
self
}
pub fn with_range_constraint(mut self, n: impl Into<RangeConstraintSyntax>) -> Self {
self.range_constraint = Some(n.into());
self
}
pub fn build(self) -> NameSyntax {
RawNodeBuilder::new()
.push_node(self.prefix)
.push_nodes(self.name_tails)
.push_opt_node(self.range_constraint)
.finish()
}
}
impl From<NameBuilder> for NameSyntax {
fn from(value: NameBuilder) -> Self {
value.build()
}
}
pub struct NameDesignatorPrefixBuilder {
name_designator: NameDesignatorToken,
}
impl NameDesignatorPrefixBuilder {
pub fn new(name_designator: impl Into<NameDesignatorToken>) -> Self {
Self {
name_designator: name_designator.into(),
}
}
pub fn with_name_designator(mut self, n: impl Into<NameDesignatorToken>) -> Self {
self.name_designator = n.into();
self
}
pub fn build(self) -> NameDesignatorPrefixSyntax {
RawNodeBuilder::new()
.push_token(self.name_designator.0)
.finish()
}
}
impl From<NameDesignatorPrefixBuilder> for NameDesignatorPrefixSyntax {
fn from(value: NameDesignatorPrefixBuilder) -> Self {
value.build()
}
}
pub struct NameExpressionBuilder {
name: NameSyntax,
}
impl NameExpressionBuilder {
pub fn new(name: impl Into<NameSyntax>) -> Self {
Self { name: name.into() }
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn build(self) -> NameExpressionSyntax {
RawNodeBuilder::new().push_node(self.name).finish()
}
}
impl From<NameExpressionBuilder> for NameExpressionSyntax {
fn from(value: NameExpressionBuilder) -> Self {
value.build()
}
}
pub struct NameResolutionIndicationBuilder {
name: NameSyntax,
}
impl NameResolutionIndicationBuilder {
pub fn new(name: impl Into<NameSyntax>) -> Self {
Self { name: name.into() }
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn build(self) -> NameResolutionIndicationSyntax {
RawNodeBuilder::new().push_node(self.name).finish()
}
}
impl From<NameResolutionIndicationBuilder> for NameResolutionIndicationSyntax {
fn from(value: NameResolutionIndicationBuilder) -> Self {
value.build()
}
}
pub struct NameTargetBuilder {
name: NameSyntax,
}
impl NameTargetBuilder {
pub fn new(name: impl Into<NameSyntax>) -> Self {
Self { name: name.into() }
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn build(self) -> NameTargetSyntax {
RawNodeBuilder::new().push_node(self.name).finish()
}
}
impl From<NameTargetBuilder> for NameTargetSyntax {
fn from(value: NameTargetBuilder) -> Self {
value.build()
}
}
pub struct NextStatementBuilder {
stmt_label: Option<StmtLabelSyntax>,
next_token: Token,
label: Option<Token>,
when_clause: Option<WhenClauseSyntax>,
semi_colon_token: Token,
}
impl Default for NextStatementBuilder {
fn default() -> Self {
Self::new()
}
}
impl NextStatementBuilder {
pub fn new() -> Self {
Self {
stmt_label: None,
next_token: Kw::Next.canonical_token(),
label: None,
when_clause: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_next_token(mut self, t: impl Into<Token>) -> Self {
self.next_token = t.into();
self
}
pub fn with_next_token_trivia(mut self, trivia: Trivia) -> Self {
self.next_token.set_leading_trivia(trivia);
self
}
pub fn with_label(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.label = Some(t.into().into());
self
}
pub fn with_label_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.label {
t.set_leading_trivia(trivia);
}
self
}
pub fn with_when_clause(mut self, n: impl Into<WhenClauseSyntax>) -> Self {
self.when_clause = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> NextStatementSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_token(self.next_token)
.push_opt_token(self.label)
.push_opt_node(self.when_clause)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<NextStatementBuilder> for NextStatementSyntax {
fn from(value: NextStatementBuilder) -> Self {
value.build()
}
}
pub struct NullStatementBuilder {
stmt_label: Option<StmtLabelSyntax>,
null_token: Token,
semi_colon_token: Token,
}
impl Default for NullStatementBuilder {
fn default() -> Self {
Self::new()
}
}
impl NullStatementBuilder {
pub fn new() -> Self {
Self {
stmt_label: None,
null_token: Kw::Null.canonical_token(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_null_token(mut self, t: impl Into<Token>) -> Self {
self.null_token = t.into();
self
}
pub fn with_null_token_trivia(mut self, trivia: Trivia) -> Self {
self.null_token.set_leading_trivia(trivia);
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> NullStatementSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_token(self.null_token)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<NullStatementBuilder> for NullStatementSyntax {
fn from(value: NullStatementBuilder) -> Self {
value.build()
}
}
pub struct NumericTypeDefinitionBuilder {
range_constraint: RangeConstraintSyntax,
}
impl NumericTypeDefinitionBuilder {
pub fn new(range_constraint: impl Into<RangeConstraintSyntax>) -> Self {
Self {
range_constraint: range_constraint.into(),
}
}
pub fn with_range_constraint(mut self, n: impl Into<RangeConstraintSyntax>) -> Self {
self.range_constraint = n.into();
self
}
pub fn build(self) -> NumericTypeDefinitionSyntax {
RawNodeBuilder::new()
.push_node(self.range_constraint)
.finish()
}
}
impl From<NumericTypeDefinitionBuilder> for NumericTypeDefinitionSyntax {
fn from(value: NumericTypeDefinitionBuilder) -> Self {
value.build()
}
}
pub struct OthersChoiceBuilder {
others_token: Token,
}
impl Default for OthersChoiceBuilder {
fn default() -> Self {
Self::new()
}
}
impl OthersChoiceBuilder {
pub fn new() -> Self {
Self {
others_token: Kw::Others.canonical_token(),
}
}
pub fn with_others_token(mut self, t: impl Into<Token>) -> Self {
self.others_token = t.into();
self
}
pub fn with_others_token_trivia(mut self, trivia: Trivia) -> Self {
self.others_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> OthersChoiceSyntax {
RawNodeBuilder::new().push_token(self.others_token).finish()
}
}
impl From<OthersChoiceBuilder> for OthersChoiceSyntax {
fn from(value: OthersChoiceBuilder) -> Self {
value.build()
}
}
pub struct PackageBodyBuilder {
package_body_preamble: PackageBodyPreambleSyntax,
package_body_declarative_part: Option<PackageBodyDeclarativePartSyntax>,
package_body_epilogue: PackageBodyEpilogueSyntax,
}
impl PackageBodyBuilder {
pub fn new(package_body_preamble: impl Into<PackageBodyPreambleSyntax>) -> Self {
Self {
package_body_preamble: package_body_preamble.into(),
package_body_declarative_part: None,
package_body_epilogue: PackageBodyEpilogueBuilder::default().build(),
}
}
pub fn with_package_body_preamble(mut self, n: impl Into<PackageBodyPreambleSyntax>) -> Self {
self.package_body_preamble = n.into();
self
}
pub fn with_package_body_declarative_part(
mut self,
n: impl Into<PackageBodyDeclarativePartSyntax>,
) -> Self {
self.package_body_declarative_part = Some(n.into());
self
}
pub fn with_package_body_epilogue(mut self, n: impl Into<PackageBodyEpilogueSyntax>) -> Self {
self.package_body_epilogue = n.into();
self
}
pub fn build(self) -> PackageBodySyntax {
RawNodeBuilder::new()
.push_node(self.package_body_preamble)
.push_opt_node(self.package_body_declarative_part)
.push_node(self.package_body_epilogue)
.finish()
}
}
impl From<PackageBodyBuilder> for PackageBodySyntax {
fn from(value: PackageBodyBuilder) -> Self {
value.build()
}
}
pub struct PackageBodyDeclarationBuilder {
package_body: PackageBodySyntax,
}
impl PackageBodyDeclarationBuilder {
pub fn new(package_body: impl Into<PackageBodySyntax>) -> Self {
Self {
package_body: package_body.into(),
}
}
pub fn with_package_body(mut self, n: impl Into<PackageBodySyntax>) -> Self {
self.package_body = n.into();
self
}
pub fn build(self) -> PackageBodyDeclarationSyntax {
RawNodeBuilder::new().push_node(self.package_body).finish()
}
}
impl From<PackageBodyDeclarationBuilder> for PackageBodyDeclarationSyntax {
fn from(value: PackageBodyDeclarationBuilder) -> Self {
value.build()
}
}
pub struct PackageBodyDeclarativePartBuilder {
package_body_declarative_items: Vec<PackageBodyDeclarativeItemSyntax>,
}
impl Default for PackageBodyDeclarativePartBuilder {
fn default() -> Self {
Self::new()
}
}
impl PackageBodyDeclarativePartBuilder {
pub fn new() -> Self {
Self {
package_body_declarative_items: Vec::new(),
}
}
pub fn add_package_body_declarative_items(
mut self,
n: impl Into<PackageBodyDeclarativeItemSyntax>,
) -> Self {
self.package_body_declarative_items.push(n.into());
self
}
pub fn build(self) -> PackageBodyDeclarativePartSyntax {
RawNodeBuilder::new()
.push_nodes(self.package_body_declarative_items)
.finish()
}
}
impl From<PackageBodyDeclarativePartBuilder> for PackageBodyDeclarativePartSyntax {
fn from(value: PackageBodyDeclarativePartBuilder) -> Self {
value.build()
}
}
pub struct PackageBodyEpilogueBuilder {
end_token: Token,
end_package_body: Option<EndPackageBodySyntax>,
simple_name: Option<Token>,
semi_colon_token: Token,
}
impl Default for PackageBodyEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl PackageBodyEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
end_package_body: None,
simple_name: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_end_package_body(mut self, n: impl Into<EndPackageBodySyntax>) -> Self {
self.end_package_body = Some(n.into());
self
}
pub fn with_simple_name(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.simple_name = Some(t.into().into());
self
}
pub fn with_simple_name_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.simple_name {
t.set_leading_trivia(trivia);
}
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> PackageBodyEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_opt_node(self.end_package_body)
.push_opt_token(self.simple_name)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<PackageBodyEpilogueBuilder> for PackageBodyEpilogueSyntax {
fn from(value: PackageBodyEpilogueBuilder) -> Self {
value.build()
}
}
pub struct PackageBodyPreambleBuilder {
package_token: Token,
body_token: Token,
simple_name: Token,
is_token: Token,
}
impl PackageBodyPreambleBuilder {
pub fn new(simple_name: impl Into<crate::builder::Identifier>) -> Self {
Self {
package_token: Kw::Package.canonical_token(),
body_token: Kw::Body.canonical_token(),
simple_name: simple_name.into().into(),
is_token: Kw::Is.canonical_token(),
}
}
pub fn with_package_token(mut self, t: impl Into<Token>) -> Self {
self.package_token = t.into();
self
}
pub fn with_package_token_trivia(mut self, trivia: Trivia) -> Self {
self.package_token.set_leading_trivia(trivia);
self
}
pub fn with_body_token(mut self, t: impl Into<Token>) -> Self {
self.body_token = t.into();
self
}
pub fn with_body_token_trivia(mut self, trivia: Trivia) -> Self {
self.body_token.set_leading_trivia(trivia);
self
}
pub fn with_simple_name(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.simple_name = t.into().into();
self
}
pub fn with_simple_name_trivia(mut self, trivia: Trivia) -> Self {
self.simple_name.set_leading_trivia(trivia);
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> PackageBodyPreambleSyntax {
RawNodeBuilder::new()
.push_token(self.package_token)
.push_token(self.body_token)
.push_token(self.simple_name)
.push_token(self.is_token)
.finish()
}
}
impl From<PackageBodyPreambleBuilder> for PackageBodyPreambleSyntax {
fn from(value: PackageBodyPreambleBuilder) -> Self {
value.build()
}
}
pub struct PackageDeclarationBuilder {
package_preamble: PackagePreambleSyntax,
package_header: Option<PackageHeaderSyntax>,
package_declarative_part: Option<PackageDeclarativePartSyntax>,
package_epilogue: PackageEpilogueSyntax,
}
impl PackageDeclarationBuilder {
pub fn new(package_preamble: impl Into<PackagePreambleSyntax>) -> Self {
Self {
package_preamble: package_preamble.into(),
package_header: None,
package_declarative_part: None,
package_epilogue: PackageEpilogueBuilder::default().build(),
}
}
pub fn with_package_preamble(mut self, n: impl Into<PackagePreambleSyntax>) -> Self {
self.package_preamble = n.into();
self
}
pub fn with_package_header(mut self, n: impl Into<PackageHeaderSyntax>) -> Self {
self.package_header = Some(n.into());
self
}
pub fn with_package_declarative_part(
mut self,
n: impl Into<PackageDeclarativePartSyntax>,
) -> Self {
self.package_declarative_part = Some(n.into());
self
}
pub fn with_package_epilogue(mut self, n: impl Into<PackageEpilogueSyntax>) -> Self {
self.package_epilogue = n.into();
self
}
pub fn build(self) -> PackageDeclarationSyntax {
RawNodeBuilder::new()
.push_node(self.package_preamble)
.push_opt_node(self.package_header)
.push_opt_node(self.package_declarative_part)
.push_node(self.package_epilogue)
.finish()
}
}
impl From<PackageDeclarationBuilder> for PackageDeclarationSyntax {
fn from(value: PackageDeclarationBuilder) -> Self {
value.build()
}
}
pub struct PackageDeclarationItemBuilder {
package_declaration: PackageDeclarationSyntax,
}
impl PackageDeclarationItemBuilder {
pub fn new(package_declaration: impl Into<PackageDeclarationSyntax>) -> Self {
Self {
package_declaration: package_declaration.into(),
}
}
pub fn with_package_declaration(mut self, n: impl Into<PackageDeclarationSyntax>) -> Self {
self.package_declaration = n.into();
self
}
pub fn build(self) -> PackageDeclarationItemSyntax {
RawNodeBuilder::new()
.push_node(self.package_declaration)
.finish()
}
}
impl From<PackageDeclarationItemBuilder> for PackageDeclarationItemSyntax {
fn from(value: PackageDeclarationItemBuilder) -> Self {
value.build()
}
}
pub struct PackageDeclarativePartBuilder {
package_declarative_items: Vec<PackageDeclarativeItemSyntax>,
}
impl Default for PackageDeclarativePartBuilder {
fn default() -> Self {
Self::new()
}
}
impl PackageDeclarativePartBuilder {
pub fn new() -> Self {
Self {
package_declarative_items: Vec::new(),
}
}
pub fn add_package_declarative_items(
mut self,
n: impl Into<PackageDeclarativeItemSyntax>,
) -> Self {
self.package_declarative_items.push(n.into());
self
}
pub fn build(self) -> PackageDeclarativePartSyntax {
RawNodeBuilder::new()
.push_nodes(self.package_declarative_items)
.finish()
}
}
impl From<PackageDeclarativePartBuilder> for PackageDeclarativePartSyntax {
fn from(value: PackageDeclarativePartBuilder) -> Self {
value.build()
}
}
pub struct PackageEpilogueBuilder {
end_token: Token,
package_token: Option<Token>,
simple_name: Option<Token>,
semi_colon_token: Token,
}
impl Default for PackageEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl PackageEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
package_token: None,
simple_name: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_package_token(mut self, t: impl Into<Token>) -> Self {
self.package_token = Some(t.into());
self
}
pub fn with_package_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.package_token
.get_or_insert_with(|| Kw::Package.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_simple_name(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.simple_name = Some(t.into().into());
self
}
pub fn with_simple_name_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.simple_name {
t.set_leading_trivia(trivia);
}
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> PackageEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_opt_token(self.package_token)
.push_opt_token(self.simple_name)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<PackageEpilogueBuilder> for PackageEpilogueSyntax {
fn from(value: PackageEpilogueBuilder) -> Self {
value.build()
}
}
pub struct PackageHeaderBuilder {
generic_clause: GenericClauseSyntax,
generic_map: Option<GenericMapSyntax>,
}
impl PackageHeaderBuilder {
pub fn new(generic_clause: impl Into<GenericClauseSyntax>) -> Self {
Self {
generic_clause: generic_clause.into(),
generic_map: None,
}
}
pub fn with_generic_clause(mut self, n: impl Into<GenericClauseSyntax>) -> Self {
self.generic_clause = n.into();
self
}
pub fn with_generic_map(mut self, n: impl Into<GenericMapSyntax>) -> Self {
self.generic_map = Some(n.into());
self
}
pub fn build(self) -> PackageHeaderSyntax {
RawNodeBuilder::new()
.push_node(self.generic_clause)
.push_opt_node(self.generic_map)
.finish()
}
}
impl From<PackageHeaderBuilder> for PackageHeaderSyntax {
fn from(value: PackageHeaderBuilder) -> Self {
value.build()
}
}
pub struct PackageInstantiationDeclarationBuilder {
package_instantiation_preamble: PackageInstantiationPreambleSyntax,
generic_map_aspect: Option<GenericMapAspectSyntax>,
semi_colon_token: Token,
}
impl PackageInstantiationDeclarationBuilder {
pub fn new(
package_instantiation_preamble: impl Into<PackageInstantiationPreambleSyntax>,
) -> Self {
Self {
package_instantiation_preamble: package_instantiation_preamble.into(),
generic_map_aspect: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_package_instantiation_preamble(
mut self,
n: impl Into<PackageInstantiationPreambleSyntax>,
) -> Self {
self.package_instantiation_preamble = n.into();
self
}
pub fn with_generic_map_aspect(mut self, n: impl Into<GenericMapAspectSyntax>) -> Self {
self.generic_map_aspect = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> PackageInstantiationDeclarationSyntax {
RawNodeBuilder::new()
.push_node(self.package_instantiation_preamble)
.push_opt_node(self.generic_map_aspect)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<PackageInstantiationDeclarationBuilder> for PackageInstantiationDeclarationSyntax {
fn from(value: PackageInstantiationDeclarationBuilder) -> Self {
value.build()
}
}
pub struct PackageInstantiationDeclarationItemBuilder {
package_instantiation_declaration: PackageInstantiationDeclarationSyntax,
}
impl PackageInstantiationDeclarationItemBuilder {
pub fn new(
package_instantiation_declaration: impl Into<PackageInstantiationDeclarationSyntax>,
) -> Self {
Self {
package_instantiation_declaration: package_instantiation_declaration.into(),
}
}
pub fn with_package_instantiation_declaration(
mut self,
n: impl Into<PackageInstantiationDeclarationSyntax>,
) -> Self {
self.package_instantiation_declaration = n.into();
self
}
pub fn build(self) -> PackageInstantiationDeclarationItemSyntax {
RawNodeBuilder::new()
.push_node(self.package_instantiation_declaration)
.finish()
}
}
impl From<PackageInstantiationDeclarationItemBuilder>
for PackageInstantiationDeclarationItemSyntax
{
fn from(value: PackageInstantiationDeclarationItemBuilder) -> Self {
value.build()
}
}
pub struct PackageInstantiationDeclarationPrimaryUnitBuilder {
package_instantiation_declaration: PackageInstantiationDeclarationSyntax,
}
impl PackageInstantiationDeclarationPrimaryUnitBuilder {
pub fn new(
package_instantiation_declaration: impl Into<PackageInstantiationDeclarationSyntax>,
) -> Self {
Self {
package_instantiation_declaration: package_instantiation_declaration.into(),
}
}
pub fn with_package_instantiation_declaration(
mut self,
n: impl Into<PackageInstantiationDeclarationSyntax>,
) -> Self {
self.package_instantiation_declaration = n.into();
self
}
pub fn build(self) -> PackageInstantiationDeclarationPrimaryUnitSyntax {
RawNodeBuilder::new()
.push_node(self.package_instantiation_declaration)
.finish()
}
}
impl From<PackageInstantiationDeclarationPrimaryUnitBuilder>
for PackageInstantiationDeclarationPrimaryUnitSyntax
{
fn from(value: PackageInstantiationDeclarationPrimaryUnitBuilder) -> Self {
value.build()
}
}
pub struct PackageInstantiationPreambleBuilder {
package_token: Token,
identifier_token: Token,
is_token: Token,
new_token: Token,
name: NameSyntax,
}
impl PackageInstantiationPreambleBuilder {
pub fn new(
identifier_token: impl Into<crate::builder::Identifier>,
name: impl Into<NameSyntax>,
) -> Self {
Self {
package_token: Kw::Package.canonical_token(),
identifier_token: identifier_token.into().into(),
is_token: Kw::Is.canonical_token(),
new_token: Kw::New.canonical_token(),
name: name.into(),
}
}
pub fn with_package_token(mut self, t: impl Into<Token>) -> Self {
self.package_token = t.into();
self
}
pub fn with_package_token_trivia(mut self, trivia: Trivia) -> Self {
self.package_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn with_new_token(mut self, t: impl Into<Token>) -> Self {
self.new_token = t.into();
self
}
pub fn with_new_token_trivia(mut self, trivia: Trivia) -> Self {
self.new_token.set_leading_trivia(trivia);
self
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn build(self) -> PackageInstantiationPreambleSyntax {
RawNodeBuilder::new()
.push_token(self.package_token)
.push_token(self.identifier_token)
.push_token(self.is_token)
.push_token(self.new_token)
.push_node(self.name)
.finish()
}
}
impl From<PackageInstantiationPreambleBuilder> for PackageInstantiationPreambleSyntax {
fn from(value: PackageInstantiationPreambleBuilder) -> Self {
value.build()
}
}
pub struct PackagePathnameBuilder {
comm_at_token: Token,
package_path: PackagePathSyntax,
}
impl PackagePathnameBuilder {
pub fn new(package_path: impl Into<PackagePathSyntax>) -> Self {
Self {
comm_at_token: TokenKind::CommAt.canonical_token().unwrap(),
package_path: package_path.into(),
}
}
pub fn with_comm_at_token(mut self, t: impl Into<Token>) -> Self {
self.comm_at_token = t.into();
self
}
pub fn with_comm_at_token_trivia(mut self, trivia: Trivia) -> Self {
self.comm_at_token.set_leading_trivia(trivia);
self
}
pub fn with_package_path(mut self, n: impl Into<PackagePathSyntax>) -> Self {
self.package_path = n.into();
self
}
pub fn build(self) -> PackagePathnameSyntax {
RawNodeBuilder::new()
.push_token(self.comm_at_token)
.push_node(self.package_path)
.finish()
}
}
impl From<PackagePathnameBuilder> for PackagePathnameSyntax {
fn from(value: PackagePathnameBuilder) -> Self {
value.build()
}
}
pub struct PackagePreambleBuilder {
package_token: Token,
identifier_token: Token,
is_token: Token,
}
impl PackagePreambleBuilder {
pub fn new(identifier_token: impl Into<crate::builder::Identifier>) -> Self {
Self {
package_token: Kw::Package.canonical_token(),
identifier_token: identifier_token.into().into(),
is_token: Kw::Is.canonical_token(),
}
}
pub fn with_package_token(mut self, t: impl Into<Token>) -> Self {
self.package_token = t.into();
self
}
pub fn with_package_token_trivia(mut self, trivia: Trivia) -> Self {
self.package_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> PackagePreambleSyntax {
RawNodeBuilder::new()
.push_token(self.package_token)
.push_token(self.identifier_token)
.push_token(self.is_token)
.finish()
}
}
impl From<PackagePreambleBuilder> for PackagePreambleSyntax {
fn from(value: PackagePreambleBuilder) -> Self {
value.build()
}
}
pub struct ParameterListBuilder {
parameter_token: Option<Token>,
parenthesized_interface_list: ParenthesizedInterfaceListSyntax,
}
impl ParameterListBuilder {
pub fn new(parenthesized_interface_list: impl Into<ParenthesizedInterfaceListSyntax>) -> Self {
Self {
parameter_token: None,
parenthesized_interface_list: parenthesized_interface_list.into(),
}
}
pub fn with_parameter_token(mut self, t: impl Into<Token>) -> Self {
self.parameter_token = Some(t.into());
self
}
pub fn with_parameter_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.parameter_token
.get_or_insert_with(|| Kw::Parameter.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_parenthesized_interface_list(
mut self,
n: impl Into<ParenthesizedInterfaceListSyntax>,
) -> Self {
self.parenthesized_interface_list = n.into();
self
}
pub fn build(self) -> ParameterListSyntax {
RawNodeBuilder::new()
.push_opt_token(self.parameter_token)
.push_node(self.parenthesized_interface_list)
.finish()
}
}
impl From<ParameterListBuilder> for ParameterListSyntax {
fn from(value: ParameterListBuilder) -> Self {
value.build()
}
}
pub struct ParameterSpecificationBuilder {
identifier_token: Token,
in_token: Token,
expression: ExpressionSyntax,
}
impl ParameterSpecificationBuilder {
pub fn new(
identifier_token: impl Into<crate::builder::Identifier>,
expression: impl Into<ExpressionSyntax>,
) -> Self {
Self {
identifier_token: identifier_token.into().into(),
in_token: Kw::In.canonical_token(),
expression: expression.into(),
}
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_in_token(mut self, t: impl Into<Token>) -> Self {
self.in_token = t.into();
self
}
pub fn with_in_token_trivia(mut self, trivia: Trivia) -> Self {
self.in_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn build(self) -> ParameterSpecificationSyntax {
RawNodeBuilder::new()
.push_token(self.identifier_token)
.push_token(self.in_token)
.push_node(self.expression)
.finish()
}
}
impl From<ParameterSpecificationBuilder> for ParameterSpecificationSyntax {
fn from(value: ParameterSpecificationBuilder) -> Self {
value.build()
}
}
pub struct ParenthesizedConditionBuilder {
left_par_token: Token,
condition: ExpressionSyntax,
right_par_token: Token,
}
impl ParenthesizedConditionBuilder {
pub fn new(condition: impl Into<ExpressionSyntax>) -> Self {
Self {
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
condition: condition.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
}
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_condition(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.condition = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ParenthesizedConditionSyntax {
RawNodeBuilder::new()
.push_token(self.left_par_token)
.push_node(self.condition)
.push_token(self.right_par_token)
.finish()
}
}
impl From<ParenthesizedConditionBuilder> for ParenthesizedConditionSyntax {
fn from(value: ParenthesizedConditionBuilder) -> Self {
value.build()
}
}
pub struct ParenthesizedElementResolutionBuilder {
left_par_token: Token,
element_resolution_resolution_indication: ElementResolutionResolutionIndicationSyntax,
right_par_token: Token,
}
impl ParenthesizedElementResolutionBuilder {
pub fn new(
element_resolution_resolution_indication: impl Into<ElementResolutionResolutionIndicationSyntax>,
) -> Self {
Self {
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
element_resolution_resolution_indication: element_resolution_resolution_indication
.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
}
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_element_resolution_resolution_indication(
mut self,
n: impl Into<ElementResolutionResolutionIndicationSyntax>,
) -> Self {
self.element_resolution_resolution_indication = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ParenthesizedElementResolutionSyntax {
RawNodeBuilder::new()
.push_token(self.left_par_token)
.push_node(self.element_resolution_resolution_indication)
.push_token(self.right_par_token)
.finish()
}
}
impl From<ParenthesizedElementResolutionBuilder> for ParenthesizedElementResolutionSyntax {
fn from(value: ParenthesizedElementResolutionBuilder) -> Self {
value.build()
}
}
pub struct ParenthesizedExpressionBuilder {
left_par_token: Token,
expression: ExpressionSyntax,
right_par_token: Token,
}
impl ParenthesizedExpressionBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
expression: expression.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
}
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ParenthesizedExpressionSyntax {
RawNodeBuilder::new()
.push_token(self.left_par_token)
.push_node(self.expression)
.push_token(self.right_par_token)
.finish()
}
}
impl From<ParenthesizedExpressionBuilder> for ParenthesizedExpressionSyntax {
fn from(value: ParenthesizedExpressionBuilder) -> Self {
value.build()
}
}
pub struct ParenthesizedExpressionOrAggregateBuilder {
left_par_token: Token,
element_association_list: ElementAssociationListSyntax,
right_par_token: Token,
}
impl ParenthesizedExpressionOrAggregateBuilder {
pub fn new(element_association_list: impl Into<ElementAssociationListSyntax>) -> Self {
Self {
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
element_association_list: element_association_list.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
}
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_element_association_list(
mut self,
n: impl Into<ElementAssociationListSyntax>,
) -> Self {
self.element_association_list = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ParenthesizedExpressionOrAggregateSyntax {
RawNodeBuilder::new()
.push_token(self.left_par_token)
.push_node(self.element_association_list)
.push_token(self.right_par_token)
.finish()
}
}
impl From<ParenthesizedExpressionOrAggregateBuilder> for ParenthesizedExpressionOrAggregateSyntax {
fn from(value: ParenthesizedExpressionOrAggregateBuilder) -> Self {
value.build()
}
}
pub struct ParenthesizedInterfaceListBuilder {
left_par_token: Token,
formal_parameter_list: InterfaceListSyntax,
right_par_token: Token,
}
impl ParenthesizedInterfaceListBuilder {
pub fn new(formal_parameter_list: impl Into<InterfaceListSyntax>) -> Self {
Self {
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
formal_parameter_list: formal_parameter_list.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
}
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_formal_parameter_list(mut self, n: impl Into<InterfaceListSyntax>) -> Self {
self.formal_parameter_list = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ParenthesizedInterfaceListSyntax {
RawNodeBuilder::new()
.push_token(self.left_par_token)
.push_node(self.formal_parameter_list)
.push_token(self.right_par_token)
.finish()
}
}
impl From<ParenthesizedInterfaceListBuilder> for ParenthesizedInterfaceListSyntax {
fn from(value: ParenthesizedInterfaceListBuilder) -> Self {
value.build()
}
}
pub struct ParenthesizedNameBuilder {
left_par_token: Token,
association_list: AssociationListSyntax,
right_par_token: Token,
}
impl ParenthesizedNameBuilder {
pub fn new(association_list: impl Into<AssociationListSyntax>) -> Self {
Self {
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
association_list: association_list.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
}
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_association_list(mut self, n: impl Into<AssociationListSyntax>) -> Self {
self.association_list = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ParenthesizedNameSyntax {
RawNodeBuilder::new()
.push_token(self.left_par_token)
.push_node(self.association_list)
.push_token(self.right_par_token)
.finish()
}
}
impl From<ParenthesizedNameBuilder> for ParenthesizedNameSyntax {
fn from(value: ParenthesizedNameBuilder) -> Self {
value.build()
}
}
pub struct ParenthesizedProcessSensitivityListBuilder {
left_par_token: Token,
process_sensitivity_list: ProcessSensitivityListSyntax,
right_par_token: Token,
}
impl ParenthesizedProcessSensitivityListBuilder {
pub fn new(process_sensitivity_list: impl Into<ProcessSensitivityListSyntax>) -> Self {
Self {
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
process_sensitivity_list: process_sensitivity_list.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
}
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_process_sensitivity_list(
mut self,
n: impl Into<ProcessSensitivityListSyntax>,
) -> Self {
self.process_sensitivity_list = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ParenthesizedProcessSensitivityListSyntax {
RawNodeBuilder::new()
.push_token(self.left_par_token)
.push_node(self.process_sensitivity_list)
.push_token(self.right_par_token)
.finish()
}
}
impl From<ParenthesizedProcessSensitivityListBuilder>
for ParenthesizedProcessSensitivityListSyntax
{
fn from(value: ParenthesizedProcessSensitivityListBuilder) -> Self {
value.build()
}
}
pub struct PathnameElementBuilder {
identifier_token: Token,
parenthesized_expression: Option<ParenthesizedExpressionSyntax>,
}
impl PathnameElementBuilder {
pub fn new(identifier_token: impl Into<crate::builder::Identifier>) -> Self {
Self {
identifier_token: identifier_token.into().into(),
parenthesized_expression: None,
}
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_parenthesized_expression(
mut self,
n: impl Into<ParenthesizedExpressionSyntax>,
) -> Self {
self.parenthesized_expression = Some(n.into());
self
}
pub fn build(self) -> PathnameElementSyntax {
RawNodeBuilder::new()
.push_token(self.identifier_token)
.push_opt_node(self.parenthesized_expression)
.finish()
}
}
impl From<PathnameElementBuilder> for PathnameElementSyntax {
fn from(value: PathnameElementBuilder) -> Self {
value.build()
}
}
pub struct PhysicalLiteralBuilder {
abstract_literal_token: Option<Token>,
name: NameSyntax,
}
impl PhysicalLiteralBuilder {
pub fn new(name: impl Into<NameSyntax>) -> Self {
Self {
abstract_literal_token: None,
name: name.into(),
}
}
pub fn with_abstract_literal_token(
mut self,
t: impl Into<crate::builder::AbstractLiteral>,
) -> Self {
self.abstract_literal_token = Some(t.into().into());
self
}
pub fn with_abstract_literal_token_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.abstract_literal_token {
t.set_leading_trivia(trivia);
}
self
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn build(self) -> PhysicalLiteralSyntax {
RawNodeBuilder::new()
.push_opt_token(self.abstract_literal_token)
.push_node(self.name)
.finish()
}
}
impl From<PhysicalLiteralBuilder> for PhysicalLiteralSyntax {
fn from(value: PhysicalLiteralBuilder) -> Self {
value.build()
}
}
pub struct PhysicalLiteralExpressionBuilder {
physical_literal: PhysicalLiteralSyntax,
}
impl PhysicalLiteralExpressionBuilder {
pub fn new(physical_literal: impl Into<PhysicalLiteralSyntax>) -> Self {
Self {
physical_literal: physical_literal.into(),
}
}
pub fn with_physical_literal(mut self, n: impl Into<PhysicalLiteralSyntax>) -> Self {
self.physical_literal = n.into();
self
}
pub fn build(self) -> PhysicalLiteralExpressionSyntax {
RawNodeBuilder::new()
.push_node(self.physical_literal)
.finish()
}
}
impl From<PhysicalLiteralExpressionBuilder> for PhysicalLiteralExpressionSyntax {
fn from(value: PhysicalLiteralExpressionBuilder) -> Self {
value.build()
}
}
pub struct PhysicalTypeDefinitionBuilder {
range_constraint: RangeConstraintSyntax,
unit_declarations: UnitDeclarationsSyntax,
physical_type_definition_epilogue: PhysicalTypeDefinitionEpilogueSyntax,
}
impl PhysicalTypeDefinitionBuilder {
pub fn new(
range_constraint: impl Into<RangeConstraintSyntax>,
unit_declarations: impl Into<UnitDeclarationsSyntax>,
) -> Self {
Self {
range_constraint: range_constraint.into(),
unit_declarations: unit_declarations.into(),
physical_type_definition_epilogue: PhysicalTypeDefinitionEpilogueBuilder::default()
.build(),
}
}
pub fn with_range_constraint(mut self, n: impl Into<RangeConstraintSyntax>) -> Self {
self.range_constraint = n.into();
self
}
pub fn with_unit_declarations(mut self, n: impl Into<UnitDeclarationsSyntax>) -> Self {
self.unit_declarations = n.into();
self
}
pub fn with_physical_type_definition_epilogue(
mut self,
n: impl Into<PhysicalTypeDefinitionEpilogueSyntax>,
) -> Self {
self.physical_type_definition_epilogue = n.into();
self
}
pub fn build(self) -> PhysicalTypeDefinitionSyntax {
RawNodeBuilder::new()
.push_node(self.range_constraint)
.push_node(self.unit_declarations)
.push_node(self.physical_type_definition_epilogue)
.finish()
}
}
impl From<PhysicalTypeDefinitionBuilder> for PhysicalTypeDefinitionSyntax {
fn from(value: PhysicalTypeDefinitionBuilder) -> Self {
value.build()
}
}
pub struct PhysicalTypeDefinitionEpilogueBuilder {
end_token: Token,
units_token: Token,
simple_name: Option<Token>,
}
impl Default for PhysicalTypeDefinitionEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl PhysicalTypeDefinitionEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
units_token: Kw::Units.canonical_token(),
simple_name: None,
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_units_token(mut self, t: impl Into<Token>) -> Self {
self.units_token = t.into();
self
}
pub fn with_units_token_trivia(mut self, trivia: Trivia) -> Self {
self.units_token.set_leading_trivia(trivia);
self
}
pub fn with_simple_name(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.simple_name = Some(t.into().into());
self
}
pub fn with_simple_name_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.simple_name {
t.set_leading_trivia(trivia);
}
self
}
pub fn build(self) -> PhysicalTypeDefinitionEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_token(self.units_token)
.push_opt_token(self.simple_name)
.finish()
}
}
impl From<PhysicalTypeDefinitionEpilogueBuilder> for PhysicalTypeDefinitionEpilogueSyntax {
fn from(value: PhysicalTypeDefinitionEpilogueBuilder) -> Self {
value.build()
}
}
pub struct PortClauseBuilder {
port_token: Token,
left_par_token: Token,
port_list: InterfaceListSyntax,
right_par_token: Token,
semi_colon_token: Token,
}
impl PortClauseBuilder {
pub fn new(port_list: impl Into<InterfaceListSyntax>) -> Self {
Self {
port_token: Kw::Port.canonical_token(),
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
port_list: port_list.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_port_token(mut self, t: impl Into<Token>) -> Self {
self.port_token = t.into();
self
}
pub fn with_port_token_trivia(mut self, trivia: Trivia) -> Self {
self.port_token.set_leading_trivia(trivia);
self
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_port_list(mut self, n: impl Into<InterfaceListSyntax>) -> Self {
self.port_list = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> PortClauseSyntax {
RawNodeBuilder::new()
.push_token(self.port_token)
.push_token(self.left_par_token)
.push_node(self.port_list)
.push_token(self.right_par_token)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<PortClauseBuilder> for PortClauseSyntax {
fn from(value: PortClauseBuilder) -> Self {
value.build()
}
}
pub struct PortMapBuilder {
port_map_aspect: PortMapAspectSyntax,
semi_colon_token: Token,
}
impl PortMapBuilder {
pub fn new(port_map_aspect: impl Into<PortMapAspectSyntax>) -> Self {
Self {
port_map_aspect: port_map_aspect.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_port_map_aspect(mut self, n: impl Into<PortMapAspectSyntax>) -> Self {
self.port_map_aspect = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> PortMapSyntax {
RawNodeBuilder::new()
.push_node(self.port_map_aspect)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<PortMapBuilder> for PortMapSyntax {
fn from(value: PortMapBuilder) -> Self {
value.build()
}
}
pub struct PortMapAspectBuilder {
port_token: Token,
map_token: Token,
left_par_token: Token,
association_list: AssociationListSyntax,
right_par_token: Token,
}
impl PortMapAspectBuilder {
pub fn new(association_list: impl Into<AssociationListSyntax>) -> Self {
Self {
port_token: Kw::Port.canonical_token(),
map_token: Kw::Map.canonical_token(),
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
association_list: association_list.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
}
}
pub fn with_port_token(mut self, t: impl Into<Token>) -> Self {
self.port_token = t.into();
self
}
pub fn with_port_token_trivia(mut self, trivia: Trivia) -> Self {
self.port_token.set_leading_trivia(trivia);
self
}
pub fn with_map_token(mut self, t: impl Into<Token>) -> Self {
self.map_token = t.into();
self
}
pub fn with_map_token_trivia(mut self, trivia: Trivia) -> Self {
self.map_token.set_leading_trivia(trivia);
self
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_association_list(mut self, n: impl Into<AssociationListSyntax>) -> Self {
self.association_list = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> PortMapAspectSyntax {
RawNodeBuilder::new()
.push_token(self.port_token)
.push_token(self.map_token)
.push_token(self.left_par_token)
.push_node(self.association_list)
.push_token(self.right_par_token)
.finish()
}
}
impl From<PortMapAspectBuilder> for PortMapAspectSyntax {
fn from(value: PortMapAspectBuilder) -> Self {
value.build()
}
}
pub struct PortPartBuilder {
port_clause: PortClauseSyntax,
port_map: Option<PortMapSyntax>,
}
impl PortPartBuilder {
pub fn new(port_clause: impl Into<PortClauseSyntax>) -> Self {
Self {
port_clause: port_clause.into(),
port_map: None,
}
}
pub fn with_port_clause(mut self, n: impl Into<PortClauseSyntax>) -> Self {
self.port_clause = n.into();
self
}
pub fn with_port_map(mut self, n: impl Into<PortMapSyntax>) -> Self {
self.port_map = Some(n.into());
self
}
pub fn build(self) -> PortPartSyntax {
RawNodeBuilder::new()
.push_node(self.port_clause)
.push_opt_node(self.port_map)
.finish()
}
}
impl From<PortPartBuilder> for PortPartSyntax {
fn from(value: PortPartBuilder) -> Self {
value.build()
}
}
pub struct PrimaryUnitDeclarationBuilder {
identifier_token: Token,
semi_colon_token: Token,
}
impl PrimaryUnitDeclarationBuilder {
pub fn new(identifier_token: impl Into<crate::builder::Identifier>) -> Self {
Self {
identifier_token: identifier_token.into().into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> PrimaryUnitDeclarationSyntax {
RawNodeBuilder::new()
.push_token(self.identifier_token)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<PrimaryUnitDeclarationBuilder> for PrimaryUnitDeclarationSyntax {
fn from(value: PrimaryUnitDeclarationBuilder) -> Self {
value.build()
}
}
pub struct PrimaryUnitPackageDeclarationBuilder {
package_declaration: PackageDeclarationSyntax,
}
impl PrimaryUnitPackageDeclarationBuilder {
pub fn new(package_declaration: impl Into<PackageDeclarationSyntax>) -> Self {
Self {
package_declaration: package_declaration.into(),
}
}
pub fn with_package_declaration(mut self, n: impl Into<PackageDeclarationSyntax>) -> Self {
self.package_declaration = n.into();
self
}
pub fn build(self) -> PrimaryUnitPackageDeclarationSyntax {
RawNodeBuilder::new()
.push_node(self.package_declaration)
.finish()
}
}
impl From<PrimaryUnitPackageDeclarationBuilder> for PrimaryUnitPackageDeclarationSyntax {
fn from(value: PrimaryUnitPackageDeclarationBuilder) -> Self {
value.build()
}
}
pub struct ProcedureCallStatementBuilder {
stmt_label: Option<StmtLabelSyntax>,
procedure_call: NameSyntax,
semi_colon_token: Token,
}
impl ProcedureCallStatementBuilder {
pub fn new(procedure_call: impl Into<NameSyntax>) -> Self {
Self {
stmt_label: None,
procedure_call: procedure_call.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_procedure_call(mut self, n: impl Into<NameSyntax>) -> Self {
self.procedure_call = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ProcedureCallStatementSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_node(self.procedure_call)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ProcedureCallStatementBuilder> for ProcedureCallStatementSyntax {
fn from(value: ProcedureCallStatementBuilder) -> Self {
value.build()
}
}
pub struct ProcedureSpecificationBuilder {
procedure_token: Token,
designator: DesignatorToken,
subprogram_header: Option<SubprogramHeaderSyntax>,
parameter_list: Option<ParameterListSyntax>,
}
impl ProcedureSpecificationBuilder {
pub fn new(designator: impl Into<DesignatorToken>) -> Self {
Self {
procedure_token: Kw::Procedure.canonical_token(),
designator: designator.into(),
subprogram_header: None,
parameter_list: None,
}
}
pub fn with_procedure_token(mut self, t: impl Into<Token>) -> Self {
self.procedure_token = t.into();
self
}
pub fn with_procedure_token_trivia(mut self, trivia: Trivia) -> Self {
self.procedure_token.set_leading_trivia(trivia);
self
}
pub fn with_designator(mut self, n: impl Into<DesignatorToken>) -> Self {
self.designator = n.into();
self
}
pub fn with_subprogram_header(mut self, n: impl Into<SubprogramHeaderSyntax>) -> Self {
self.subprogram_header = Some(n.into());
self
}
pub fn with_parameter_list(mut self, n: impl Into<ParameterListSyntax>) -> Self {
self.parameter_list = Some(n.into());
self
}
pub fn build(self) -> ProcedureSpecificationSyntax {
RawNodeBuilder::new()
.push_token(self.procedure_token)
.push_token(self.designator.0)
.push_opt_node(self.subprogram_header)
.push_opt_node(self.parameter_list)
.finish()
}
}
impl From<ProcedureSpecificationBuilder> for ProcedureSpecificationSyntax {
fn from(value: ProcedureSpecificationBuilder) -> Self {
value.build()
}
}
pub struct ProcessDeclarativePartBuilder {
process_declarative_items: Vec<ProcessDeclarativeItemSyntax>,
}
impl Default for ProcessDeclarativePartBuilder {
fn default() -> Self {
Self::new()
}
}
impl ProcessDeclarativePartBuilder {
pub fn new() -> Self {
Self {
process_declarative_items: Vec::new(),
}
}
pub fn add_process_declarative_items(
mut self,
n: impl Into<ProcessDeclarativeItemSyntax>,
) -> Self {
self.process_declarative_items.push(n.into());
self
}
pub fn build(self) -> ProcessDeclarativePartSyntax {
RawNodeBuilder::new()
.push_nodes(self.process_declarative_items)
.finish()
}
}
impl From<ProcessDeclarativePartBuilder> for ProcessDeclarativePartSyntax {
fn from(value: ProcessDeclarativePartBuilder) -> Self {
value.build()
}
}
pub struct ProcessEpilogueBuilder {
end_token: Token,
postponed_token: Option<Token>,
process_token: Token,
label: Option<Token>,
semi_colon_token: Token,
}
impl Default for ProcessEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl ProcessEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
postponed_token: None,
process_token: Kw::Process.canonical_token(),
label: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_postponed_token(mut self, t: impl Into<Token>) -> Self {
self.postponed_token = Some(t.into());
self
}
pub fn with_postponed_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.postponed_token
.get_or_insert_with(|| Kw::Postponed.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_process_token(mut self, t: impl Into<Token>) -> Self {
self.process_token = t.into();
self
}
pub fn with_process_token_trivia(mut self, trivia: Trivia) -> Self {
self.process_token.set_leading_trivia(trivia);
self
}
pub fn with_label(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.label = Some(t.into().into());
self
}
pub fn with_label_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.label {
t.set_leading_trivia(trivia);
}
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ProcessEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_opt_token(self.postponed_token)
.push_token(self.process_token)
.push_opt_token(self.label)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ProcessEpilogueBuilder> for ProcessEpilogueSyntax {
fn from(value: ProcessEpilogueBuilder) -> Self {
value.build()
}
}
pub struct ProcessPreambleBuilder {
postponed_token: Option<Token>,
process_token: Token,
parenthesized_process_sensitivity_list: Option<ParenthesizedProcessSensitivityListSyntax>,
is_token: Option<Token>,
}
impl Default for ProcessPreambleBuilder {
fn default() -> Self {
Self::new()
}
}
impl ProcessPreambleBuilder {
pub fn new() -> Self {
Self {
postponed_token: None,
process_token: Kw::Process.canonical_token(),
parenthesized_process_sensitivity_list: None,
is_token: None,
}
}
pub fn with_postponed_token(mut self, t: impl Into<Token>) -> Self {
self.postponed_token = Some(t.into());
self
}
pub fn with_postponed_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.postponed_token
.get_or_insert_with(|| Kw::Postponed.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_process_token(mut self, t: impl Into<Token>) -> Self {
self.process_token = t.into();
self
}
pub fn with_process_token_trivia(mut self, trivia: Trivia) -> Self {
self.process_token.set_leading_trivia(trivia);
self
}
pub fn with_parenthesized_process_sensitivity_list(
mut self,
n: impl Into<ParenthesizedProcessSensitivityListSyntax>,
) -> Self {
self.parenthesized_process_sensitivity_list = Some(n.into());
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = Some(t.into());
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.is_token
.get_or_insert_with(|| Kw::Is.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ProcessPreambleSyntax {
RawNodeBuilder::new()
.push_opt_token(self.postponed_token)
.push_token(self.process_token)
.push_opt_node(self.parenthesized_process_sensitivity_list)
.push_opt_token(self.is_token)
.finish()
}
}
impl From<ProcessPreambleBuilder> for ProcessPreambleSyntax {
fn from(value: ProcessPreambleBuilder) -> Self {
value.build()
}
}
pub struct ProcessStatementBuilder {
stmt_label: Option<StmtLabelSyntax>,
process_preamble: ProcessPreambleSyntax,
process_declarative_part: Option<ProcessDeclarativePartSyntax>,
declaration_statement_separator: DeclarationStatementSeparatorSyntax,
process_statement_part: Option<ProcessStatementPartSyntax>,
process_epilogue: ProcessEpilogueSyntax,
}
impl Default for ProcessStatementBuilder {
fn default() -> Self {
Self::new()
}
}
impl ProcessStatementBuilder {
pub fn new() -> Self {
Self {
stmt_label: None,
process_preamble: ProcessPreambleBuilder::default().build(),
process_declarative_part: None,
declaration_statement_separator: DeclarationStatementSeparatorBuilder::default()
.build(),
process_statement_part: None,
process_epilogue: ProcessEpilogueBuilder::default().build(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_process_preamble(mut self, n: impl Into<ProcessPreambleSyntax>) -> Self {
self.process_preamble = n.into();
self
}
pub fn with_process_declarative_part(
mut self,
n: impl Into<ProcessDeclarativePartSyntax>,
) -> Self {
self.process_declarative_part = Some(n.into());
self
}
pub fn with_declaration_statement_separator(
mut self,
n: impl Into<DeclarationStatementSeparatorSyntax>,
) -> Self {
self.declaration_statement_separator = n.into();
self
}
pub fn with_process_statement_part(mut self, n: impl Into<ProcessStatementPartSyntax>) -> Self {
self.process_statement_part = Some(n.into());
self
}
pub fn with_process_epilogue(mut self, n: impl Into<ProcessEpilogueSyntax>) -> Self {
self.process_epilogue = n.into();
self
}
pub fn build(self) -> ProcessStatementSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_node(self.process_preamble)
.push_opt_node(self.process_declarative_part)
.push_node(self.declaration_statement_separator)
.push_opt_node(self.process_statement_part)
.push_node(self.process_epilogue)
.finish()
}
}
impl From<ProcessStatementBuilder> for ProcessStatementSyntax {
fn from(value: ProcessStatementBuilder) -> Self {
value.build()
}
}
pub struct ProcessStatementPartBuilder {
sequential_statements: Vec<SequentialStatementSyntax>,
}
impl Default for ProcessStatementPartBuilder {
fn default() -> Self {
Self::new()
}
}
impl ProcessStatementPartBuilder {
pub fn new() -> Self {
Self {
sequential_statements: Vec::new(),
}
}
pub fn add_sequential_statements(mut self, n: impl Into<SequentialStatementSyntax>) -> Self {
self.sequential_statements.push(n.into());
self
}
pub fn build(self) -> ProcessStatementPartSyntax {
RawNodeBuilder::new()
.push_nodes(self.sequential_statements)
.finish()
}
}
impl From<ProcessStatementPartBuilder> for ProcessStatementPartSyntax {
fn from(value: ProcessStatementPartBuilder) -> Self {
value.build()
}
}
pub struct ProtectedPreambleBuilder {
protected_token: Token,
}
impl Default for ProtectedPreambleBuilder {
fn default() -> Self {
Self::new()
}
}
impl ProtectedPreambleBuilder {
pub fn new() -> Self {
Self {
protected_token: Kw::Protected.canonical_token(),
}
}
pub fn with_protected_token(mut self, t: impl Into<Token>) -> Self {
self.protected_token = t.into();
self
}
pub fn with_protected_token_trivia(mut self, trivia: Trivia) -> Self {
self.protected_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ProtectedPreambleSyntax {
RawNodeBuilder::new()
.push_token(self.protected_token)
.finish()
}
}
impl From<ProtectedPreambleBuilder> for ProtectedPreambleSyntax {
fn from(value: ProtectedPreambleBuilder) -> Self {
value.build()
}
}
pub struct ProtectedTypeBodyBuilder {
protected_type_body_preamble: ProtectedTypeBodyPreambleSyntax,
protected_type_body_declarative_part: Option<ProtectedTypeBodyDeclarativePartSyntax>,
protected_type_body_epilogue: ProtectedTypeBodyEpilogueSyntax,
}
impl Default for ProtectedTypeBodyBuilder {
fn default() -> Self {
Self::new()
}
}
impl ProtectedTypeBodyBuilder {
pub fn new() -> Self {
Self {
protected_type_body_preamble: ProtectedTypeBodyPreambleBuilder::default().build(),
protected_type_body_declarative_part: None,
protected_type_body_epilogue: ProtectedTypeBodyEpilogueBuilder::default().build(),
}
}
pub fn with_protected_type_body_preamble(
mut self,
n: impl Into<ProtectedTypeBodyPreambleSyntax>,
) -> Self {
self.protected_type_body_preamble = n.into();
self
}
pub fn with_protected_type_body_declarative_part(
mut self,
n: impl Into<ProtectedTypeBodyDeclarativePartSyntax>,
) -> Self {
self.protected_type_body_declarative_part = Some(n.into());
self
}
pub fn with_protected_type_body_epilogue(
mut self,
n: impl Into<ProtectedTypeBodyEpilogueSyntax>,
) -> Self {
self.protected_type_body_epilogue = n.into();
self
}
pub fn build(self) -> ProtectedTypeBodySyntax {
RawNodeBuilder::new()
.push_node(self.protected_type_body_preamble)
.push_opt_node(self.protected_type_body_declarative_part)
.push_node(self.protected_type_body_epilogue)
.finish()
}
}
impl From<ProtectedTypeBodyBuilder> for ProtectedTypeBodySyntax {
fn from(value: ProtectedTypeBodyBuilder) -> Self {
value.build()
}
}
pub struct ProtectedTypeBodyDeclarativePartBuilder {
protected_type_body_declarative_items: Vec<ProtectedTypeBodyDeclarativeItemSyntax>,
}
impl Default for ProtectedTypeBodyDeclarativePartBuilder {
fn default() -> Self {
Self::new()
}
}
impl ProtectedTypeBodyDeclarativePartBuilder {
pub fn new() -> Self {
Self {
protected_type_body_declarative_items: Vec::new(),
}
}
pub fn add_protected_type_body_declarative_items(
mut self,
n: impl Into<ProtectedTypeBodyDeclarativeItemSyntax>,
) -> Self {
self.protected_type_body_declarative_items.push(n.into());
self
}
pub fn build(self) -> ProtectedTypeBodyDeclarativePartSyntax {
RawNodeBuilder::new()
.push_nodes(self.protected_type_body_declarative_items)
.finish()
}
}
impl From<ProtectedTypeBodyDeclarativePartBuilder> for ProtectedTypeBodyDeclarativePartSyntax {
fn from(value: ProtectedTypeBodyDeclarativePartBuilder) -> Self {
value.build()
}
}
pub struct ProtectedTypeBodyEpilogueBuilder {
end_token: Token,
protected_token: Token,
body_token: Token,
simple_name: Option<Token>,
}
impl Default for ProtectedTypeBodyEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl ProtectedTypeBodyEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
protected_token: Kw::Protected.canonical_token(),
body_token: Kw::Body.canonical_token(),
simple_name: None,
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_protected_token(mut self, t: impl Into<Token>) -> Self {
self.protected_token = t.into();
self
}
pub fn with_protected_token_trivia(mut self, trivia: Trivia) -> Self {
self.protected_token.set_leading_trivia(trivia);
self
}
pub fn with_body_token(mut self, t: impl Into<Token>) -> Self {
self.body_token = t.into();
self
}
pub fn with_body_token_trivia(mut self, trivia: Trivia) -> Self {
self.body_token.set_leading_trivia(trivia);
self
}
pub fn with_simple_name(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.simple_name = Some(t.into().into());
self
}
pub fn with_simple_name_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.simple_name {
t.set_leading_trivia(trivia);
}
self
}
pub fn build(self) -> ProtectedTypeBodyEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_token(self.protected_token)
.push_token(self.body_token)
.push_opt_token(self.simple_name)
.finish()
}
}
impl From<ProtectedTypeBodyEpilogueBuilder> for ProtectedTypeBodyEpilogueSyntax {
fn from(value: ProtectedTypeBodyEpilogueBuilder) -> Self {
value.build()
}
}
pub struct ProtectedTypeBodyPreambleBuilder {
protected_token: Token,
body_token: Token,
}
impl Default for ProtectedTypeBodyPreambleBuilder {
fn default() -> Self {
Self::new()
}
}
impl ProtectedTypeBodyPreambleBuilder {
pub fn new() -> Self {
Self {
protected_token: Kw::Protected.canonical_token(),
body_token: Kw::Body.canonical_token(),
}
}
pub fn with_protected_token(mut self, t: impl Into<Token>) -> Self {
self.protected_token = t.into();
self
}
pub fn with_protected_token_trivia(mut self, trivia: Trivia) -> Self {
self.protected_token.set_leading_trivia(trivia);
self
}
pub fn with_body_token(mut self, t: impl Into<Token>) -> Self {
self.body_token = t.into();
self
}
pub fn with_body_token_trivia(mut self, trivia: Trivia) -> Self {
self.body_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ProtectedTypeBodyPreambleSyntax {
RawNodeBuilder::new()
.push_token(self.protected_token)
.push_token(self.body_token)
.finish()
}
}
impl From<ProtectedTypeBodyPreambleBuilder> for ProtectedTypeBodyPreambleSyntax {
fn from(value: ProtectedTypeBodyPreambleBuilder) -> Self {
value.build()
}
}
pub struct ProtectedTypeDeclarationBuilder {
protected_preamble: ProtectedPreambleSyntax,
protected_type_declarative_part: Option<ProtectedTypeDeclarativePartSyntax>,
protected_type_declaration_epilogue: ProtectedTypeDeclarationEpilogueSyntax,
}
impl Default for ProtectedTypeDeclarationBuilder {
fn default() -> Self {
Self::new()
}
}
impl ProtectedTypeDeclarationBuilder {
pub fn new() -> Self {
Self {
protected_preamble: ProtectedPreambleBuilder::default().build(),
protected_type_declarative_part: None,
protected_type_declaration_epilogue: ProtectedTypeDeclarationEpilogueBuilder::default()
.build(),
}
}
pub fn with_protected_preamble(mut self, n: impl Into<ProtectedPreambleSyntax>) -> Self {
self.protected_preamble = n.into();
self
}
pub fn with_protected_type_declarative_part(
mut self,
n: impl Into<ProtectedTypeDeclarativePartSyntax>,
) -> Self {
self.protected_type_declarative_part = Some(n.into());
self
}
pub fn with_protected_type_declaration_epilogue(
mut self,
n: impl Into<ProtectedTypeDeclarationEpilogueSyntax>,
) -> Self {
self.protected_type_declaration_epilogue = n.into();
self
}
pub fn build(self) -> ProtectedTypeDeclarationSyntax {
RawNodeBuilder::new()
.push_node(self.protected_preamble)
.push_opt_node(self.protected_type_declarative_part)
.push_node(self.protected_type_declaration_epilogue)
.finish()
}
}
impl From<ProtectedTypeDeclarationBuilder> for ProtectedTypeDeclarationSyntax {
fn from(value: ProtectedTypeDeclarationBuilder) -> Self {
value.build()
}
}
pub struct ProtectedTypeDeclarationEpilogueBuilder {
end_token: Token,
protected_token: Token,
simple_name: Option<Token>,
}
impl Default for ProtectedTypeDeclarationEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl ProtectedTypeDeclarationEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
protected_token: Kw::Protected.canonical_token(),
simple_name: None,
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_protected_token(mut self, t: impl Into<Token>) -> Self {
self.protected_token = t.into();
self
}
pub fn with_protected_token_trivia(mut self, trivia: Trivia) -> Self {
self.protected_token.set_leading_trivia(trivia);
self
}
pub fn with_simple_name(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.simple_name = Some(t.into().into());
self
}
pub fn with_simple_name_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.simple_name {
t.set_leading_trivia(trivia);
}
self
}
pub fn build(self) -> ProtectedTypeDeclarationEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_token(self.protected_token)
.push_opt_token(self.simple_name)
.finish()
}
}
impl From<ProtectedTypeDeclarationEpilogueBuilder> for ProtectedTypeDeclarationEpilogueSyntax {
fn from(value: ProtectedTypeDeclarationEpilogueBuilder) -> Self {
value.build()
}
}
pub struct ProtectedTypeDeclarativePartBuilder {
protected_type_declarative_items: Vec<ProtectedTypeDeclarativeItemSyntax>,
}
impl Default for ProtectedTypeDeclarativePartBuilder {
fn default() -> Self {
Self::new()
}
}
impl ProtectedTypeDeclarativePartBuilder {
pub fn new() -> Self {
Self {
protected_type_declarative_items: Vec::new(),
}
}
pub fn add_protected_type_declarative_items(
mut self,
n: impl Into<ProtectedTypeDeclarativeItemSyntax>,
) -> Self {
self.protected_type_declarative_items.push(n.into());
self
}
pub fn build(self) -> ProtectedTypeDeclarativePartSyntax {
RawNodeBuilder::new()
.push_nodes(self.protected_type_declarative_items)
.finish()
}
}
impl From<ProtectedTypeDeclarativePartBuilder> for ProtectedTypeDeclarativePartSyntax {
fn from(value: ProtectedTypeDeclarativePartBuilder) -> Self {
value.build()
}
}
pub struct QualifiedExpressionBuilder {
type_mark: NameSyntax,
tick_token: Token,
parenthesized_expression_or_aggregate: ParenthesizedExpressionOrAggregateSyntax,
}
impl QualifiedExpressionBuilder {
pub fn new(
type_mark: impl Into<NameSyntax>,
parenthesized_expression_or_aggregate: impl Into<ParenthesizedExpressionOrAggregateSyntax>,
) -> Self {
Self {
type_mark: type_mark.into(),
tick_token: TokenKind::Tick.canonical_token().unwrap(),
parenthesized_expression_or_aggregate: parenthesized_expression_or_aggregate.into(),
}
}
pub fn with_type_mark(mut self, n: impl Into<NameSyntax>) -> Self {
self.type_mark = n.into();
self
}
pub fn with_tick_token(mut self, t: impl Into<Token>) -> Self {
self.tick_token = t.into();
self
}
pub fn with_tick_token_trivia(mut self, trivia: Trivia) -> Self {
self.tick_token.set_leading_trivia(trivia);
self
}
pub fn with_parenthesized_expression_or_aggregate(
mut self,
n: impl Into<ParenthesizedExpressionOrAggregateSyntax>,
) -> Self {
self.parenthesized_expression_or_aggregate = n.into();
self
}
pub fn build(self) -> QualifiedExpressionSyntax {
RawNodeBuilder::new()
.push_node(self.type_mark)
.push_token(self.tick_token)
.push_node(self.parenthesized_expression_or_aggregate)
.finish()
}
}
impl From<QualifiedExpressionBuilder> for QualifiedExpressionSyntax {
fn from(value: QualifiedExpressionBuilder) -> Self {
value.build()
}
}
pub struct RangeConstraintBuilder {
range_token: Token,
expression: ExpressionSyntax,
}
impl RangeConstraintBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
range_token: Kw::Range.canonical_token(),
expression: expression.into(),
}
}
pub fn with_range_token(mut self, t: impl Into<Token>) -> Self {
self.range_token = t.into();
self
}
pub fn with_range_token_trivia(mut self, trivia: Trivia) -> Self {
self.range_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn build(self) -> RangeConstraintSyntax {
RawNodeBuilder::new()
.push_token(self.range_token)
.push_node(self.expression)
.finish()
}
}
impl From<RangeConstraintBuilder> for RangeConstraintSyntax {
fn from(value: RangeConstraintBuilder) -> Self {
value.build()
}
}
pub struct RecordElementDeclarationsBuilder {
element_declarations: Vec<ElementDeclarationSyntax>,
}
impl RecordElementDeclarationsBuilder {
pub fn new(element_declarations: impl Into<ElementDeclarationSyntax>) -> Self {
Self {
element_declarations: vec![element_declarations.into()],
}
}
pub fn add_element_declarations(mut self, n: impl Into<ElementDeclarationSyntax>) -> Self {
self.element_declarations.push(n.into());
self
}
pub fn build(self) -> RecordElementDeclarationsSyntax {
RawNodeBuilder::new()
.push_nodes(self.element_declarations)
.finish()
}
}
impl From<RecordElementDeclarationsBuilder> for RecordElementDeclarationsSyntax {
fn from(value: RecordElementDeclarationsBuilder) -> Self {
value.build()
}
}
pub struct RecordElementResolutionBuilder {
simple_name: Token,
resolution_indication: ResolutionIndicationSyntax,
}
impl RecordElementResolutionBuilder {
pub fn new(
simple_name: impl Into<crate::builder::Identifier>,
resolution_indication: impl Into<ResolutionIndicationSyntax>,
) -> Self {
Self {
simple_name: simple_name.into().into(),
resolution_indication: resolution_indication.into(),
}
}
pub fn with_simple_name(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.simple_name = t.into().into();
self
}
pub fn with_simple_name_trivia(mut self, trivia: Trivia) -> Self {
self.simple_name.set_leading_trivia(trivia);
self
}
pub fn with_resolution_indication(mut self, n: impl Into<ResolutionIndicationSyntax>) -> Self {
self.resolution_indication = n.into();
self
}
pub fn build(self) -> RecordElementResolutionSyntax {
RawNodeBuilder::new()
.push_token(self.simple_name)
.push_node(self.resolution_indication)
.finish()
}
}
impl From<RecordElementResolutionBuilder> for RecordElementResolutionSyntax {
fn from(value: RecordElementResolutionBuilder) -> Self {
value.build()
}
}
pub struct RecordResolutionElementResolutionBuilder {
record_resolution: RecordResolutionSyntax,
}
impl RecordResolutionElementResolutionBuilder {
pub fn new(record_resolution: impl Into<RecordResolutionSyntax>) -> Self {
Self {
record_resolution: record_resolution.into(),
}
}
pub fn with_record_resolution(mut self, n: impl Into<RecordResolutionSyntax>) -> Self {
self.record_resolution = n.into();
self
}
pub fn build(self) -> RecordResolutionElementResolutionSyntax {
RawNodeBuilder::new()
.push_node(self.record_resolution)
.finish()
}
}
impl From<RecordResolutionElementResolutionBuilder> for RecordResolutionElementResolutionSyntax {
fn from(value: RecordResolutionElementResolutionBuilder) -> Self {
value.build()
}
}
pub struct RecordTypeDefinitionBuilder {
record_type_definition_preamble: RecordTypeDefinitionPreambleSyntax,
record_element_declarations: RecordElementDeclarationsSyntax,
record_type_definition_epilogue: RecordTypeDefinitionEpilogueSyntax,
}
impl RecordTypeDefinitionBuilder {
pub fn new(record_element_declarations: impl Into<RecordElementDeclarationsSyntax>) -> Self {
Self {
record_type_definition_preamble: RecordTypeDefinitionPreambleBuilder::default().build(),
record_element_declarations: record_element_declarations.into(),
record_type_definition_epilogue: RecordTypeDefinitionEpilogueBuilder::default().build(),
}
}
pub fn with_record_type_definition_preamble(
mut self,
n: impl Into<RecordTypeDefinitionPreambleSyntax>,
) -> Self {
self.record_type_definition_preamble = n.into();
self
}
pub fn with_record_element_declarations(
mut self,
n: impl Into<RecordElementDeclarationsSyntax>,
) -> Self {
self.record_element_declarations = n.into();
self
}
pub fn with_record_type_definition_epilogue(
mut self,
n: impl Into<RecordTypeDefinitionEpilogueSyntax>,
) -> Self {
self.record_type_definition_epilogue = n.into();
self
}
pub fn build(self) -> RecordTypeDefinitionSyntax {
RawNodeBuilder::new()
.push_node(self.record_type_definition_preamble)
.push_node(self.record_element_declarations)
.push_node(self.record_type_definition_epilogue)
.finish()
}
}
impl From<RecordTypeDefinitionBuilder> for RecordTypeDefinitionSyntax {
fn from(value: RecordTypeDefinitionBuilder) -> Self {
value.build()
}
}
pub struct RecordTypeDefinitionEpilogueBuilder {
end_token: Token,
record_token: Token,
simple_name: Option<Token>,
}
impl Default for RecordTypeDefinitionEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl RecordTypeDefinitionEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
record_token: Kw::Record.canonical_token(),
simple_name: None,
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_record_token(mut self, t: impl Into<Token>) -> Self {
self.record_token = t.into();
self
}
pub fn with_record_token_trivia(mut self, trivia: Trivia) -> Self {
self.record_token.set_leading_trivia(trivia);
self
}
pub fn with_simple_name(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.simple_name = Some(t.into().into());
self
}
pub fn with_simple_name_trivia(mut self, trivia: Trivia) -> Self {
if let Some(ref mut t) = self.simple_name {
t.set_leading_trivia(trivia);
}
self
}
pub fn build(self) -> RecordTypeDefinitionEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_token(self.record_token)
.push_opt_token(self.simple_name)
.finish()
}
}
impl From<RecordTypeDefinitionEpilogueBuilder> for RecordTypeDefinitionEpilogueSyntax {
fn from(value: RecordTypeDefinitionEpilogueBuilder) -> Self {
value.build()
}
}
pub struct RecordTypeDefinitionPreambleBuilder {
record_token: Token,
}
impl Default for RecordTypeDefinitionPreambleBuilder {
fn default() -> Self {
Self::new()
}
}
impl RecordTypeDefinitionPreambleBuilder {
pub fn new() -> Self {
Self {
record_token: Kw::Record.canonical_token(),
}
}
pub fn with_record_token(mut self, t: impl Into<Token>) -> Self {
self.record_token = t.into();
self
}
pub fn with_record_token_trivia(mut self, trivia: Trivia) -> Self {
self.record_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> RecordTypeDefinitionPreambleSyntax {
RawNodeBuilder::new().push_token(self.record_token).finish()
}
}
impl From<RecordTypeDefinitionPreambleBuilder> for RecordTypeDefinitionPreambleSyntax {
fn from(value: RecordTypeDefinitionPreambleBuilder) -> Self {
value.build()
}
}
pub struct RejectClauseBuilder {
reject_token: Token,
expression: ExpressionSyntax,
}
impl RejectClauseBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
reject_token: Kw::Reject.canonical_token(),
expression: expression.into(),
}
}
pub fn with_reject_token(mut self, t: impl Into<Token>) -> Self {
self.reject_token = t.into();
self
}
pub fn with_reject_token_trivia(mut self, trivia: Trivia) -> Self {
self.reject_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn build(self) -> RejectClauseSyntax {
RawNodeBuilder::new()
.push_token(self.reject_token)
.push_node(self.expression)
.finish()
}
}
impl From<RejectClauseBuilder> for RejectClauseSyntax {
fn from(value: RejectClauseBuilder) -> Self {
value.build()
}
}
pub struct RelativePathnameBuilder {
up_levels: Vec<UpLevelSyntax>,
partial_pathname: PartialPathnameSyntax,
}
impl RelativePathnameBuilder {
pub fn new(partial_pathname: impl Into<PartialPathnameSyntax>) -> Self {
Self {
up_levels: Vec::new(),
partial_pathname: partial_pathname.into(),
}
}
pub fn add_up_levels(mut self, n: impl Into<UpLevelSyntax>) -> Self {
self.up_levels.push(n.into());
self
}
pub fn with_partial_pathname(mut self, n: impl Into<PartialPathnameSyntax>) -> Self {
self.partial_pathname = n.into();
self
}
pub fn build(self) -> RelativePathnameSyntax {
RawNodeBuilder::new()
.push_nodes(self.up_levels)
.push_node(self.partial_pathname)
.finish()
}
}
impl From<RelativePathnameBuilder> for RelativePathnameSyntax {
fn from(value: RelativePathnameBuilder) -> Self {
value.build()
}
}
pub struct ReportClauseBuilder {
report_token: Token,
expression: ExpressionSyntax,
}
impl ReportClauseBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
report_token: Kw::Report.canonical_token(),
expression: expression.into(),
}
}
pub fn with_report_token(mut self, t: impl Into<Token>) -> Self {
self.report_token = t.into();
self
}
pub fn with_report_token_trivia(mut self, trivia: Trivia) -> Self {
self.report_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn build(self) -> ReportClauseSyntax {
RawNodeBuilder::new()
.push_token(self.report_token)
.push_node(self.expression)
.finish()
}
}
impl From<ReportClauseBuilder> for ReportClauseSyntax {
fn from(value: ReportClauseBuilder) -> Self {
value.build()
}
}
pub struct ReportStatementBuilder {
stmt_label: Option<StmtLabelSyntax>,
report_token: Token,
expression: ExpressionSyntax,
severity_clause: Option<SeverityClauseSyntax>,
semi_colon_token: Token,
}
impl ReportStatementBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
stmt_label: None,
report_token: Kw::Report.canonical_token(),
expression: expression.into(),
severity_clause: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_report_token(mut self, t: impl Into<Token>) -> Self {
self.report_token = t.into();
self
}
pub fn with_report_token_trivia(mut self, trivia: Trivia) -> Self {
self.report_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn with_severity_clause(mut self, n: impl Into<SeverityClauseSyntax>) -> Self {
self.severity_clause = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ReportStatementSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_token(self.report_token)
.push_node(self.expression)
.push_opt_node(self.severity_clause)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ReportStatementBuilder> for ReportStatementSyntax {
fn from(value: ReportStatementBuilder) -> Self {
value.build()
}
}
pub struct ReturnStatementBuilder {
stmt_label: Option<StmtLabelSyntax>,
return_token: Token,
expression: Option<ExpressionSyntax>,
semi_colon_token: Token,
}
impl Default for ReturnStatementBuilder {
fn default() -> Self {
Self::new()
}
}
impl ReturnStatementBuilder {
pub fn new() -> Self {
Self {
stmt_label: None,
return_token: Kw::Return.canonical_token(),
expression: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_return_token(mut self, t: impl Into<Token>) -> Self {
self.return_token = t.into();
self
}
pub fn with_return_token_trivia(mut self, trivia: Trivia) -> Self {
self.return_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> ReturnStatementSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_token(self.return_token)
.push_opt_node(self.expression)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<ReturnStatementBuilder> for ReturnStatementSyntax {
fn from(value: ReturnStatementBuilder) -> Self {
value.build()
}
}
pub struct ReturnTypeBuilder {
return_token: Token,
type_mark: NameSyntax,
}
impl ReturnTypeBuilder {
pub fn new(type_mark: impl Into<NameSyntax>) -> Self {
Self {
return_token: Kw::Return.canonical_token(),
type_mark: type_mark.into(),
}
}
pub fn with_return_token(mut self, t: impl Into<Token>) -> Self {
self.return_token = t.into();
self
}
pub fn with_return_token_trivia(mut self, trivia: Trivia) -> Self {
self.return_token.set_leading_trivia(trivia);
self
}
pub fn with_type_mark(mut self, n: impl Into<NameSyntax>) -> Self {
self.type_mark = n.into();
self
}
pub fn build(self) -> ReturnTypeSyntax {
RawNodeBuilder::new()
.push_token(self.return_token)
.push_node(self.type_mark)
.finish()
}
}
impl From<ReturnTypeBuilder> for ReturnTypeSyntax {
fn from(value: ReturnTypeBuilder) -> Self {
value.build()
}
}
pub struct SecondaryUnitDeclarationBuilder {
identifier_token: Token,
eq_token: Token,
physical_literal: PhysicalLiteralSyntax,
semi_colon_token: Token,
}
impl SecondaryUnitDeclarationBuilder {
pub fn new(
identifier_token: impl Into<crate::builder::Identifier>,
physical_literal: impl Into<PhysicalLiteralSyntax>,
) -> Self {
Self {
identifier_token: identifier_token.into().into(),
eq_token: TokenKind::EQ.canonical_token().unwrap(),
physical_literal: physical_literal.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_eq_token(mut self, t: impl Into<Token>) -> Self {
self.eq_token = t.into();
self
}
pub fn with_eq_token_trivia(mut self, trivia: Trivia) -> Self {
self.eq_token.set_leading_trivia(trivia);
self
}
pub fn with_physical_literal(mut self, n: impl Into<PhysicalLiteralSyntax>) -> Self {
self.physical_literal = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SecondaryUnitDeclarationSyntax {
RawNodeBuilder::new()
.push_token(self.identifier_token)
.push_token(self.eq_token)
.push_node(self.physical_literal)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<SecondaryUnitDeclarationBuilder> for SecondaryUnitDeclarationSyntax {
fn from(value: SecondaryUnitDeclarationBuilder) -> Self {
value.build()
}
}
pub struct SecondaryUnitPackageBodyBuilder {
package_body: PackageBodySyntax,
}
impl SecondaryUnitPackageBodyBuilder {
pub fn new(package_body: impl Into<PackageBodySyntax>) -> Self {
Self {
package_body: package_body.into(),
}
}
pub fn with_package_body(mut self, n: impl Into<PackageBodySyntax>) -> Self {
self.package_body = n.into();
self
}
pub fn build(self) -> SecondaryUnitPackageBodySyntax {
RawNodeBuilder::new().push_node(self.package_body).finish()
}
}
impl From<SecondaryUnitPackageBodyBuilder> for SecondaryUnitPackageBodySyntax {
fn from(value: SecondaryUnitPackageBodyBuilder) -> Self {
value.build()
}
}
pub struct SelectedAssignmentPreambleBuilder {
with_token: Token,
expression: ExpressionSyntax,
select_token: Token,
que_token: Option<Token>,
}
impl SelectedAssignmentPreambleBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
with_token: Kw::With.canonical_token(),
expression: expression.into(),
select_token: Kw::Select.canonical_token(),
que_token: None,
}
}
pub fn with_with_token(mut self, t: impl Into<Token>) -> Self {
self.with_token = t.into();
self
}
pub fn with_with_token_trivia(mut self, trivia: Trivia) -> Self {
self.with_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn with_select_token(mut self, t: impl Into<Token>) -> Self {
self.select_token = t.into();
self
}
pub fn with_select_token_trivia(mut self, trivia: Trivia) -> Self {
self.select_token.set_leading_trivia(trivia);
self
}
pub fn with_que_token(mut self, t: impl Into<Token>) -> Self {
self.que_token = Some(t.into());
self
}
pub fn with_que_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.que_token
.get_or_insert_with(|| TokenKind::Que.canonical_token().unwrap());
tok.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SelectedAssignmentPreambleSyntax {
RawNodeBuilder::new()
.push_token(self.with_token)
.push_node(self.expression)
.push_token(self.select_token)
.push_opt_token(self.que_token)
.finish()
}
}
impl From<SelectedAssignmentPreambleBuilder> for SelectedAssignmentPreambleSyntax {
fn from(value: SelectedAssignmentPreambleBuilder) -> Self {
value.build()
}
}
pub struct SelectedExpressionItemBuilder {
expression: ExpressionSyntax,
when_token: Token,
choices: ChoicesSyntax,
}
impl SelectedExpressionItemBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>, choices: impl Into<ChoicesSyntax>) -> Self {
Self {
expression: expression.into(),
when_token: Kw::When.canonical_token(),
choices: choices.into(),
}
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn with_when_token(mut self, t: impl Into<Token>) -> Self {
self.when_token = t.into();
self
}
pub fn with_when_token_trivia(mut self, trivia: Trivia) -> Self {
self.when_token.set_leading_trivia(trivia);
self
}
pub fn with_choices(mut self, n: impl Into<ChoicesSyntax>) -> Self {
self.choices = n.into();
self
}
pub fn build(self) -> SelectedExpressionItemSyntax {
RawNodeBuilder::new()
.push_node(self.expression)
.push_token(self.when_token)
.push_node(self.choices)
.finish()
}
}
impl From<SelectedExpressionItemBuilder> for SelectedExpressionItemSyntax {
fn from(value: SelectedExpressionItemBuilder) -> Self {
value.build()
}
}
pub struct SelectedForceAssignmentBuilder {
stmt_label: Option<StmtLabelSyntax>,
selected_assignment_preamble: SelectedAssignmentPreambleSyntax,
target: TargetSyntax,
lte_token: Token,
force_token: Token,
force_mode: Option<ForceModeToken>,
selected_expressions: SelectedExpressionsSyntax,
semi_colon_token: Token,
}
impl SelectedForceAssignmentBuilder {
pub fn new(
selected_assignment_preamble: impl Into<SelectedAssignmentPreambleSyntax>,
target: impl Into<TargetSyntax>,
selected_expressions: impl Into<SelectedExpressionsSyntax>,
) -> Self {
Self {
stmt_label: None,
selected_assignment_preamble: selected_assignment_preamble.into(),
target: target.into(),
lte_token: TokenKind::LTE.canonical_token().unwrap(),
force_token: Kw::Force.canonical_token(),
force_mode: None,
selected_expressions: selected_expressions.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_selected_assignment_preamble(
mut self,
n: impl Into<SelectedAssignmentPreambleSyntax>,
) -> Self {
self.selected_assignment_preamble = n.into();
self
}
pub fn with_target(mut self, n: impl Into<TargetSyntax>) -> Self {
self.target = n.into();
self
}
pub fn with_lte_token(mut self, t: impl Into<Token>) -> Self {
self.lte_token = t.into();
self
}
pub fn with_lte_token_trivia(mut self, trivia: Trivia) -> Self {
self.lte_token.set_leading_trivia(trivia);
self
}
pub fn with_force_token(mut self, t: impl Into<Token>) -> Self {
self.force_token = t.into();
self
}
pub fn with_force_token_trivia(mut self, trivia: Trivia) -> Self {
self.force_token.set_leading_trivia(trivia);
self
}
pub fn with_force_mode(mut self, n: impl Into<ForceModeToken>) -> Self {
self.force_mode = Some(n.into());
self
}
pub fn with_selected_expressions(mut self, n: impl Into<SelectedExpressionsSyntax>) -> Self {
self.selected_expressions = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SelectedForceAssignmentSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_node(self.selected_assignment_preamble)
.push_node(self.target)
.push_token(self.lte_token)
.push_token(self.force_token)
.push_opt_token(self.force_mode.map(|t| t.0))
.push_node(self.selected_expressions)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<SelectedForceAssignmentBuilder> for SelectedForceAssignmentSyntax {
fn from(value: SelectedForceAssignmentBuilder) -> Self {
value.build()
}
}
pub struct SelectedNameBuilder {
dot_token: Token,
suffix: SuffixToken,
}
impl SelectedNameBuilder {
pub fn new(suffix: impl Into<SuffixToken>) -> Self {
Self {
dot_token: TokenKind::Dot.canonical_token().unwrap(),
suffix: suffix.into(),
}
}
pub fn with_dot_token(mut self, t: impl Into<Token>) -> Self {
self.dot_token = t.into();
self
}
pub fn with_dot_token_trivia(mut self, trivia: Trivia) -> Self {
self.dot_token.set_leading_trivia(trivia);
self
}
pub fn with_suffix(mut self, n: impl Into<SuffixToken>) -> Self {
self.suffix = n.into();
self
}
pub fn build(self) -> SelectedNameSyntax {
RawNodeBuilder::new()
.push_token(self.dot_token)
.push_token(self.suffix.0)
.finish()
}
}
impl From<SelectedNameBuilder> for SelectedNameSyntax {
fn from(value: SelectedNameBuilder) -> Self {
value.build()
}
}
pub struct SelectedVariableAssignmentBuilder {
stmt_label: Option<StmtLabelSyntax>,
selected_assignment_preamble: SelectedAssignmentPreambleSyntax,
target: TargetSyntax,
colon_eq_token: Token,
selected_expressions: SelectedExpressionsSyntax,
semi_colon_token: Token,
}
impl SelectedVariableAssignmentBuilder {
pub fn new(
selected_assignment_preamble: impl Into<SelectedAssignmentPreambleSyntax>,
target: impl Into<TargetSyntax>,
selected_expressions: impl Into<SelectedExpressionsSyntax>,
) -> Self {
Self {
stmt_label: None,
selected_assignment_preamble: selected_assignment_preamble.into(),
target: target.into(),
colon_eq_token: TokenKind::ColonEq.canonical_token().unwrap(),
selected_expressions: selected_expressions.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_selected_assignment_preamble(
mut self,
n: impl Into<SelectedAssignmentPreambleSyntax>,
) -> Self {
self.selected_assignment_preamble = n.into();
self
}
pub fn with_target(mut self, n: impl Into<TargetSyntax>) -> Self {
self.target = n.into();
self
}
pub fn with_colon_eq_token(mut self, t: impl Into<Token>) -> Self {
self.colon_eq_token = t.into();
self
}
pub fn with_colon_eq_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_eq_token.set_leading_trivia(trivia);
self
}
pub fn with_selected_expressions(mut self, n: impl Into<SelectedExpressionsSyntax>) -> Self {
self.selected_expressions = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SelectedVariableAssignmentSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_node(self.selected_assignment_preamble)
.push_node(self.target)
.push_token(self.colon_eq_token)
.push_node(self.selected_expressions)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<SelectedVariableAssignmentBuilder> for SelectedVariableAssignmentSyntax {
fn from(value: SelectedVariableAssignmentBuilder) -> Self {
value.build()
}
}
pub struct SelectedWaveformAssignmentBuilder {
stmt_label: Option<StmtLabelSyntax>,
selected_assignment_preamble: SelectedAssignmentPreambleSyntax,
target: TargetSyntax,
lte_token: Token,
delay_mechanism: Option<DelayMechanismSyntax>,
selected_waveforms: SelectedWaveformsSyntax,
semi_colon_token: Token,
}
impl SelectedWaveformAssignmentBuilder {
pub fn new(
selected_assignment_preamble: impl Into<SelectedAssignmentPreambleSyntax>,
target: impl Into<TargetSyntax>,
selected_waveforms: impl Into<SelectedWaveformsSyntax>,
) -> Self {
Self {
stmt_label: None,
selected_assignment_preamble: selected_assignment_preamble.into(),
target: target.into(),
lte_token: TokenKind::LTE.canonical_token().unwrap(),
delay_mechanism: None,
selected_waveforms: selected_waveforms.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_selected_assignment_preamble(
mut self,
n: impl Into<SelectedAssignmentPreambleSyntax>,
) -> Self {
self.selected_assignment_preamble = n.into();
self
}
pub fn with_target(mut self, n: impl Into<TargetSyntax>) -> Self {
self.target = n.into();
self
}
pub fn with_lte_token(mut self, t: impl Into<Token>) -> Self {
self.lte_token = t.into();
self
}
pub fn with_lte_token_trivia(mut self, trivia: Trivia) -> Self {
self.lte_token.set_leading_trivia(trivia);
self
}
pub fn with_delay_mechanism(mut self, n: impl Into<DelayMechanismSyntax>) -> Self {
self.delay_mechanism = Some(n.into());
self
}
pub fn with_selected_waveforms(mut self, n: impl Into<SelectedWaveformsSyntax>) -> Self {
self.selected_waveforms = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SelectedWaveformAssignmentSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_node(self.selected_assignment_preamble)
.push_node(self.target)
.push_token(self.lte_token)
.push_opt_node(self.delay_mechanism)
.push_node(self.selected_waveforms)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<SelectedWaveformAssignmentBuilder> for SelectedWaveformAssignmentSyntax {
fn from(value: SelectedWaveformAssignmentBuilder) -> Self {
value.build()
}
}
pub struct SelectedWaveformItemBuilder {
waveform: WaveformSyntax,
when_token: Token,
choices: ChoicesSyntax,
}
impl SelectedWaveformItemBuilder {
pub fn new(waveform: impl Into<WaveformSyntax>, choices: impl Into<ChoicesSyntax>) -> Self {
Self {
waveform: waveform.into(),
when_token: Kw::When.canonical_token(),
choices: choices.into(),
}
}
pub fn with_waveform(mut self, n: impl Into<WaveformSyntax>) -> Self {
self.waveform = n.into();
self
}
pub fn with_when_token(mut self, t: impl Into<Token>) -> Self {
self.when_token = t.into();
self
}
pub fn with_when_token_trivia(mut self, trivia: Trivia) -> Self {
self.when_token.set_leading_trivia(trivia);
self
}
pub fn with_choices(mut self, n: impl Into<ChoicesSyntax>) -> Self {
self.choices = n.into();
self
}
pub fn build(self) -> SelectedWaveformItemSyntax {
RawNodeBuilder::new()
.push_node(self.waveform)
.push_token(self.when_token)
.push_node(self.choices)
.finish()
}
}
impl From<SelectedWaveformItemBuilder> for SelectedWaveformItemSyntax {
fn from(value: SelectedWaveformItemBuilder) -> Self {
value.build()
}
}
pub struct SensitivityClauseBuilder {
on_token: Token,
sensitivity_list: SensitivityListSyntax,
}
impl SensitivityClauseBuilder {
pub fn new(sensitivity_list: impl Into<SensitivityListSyntax>) -> Self {
Self {
on_token: Kw::On.canonical_token(),
sensitivity_list: sensitivity_list.into(),
}
}
pub fn with_on_token(mut self, t: impl Into<Token>) -> Self {
self.on_token = t.into();
self
}
pub fn with_on_token_trivia(mut self, trivia: Trivia) -> Self {
self.on_token.set_leading_trivia(trivia);
self
}
pub fn with_sensitivity_list(mut self, n: impl Into<SensitivityListSyntax>) -> Self {
self.sensitivity_list = n.into();
self
}
pub fn build(self) -> SensitivityClauseSyntax {
RawNodeBuilder::new()
.push_token(self.on_token)
.push_node(self.sensitivity_list)
.finish()
}
}
impl From<SensitivityClauseBuilder> for SensitivityClauseSyntax {
fn from(value: SensitivityClauseBuilder) -> Self {
value.build()
}
}
pub struct SequenceOfStatementsBuilder {
sequential_statements: Vec<SequentialStatementSyntax>,
}
impl Default for SequenceOfStatementsBuilder {
fn default() -> Self {
Self::new()
}
}
impl SequenceOfStatementsBuilder {
pub fn new() -> Self {
Self {
sequential_statements: Vec::new(),
}
}
pub fn add_sequential_statements(mut self, n: impl Into<SequentialStatementSyntax>) -> Self {
self.sequential_statements.push(n.into());
self
}
pub fn build(self) -> SequenceOfStatementsSyntax {
RawNodeBuilder::new()
.push_nodes(self.sequential_statements)
.finish()
}
}
impl From<SequenceOfStatementsBuilder> for SequenceOfStatementsSyntax {
fn from(value: SequenceOfStatementsBuilder) -> Self {
value.build()
}
}
pub struct SeverityClauseBuilder {
severity_token: Token,
expression: ExpressionSyntax,
}
impl SeverityClauseBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
severity_token: Kw::Severity.canonical_token(),
expression: expression.into(),
}
}
pub fn with_severity_token(mut self, t: impl Into<Token>) -> Self {
self.severity_token = t.into();
self
}
pub fn with_severity_token_trivia(mut self, trivia: Trivia) -> Self {
self.severity_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn build(self) -> SeverityClauseSyntax {
RawNodeBuilder::new()
.push_token(self.severity_token)
.push_node(self.expression)
.finish()
}
}
impl From<SeverityClauseBuilder> for SeverityClauseSyntax {
fn from(value: SeverityClauseBuilder) -> Self {
value.build()
}
}
pub struct SignalDeclarationBuilder {
signal_token: Token,
identifier_list: IdentifierListSyntax,
colon_token: Token,
subtype_indication: SubtypeIndicationSyntax,
signal_kind: Option<SignalKindToken>,
initial_value: Option<InitialValueSyntax>,
semi_colon_token: Token,
}
impl SignalDeclarationBuilder {
pub fn new(
identifier_list: impl Into<IdentifierListSyntax>,
subtype_indication: impl Into<SubtypeIndicationSyntax>,
) -> Self {
Self {
signal_token: Kw::Signal.canonical_token(),
identifier_list: identifier_list.into(),
colon_token: TokenKind::Colon.canonical_token().unwrap(),
subtype_indication: subtype_indication.into(),
signal_kind: None,
initial_value: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_signal_token(mut self, t: impl Into<Token>) -> Self {
self.signal_token = t.into();
self
}
pub fn with_signal_token_trivia(mut self, trivia: Trivia) -> Self {
self.signal_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_list(mut self, n: impl Into<IdentifierListSyntax>) -> Self {
self.identifier_list = n.into();
self
}
pub fn with_colon_token(mut self, t: impl Into<Token>) -> Self {
self.colon_token = t.into();
self
}
pub fn with_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_token.set_leading_trivia(trivia);
self
}
pub fn with_subtype_indication(mut self, n: impl Into<SubtypeIndicationSyntax>) -> Self {
self.subtype_indication = n.into();
self
}
pub fn with_signal_kind(mut self, n: impl Into<SignalKindToken>) -> Self {
self.signal_kind = Some(n.into());
self
}
pub fn with_initial_value(mut self, n: impl Into<InitialValueSyntax>) -> Self {
self.initial_value = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SignalDeclarationSyntax {
RawNodeBuilder::new()
.push_token(self.signal_token)
.push_node(self.identifier_list)
.push_token(self.colon_token)
.push_node(self.subtype_indication)
.push_opt_token(self.signal_kind.map(|t| t.0))
.push_opt_node(self.initial_value)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<SignalDeclarationBuilder> for SignalDeclarationSyntax {
fn from(value: SignalDeclarationBuilder) -> Self {
value.build()
}
}
pub struct SignalListAllBuilder {
all_token: Token,
}
impl Default for SignalListAllBuilder {
fn default() -> Self {
Self::new()
}
}
impl SignalListAllBuilder {
pub fn new() -> Self {
Self {
all_token: Kw::All.canonical_token(),
}
}
pub fn with_all_token(mut self, t: impl Into<Token>) -> Self {
self.all_token = t.into();
self
}
pub fn with_all_token_trivia(mut self, trivia: Trivia) -> Self {
self.all_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SignalListAllSyntax {
RawNodeBuilder::new().push_token(self.all_token).finish()
}
}
impl From<SignalListAllBuilder> for SignalListAllSyntax {
fn from(value: SignalListAllBuilder) -> Self {
value.build()
}
}
pub struct SignalListOthersBuilder {
others_token: Token,
}
impl Default for SignalListOthersBuilder {
fn default() -> Self {
Self::new()
}
}
impl SignalListOthersBuilder {
pub fn new() -> Self {
Self {
others_token: Kw::Others.canonical_token(),
}
}
pub fn with_others_token(mut self, t: impl Into<Token>) -> Self {
self.others_token = t.into();
self
}
pub fn with_others_token_trivia(mut self, trivia: Trivia) -> Self {
self.others_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SignalListOthersSyntax {
RawNodeBuilder::new().push_token(self.others_token).finish()
}
}
impl From<SignalListOthersBuilder> for SignalListOthersSyntax {
fn from(value: SignalListOthersBuilder) -> Self {
value.build()
}
}
pub struct SignatureBuilder {
left_square_token: Token,
type_mark_list: Option<TypeMarkListSyntax>,
return_type: Option<ReturnTypeSyntax>,
right_square_token: Token,
}
impl Default for SignatureBuilder {
fn default() -> Self {
Self::new()
}
}
impl SignatureBuilder {
pub fn new() -> Self {
Self {
left_square_token: TokenKind::LeftSquare.canonical_token().unwrap(),
type_mark_list: None,
return_type: None,
right_square_token: TokenKind::RightSquare.canonical_token().unwrap(),
}
}
pub fn with_left_square_token(mut self, t: impl Into<Token>) -> Self {
self.left_square_token = t.into();
self
}
pub fn with_left_square_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_square_token.set_leading_trivia(trivia);
self
}
pub fn with_type_mark_list(mut self, n: impl Into<TypeMarkListSyntax>) -> Self {
self.type_mark_list = Some(n.into());
self
}
pub fn with_return_type(mut self, n: impl Into<ReturnTypeSyntax>) -> Self {
self.return_type = Some(n.into());
self
}
pub fn with_right_square_token(mut self, t: impl Into<Token>) -> Self {
self.right_square_token = t.into();
self
}
pub fn with_right_square_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_square_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SignatureSyntax {
RawNodeBuilder::new()
.push_token(self.left_square_token)
.push_opt_node(self.type_mark_list)
.push_opt_node(self.return_type)
.push_token(self.right_square_token)
.finish()
}
}
impl From<SignatureBuilder> for SignatureSyntax {
fn from(value: SignatureBuilder) -> Self {
value.build()
}
}
pub struct SimpleConfigurationSpecificationBuilder {
component_configuration_preamble: ComponentConfigurationPreambleSyntax,
binding_indication: Option<BindingIndicationSyntax>,
semi_colon_token: Token,
component_configuration_epilogue: Option<ComponentConfigurationEpilogueSyntax>,
}
impl SimpleConfigurationSpecificationBuilder {
pub fn new(
component_configuration_preamble: impl Into<ComponentConfigurationPreambleSyntax>,
) -> Self {
Self {
component_configuration_preamble: component_configuration_preamble.into(),
binding_indication: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
component_configuration_epilogue: None,
}
}
pub fn with_component_configuration_preamble(
mut self,
n: impl Into<ComponentConfigurationPreambleSyntax>,
) -> Self {
self.component_configuration_preamble = n.into();
self
}
pub fn with_binding_indication(mut self, n: impl Into<BindingIndicationSyntax>) -> Self {
self.binding_indication = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn with_component_configuration_epilogue(
mut self,
n: impl Into<ComponentConfigurationEpilogueSyntax>,
) -> Self {
self.component_configuration_epilogue = Some(n.into());
self
}
pub fn build(self) -> SimpleConfigurationSpecificationSyntax {
RawNodeBuilder::new()
.push_node(self.component_configuration_preamble)
.push_opt_node(self.binding_indication)
.push_token(self.semi_colon_token)
.push_opt_node(self.component_configuration_epilogue)
.finish()
}
}
impl From<SimpleConfigurationSpecificationBuilder> for SimpleConfigurationSpecificationSyntax {
fn from(value: SimpleConfigurationSpecificationBuilder) -> Self {
value.build()
}
}
pub struct SimpleForceAssignmentBuilder {
stmt_label: Option<StmtLabelSyntax>,
target: TargetSyntax,
lte_token: Token,
force_token: Token,
force_mode: Option<ForceModeToken>,
expression: ExpressionSyntax,
semi_colon_token: Token,
}
impl SimpleForceAssignmentBuilder {
pub fn new(target: impl Into<TargetSyntax>, expression: impl Into<ExpressionSyntax>) -> Self {
Self {
stmt_label: None,
target: target.into(),
lte_token: TokenKind::LTE.canonical_token().unwrap(),
force_token: Kw::Force.canonical_token(),
force_mode: None,
expression: expression.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_target(mut self, n: impl Into<TargetSyntax>) -> Self {
self.target = n.into();
self
}
pub fn with_lte_token(mut self, t: impl Into<Token>) -> Self {
self.lte_token = t.into();
self
}
pub fn with_lte_token_trivia(mut self, trivia: Trivia) -> Self {
self.lte_token.set_leading_trivia(trivia);
self
}
pub fn with_force_token(mut self, t: impl Into<Token>) -> Self {
self.force_token = t.into();
self
}
pub fn with_force_token_trivia(mut self, trivia: Trivia) -> Self {
self.force_token.set_leading_trivia(trivia);
self
}
pub fn with_force_mode(mut self, n: impl Into<ForceModeToken>) -> Self {
self.force_mode = Some(n.into());
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SimpleForceAssignmentSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_node(self.target)
.push_token(self.lte_token)
.push_token(self.force_token)
.push_opt_token(self.force_mode.map(|t| t.0))
.push_node(self.expression)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<SimpleForceAssignmentBuilder> for SimpleForceAssignmentSyntax {
fn from(value: SimpleForceAssignmentBuilder) -> Self {
value.build()
}
}
pub struct SimpleReleaseAssignmentBuilder {
stmt_label: Option<StmtLabelSyntax>,
target: TargetSyntax,
lte_token: Token,
release_token: Token,
force_mode: Option<ForceModeToken>,
semi_colon_token: Token,
}
impl SimpleReleaseAssignmentBuilder {
pub fn new(target: impl Into<TargetSyntax>) -> Self {
Self {
stmt_label: None,
target: target.into(),
lte_token: TokenKind::LTE.canonical_token().unwrap(),
release_token: Kw::Release.canonical_token(),
force_mode: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_target(mut self, n: impl Into<TargetSyntax>) -> Self {
self.target = n.into();
self
}
pub fn with_lte_token(mut self, t: impl Into<Token>) -> Self {
self.lte_token = t.into();
self
}
pub fn with_lte_token_trivia(mut self, trivia: Trivia) -> Self {
self.lte_token.set_leading_trivia(trivia);
self
}
pub fn with_release_token(mut self, t: impl Into<Token>) -> Self {
self.release_token = t.into();
self
}
pub fn with_release_token_trivia(mut self, trivia: Trivia) -> Self {
self.release_token.set_leading_trivia(trivia);
self
}
pub fn with_force_mode(mut self, n: impl Into<ForceModeToken>) -> Self {
self.force_mode = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SimpleReleaseAssignmentSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_node(self.target)
.push_token(self.lte_token)
.push_token(self.release_token)
.push_opt_token(self.force_mode.map(|t| t.0))
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<SimpleReleaseAssignmentBuilder> for SimpleReleaseAssignmentSyntax {
fn from(value: SimpleReleaseAssignmentBuilder) -> Self {
value.build()
}
}
pub struct SimpleVariableAssignmentBuilder {
stmt_label: Option<StmtLabelSyntax>,
target: TargetSyntax,
colon_eq_token: Token,
expression: ExpressionSyntax,
semi_colon_token: Token,
}
impl SimpleVariableAssignmentBuilder {
pub fn new(target: impl Into<TargetSyntax>, expression: impl Into<ExpressionSyntax>) -> Self {
Self {
stmt_label: None,
target: target.into(),
colon_eq_token: TokenKind::ColonEq.canonical_token().unwrap(),
expression: expression.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_target(mut self, n: impl Into<TargetSyntax>) -> Self {
self.target = n.into();
self
}
pub fn with_colon_eq_token(mut self, t: impl Into<Token>) -> Self {
self.colon_eq_token = t.into();
self
}
pub fn with_colon_eq_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_eq_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SimpleVariableAssignmentSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_node(self.target)
.push_token(self.colon_eq_token)
.push_node(self.expression)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<SimpleVariableAssignmentBuilder> for SimpleVariableAssignmentSyntax {
fn from(value: SimpleVariableAssignmentBuilder) -> Self {
value.build()
}
}
pub struct SimpleWaveformAssignmentBuilder {
stmt_label: Option<StmtLabelSyntax>,
target: TargetSyntax,
lte_token: Token,
delay_mechanism: Option<DelayMechanismSyntax>,
waveform: WaveformSyntax,
semi_colon_token: Token,
}
impl SimpleWaveformAssignmentBuilder {
pub fn new(target: impl Into<TargetSyntax>, waveform: impl Into<WaveformSyntax>) -> Self {
Self {
stmt_label: None,
target: target.into(),
lte_token: TokenKind::LTE.canonical_token().unwrap(),
delay_mechanism: None,
waveform: waveform.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_target(mut self, n: impl Into<TargetSyntax>) -> Self {
self.target = n.into();
self
}
pub fn with_lte_token(mut self, t: impl Into<Token>) -> Self {
self.lte_token = t.into();
self
}
pub fn with_lte_token_trivia(mut self, trivia: Trivia) -> Self {
self.lte_token.set_leading_trivia(trivia);
self
}
pub fn with_delay_mechanism(mut self, n: impl Into<DelayMechanismSyntax>) -> Self {
self.delay_mechanism = Some(n.into());
self
}
pub fn with_waveform(mut self, n: impl Into<WaveformSyntax>) -> Self {
self.waveform = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SimpleWaveformAssignmentSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_node(self.target)
.push_token(self.lte_token)
.push_opt_node(self.delay_mechanism)
.push_node(self.waveform)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<SimpleWaveformAssignmentBuilder> for SimpleWaveformAssignmentSyntax {
fn from(value: SimpleWaveformAssignmentBuilder) -> Self {
value.build()
}
}
pub struct StmtLabelBuilder {
label: Token,
colon_token: Token,
}
impl StmtLabelBuilder {
pub fn new(label: impl Into<crate::builder::Identifier>) -> Self {
Self {
label: label.into().into(),
colon_token: TokenKind::Colon.canonical_token().unwrap(),
}
}
pub fn with_label(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.label = t.into().into();
self
}
pub fn with_label_trivia(mut self, trivia: Trivia) -> Self {
self.label.set_leading_trivia(trivia);
self
}
pub fn with_colon_token(mut self, t: impl Into<Token>) -> Self {
self.colon_token = t.into();
self
}
pub fn with_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> StmtLabelSyntax {
RawNodeBuilder::new()
.push_token(self.label)
.push_token(self.colon_token)
.finish()
}
}
impl From<StmtLabelBuilder> for StmtLabelSyntax {
fn from(value: StmtLabelBuilder) -> Self {
value.build()
}
}
pub struct SubprogramBodyBuilder {
subprogram_body_preamble: SubprogramBodyPreambleSyntax,
subprogram_declarative_part: Option<SubprogramDeclarativePartSyntax>,
declaration_statement_separator: DeclarationStatementSeparatorSyntax,
subprogram_statement_part: Option<SubprogramStatementPartSyntax>,
subprogram_body_epilogue: SubprogramBodyEpilogueSyntax,
}
impl SubprogramBodyBuilder {
pub fn new(subprogram_body_preamble: impl Into<SubprogramBodyPreambleSyntax>) -> Self {
Self {
subprogram_body_preamble: subprogram_body_preamble.into(),
subprogram_declarative_part: None,
declaration_statement_separator: DeclarationStatementSeparatorBuilder::default()
.build(),
subprogram_statement_part: None,
subprogram_body_epilogue: SubprogramBodyEpilogueBuilder::default().build(),
}
}
pub fn with_subprogram_body_preamble(
mut self,
n: impl Into<SubprogramBodyPreambleSyntax>,
) -> Self {
self.subprogram_body_preamble = n.into();
self
}
pub fn with_subprogram_declarative_part(
mut self,
n: impl Into<SubprogramDeclarativePartSyntax>,
) -> Self {
self.subprogram_declarative_part = Some(n.into());
self
}
pub fn with_declaration_statement_separator(
mut self,
n: impl Into<DeclarationStatementSeparatorSyntax>,
) -> Self {
self.declaration_statement_separator = n.into();
self
}
pub fn with_subprogram_statement_part(
mut self,
n: impl Into<SubprogramStatementPartSyntax>,
) -> Self {
self.subprogram_statement_part = Some(n.into());
self
}
pub fn with_subprogram_body_epilogue(
mut self,
n: impl Into<SubprogramBodyEpilogueSyntax>,
) -> Self {
self.subprogram_body_epilogue = n.into();
self
}
pub fn build(self) -> SubprogramBodySyntax {
RawNodeBuilder::new()
.push_node(self.subprogram_body_preamble)
.push_opt_node(self.subprogram_declarative_part)
.push_node(self.declaration_statement_separator)
.push_opt_node(self.subprogram_statement_part)
.push_node(self.subprogram_body_epilogue)
.finish()
}
}
impl From<SubprogramBodyBuilder> for SubprogramBodySyntax {
fn from(value: SubprogramBodyBuilder) -> Self {
value.build()
}
}
pub struct SubprogramBodyEpilogueBuilder {
end_token: Token,
subprogram_kind: Option<SubprogramKindToken>,
designator: Option<DesignatorToken>,
semi_colon_token: Token,
}
impl Default for SubprogramBodyEpilogueBuilder {
fn default() -> Self {
Self::new()
}
}
impl SubprogramBodyEpilogueBuilder {
pub fn new() -> Self {
Self {
end_token: Kw::End.canonical_token(),
subprogram_kind: None,
designator: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_end_token(mut self, t: impl Into<Token>) -> Self {
self.end_token = t.into();
self
}
pub fn with_end_token_trivia(mut self, trivia: Trivia) -> Self {
self.end_token.set_leading_trivia(trivia);
self
}
pub fn with_subprogram_kind(mut self, n: impl Into<SubprogramKindToken>) -> Self {
self.subprogram_kind = Some(n.into());
self
}
pub fn with_designator(mut self, n: impl Into<DesignatorToken>) -> Self {
self.designator = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SubprogramBodyEpilogueSyntax {
RawNodeBuilder::new()
.push_token(self.end_token)
.push_opt_token(self.subprogram_kind.map(|t| t.0))
.push_opt_token(self.designator.map(|t| t.0))
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<SubprogramBodyEpilogueBuilder> for SubprogramBodyEpilogueSyntax {
fn from(value: SubprogramBodyEpilogueBuilder) -> Self {
value.build()
}
}
pub struct SubprogramBodyPreambleBuilder {
subprogram_specification: SubprogramSpecificationSyntax,
is_token: Token,
}
impl SubprogramBodyPreambleBuilder {
pub fn new(subprogram_specification: impl Into<SubprogramSpecificationSyntax>) -> Self {
Self {
subprogram_specification: subprogram_specification.into(),
is_token: Kw::Is.canonical_token(),
}
}
pub fn with_subprogram_specification(
mut self,
n: impl Into<SubprogramSpecificationSyntax>,
) -> Self {
self.subprogram_specification = n.into();
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SubprogramBodyPreambleSyntax {
RawNodeBuilder::new()
.push_node(self.subprogram_specification)
.push_token(self.is_token)
.finish()
}
}
impl From<SubprogramBodyPreambleBuilder> for SubprogramBodyPreambleSyntax {
fn from(value: SubprogramBodyPreambleBuilder) -> Self {
value.build()
}
}
pub struct SubprogramDeclarationBuilder {
subprogram_specification: SubprogramSpecificationSyntax,
semi_colon_token: Token,
}
impl SubprogramDeclarationBuilder {
pub fn new(subprogram_specification: impl Into<SubprogramSpecificationSyntax>) -> Self {
Self {
subprogram_specification: subprogram_specification.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_subprogram_specification(
mut self,
n: impl Into<SubprogramSpecificationSyntax>,
) -> Self {
self.subprogram_specification = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SubprogramDeclarationSyntax {
RawNodeBuilder::new()
.push_node(self.subprogram_specification)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<SubprogramDeclarationBuilder> for SubprogramDeclarationSyntax {
fn from(value: SubprogramDeclarationBuilder) -> Self {
value.build()
}
}
pub struct SubprogramDeclarativePartBuilder {
subprogram_declarative_items: Vec<SubprogramDeclarativeItemSyntax>,
}
impl Default for SubprogramDeclarativePartBuilder {
fn default() -> Self {
Self::new()
}
}
impl SubprogramDeclarativePartBuilder {
pub fn new() -> Self {
Self {
subprogram_declarative_items: Vec::new(),
}
}
pub fn add_subprogram_declarative_items(
mut self,
n: impl Into<SubprogramDeclarativeItemSyntax>,
) -> Self {
self.subprogram_declarative_items.push(n.into());
self
}
pub fn build(self) -> SubprogramDeclarativePartSyntax {
RawNodeBuilder::new()
.push_nodes(self.subprogram_declarative_items)
.finish()
}
}
impl From<SubprogramDeclarativePartBuilder> for SubprogramDeclarativePartSyntax {
fn from(value: SubprogramDeclarativePartBuilder) -> Self {
value.build()
}
}
pub struct SubprogramDefaultBuilder {
is_token: Token,
interface_subprogram_default: InterfaceSubprogramDefaultSyntax,
}
impl SubprogramDefaultBuilder {
pub fn new(interface_subprogram_default: impl Into<InterfaceSubprogramDefaultSyntax>) -> Self {
Self {
is_token: Kw::Is.canonical_token(),
interface_subprogram_default: interface_subprogram_default.into(),
}
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn with_interface_subprogram_default(
mut self,
n: impl Into<InterfaceSubprogramDefaultSyntax>,
) -> Self {
self.interface_subprogram_default = n.into();
self
}
pub fn build(self) -> SubprogramDefaultSyntax {
RawNodeBuilder::new()
.push_token(self.is_token)
.push_node(self.interface_subprogram_default)
.finish()
}
}
impl From<SubprogramDefaultBuilder> for SubprogramDefaultSyntax {
fn from(value: SubprogramDefaultBuilder) -> Self {
value.build()
}
}
pub struct SubprogramHeaderBuilder {
subprogram_header_generic_clause: SubprogramHeaderGenericClauseSyntax,
generic_map_aspect: Option<GenericMapAspectSyntax>,
}
impl SubprogramHeaderBuilder {
pub fn new(
subprogram_header_generic_clause: impl Into<SubprogramHeaderGenericClauseSyntax>,
) -> Self {
Self {
subprogram_header_generic_clause: subprogram_header_generic_clause.into(),
generic_map_aspect: None,
}
}
pub fn with_subprogram_header_generic_clause(
mut self,
n: impl Into<SubprogramHeaderGenericClauseSyntax>,
) -> Self {
self.subprogram_header_generic_clause = n.into();
self
}
pub fn with_generic_map_aspect(mut self, n: impl Into<GenericMapAspectSyntax>) -> Self {
self.generic_map_aspect = Some(n.into());
self
}
pub fn build(self) -> SubprogramHeaderSyntax {
RawNodeBuilder::new()
.push_node(self.subprogram_header_generic_clause)
.push_opt_node(self.generic_map_aspect)
.finish()
}
}
impl From<SubprogramHeaderBuilder> for SubprogramHeaderSyntax {
fn from(value: SubprogramHeaderBuilder) -> Self {
value.build()
}
}
pub struct SubprogramHeaderGenericClauseBuilder {
generic_token: Token,
left_par_token: Token,
generic_list: InterfaceListSyntax,
right_par_token: Token,
}
impl SubprogramHeaderGenericClauseBuilder {
pub fn new(generic_list: impl Into<InterfaceListSyntax>) -> Self {
Self {
generic_token: Kw::Generic.canonical_token(),
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
generic_list: generic_list.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
}
}
pub fn with_generic_token(mut self, t: impl Into<Token>) -> Self {
self.generic_token = t.into();
self
}
pub fn with_generic_token_trivia(mut self, trivia: Trivia) -> Self {
self.generic_token.set_leading_trivia(trivia);
self
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_generic_list(mut self, n: impl Into<InterfaceListSyntax>) -> Self {
self.generic_list = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SubprogramHeaderGenericClauseSyntax {
RawNodeBuilder::new()
.push_token(self.generic_token)
.push_token(self.left_par_token)
.push_node(self.generic_list)
.push_token(self.right_par_token)
.finish()
}
}
impl From<SubprogramHeaderGenericClauseBuilder> for SubprogramHeaderGenericClauseSyntax {
fn from(value: SubprogramHeaderGenericClauseBuilder) -> Self {
value.build()
}
}
pub struct SubprogramInstantiationDeclarationBuilder {
subprogram_instantiation_declaration_preamble: SubprogramInstantiationDeclarationPreambleSyntax,
generic_map_aspect: Option<GenericMapAspectSyntax>,
semi_colon_token: Token,
}
impl SubprogramInstantiationDeclarationBuilder {
pub fn new(
subprogram_instantiation_declaration_preamble: impl Into<
SubprogramInstantiationDeclarationPreambleSyntax,
>,
) -> Self {
Self {
subprogram_instantiation_declaration_preamble:
subprogram_instantiation_declaration_preamble.into(),
generic_map_aspect: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_subprogram_instantiation_declaration_preamble(
mut self,
n: impl Into<SubprogramInstantiationDeclarationPreambleSyntax>,
) -> Self {
self.subprogram_instantiation_declaration_preamble = n.into();
self
}
pub fn with_generic_map_aspect(mut self, n: impl Into<GenericMapAspectSyntax>) -> Self {
self.generic_map_aspect = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SubprogramInstantiationDeclarationSyntax {
RawNodeBuilder::new()
.push_node(self.subprogram_instantiation_declaration_preamble)
.push_opt_node(self.generic_map_aspect)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<SubprogramInstantiationDeclarationBuilder> for SubprogramInstantiationDeclarationSyntax {
fn from(value: SubprogramInstantiationDeclarationBuilder) -> Self {
value.build()
}
}
pub struct SubprogramInstantiationDeclarationPreambleBuilder {
subprogram_kind: SubprogramKindToken,
identifier_token: Token,
is_token: Token,
new_token: Token,
name: NameSyntax,
signature: Option<SignatureSyntax>,
}
impl SubprogramInstantiationDeclarationPreambleBuilder {
pub fn new(
subprogram_kind: impl Into<SubprogramKindToken>,
identifier_token: impl Into<crate::builder::Identifier>,
name: impl Into<NameSyntax>,
) -> Self {
Self {
subprogram_kind: subprogram_kind.into(),
identifier_token: identifier_token.into().into(),
is_token: Kw::Is.canonical_token(),
new_token: Kw::New.canonical_token(),
name: name.into(),
signature: None,
}
}
pub fn with_subprogram_kind(mut self, n: impl Into<SubprogramKindToken>) -> Self {
self.subprogram_kind = n.into();
self
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn with_new_token(mut self, t: impl Into<Token>) -> Self {
self.new_token = t.into();
self
}
pub fn with_new_token_trivia(mut self, trivia: Trivia) -> Self {
self.new_token.set_leading_trivia(trivia);
self
}
pub fn with_name(mut self, n: impl Into<NameSyntax>) -> Self {
self.name = n.into();
self
}
pub fn with_signature(mut self, n: impl Into<SignatureSyntax>) -> Self {
self.signature = Some(n.into());
self
}
pub fn build(self) -> SubprogramInstantiationDeclarationPreambleSyntax {
RawNodeBuilder::new()
.push_token(self.subprogram_kind.0)
.push_token(self.identifier_token)
.push_token(self.is_token)
.push_token(self.new_token)
.push_node(self.name)
.push_opt_node(self.signature)
.finish()
}
}
impl From<SubprogramInstantiationDeclarationPreambleBuilder>
for SubprogramInstantiationDeclarationPreambleSyntax
{
fn from(value: SubprogramInstantiationDeclarationPreambleBuilder) -> Self {
value.build()
}
}
pub struct SubprogramStatementPartBuilder {
sequential_statements: Vec<SequentialStatementSyntax>,
}
impl Default for SubprogramStatementPartBuilder {
fn default() -> Self {
Self::new()
}
}
impl SubprogramStatementPartBuilder {
pub fn new() -> Self {
Self {
sequential_statements: Vec::new(),
}
}
pub fn add_sequential_statements(mut self, n: impl Into<SequentialStatementSyntax>) -> Self {
self.sequential_statements.push(n.into());
self
}
pub fn build(self) -> SubprogramStatementPartSyntax {
RawNodeBuilder::new()
.push_nodes(self.sequential_statements)
.finish()
}
}
impl From<SubprogramStatementPartBuilder> for SubprogramStatementPartSyntax {
fn from(value: SubprogramStatementPartBuilder) -> Self {
value.build()
}
}
pub struct SubtypeDeclarationBuilder {
subtype_token: Token,
identifier_token: Token,
is_token: Token,
subtype_indication: SubtypeIndicationSyntax,
semi_colon_token: Token,
}
impl SubtypeDeclarationBuilder {
pub fn new(
identifier_token: impl Into<crate::builder::Identifier>,
subtype_indication: impl Into<SubtypeIndicationSyntax>,
) -> Self {
Self {
subtype_token: Kw::Subtype.canonical_token(),
identifier_token: identifier_token.into().into(),
is_token: Kw::Is.canonical_token(),
subtype_indication: subtype_indication.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_subtype_token(mut self, t: impl Into<Token>) -> Self {
self.subtype_token = t.into();
self
}
pub fn with_subtype_token_trivia(mut self, trivia: Trivia) -> Self {
self.subtype_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_token(mut self, t: impl Into<crate::builder::Identifier>) -> Self {
self.identifier_token = t.into().into();
self
}
pub fn with_identifier_token_trivia(mut self, trivia: Trivia) -> Self {
self.identifier_token.set_leading_trivia(trivia);
self
}
pub fn with_is_token(mut self, t: impl Into<Token>) -> Self {
self.is_token = t.into();
self
}
pub fn with_is_token_trivia(mut self, trivia: Trivia) -> Self {
self.is_token.set_leading_trivia(trivia);
self
}
pub fn with_subtype_indication(mut self, n: impl Into<SubtypeIndicationSyntax>) -> Self {
self.subtype_indication = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> SubtypeDeclarationSyntax {
RawNodeBuilder::new()
.push_token(self.subtype_token)
.push_token(self.identifier_token)
.push_token(self.is_token)
.push_node(self.subtype_indication)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<SubtypeDeclarationBuilder> for SubtypeDeclarationSyntax {
fn from(value: SubtypeDeclarationBuilder) -> Self {
value.build()
}
}
pub struct SubtypeIndicationBuilder {
resolution_indication: Option<ResolutionIndicationSyntax>,
type_mark: NameSyntax,
}
impl SubtypeIndicationBuilder {
pub fn new(type_mark: impl Into<NameSyntax>) -> Self {
Self {
resolution_indication: None,
type_mark: type_mark.into(),
}
}
pub fn with_resolution_indication(mut self, n: impl Into<ResolutionIndicationSyntax>) -> Self {
self.resolution_indication = Some(n.into());
self
}
pub fn with_type_mark(mut self, n: impl Into<NameSyntax>) -> Self {
self.type_mark = n.into();
self
}
pub fn build(self) -> SubtypeIndicationSyntax {
RawNodeBuilder::new()
.push_opt_node(self.resolution_indication)
.push_node(self.type_mark)
.finish()
}
}
impl From<SubtypeIndicationBuilder> for SubtypeIndicationSyntax {
fn from(value: SubtypeIndicationBuilder) -> Self {
value.build()
}
}
pub struct TimeoutClauseBuilder {
for_token: Token,
expression: ExpressionSyntax,
}
impl TimeoutClauseBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
for_token: Kw::For.canonical_token(),
expression: expression.into(),
}
}
pub fn with_for_token(mut self, t: impl Into<Token>) -> Self {
self.for_token = t.into();
self
}
pub fn with_for_token_trivia(mut self, trivia: Trivia) -> Self {
self.for_token.set_leading_trivia(trivia);
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn build(self) -> TimeoutClauseSyntax {
RawNodeBuilder::new()
.push_token(self.for_token)
.push_node(self.expression)
.finish()
}
}
impl From<TimeoutClauseBuilder> for TimeoutClauseSyntax {
fn from(value: TimeoutClauseBuilder) -> Self {
value.build()
}
}
pub struct TransportDelayMechanismBuilder {
transport_token: Token,
}
impl Default for TransportDelayMechanismBuilder {
fn default() -> Self {
Self::new()
}
}
impl TransportDelayMechanismBuilder {
pub fn new() -> Self {
Self {
transport_token: Kw::Transport.canonical_token(),
}
}
pub fn with_transport_token(mut self, t: impl Into<Token>) -> Self {
self.transport_token = t.into();
self
}
pub fn with_transport_token_trivia(mut self, trivia: Trivia) -> Self {
self.transport_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> TransportDelayMechanismSyntax {
RawNodeBuilder::new()
.push_token(self.transport_token)
.finish()
}
}
impl From<TransportDelayMechanismBuilder> for TransportDelayMechanismSyntax {
fn from(value: TransportDelayMechanismBuilder) -> Self {
value.build()
}
}
pub struct UnaffectedWaveformBuilder {
unaffected_token: Token,
}
impl Default for UnaffectedWaveformBuilder {
fn default() -> Self {
Self::new()
}
}
impl UnaffectedWaveformBuilder {
pub fn new() -> Self {
Self {
unaffected_token: Kw::Unaffected.canonical_token(),
}
}
pub fn with_unaffected_token(mut self, t: impl Into<Token>) -> Self {
self.unaffected_token = t.into();
self
}
pub fn with_unaffected_token_trivia(mut self, trivia: Trivia) -> Self {
self.unaffected_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> UnaffectedWaveformSyntax {
RawNodeBuilder::new()
.push_token(self.unaffected_token)
.finish()
}
}
impl From<UnaffectedWaveformBuilder> for UnaffectedWaveformSyntax {
fn from(value: UnaffectedWaveformBuilder) -> Self {
value.build()
}
}
pub struct UnaryExpressionBuilder {
unary_operator: UnaryOperatorToken,
expression: ExpressionSyntax,
}
impl UnaryExpressionBuilder {
pub fn new(
unary_operator: impl Into<UnaryOperatorToken>,
expression: impl Into<ExpressionSyntax>,
) -> Self {
Self {
unary_operator: unary_operator.into(),
expression: expression.into(),
}
}
pub fn with_unary_operator(mut self, n: impl Into<UnaryOperatorToken>) -> Self {
self.unary_operator = n.into();
self
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn build(self) -> UnaryExpressionSyntax {
RawNodeBuilder::new()
.push_token(self.unary_operator.0)
.push_node(self.expression)
.finish()
}
}
impl From<UnaryExpressionBuilder> for UnaryExpressionSyntax {
fn from(value: UnaryExpressionBuilder) -> Self {
value.build()
}
}
pub struct UnboundedArrayDefinitionBuilder {
array_token: Token,
left_par_token: Token,
index_subtype_definition_list: IndexSubtypeDefinitionListSyntax,
right_par_token: Token,
of_token: Token,
subtype_indication: SubtypeIndicationSyntax,
}
impl UnboundedArrayDefinitionBuilder {
pub fn new(
index_subtype_definition_list: impl Into<IndexSubtypeDefinitionListSyntax>,
subtype_indication: impl Into<SubtypeIndicationSyntax>,
) -> Self {
Self {
array_token: Kw::Array.canonical_token(),
left_par_token: TokenKind::LeftPar.canonical_token().unwrap(),
index_subtype_definition_list: index_subtype_definition_list.into(),
right_par_token: TokenKind::RightPar.canonical_token().unwrap(),
of_token: Kw::Of.canonical_token(),
subtype_indication: subtype_indication.into(),
}
}
pub fn with_array_token(mut self, t: impl Into<Token>) -> Self {
self.array_token = t.into();
self
}
pub fn with_array_token_trivia(mut self, trivia: Trivia) -> Self {
self.array_token.set_leading_trivia(trivia);
self
}
pub fn with_left_par_token(mut self, t: impl Into<Token>) -> Self {
self.left_par_token = t.into();
self
}
pub fn with_left_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.left_par_token.set_leading_trivia(trivia);
self
}
pub fn with_index_subtype_definition_list(
mut self,
n: impl Into<IndexSubtypeDefinitionListSyntax>,
) -> Self {
self.index_subtype_definition_list = n.into();
self
}
pub fn with_right_par_token(mut self, t: impl Into<Token>) -> Self {
self.right_par_token = t.into();
self
}
pub fn with_right_par_token_trivia(mut self, trivia: Trivia) -> Self {
self.right_par_token.set_leading_trivia(trivia);
self
}
pub fn with_of_token(mut self, t: impl Into<Token>) -> Self {
self.of_token = t.into();
self
}
pub fn with_of_token_trivia(mut self, trivia: Trivia) -> Self {
self.of_token.set_leading_trivia(trivia);
self
}
pub fn with_subtype_indication(mut self, n: impl Into<SubtypeIndicationSyntax>) -> Self {
self.subtype_indication = n.into();
self
}
pub fn build(self) -> UnboundedArrayDefinitionSyntax {
RawNodeBuilder::new()
.push_token(self.array_token)
.push_token(self.left_par_token)
.push_node(self.index_subtype_definition_list)
.push_token(self.right_par_token)
.push_token(self.of_token)
.push_node(self.subtype_indication)
.finish()
}
}
impl From<UnboundedArrayDefinitionBuilder> for UnboundedArrayDefinitionSyntax {
fn from(value: UnboundedArrayDefinitionBuilder) -> Self {
value.build()
}
}
pub struct UnitDeclarationsBuilder {
units_token: Token,
primary_unit_declaration: PrimaryUnitDeclarationSyntax,
secondary_unit_declarations: Vec<SecondaryUnitDeclarationSyntax>,
}
impl UnitDeclarationsBuilder {
pub fn new(primary_unit_declaration: impl Into<PrimaryUnitDeclarationSyntax>) -> Self {
Self {
units_token: Kw::Units.canonical_token(),
primary_unit_declaration: primary_unit_declaration.into(),
secondary_unit_declarations: Vec::new(),
}
}
pub fn with_units_token(mut self, t: impl Into<Token>) -> Self {
self.units_token = t.into();
self
}
pub fn with_units_token_trivia(mut self, trivia: Trivia) -> Self {
self.units_token.set_leading_trivia(trivia);
self
}
pub fn with_primary_unit_declaration(
mut self,
n: impl Into<PrimaryUnitDeclarationSyntax>,
) -> Self {
self.primary_unit_declaration = n.into();
self
}
pub fn add_secondary_unit_declarations(
mut self,
n: impl Into<SecondaryUnitDeclarationSyntax>,
) -> Self {
self.secondary_unit_declarations.push(n.into());
self
}
pub fn build(self) -> UnitDeclarationsSyntax {
RawNodeBuilder::new()
.push_token(self.units_token)
.push_node(self.primary_unit_declaration)
.push_nodes(self.secondary_unit_declarations)
.finish()
}
}
impl From<UnitDeclarationsBuilder> for UnitDeclarationsSyntax {
fn from(value: UnitDeclarationsBuilder) -> Self {
value.build()
}
}
pub struct UpLevelBuilder {
circ_token: Token,
dot_token: Token,
}
impl Default for UpLevelBuilder {
fn default() -> Self {
Self::new()
}
}
impl UpLevelBuilder {
pub fn new() -> Self {
Self {
circ_token: TokenKind::Circ.canonical_token().unwrap(),
dot_token: TokenKind::Dot.canonical_token().unwrap(),
}
}
pub fn with_circ_token(mut self, t: impl Into<Token>) -> Self {
self.circ_token = t.into();
self
}
pub fn with_circ_token_trivia(mut self, trivia: Trivia) -> Self {
self.circ_token.set_leading_trivia(trivia);
self
}
pub fn with_dot_token(mut self, t: impl Into<Token>) -> Self {
self.dot_token = t.into();
self
}
pub fn with_dot_token_trivia(mut self, trivia: Trivia) -> Self {
self.dot_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> UpLevelSyntax {
RawNodeBuilder::new()
.push_token(self.circ_token)
.push_token(self.dot_token)
.finish()
}
}
impl From<UpLevelBuilder> for UpLevelSyntax {
fn from(value: UpLevelBuilder) -> Self {
value.build()
}
}
pub struct UseClauseBuilder {
use_token: Token,
name_list: NameListSyntax,
semi_colon_token: Token,
}
impl UseClauseBuilder {
pub fn new(name_list: impl Into<NameListSyntax>) -> Self {
Self {
use_token: Kw::Use.canonical_token(),
name_list: name_list.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_use_token(mut self, t: impl Into<Token>) -> Self {
self.use_token = t.into();
self
}
pub fn with_use_token_trivia(mut self, trivia: Trivia) -> Self {
self.use_token.set_leading_trivia(trivia);
self
}
pub fn with_name_list(mut self, n: impl Into<NameListSyntax>) -> Self {
self.name_list = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> UseClauseSyntax {
RawNodeBuilder::new()
.push_token(self.use_token)
.push_node(self.name_list)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<UseClauseBuilder> for UseClauseSyntax {
fn from(value: UseClauseBuilder) -> Self {
value.build()
}
}
pub struct UseClauseContextItemBuilder {
use_clause: UseClauseSyntax,
}
impl UseClauseContextItemBuilder {
pub fn new(use_clause: impl Into<UseClauseSyntax>) -> Self {
Self {
use_clause: use_clause.into(),
}
}
pub fn with_use_clause(mut self, n: impl Into<UseClauseSyntax>) -> Self {
self.use_clause = n.into();
self
}
pub fn build(self) -> UseClauseContextItemSyntax {
RawNodeBuilder::new().push_node(self.use_clause).finish()
}
}
impl From<UseClauseContextItemBuilder> for UseClauseContextItemSyntax {
fn from(value: UseClauseContextItemBuilder) -> Self {
value.build()
}
}
pub struct UseClauseDeclarationBuilder {
use_clause: UseClauseSyntax,
}
impl UseClauseDeclarationBuilder {
pub fn new(use_clause: impl Into<UseClauseSyntax>) -> Self {
Self {
use_clause: use_clause.into(),
}
}
pub fn with_use_clause(mut self, n: impl Into<UseClauseSyntax>) -> Self {
self.use_clause = n.into();
self
}
pub fn build(self) -> UseClauseDeclarationSyntax {
RawNodeBuilder::new().push_node(self.use_clause).finish()
}
}
impl From<UseClauseDeclarationBuilder> for UseClauseDeclarationSyntax {
fn from(value: UseClauseDeclarationBuilder) -> Self {
value.build()
}
}
pub struct VariableDeclarationBuilder {
shared_token: Option<Token>,
variable_token: Token,
identifier_list: IdentifierListSyntax,
colon_token: Token,
subtype_indication: SubtypeIndicationSyntax,
initial_value: Option<InitialValueSyntax>,
semi_colon_token: Token,
}
impl VariableDeclarationBuilder {
pub fn new(
identifier_list: impl Into<IdentifierListSyntax>,
subtype_indication: impl Into<SubtypeIndicationSyntax>,
) -> Self {
Self {
shared_token: None,
variable_token: Kw::Variable.canonical_token(),
identifier_list: identifier_list.into(),
colon_token: TokenKind::Colon.canonical_token().unwrap(),
subtype_indication: subtype_indication.into(),
initial_value: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_shared_token(mut self, t: impl Into<Token>) -> Self {
self.shared_token = Some(t.into());
self
}
pub fn with_shared_token_trivia(mut self, trivia: Trivia) -> Self {
let tok = self
.shared_token
.get_or_insert_with(|| Kw::Shared.canonical_token());
tok.set_leading_trivia(trivia);
self
}
pub fn with_variable_token(mut self, t: impl Into<Token>) -> Self {
self.variable_token = t.into();
self
}
pub fn with_variable_token_trivia(mut self, trivia: Trivia) -> Self {
self.variable_token.set_leading_trivia(trivia);
self
}
pub fn with_identifier_list(mut self, n: impl Into<IdentifierListSyntax>) -> Self {
self.identifier_list = n.into();
self
}
pub fn with_colon_token(mut self, t: impl Into<Token>) -> Self {
self.colon_token = t.into();
self
}
pub fn with_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.colon_token.set_leading_trivia(trivia);
self
}
pub fn with_subtype_indication(mut self, n: impl Into<SubtypeIndicationSyntax>) -> Self {
self.subtype_indication = n.into();
self
}
pub fn with_initial_value(mut self, n: impl Into<InitialValueSyntax>) -> Self {
self.initial_value = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> VariableDeclarationSyntax {
RawNodeBuilder::new()
.push_opt_token(self.shared_token)
.push_token(self.variable_token)
.push_node(self.identifier_list)
.push_token(self.colon_token)
.push_node(self.subtype_indication)
.push_opt_node(self.initial_value)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<VariableDeclarationBuilder> for VariableDeclarationSyntax {
fn from(value: VariableDeclarationBuilder) -> Self {
value.build()
}
}
pub struct VerificationUnitBindingBuilder {
verification_unit_binding_indication: VerificationUnitBindingIndicationSyntax,
semi_colon_token: Token,
}
impl VerificationUnitBindingBuilder {
pub fn new(
verification_unit_binding_indication: impl Into<VerificationUnitBindingIndicationSyntax>,
) -> Self {
Self {
verification_unit_binding_indication: verification_unit_binding_indication.into(),
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_verification_unit_binding_indication(
mut self,
n: impl Into<VerificationUnitBindingIndicationSyntax>,
) -> Self {
self.verification_unit_binding_indication = n.into();
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> VerificationUnitBindingSyntax {
RawNodeBuilder::new()
.push_node(self.verification_unit_binding_indication)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<VerificationUnitBindingBuilder> for VerificationUnitBindingSyntax {
fn from(value: VerificationUnitBindingBuilder) -> Self {
value.build()
}
}
pub struct VerificationUnitBindingIndicationBuilder {
use_token: Token,
vunit_token: Token,
verification_unit_list: VerificationUnitListSyntax,
}
impl VerificationUnitBindingIndicationBuilder {
pub fn new(verification_unit_list: impl Into<VerificationUnitListSyntax>) -> Self {
Self {
use_token: Kw::Use.canonical_token(),
vunit_token: Kw::Vunit.canonical_token(),
verification_unit_list: verification_unit_list.into(),
}
}
pub fn with_use_token(mut self, t: impl Into<Token>) -> Self {
self.use_token = t.into();
self
}
pub fn with_use_token_trivia(mut self, trivia: Trivia) -> Self {
self.use_token.set_leading_trivia(trivia);
self
}
pub fn with_vunit_token(mut self, t: impl Into<Token>) -> Self {
self.vunit_token = t.into();
self
}
pub fn with_vunit_token_trivia(mut self, trivia: Trivia) -> Self {
self.vunit_token.set_leading_trivia(trivia);
self
}
pub fn with_verification_unit_list(mut self, n: impl Into<VerificationUnitListSyntax>) -> Self {
self.verification_unit_list = n.into();
self
}
pub fn build(self) -> VerificationUnitBindingIndicationSyntax {
RawNodeBuilder::new()
.push_token(self.use_token)
.push_token(self.vunit_token)
.push_node(self.verification_unit_list)
.finish()
}
}
impl From<VerificationUnitBindingIndicationBuilder> for VerificationUnitBindingIndicationSyntax {
fn from(value: VerificationUnitBindingIndicationBuilder) -> Self {
value.build()
}
}
pub struct WaitStatementBuilder {
stmt_label: Option<StmtLabelSyntax>,
wait_token: Token,
sensitivity_clause: Option<SensitivityClauseSyntax>,
condition_clause: Option<ConditionClauseSyntax>,
timeout_clause: Option<TimeoutClauseSyntax>,
semi_colon_token: Token,
}
impl Default for WaitStatementBuilder {
fn default() -> Self {
Self::new()
}
}
impl WaitStatementBuilder {
pub fn new() -> Self {
Self {
stmt_label: None,
wait_token: Kw::Wait.canonical_token(),
sensitivity_clause: None,
condition_clause: None,
timeout_clause: None,
semi_colon_token: TokenKind::SemiColon.canonical_token().unwrap(),
}
}
pub fn with_stmt_label(mut self, n: impl Into<StmtLabelSyntax>) -> Self {
self.stmt_label = Some(n.into());
self
}
pub fn with_wait_token(mut self, t: impl Into<Token>) -> Self {
self.wait_token = t.into();
self
}
pub fn with_wait_token_trivia(mut self, trivia: Trivia) -> Self {
self.wait_token.set_leading_trivia(trivia);
self
}
pub fn with_sensitivity_clause(mut self, n: impl Into<SensitivityClauseSyntax>) -> Self {
self.sensitivity_clause = Some(n.into());
self
}
pub fn with_condition_clause(mut self, n: impl Into<ConditionClauseSyntax>) -> Self {
self.condition_clause = Some(n.into());
self
}
pub fn with_timeout_clause(mut self, n: impl Into<TimeoutClauseSyntax>) -> Self {
self.timeout_clause = Some(n.into());
self
}
pub fn with_semi_colon_token(mut self, t: impl Into<Token>) -> Self {
self.semi_colon_token = t.into();
self
}
pub fn with_semi_colon_token_trivia(mut self, trivia: Trivia) -> Self {
self.semi_colon_token.set_leading_trivia(trivia);
self
}
pub fn build(self) -> WaitStatementSyntax {
RawNodeBuilder::new()
.push_opt_node(self.stmt_label)
.push_token(self.wait_token)
.push_opt_node(self.sensitivity_clause)
.push_opt_node(self.condition_clause)
.push_opt_node(self.timeout_clause)
.push_token(self.semi_colon_token)
.finish()
}
}
impl From<WaitStatementBuilder> for WaitStatementSyntax {
fn from(value: WaitStatementBuilder) -> Self {
value.build()
}
}
pub struct WaveformElementBuilder {
expression: ExpressionSyntax,
after_clause: Option<AfterClauseSyntax>,
}
impl WaveformElementBuilder {
pub fn new(expression: impl Into<ExpressionSyntax>) -> Self {
Self {
expression: expression.into(),
after_clause: None,
}
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn with_after_clause(mut self, n: impl Into<AfterClauseSyntax>) -> Self {
self.after_clause = Some(n.into());
self
}
pub fn build(self) -> WaveformElementSyntax {
RawNodeBuilder::new()
.push_node(self.expression)
.push_opt_node(self.after_clause)
.finish()
}
}
impl From<WaveformElementBuilder> for WaveformElementSyntax {
fn from(value: WaveformElementBuilder) -> Self {
value.build()
}
}
pub struct WhenClauseBuilder {
when_token: Token,
condition: ExpressionSyntax,
}
impl WhenClauseBuilder {
pub fn new(condition: impl Into<ExpressionSyntax>) -> Self {
Self {
when_token: Kw::When.canonical_token(),
condition: condition.into(),
}
}
pub fn with_when_token(mut self, t: impl Into<Token>) -> Self {
self.when_token = t.into();
self
}
pub fn with_when_token_trivia(mut self, trivia: Trivia) -> Self {
self.when_token.set_leading_trivia(trivia);
self
}
pub fn with_condition(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.condition = n.into();
self
}
pub fn build(self) -> WhenClauseSyntax {
RawNodeBuilder::new()
.push_token(self.when_token)
.push_node(self.condition)
.finish()
}
}
impl From<WhenClauseBuilder> for WhenClauseSyntax {
fn from(value: WhenClauseBuilder) -> Self {
value.build()
}
}
pub struct WhenExpressionBuilder {
expression: ExpressionSyntax,
when_token: Token,
condition: ExpressionSyntax,
}
impl WhenExpressionBuilder {
pub fn new(
expression: impl Into<ExpressionSyntax>,
condition: impl Into<ExpressionSyntax>,
) -> Self {
Self {
expression: expression.into(),
when_token: Kw::When.canonical_token(),
condition: condition.into(),
}
}
pub fn with_expression(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.expression = n.into();
self
}
pub fn with_when_token(mut self, t: impl Into<Token>) -> Self {
self.when_token = t.into();
self
}
pub fn with_when_token_trivia(mut self, trivia: Trivia) -> Self {
self.when_token.set_leading_trivia(trivia);
self
}
pub fn with_condition(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.condition = n.into();
self
}
pub fn build(self) -> WhenExpressionSyntax {
RawNodeBuilder::new()
.push_node(self.expression)
.push_token(self.when_token)
.push_node(self.condition)
.finish()
}
}
impl From<WhenExpressionBuilder> for WhenExpressionSyntax {
fn from(value: WhenExpressionBuilder) -> Self {
value.build()
}
}
pub struct WhenWaveformBuilder {
waveform: WaveformSyntax,
when_token: Token,
condition: ExpressionSyntax,
}
impl WhenWaveformBuilder {
pub fn new(
waveform: impl Into<WaveformSyntax>,
condition: impl Into<ExpressionSyntax>,
) -> Self {
Self {
waveform: waveform.into(),
when_token: Kw::When.canonical_token(),
condition: condition.into(),
}
}
pub fn with_waveform(mut self, n: impl Into<WaveformSyntax>) -> Self {
self.waveform = n.into();
self
}
pub fn with_when_token(mut self, t: impl Into<Token>) -> Self {
self.when_token = t.into();
self
}
pub fn with_when_token_trivia(mut self, trivia: Trivia) -> Self {
self.when_token.set_leading_trivia(trivia);
self
}
pub fn with_condition(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.condition = n.into();
self
}
pub fn build(self) -> WhenWaveformSyntax {
RawNodeBuilder::new()
.push_node(self.waveform)
.push_token(self.when_token)
.push_node(self.condition)
.finish()
}
}
impl From<WhenWaveformBuilder> for WhenWaveformSyntax {
fn from(value: WhenWaveformBuilder) -> Self {
value.build()
}
}
pub struct WhileSchemeBuilder {
while_token: Token,
condition: ExpressionSyntax,
}
impl WhileSchemeBuilder {
pub fn new(condition: impl Into<ExpressionSyntax>) -> Self {
Self {
while_token: Kw::While.canonical_token(),
condition: condition.into(),
}
}
pub fn with_while_token(mut self, t: impl Into<Token>) -> Self {
self.while_token = t.into();
self
}
pub fn with_while_token_trivia(mut self, trivia: Trivia) -> Self {
self.while_token.set_leading_trivia(trivia);
self
}
pub fn with_condition(mut self, n: impl Into<ExpressionSyntax>) -> Self {
self.condition = n.into();
self
}
pub fn build(self) -> WhileSchemeSyntax {
RawNodeBuilder::new()
.push_token(self.while_token)
.push_node(self.condition)
.finish()
}
}
impl From<WhileSchemeBuilder> for WhileSchemeSyntax {
fn from(value: WhileSchemeBuilder) -> Self {
value.build()
}
}
pub struct AssociationListBuilder {
elements: Vec<AssociationElementSyntax>,
}
impl AssociationListBuilder {
pub fn new(first: impl Into<AssociationElementSyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<AssociationElementSyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(
mut self,
elements: impl IntoIterator<Item = impl Into<AssociationElementSyntax>>,
) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> AssociationListSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<AssociationListBuilder> for AssociationListSyntax {
fn from(value: AssociationListBuilder) -> Self {
value.build()
}
}
pub struct ChoicesBuilder {
elements: Vec<ChoiceSyntax>,
}
impl ChoicesBuilder {
pub fn new(first: impl Into<ChoiceSyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<ChoiceSyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(mut self, elements: impl IntoIterator<Item = impl Into<ChoiceSyntax>>) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> ChoicesSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Bar.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<ChoicesBuilder> for ChoicesSyntax {
fn from(value: ChoicesBuilder) -> Self {
value.build()
}
}
pub struct ElementAssociationListBuilder {
elements: Vec<ElementAssociationSyntax>,
}
impl ElementAssociationListBuilder {
pub fn new(first: impl Into<ElementAssociationSyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<ElementAssociationSyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(
mut self,
elements: impl IntoIterator<Item = impl Into<ElementAssociationSyntax>>,
) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> ElementAssociationListSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<ElementAssociationListBuilder> for ElementAssociationListSyntax {
fn from(value: ElementAssociationListBuilder) -> Self {
value.build()
}
}
pub struct EntityClassEntryListBuilder {
elements: Vec<EntityClassEntrySyntax>,
}
impl EntityClassEntryListBuilder {
pub fn new(first: impl Into<EntityClassEntrySyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<EntityClassEntrySyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(
mut self,
elements: impl IntoIterator<Item = impl Into<EntityClassEntrySyntax>>,
) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> EntityClassEntryListSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<EntityClassEntryListBuilder> for EntityClassEntryListSyntax {
fn from(value: EntityClassEntryListBuilder) -> Self {
value.build()
}
}
pub struct EntityDesignatorListBuilder {
elements: Vec<EntityDesignatorSyntax>,
}
impl EntityDesignatorListBuilder {
pub fn new(first: impl Into<EntityDesignatorSyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<EntityDesignatorSyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(
mut self,
elements: impl IntoIterator<Item = impl Into<EntityDesignatorSyntax>>,
) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> EntityDesignatorListSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<EntityDesignatorListBuilder> for EntityDesignatorListSyntax {
fn from(value: EntityDesignatorListBuilder) -> Self {
value.build()
}
}
pub struct EnumerationListBuilder {
elements: Vec<EnumerationLiteralToken>,
}
impl EnumerationListBuilder {
pub fn new(first: impl Into<EnumerationLiteralToken>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<EnumerationLiteralToken>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(
mut self,
elements: impl IntoIterator<Item = impl Into<EnumerationLiteralToken>>,
) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> EnumerationListSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_token(element.0)
}
builder.finish()
}
}
impl From<EnumerationListBuilder> for EnumerationListSyntax {
fn from(value: EnumerationListBuilder) -> Self {
value.build()
}
}
pub struct ExpressionListBuilder {
elements: Vec<ExpressionSyntax>,
}
impl ExpressionListBuilder {
pub fn new(first: impl Into<ExpressionSyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<ExpressionSyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(
mut self,
elements: impl IntoIterator<Item = impl Into<ExpressionSyntax>>,
) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> ExpressionListSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<ExpressionListBuilder> for ExpressionListSyntax {
fn from(value: ExpressionListBuilder) -> Self {
value.build()
}
}
pub struct IdentifierListBuilder {
elements: Vec<crate::builder::Identifier>,
}
impl IdentifierListBuilder {
pub fn new(first: impl Into<crate::builder::Identifier>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<crate::builder::Identifier>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(
mut self,
elements: impl IntoIterator<Item = impl Into<crate::builder::Identifier>>,
) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> IdentifierListSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_token(element.into())
}
builder.finish()
}
}
impl From<IdentifierListBuilder> for IdentifierListSyntax {
fn from(value: IdentifierListBuilder) -> Self {
value.build()
}
}
pub struct IndexSubtypeDefinitionListBuilder {
elements: Vec<IndexSubtypeDefinitionSyntax>,
}
impl IndexSubtypeDefinitionListBuilder {
pub fn new(first: impl Into<IndexSubtypeDefinitionSyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<IndexSubtypeDefinitionSyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(
mut self,
elements: impl IntoIterator<Item = impl Into<IndexSubtypeDefinitionSyntax>>,
) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> IndexSubtypeDefinitionListSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<IndexSubtypeDefinitionListBuilder> for IndexSubtypeDefinitionListSyntax {
fn from(value: IndexSubtypeDefinitionListBuilder) -> Self {
value.build()
}
}
pub struct InstantiationListListBuilder {
elements: Vec<crate::builder::Identifier>,
}
impl InstantiationListListBuilder {
pub fn new(first: impl Into<crate::builder::Identifier>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<crate::builder::Identifier>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(
mut self,
elements: impl IntoIterator<Item = impl Into<crate::builder::Identifier>>,
) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> InstantiationListListSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_token(element.into())
}
builder.finish()
}
}
impl From<InstantiationListListBuilder> for InstantiationListListSyntax {
fn from(value: InstantiationListListBuilder) -> Self {
value.build()
}
}
pub struct InterfaceListBuilder {
elements: Vec<InterfaceDeclarationSyntax>,
}
impl InterfaceListBuilder {
pub fn new(first: impl Into<InterfaceDeclarationSyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<InterfaceDeclarationSyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(
mut self,
elements: impl IntoIterator<Item = impl Into<InterfaceDeclarationSyntax>>,
) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> InterfaceListSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::SemiColon.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<InterfaceListBuilder> for InterfaceListSyntax {
fn from(value: InterfaceListBuilder) -> Self {
value.build()
}
}
pub struct LogicalNameListBuilder {
elements: Vec<crate::builder::Identifier>,
}
impl LogicalNameListBuilder {
pub fn new(first: impl Into<crate::builder::Identifier>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<crate::builder::Identifier>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(
mut self,
elements: impl IntoIterator<Item = impl Into<crate::builder::Identifier>>,
) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> LogicalNameListSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_token(element.into())
}
builder.finish()
}
}
impl From<LogicalNameListBuilder> for LogicalNameListSyntax {
fn from(value: LogicalNameListBuilder) -> Self {
value.build()
}
}
pub struct NameListBuilder {
elements: Vec<NameSyntax>,
}
impl NameListBuilder {
pub fn new(first: impl Into<NameSyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<NameSyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(mut self, elements: impl IntoIterator<Item = impl Into<NameSyntax>>) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> NameListSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<NameListBuilder> for NameListSyntax {
fn from(value: NameListBuilder) -> Self {
value.build()
}
}
pub struct PackagePathBuilder {
elements: Vec<crate::builder::Identifier>,
}
impl PackagePathBuilder {
pub fn new(first: impl Into<crate::builder::Identifier>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<crate::builder::Identifier>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(
mut self,
elements: impl IntoIterator<Item = impl Into<crate::builder::Identifier>>,
) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> PackagePathSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Dot.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_token(element.into())
}
builder.finish()
}
}
impl From<PackagePathBuilder> for PackagePathSyntax {
fn from(value: PackagePathBuilder) -> Self {
value.build()
}
}
pub struct PartialPathnameBuilder {
elements: Vec<PathnameElementSyntax>,
}
impl PartialPathnameBuilder {
pub fn new(first: impl Into<PathnameElementSyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<PathnameElementSyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(
mut self,
elements: impl IntoIterator<Item = impl Into<PathnameElementSyntax>>,
) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> PartialPathnameSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Dot.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<PartialPathnameBuilder> for PartialPathnameSyntax {
fn from(value: PartialPathnameBuilder) -> Self {
value.build()
}
}
pub struct RecordResolutionBuilder {
elements: Vec<RecordElementResolutionSyntax>,
}
impl RecordResolutionBuilder {
pub fn new(first: impl Into<RecordElementResolutionSyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<RecordElementResolutionSyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(
mut self,
elements: impl IntoIterator<Item = impl Into<RecordElementResolutionSyntax>>,
) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> RecordResolutionSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<RecordResolutionBuilder> for RecordResolutionSyntax {
fn from(value: RecordResolutionBuilder) -> Self {
value.build()
}
}
pub struct SelectedExpressionsBuilder {
elements: Vec<SelectedExpressionItemSyntax>,
}
impl SelectedExpressionsBuilder {
pub fn new(first: impl Into<SelectedExpressionItemSyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<SelectedExpressionItemSyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(
mut self,
elements: impl IntoIterator<Item = impl Into<SelectedExpressionItemSyntax>>,
) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> SelectedExpressionsSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<SelectedExpressionsBuilder> for SelectedExpressionsSyntax {
fn from(value: SelectedExpressionsBuilder) -> Self {
value.build()
}
}
pub struct SelectedWaveformsBuilder {
elements: Vec<SelectedWaveformItemSyntax>,
}
impl SelectedWaveformsBuilder {
pub fn new(first: impl Into<SelectedWaveformItemSyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<SelectedWaveformItemSyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(
mut self,
elements: impl IntoIterator<Item = impl Into<SelectedWaveformItemSyntax>>,
) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> SelectedWaveformsSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<SelectedWaveformsBuilder> for SelectedWaveformsSyntax {
fn from(value: SelectedWaveformsBuilder) -> Self {
value.build()
}
}
pub struct SensitivityListBuilder {
elements: Vec<NameSyntax>,
}
impl SensitivityListBuilder {
pub fn new(first: impl Into<NameSyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<NameSyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(mut self, elements: impl IntoIterator<Item = impl Into<NameSyntax>>) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> SensitivityListSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<SensitivityListBuilder> for SensitivityListSyntax {
fn from(value: SensitivityListBuilder) -> Self {
value.build()
}
}
pub struct SignalListListBuilder {
elements: Vec<NameSyntax>,
}
impl SignalListListBuilder {
pub fn new(first: impl Into<NameSyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<NameSyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(mut self, elements: impl IntoIterator<Item = impl Into<NameSyntax>>) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> SignalListListSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<SignalListListBuilder> for SignalListListSyntax {
fn from(value: SignalListListBuilder) -> Self {
value.build()
}
}
pub struct TypeMarkListBuilder {
elements: Vec<NameSyntax>,
}
impl TypeMarkListBuilder {
pub fn new(first: impl Into<NameSyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<NameSyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(mut self, elements: impl IntoIterator<Item = impl Into<NameSyntax>>) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> TypeMarkListSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<TypeMarkListBuilder> for TypeMarkListSyntax {
fn from(value: TypeMarkListBuilder) -> Self {
value.build()
}
}
pub struct VerificationUnitListBuilder {
elements: Vec<NameSyntax>,
}
impl VerificationUnitListBuilder {
pub fn new(first: impl Into<NameSyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<NameSyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(mut self, elements: impl IntoIterator<Item = impl Into<NameSyntax>>) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> VerificationUnitListSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<VerificationUnitListBuilder> for VerificationUnitListSyntax {
fn from(value: VerificationUnitListBuilder) -> Self {
value.build()
}
}
pub struct WaveformElementsBuilder {
elements: Vec<WaveformElementSyntax>,
}
impl WaveformElementsBuilder {
pub fn new(first: impl Into<WaveformElementSyntax>) -> Self {
Self {
elements: vec![first.into()],
}
}
pub fn push(mut self, element: impl Into<WaveformElementSyntax>) -> Self {
self.elements.push(element.into());
self
}
pub fn extend(
mut self,
elements: impl IntoIterator<Item = impl Into<WaveformElementSyntax>>,
) -> Self {
self.elements.extend(elements.into_iter().map(|e| e.into()));
self
}
pub fn build(self) -> WaveformElementsSyntax {
let mut builder = RawNodeBuilder::new();
let mut first = true;
for element in self.elements {
if !first {
let mut separator = TokenKind::Comma.canonical_token().unwrap();
separator.set_leading_trivia(Trivia::default());
builder = builder.push_token(separator);
}
first = false;
builder = builder.push_node(element)
}
builder.finish()
}
}
impl From<WaveformElementsBuilder> for WaveformElementsSyntax {
fn from(value: WaveformElementsBuilder) -> Self {
value.build()
}
}
pub struct AliasDesignatorToken(pub(crate) Token);
impl AliasDesignatorToken {
pub fn identifier(v: impl Into<crate::builder::Identifier>) -> Self {
Self(v.into().into())
}
pub fn character_literal(v: impl Into<crate::builder::CharLiteral>) -> Self {
Self(v.into().into())
}
pub fn operator_symbol(v: impl Into<crate::builder::StringLiteral>) -> Self {
Self(v.into().into())
}
}
impl From<AliasDesignatorSyntax> for AliasDesignatorToken {
fn from(s: AliasDesignatorSyntax) -> Self {
AliasDesignatorToken(s.raw().token().clone())
}
}
impl From<crate::builder::Identifier> for AliasDesignatorToken {
fn from(v: crate::builder::Identifier) -> Self {
AliasDesignatorToken::identifier(v)
}
}
impl From<crate::builder::CharLiteral> for AliasDesignatorToken {
fn from(v: crate::builder::CharLiteral) -> Self {
AliasDesignatorToken::character_literal(v)
}
}
impl From<crate::builder::StringLiteral> for AliasDesignatorToken {
fn from(v: crate::builder::StringLiteral) -> Self {
AliasDesignatorToken::operator_symbol(v)
}
}
pub struct AttributeDesignatorToken(pub(crate) Token);
impl AttributeDesignatorToken {
pub fn identifier(v: impl Into<crate::builder::Identifier>) -> Self {
Self(v.into().into())
}
pub fn range() -> Self {
Self(Kw::Range.canonical_token())
}
pub fn subtype() -> Self {
Self(Kw::Subtype.canonical_token())
}
}
impl From<AttributeDesignatorSyntax> for AttributeDesignatorToken {
fn from(s: AttributeDesignatorSyntax) -> Self {
AttributeDesignatorToken(s.raw().token().clone())
}
}
impl From<crate::builder::Identifier> for AttributeDesignatorToken {
fn from(v: crate::builder::Identifier) -> Self {
AttributeDesignatorToken::identifier(v)
}
}
pub struct BinaryOperatorToken(pub(crate) Token);
impl BinaryOperatorToken {
pub fn and() -> Self {
Self(Kw::And.canonical_token())
}
pub fn or() -> Self {
Self(Kw::Or.canonical_token())
}
pub fn nand() -> Self {
Self(Kw::Nand.canonical_token())
}
pub fn nor() -> Self {
Self(Kw::Nor.canonical_token())
}
pub fn xor() -> Self {
Self(Kw::Xor.canonical_token())
}
pub fn xnor() -> Self {
Self(Kw::Xnor.canonical_token())
}
pub fn eq() -> Self {
Self(TokenKind::EQ.canonical_token().unwrap())
}
pub fn ne() -> Self {
Self(TokenKind::NE.canonical_token().unwrap())
}
pub fn lt() -> Self {
Self(TokenKind::LT.canonical_token().unwrap())
}
pub fn lte() -> Self {
Self(TokenKind::LTE.canonical_token().unwrap())
}
pub fn gt() -> Self {
Self(TokenKind::GT.canonical_token().unwrap())
}
pub fn gte() -> Self {
Self(TokenKind::GTE.canonical_token().unwrap())
}
pub fn que_eq() -> Self {
Self(TokenKind::QueEQ.canonical_token().unwrap())
}
pub fn que_ne() -> Self {
Self(TokenKind::QueNE.canonical_token().unwrap())
}
pub fn que_lte() -> Self {
Self(TokenKind::QueLTE.canonical_token().unwrap())
}
pub fn que_lt() -> Self {
Self(TokenKind::QueLT.canonical_token().unwrap())
}
pub fn que_gt() -> Self {
Self(TokenKind::QueGT.canonical_token().unwrap())
}
pub fn que_gte() -> Self {
Self(TokenKind::QueGTE.canonical_token().unwrap())
}
pub fn sll() -> Self {
Self(Kw::Sll.canonical_token())
}
pub fn srl() -> Self {
Self(Kw::Srl.canonical_token())
}
pub fn sla() -> Self {
Self(Kw::Sla.canonical_token())
}
pub fn sra() -> Self {
Self(Kw::Sra.canonical_token())
}
pub fn rol() -> Self {
Self(Kw::Rol.canonical_token())
}
pub fn ror() -> Self {
Self(Kw::Ror.canonical_token())
}
pub fn plus() -> Self {
Self(TokenKind::Plus.canonical_token().unwrap())
}
pub fn minus() -> Self {
Self(TokenKind::Minus.canonical_token().unwrap())
}
pub fn concat() -> Self {
Self(TokenKind::Concat.canonical_token().unwrap())
}
pub fn times() -> Self {
Self(TokenKind::Times.canonical_token().unwrap())
}
pub fn div() -> Self {
Self(TokenKind::Div.canonical_token().unwrap())
}
pub fn r#mod() -> Self {
Self(Kw::Mod.canonical_token())
}
pub fn rem() -> Self {
Self(Kw::Rem.canonical_token())
}
pub fn pow() -> Self {
Self(TokenKind::Pow.canonical_token().unwrap())
}
pub fn to() -> Self {
Self(Kw::To.canonical_token())
}
pub fn downto() -> Self {
Self(Kw::Downto.canonical_token())
}
}
impl From<BinaryOperatorSyntax> for BinaryOperatorToken {
fn from(s: BinaryOperatorSyntax) -> Self {
BinaryOperatorToken(s.raw().token().clone())
}
}
pub struct DesignatorToken(pub(crate) Token);
impl DesignatorToken {
pub fn identifier(v: impl Into<crate::builder::Identifier>) -> Self {
Self(v.into().into())
}
pub fn operator_symbol(v: impl Into<crate::builder::StringLiteral>) -> Self {
Self(v.into().into())
}
}
impl From<DesignatorSyntax> for DesignatorToken {
fn from(s: DesignatorSyntax) -> Self {
DesignatorToken(s.raw().token().clone())
}
}
impl From<crate::builder::Identifier> for DesignatorToken {
fn from(v: crate::builder::Identifier) -> Self {
DesignatorToken::identifier(v)
}
}
impl From<crate::builder::StringLiteral> for DesignatorToken {
fn from(v: crate::builder::StringLiteral) -> Self {
DesignatorToken::operator_symbol(v)
}
}
pub struct EntityClassToken(pub(crate) Token);
impl EntityClassToken {
pub fn entity() -> Self {
Self(Kw::Entity.canonical_token())
}
pub fn architecture() -> Self {
Self(Kw::Architecture.canonical_token())
}
pub fn configuration() -> Self {
Self(Kw::Configuration.canonical_token())
}
pub fn procedure() -> Self {
Self(Kw::Procedure.canonical_token())
}
pub fn function() -> Self {
Self(Kw::Function.canonical_token())
}
pub fn package() -> Self {
Self(Kw::Package.canonical_token())
}
pub fn r#type() -> Self {
Self(Kw::Type.canonical_token())
}
pub fn subtype() -> Self {
Self(Kw::Subtype.canonical_token())
}
pub fn constant() -> Self {
Self(Kw::Constant.canonical_token())
}
pub fn signal() -> Self {
Self(Kw::Signal.canonical_token())
}
pub fn variable() -> Self {
Self(Kw::Variable.canonical_token())
}
pub fn component() -> Self {
Self(Kw::Component.canonical_token())
}
pub fn label() -> Self {
Self(Kw::Label.canonical_token())
}
pub fn literal() -> Self {
Self(Kw::Literal.canonical_token())
}
pub fn units() -> Self {
Self(Kw::Units.canonical_token())
}
pub fn group() -> Self {
Self(Kw::Group.canonical_token())
}
pub fn file() -> Self {
Self(Kw::File.canonical_token())
}
pub fn property() -> Self {
Self(Kw::Property.canonical_token())
}
pub fn sequence() -> Self {
Self(Kw::Sequence.canonical_token())
}
}
impl From<EntityClassSyntax> for EntityClassToken {
fn from(s: EntityClassSyntax) -> Self {
EntityClassToken(s.raw().token().clone())
}
}
pub struct EntityTagToken(pub(crate) Token);
impl EntityTagToken {
pub fn simple_name(v: impl Into<crate::builder::Identifier>) -> Self {
Self(v.into().into())
}
pub fn character_literal(v: impl Into<crate::builder::CharLiteral>) -> Self {
Self(v.into().into())
}
pub fn operator_symbol(v: impl Into<crate::builder::StringLiteral>) -> Self {
Self(v.into().into())
}
}
impl From<EntityTagSyntax> for EntityTagToken {
fn from(s: EntityTagSyntax) -> Self {
EntityTagToken(s.raw().token().clone())
}
}
impl From<crate::builder::Identifier> for EntityTagToken {
fn from(v: crate::builder::Identifier) -> Self {
EntityTagToken::simple_name(v)
}
}
impl From<crate::builder::CharLiteral> for EntityTagToken {
fn from(v: crate::builder::CharLiteral) -> Self {
EntityTagToken::character_literal(v)
}
}
impl From<crate::builder::StringLiteral> for EntityTagToken {
fn from(v: crate::builder::StringLiteral) -> Self {
EntityTagToken::operator_symbol(v)
}
}
pub struct EnumerationLiteralToken(pub(crate) Token);
impl EnumerationLiteralToken {
pub fn identifier(v: impl Into<crate::builder::Identifier>) -> Self {
Self(v.into().into())
}
pub fn character_literal(v: impl Into<crate::builder::CharLiteral>) -> Self {
Self(v.into().into())
}
}
impl From<EnumerationLiteralSyntax> for EnumerationLiteralToken {
fn from(s: EnumerationLiteralSyntax) -> Self {
EnumerationLiteralToken(s.raw().token().clone())
}
}
impl From<crate::builder::Identifier> for EnumerationLiteralToken {
fn from(v: crate::builder::Identifier) -> Self {
EnumerationLiteralToken::identifier(v)
}
}
impl From<crate::builder::CharLiteral> for EnumerationLiteralToken {
fn from(v: crate::builder::CharLiteral) -> Self {
EnumerationLiteralToken::character_literal(v)
}
}
pub struct ForceModeToken(pub(crate) Token);
impl ForceModeToken {
pub fn r#in() -> Self {
Self(Kw::In.canonical_token())
}
pub fn out() -> Self {
Self(Kw::Out.canonical_token())
}
}
impl From<ForceModeSyntax> for ForceModeToken {
fn from(s: ForceModeSyntax) -> Self {
ForceModeToken(s.raw().token().clone())
}
}
pub struct InterfaceObjectClassToken(pub(crate) Token);
impl InterfaceObjectClassToken {
pub fn constant() -> Self {
Self(Kw::Constant.canonical_token())
}
pub fn signal() -> Self {
Self(Kw::Signal.canonical_token())
}
pub fn variable() -> Self {
Self(Kw::Variable.canonical_token())
}
}
impl From<InterfaceObjectClassSyntax> for InterfaceObjectClassToken {
fn from(s: InterfaceObjectClassSyntax) -> Self {
InterfaceObjectClassToken(s.raw().token().clone())
}
}
pub struct LiteralToken(pub(crate) Token);
impl LiteralToken {
pub fn abstract_literal(v: impl Into<crate::builder::AbstractLiteral>) -> Self {
Self(v.into().into())
}
pub fn character_literal(v: impl Into<crate::builder::CharLiteral>) -> Self {
Self(v.into().into())
}
pub fn string_literal(v: impl Into<crate::builder::StringLiteral>) -> Self {
Self(v.into().into())
}
pub fn bit_string_literal(v: impl Into<crate::builder::BitStringLiteral>) -> Self {
Self(v.into().into())
}
pub fn null() -> Self {
Self(Kw::Null.canonical_token())
}
}
impl From<LiteralSyntax> for LiteralToken {
fn from(s: LiteralSyntax) -> Self {
LiteralToken(s.raw().token().clone())
}
}
impl From<crate::builder::AbstractLiteral> for LiteralToken {
fn from(v: crate::builder::AbstractLiteral) -> Self {
LiteralToken::abstract_literal(v)
}
}
impl From<crate::builder::CharLiteral> for LiteralToken {
fn from(v: crate::builder::CharLiteral) -> Self {
LiteralToken::character_literal(v)
}
}
impl From<crate::builder::StringLiteral> for LiteralToken {
fn from(v: crate::builder::StringLiteral) -> Self {
LiteralToken::string_literal(v)
}
}
impl From<crate::builder::BitStringLiteral> for LiteralToken {
fn from(v: crate::builder::BitStringLiteral) -> Self {
LiteralToken::bit_string_literal(v)
}
}
pub struct ModeToken(pub(crate) Token);
impl ModeToken {
pub fn r#in() -> Self {
Self(Kw::In.canonical_token())
}
pub fn out() -> Self {
Self(Kw::Out.canonical_token())
}
pub fn inout() -> Self {
Self(Kw::Inout.canonical_token())
}
pub fn buffer() -> Self {
Self(Kw::Buffer.canonical_token())
}
pub fn linkage() -> Self {
Self(Kw::Linkage.canonical_token())
}
}
impl From<ModeSyntax> for ModeToken {
fn from(s: ModeSyntax) -> Self {
ModeToken(s.raw().token().clone())
}
}
pub struct NameDesignatorToken(pub(crate) Token);
impl NameDesignatorToken {
pub fn identifier(v: impl Into<crate::builder::Identifier>) -> Self {
Self(v.into().into())
}
pub fn string_literal(v: impl Into<crate::builder::StringLiteral>) -> Self {
Self(v.into().into())
}
pub fn character_literal(v: impl Into<crate::builder::CharLiteral>) -> Self {
Self(v.into().into())
}
}
impl From<NameDesignatorSyntax> for NameDesignatorToken {
fn from(s: NameDesignatorSyntax) -> Self {
NameDesignatorToken(s.raw().token().clone())
}
}
impl From<crate::builder::Identifier> for NameDesignatorToken {
fn from(v: crate::builder::Identifier) -> Self {
NameDesignatorToken::identifier(v)
}
}
impl From<crate::builder::StringLiteral> for NameDesignatorToken {
fn from(v: crate::builder::StringLiteral) -> Self {
NameDesignatorToken::string_literal(v)
}
}
impl From<crate::builder::CharLiteral> for NameDesignatorToken {
fn from(v: crate::builder::CharLiteral) -> Self {
NameDesignatorToken::character_literal(v)
}
}
pub struct PurityToken(pub(crate) Token);
impl PurityToken {
pub fn pure() -> Self {
Self(Kw::Pure.canonical_token())
}
pub fn impure() -> Self {
Self(Kw::Impure.canonical_token())
}
}
impl From<PuritySyntax> for PurityToken {
fn from(s: PuritySyntax) -> Self {
PurityToken(s.raw().token().clone())
}
}
pub struct SignalKindToken(pub(crate) Token);
impl SignalKindToken {
pub fn register() -> Self {
Self(Kw::Register.canonical_token())
}
pub fn bus() -> Self {
Self(Kw::Bus.canonical_token())
}
}
impl From<SignalKindSyntax> for SignalKindToken {
fn from(s: SignalKindSyntax) -> Self {
SignalKindToken(s.raw().token().clone())
}
}
pub struct SubprogramKindToken(pub(crate) Token);
impl SubprogramKindToken {
pub fn procedure() -> Self {
Self(Kw::Procedure.canonical_token())
}
pub fn function() -> Self {
Self(Kw::Function.canonical_token())
}
}
impl From<SubprogramKindSyntax> for SubprogramKindToken {
fn from(s: SubprogramKindSyntax) -> Self {
SubprogramKindToken(s.raw().token().clone())
}
}
pub struct SuffixToken(pub(crate) Token);
impl SuffixToken {
pub fn simple_name(v: impl Into<crate::builder::Identifier>) -> Self {
Self(v.into().into())
}
pub fn character_literal(v: impl Into<crate::builder::CharLiteral>) -> Self {
Self(v.into().into())
}
pub fn operator_symbol(v: impl Into<crate::builder::StringLiteral>) -> Self {
Self(v.into().into())
}
pub fn all() -> Self {
Self(Kw::All.canonical_token())
}
}
impl From<SuffixSyntax> for SuffixToken {
fn from(s: SuffixSyntax) -> Self {
SuffixToken(s.raw().token().clone())
}
}
impl From<crate::builder::Identifier> for SuffixToken {
fn from(v: crate::builder::Identifier) -> Self {
SuffixToken::simple_name(v)
}
}
impl From<crate::builder::CharLiteral> for SuffixToken {
fn from(v: crate::builder::CharLiteral) -> Self {
SuffixToken::character_literal(v)
}
}
impl From<crate::builder::StringLiteral> for SuffixToken {
fn from(v: crate::builder::StringLiteral) -> Self {
SuffixToken::operator_symbol(v)
}
}
pub struct UnaryOperatorToken(pub(crate) Token);
impl UnaryOperatorToken {
pub fn que_que() -> Self {
Self(TokenKind::QueQue.canonical_token().unwrap())
}
pub fn plus() -> Self {
Self(TokenKind::Plus.canonical_token().unwrap())
}
pub fn minus() -> Self {
Self(TokenKind::Minus.canonical_token().unwrap())
}
pub fn abs() -> Self {
Self(Kw::Abs.canonical_token())
}
pub fn not() -> Self {
Self(Kw::Not.canonical_token())
}
pub fn and() -> Self {
Self(Kw::And.canonical_token())
}
pub fn or() -> Self {
Self(Kw::Or.canonical_token())
}
pub fn nand() -> Self {
Self(Kw::Nand.canonical_token())
}
pub fn nor() -> Self {
Self(Kw::Nor.canonical_token())
}
pub fn xor() -> Self {
Self(Kw::Xor.canonical_token())
}
pub fn xnor() -> Self {
Self(Kw::Xnor.canonical_token())
}
}
impl From<UnaryOperatorSyntax> for UnaryOperatorToken {
fn from(s: UnaryOperatorSyntax) -> Self {
UnaryOperatorToken(s.raw().token().clone())
}
}