#![allow(clippy::large_enum_variant)]
mod display;
mod name_util;
#[macro_use]
mod any_design_unit;
#[macro_use]
pub mod search;
pub use self::display::*;
pub use self::name_util::*;
pub use any_design_unit::*;
use crate::data::*;
#[derive(PartialEq, Copy, Clone, Debug)]
pub enum BaseSpecifier {
B,
O,
X,
UB,
UO,
UX,
SB,
SO,
SX,
D,
}
#[derive(PartialEq, Copy, Clone, Debug)]
pub enum Unary {
And,
Or,
Nand,
Nor,
Xor,
Xnor,
Abs,
Not,
Minus,
Plus,
QueQue,
}
#[derive(PartialEq, Copy, Clone, Debug)]
pub enum Binary {
And,
Or,
Nand,
Nor,
Xor,
Xnor,
EQ,
NE,
LT,
LTE,
GT,
GTE,
QueEQ,
QueNE,
QueLT,
QueLTE,
QueGT,
QueGTE,
SLL,
SRL,
SLA,
SRA,
ROL,
ROR,
Plus,
Minus,
Concat,
Times,
Div,
Mod,
Rem,
Pow,
}
#[derive(PartialEq, Debug, Clone)]
pub struct AttributeName {
pub name: WithPos<Name>,
pub signature: Option<WithPos<Signature>>,
pub attr: Ident,
pub expr: Option<Box<WithPos<Expression>>>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum ExternalObjectClass {
Constant,
Signal,
Variable,
}
#[derive(PartialEq, Debug, Clone)]
pub enum ExternalPath {
Package(WithPos<Name>),
Absolute(WithPos<Name>),
Relative(WithPos<Name>, usize),
}
#[derive(PartialEq, Debug, Clone)]
pub struct ExternalName {
pub class: ExternalObjectClass,
pub path: WithPos<ExternalPath>,
pub subtype: SubtypeIndication,
}
#[derive(PartialEq, Debug, Clone)]
pub enum Name {
Designator(WithRef<Designator>),
Selected(Box<WithPos<Name>>, WithPos<WithRef<Designator>>),
SelectedAll(Box<WithPos<Name>>),
Indexed(Box<WithPos<Name>>, Vec<WithPos<Expression>>),
Slice(Box<WithPos<Name>>, Box<DiscreteRange>),
Attribute(Box<AttributeName>),
FunctionCall(Box<FunctionCall>),
External(Box<ExternalName>),
}
#[derive(PartialEq, Debug, Clone)]
pub enum SelectedName {
Designator(WithRef<Designator>),
Selected(Box<WithPos<SelectedName>>, WithPos<WithRef<Designator>>),
}
#[derive(PartialEq, Debug, Clone)]
pub struct FunctionCall {
pub name: WithPos<Name>,
pub parameters: Vec<AssociationElement>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum Choice {
Expression(WithPos<Expression>),
DiscreteRange(DiscreteRange),
Others,
}
#[derive(PartialEq, Debug, Clone)]
pub enum ElementAssociation {
Positional(WithPos<Expression>),
Named(Vec<Choice>, WithPos<Expression>),
}
#[derive(PartialEq, Debug, Clone)]
pub enum ActualPart {
Expression(Expression),
Open,
}
#[derive(PartialEq, Debug, Clone)]
pub struct AssociationElement {
pub formal: Option<WithPos<Name>>,
pub actual: WithPos<ActualPart>,
}
#[derive(PartialEq, Debug, Clone, Copy)]
pub enum AbstractLiteral {
Integer(u64),
Real(f64),
}
#[derive(PartialEq, Debug, Clone)]
pub struct BitString {
pub length: Option<u32>,
pub base: BaseSpecifier,
pub value: Latin1String,
}
#[derive(PartialEq, Debug, Clone)]
pub enum Literal {
String(Latin1String),
BitString(BitString),
Character(u8),
AbstractLiteral(AbstractLiteral),
Physical(AbstractLiteral, Symbol),
Null,
}
#[derive(PartialEq, Debug, Clone)]
pub enum Allocator {
Qualified(QualifiedExpression),
Subtype(SubtypeIndication),
}
#[derive(PartialEq, Debug, Clone)]
pub struct QualifiedExpression {
pub name: Box<WithPos<Name>>,
pub expr: Box<WithPos<Expression>>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum Expression {
Binary(Binary, Box<WithPos<Expression>>, Box<WithPos<Expression>>),
Unary(Unary, Box<WithPos<Expression>>),
Aggregate(Vec<ElementAssociation>),
Qualified(Box<QualifiedExpression>),
Name(Box<Name>),
Literal(Literal),
New(Box<WithPos<Allocator>>),
}
pub type Ident = WithPos<Symbol>;
#[derive(PartialEq, Debug, Clone, Copy)]
pub enum Direction {
Ascending,
Descending,
}
#[derive(PartialEq, Debug, Clone)]
pub enum DiscreteRange {
Discrete(WithPos<SelectedName>, Option<Range>),
Range(Range),
}
#[derive(PartialEq, Debug, Clone)]
pub struct RangeConstraint {
pub direction: Direction,
pub left_expr: Box<WithPos<Expression>>,
pub right_expr: Box<WithPos<Expression>>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum Range {
Range(RangeConstraint),
Attribute(Box<AttributeName>),
}
#[derive(PartialEq, Debug, Clone)]
pub struct ElementConstraint {
pub ident: Ident,
pub constraint: Box<WithPos<SubtypeConstraint>>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum SubtypeConstraint {
Range(Range),
Array(Vec<DiscreteRange>, Option<Box<WithPos<SubtypeConstraint>>>),
Record(Vec<ElementConstraint>),
}
#[derive(PartialEq, Debug, Clone)]
pub struct RecordElementResolution {
pub ident: Ident,
pub resolution: Box<ResolutionIndication>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum ResolutionIndication {
FunctionName(WithPos<SelectedName>),
ArrayElement(WithPos<SelectedName>),
Record(Vec<RecordElementResolution>),
Unresolved,
}
#[derive(PartialEq, Debug, Clone)]
pub struct SubtypeIndication {
pub resolution: ResolutionIndication,
pub type_mark: WithPos<SelectedName>,
pub constraint: Option<WithPos<SubtypeConstraint>>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum ArrayIndex {
IndexSubtypeDefintion(WithPos<SelectedName>),
Discrete(DiscreteRange),
}
#[derive(PartialEq, Debug, Clone)]
pub struct ElementDeclaration {
pub ident: Ident,
pub subtype: SubtypeIndication,
}
#[derive(PartialEq, Debug, Clone)]
pub enum ProtectedTypeDeclarativeItem {
Subprogram(SubprogramDeclaration),
}
#[derive(PartialEq, Eq, Hash, Debug, Clone)]
pub enum Designator {
Identifier(Symbol),
OperatorSymbol(Latin1String),
Character(u8),
}
pub type Reference = Option<SrcPos>;
#[derive(PartialEq, Debug, Clone)]
pub struct WithRef<T> {
pub item: T,
pub reference: Reference,
}
impl<T> WithRef<T> {
pub fn new(item: T) -> WithRef<T> {
WithRef {
item,
reference: None,
}
}
pub fn reference_positions(&self) -> impl Iterator<Item = &SrcPos> {
self.reference.iter()
}
}
#[derive(PartialEq, Debug, Clone)]
pub struct AliasDeclaration {
pub designator: WithPos<Designator>,
pub subtype_indication: Option<SubtypeIndication>,
pub name: WithPos<Name>,
pub signature: Option<WithPos<Signature>>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct AttributeDeclaration {
pub ident: Ident,
pub type_mark: WithPos<SelectedName>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct EntityTag {
pub designator: WithPos<Designator>,
pub signature: Option<WithPos<Signature>>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum EntityName {
Name(EntityTag),
All,
Others,
}
#[derive(PartialEq, Debug, Clone, Copy)]
pub enum EntityClass {
Entity,
Architecture,
Configuration,
Package,
Signal,
Variable,
Procedure,
Function,
Component,
Constant,
Type,
Label,
}
#[derive(PartialEq, Debug, Clone)]
pub struct AttributeSpecification {
pub ident: Ident,
pub entity_name: EntityName,
pub entity_class: EntityClass,
pub expr: WithPos<Expression>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum Attribute {
Specification(AttributeSpecification),
Declaration(AttributeDeclaration),
}
#[derive(PartialEq, Debug, Clone)]
pub struct ProtectedTypeDeclaration {
pub items: Vec<ProtectedTypeDeclarativeItem>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct ProtectedTypeBody {
pub type_reference: Reference,
pub decl: Vec<Declaration>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct PhysicalTypeDeclaration {
pub range: Range,
pub primary_unit: Ident,
pub secondary_units: Vec<(Ident, Literal)>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum EnumerationLiteral {
Identifier(Symbol),
Character(u8),
}
#[derive(PartialEq, Debug, Clone)]
pub enum TypeDefinition {
Enumeration(Vec<WithPos<EnumerationLiteral>>),
Integer(Range),
Physical(PhysicalTypeDeclaration),
Array(Vec<ArrayIndex>, SubtypeIndication),
Record(Vec<ElementDeclaration>),
Access(SubtypeIndication),
Incomplete(Reference),
File(WithPos<SelectedName>),
Protected(ProtectedTypeDeclaration),
ProtectedBody(ProtectedTypeBody),
Subtype(SubtypeIndication),
}
#[derive(PartialEq, Debug, Clone)]
pub struct TypeDeclaration {
pub ident: Ident,
pub def: TypeDefinition,
}
#[derive(PartialEq, Debug, Clone, Copy)]
pub enum ObjectClass {
Signal,
Constant,
Variable,
SharedVariable,
}
#[derive(PartialEq, Debug, Clone, Copy)]
pub enum InterfaceListType {
Port,
Generic,
Parameter,
}
#[derive(PartialEq, Debug, Clone)]
pub struct ObjectDeclaration {
pub class: ObjectClass,
pub ident: Ident,
pub subtype_indication: SubtypeIndication,
pub expression: Option<WithPos<Expression>>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct FileDeclaration {
pub ident: Ident,
pub subtype_indication: SubtypeIndication,
pub open_info: Option<WithPos<Expression>>,
pub file_name: Option<WithPos<Expression>>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum SubprogramDesignator {
Identifier(Symbol),
OperatorSymbol(Latin1String),
}
#[derive(PartialEq, Debug, Clone)]
pub struct ProcedureSpecification {
pub designator: WithPos<SubprogramDesignator>,
pub parameter_list: Vec<InterfaceDeclaration>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct FunctionSpecification {
pub pure: bool,
pub designator: WithPos<SubprogramDesignator>,
pub parameter_list: Vec<InterfaceDeclaration>,
pub return_type: WithPos<SelectedName>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct SubprogramBody {
pub specification: SubprogramDeclaration,
pub declarations: Vec<Declaration>,
pub statements: Vec<LabeledSequentialStatement>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum Signature {
Function(Vec<WithPos<SelectedName>>, WithPos<SelectedName>),
Procedure(Vec<WithPos<SelectedName>>),
}
#[derive(PartialEq, Debug, Clone)]
pub enum SubprogramDeclaration {
Procedure(ProcedureSpecification),
Function(FunctionSpecification),
}
#[derive(PartialEq, Debug, Clone)]
pub struct InterfaceFileDeclaration {
pub ident: Ident,
pub subtype_indication: SubtypeIndication,
}
#[derive(PartialEq, Debug, Clone)]
pub struct InterfaceObjectDeclaration {
pub list_type: InterfaceListType,
pub class: ObjectClass,
pub ident: Ident,
pub mode: Mode,
pub subtype_indication: SubtypeIndication,
pub expression: Option<WithPos<Expression>>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum SubprogramDefault {
Name(WithPos<SelectedName>),
Box,
}
#[derive(PartialEq, Debug, Clone)]
pub enum InterfacePackageGenericMapAspect {
Map(Vec<AssociationElement>),
Box,
Default,
}
#[derive(PartialEq, Debug, Clone)]
pub struct InterfacePackageDeclaration {
pub ident: Ident,
pub package_name: WithPos<SelectedName>,
pub generic_map: InterfacePackageGenericMapAspect,
}
#[derive(PartialEq, Debug, Clone)]
pub enum InterfaceDeclaration {
Object(InterfaceObjectDeclaration),
File(InterfaceFileDeclaration),
Type(Ident),
Subprogram(SubprogramDeclaration, Option<SubprogramDefault>),
Package(InterfacePackageDeclaration),
}
#[derive(PartialEq, Debug, Clone, Copy)]
pub enum Mode {
In,
Out,
InOut,
Buffer,
Linkage,
}
#[derive(PartialEq, Debug, Clone)]
pub struct PortClause {
pub port_list: Vec<InterfaceDeclaration>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct ComponentDeclaration {
pub ident: Ident,
pub generic_list: Vec<InterfaceDeclaration>,
pub port_list: Vec<InterfaceDeclaration>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum Declaration {
Object(ObjectDeclaration),
File(FileDeclaration),
Type(TypeDeclaration),
Component(ComponentDeclaration),
Attribute(Attribute),
Alias(AliasDeclaration),
SubprogramDeclaration(SubprogramDeclaration),
SubprogramBody(SubprogramBody),
Use(WithPos<UseClause>),
Package(PackageInstantiation),
Configuration(ConfigurationSpecification),
}
#[derive(PartialEq, Debug, Clone)]
pub struct WaitStatement {
pub sensitivity_clause: Vec<WithPos<Name>>,
pub condition_clause: Option<WithPos<Expression>>,
pub timeout_clause: Option<WithPos<Expression>>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct AssertStatement {
pub condition: WithPos<Expression>,
pub report: Option<WithPos<Expression>>,
pub severity: Option<WithPos<Expression>>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct ReportStatement {
pub report: WithPos<Expression>,
pub severity: Option<WithPos<Expression>>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum Target {
Name(Name),
Aggregate(Vec<ElementAssociation>),
}
#[derive(PartialEq, Debug, Clone)]
pub struct WaveformElement {
pub value: WithPos<Expression>,
pub after: Option<WithPos<Expression>>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum Waveform {
Elements(Vec<WaveformElement>),
Unaffected,
}
#[derive(PartialEq, Debug, Clone)]
pub enum DelayMechanism {
Transport,
Inertial { reject: Option<WithPos<Expression>> },
}
#[derive(PartialEq, Debug, Clone)]
pub struct SignalAssignment {
pub target: WithPos<Target>,
pub delay_mechanism: Option<DelayMechanism>,
pub rhs: AssignmentRightHand<Waveform>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum ForceMode {
In,
Out,
}
#[derive(PartialEq, Debug, Clone)]
pub struct SignalForceAssignment {
pub target: WithPos<Target>,
pub force_mode: Option<ForceMode>,
pub rhs: AssignmentRightHand<WithPos<Expression>>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct SignalReleaseAssignment {
pub target: WithPos<Target>,
pub force_mode: Option<ForceMode>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct VariableAssignment {
pub target: WithPos<Target>,
pub rhs: AssignmentRightHand<WithPos<Expression>>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum AssignmentRightHand<T> {
Simple(T),
Conditional(Conditionals<T>),
Selected(Selection<T>),
}
#[derive(PartialEq, Debug, Clone)]
pub struct Conditional<T> {
pub condition: WithPos<Expression>,
pub item: T,
}
#[derive(PartialEq, Debug, Clone)]
pub struct Conditionals<T> {
pub conditionals: Vec<Conditional<T>>,
pub else_item: Option<T>,
}
pub type ConditionalExpression = Conditional<WithPos<Expression>>;
pub type ConditionalExpressions = Conditionals<WithPos<Expression>>;
pub type IfStatement = Conditionals<Vec<LabeledSequentialStatement>>;
#[derive(PartialEq, Debug, Clone)]
pub struct Alternative<T> {
pub choices: Vec<Choice>,
pub item: T,
}
#[derive(PartialEq, Debug, Clone)]
pub struct Selection<T> {
pub expression: WithPos<Expression>,
pub alternatives: Vec<Alternative<T>>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct CaseStatement {
pub is_matching: bool,
pub expression: WithPos<Expression>,
pub alternatives: Vec<Alternative<Vec<LabeledSequentialStatement>>>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum IterationScheme {
While(WithPos<Expression>),
For(Ident, DiscreteRange),
}
#[derive(PartialEq, Debug, Clone)]
pub struct LoopStatement {
pub iteration_scheme: Option<IterationScheme>,
pub statements: Vec<LabeledSequentialStatement>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct NextStatement {
pub loop_label: Option<Ident>,
pub condition: Option<WithPos<Expression>>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct ExitStatement {
pub loop_label: Option<Ident>,
pub condition: Option<WithPos<Expression>>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct ReturnStatement {
pub expression: Option<WithPos<Expression>>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum SequentialStatement {
Wait(WaitStatement),
Assert(AssertStatement),
Report(ReportStatement),
VariableAssignment(VariableAssignment),
SignalAssignment(SignalAssignment),
SignalForceAssignment(SignalForceAssignment),
SignalReleaseAssignment(SignalReleaseAssignment),
ProcedureCall(FunctionCall),
If(IfStatement),
Case(CaseStatement),
Loop(LoopStatement),
Next(NextStatement),
Exit(ExitStatement),
Return(ReturnStatement),
Null,
}
#[derive(PartialEq, Debug, Clone)]
pub struct LabeledSequentialStatement {
pub label: Option<Ident>,
pub statement: SequentialStatement,
}
#[derive(PartialEq, Debug, Clone)]
pub struct BlockStatement {
pub guard_condition: Option<WithPos<Expression>>,
pub header: BlockHeader,
pub decl: Vec<Declaration>,
pub statements: Vec<LabeledConcurrentStatement>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct BlockHeader {
pub generic_clause: Option<Vec<InterfaceDeclaration>>,
pub generic_map: Option<Vec<AssociationElement>>,
pub port_clause: Option<Vec<InterfaceDeclaration>>,
pub port_map: Option<Vec<AssociationElement>>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum SensitivityList {
Names(Vec<WithPos<Name>>),
All,
}
#[derive(PartialEq, Debug, Clone)]
pub struct ProcessStatement {
pub postponed: bool,
pub sensitivity_list: Option<SensitivityList>,
pub decl: Vec<Declaration>,
pub statements: Vec<LabeledSequentialStatement>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct ConcurrentProcedureCall {
pub postponed: bool,
pub call: FunctionCall,
}
#[derive(PartialEq, Debug, Clone)]
pub struct ConcurrentAssertStatement {
pub postponed: bool,
pub statement: AssertStatement,
}
#[derive(PartialEq, Debug, Clone)]
pub struct ConcurrentSignalAssignment {
pub postponed: bool,
pub guarded: bool,
pub target: WithPos<Target>,
pub delay_mechanism: Option<DelayMechanism>,
pub rhs: AssignmentRightHand<Waveform>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum InstantiatedUnit {
Component(WithPos<SelectedName>),
Entity(WithPos<SelectedName>, Option<Ident>),
Configuration(WithPos<SelectedName>),
}
#[derive(PartialEq, Debug, Clone)]
pub struct InstantiationStatement {
pub unit: InstantiatedUnit,
pub generic_map: Vec<AssociationElement>,
pub port_map: Vec<AssociationElement>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct GenerateBody {
pub alternative_label: Option<Ident>,
pub decl: Option<Vec<Declaration>>,
pub statements: Vec<LabeledConcurrentStatement>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct ForGenerateStatement {
pub index_name: Ident,
pub discrete_range: DiscreteRange,
pub body: GenerateBody,
}
pub type IfGenerateStatement = Conditionals<GenerateBody>;
pub type CaseGenerateStatement = Selection<GenerateBody>;
#[derive(PartialEq, Debug, Clone)]
pub enum ConcurrentStatement {
ProcedureCall(ConcurrentProcedureCall),
Block(BlockStatement),
Process(ProcessStatement),
Assert(ConcurrentAssertStatement),
Assignment(ConcurrentSignalAssignment),
Instance(InstantiationStatement),
ForGenerate(ForGenerateStatement),
IfGenerate(IfGenerateStatement),
CaseGenerate(CaseGenerateStatement),
}
#[derive(PartialEq, Debug, Clone)]
pub struct LabeledConcurrentStatement {
pub label: Option<Ident>,
pub statement: ConcurrentStatement,
}
#[derive(PartialEq, Debug, Clone)]
pub struct LibraryClause {
pub name_list: Vec<Ident>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct UseClause {
pub name_list: Vec<WithPos<Name>>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct ContextReference {
pub name_list: Vec<WithPos<Name>>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum ContextItem {
Use(UseClause),
Library(LibraryClause),
Context(ContextReference),
}
#[derive(PartialEq, Debug, Clone)]
pub struct ContextDeclaration {
pub ident: Ident,
pub items: ContextClause,
}
#[derive(PartialEq, Debug, Clone)]
pub struct PackageInstantiation {
pub context_clause: ContextClause,
pub ident: Ident,
pub package_name: WithPos<SelectedName>,
pub generic_map: Option<Vec<AssociationElement>>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum InstantiationList {
Labels(Vec<Ident>),
Others,
All,
}
#[derive(PartialEq, Debug, Clone)]
pub enum EntityAspect {
Entity(WithPos<SelectedName>, Option<Ident>),
Configuration(WithPos<SelectedName>),
Open,
}
#[derive(PartialEq, Debug, Clone)]
pub struct BindingIndication {
pub entity_aspect: Option<EntityAspect>,
pub generic_map: Option<Vec<AssociationElement>>,
pub port_map: Option<Vec<AssociationElement>>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct ComponentSpecification {
pub instantiation_list: InstantiationList,
pub component_name: WithPos<SelectedName>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct VUnitBindingIndication {
pub vunit_list: Vec<WithPos<Name>>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct ConfigurationSpecification {
pub spec: ComponentSpecification,
pub bind_ind: BindingIndication,
pub vunit_bind_inds: Vec<VUnitBindingIndication>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum ConfigurationDeclarativeItem {
Use(WithPos<UseClause>),
}
#[derive(PartialEq, Debug, Clone)]
pub struct ComponentConfiguration {
pub spec: ComponentSpecification,
pub bind_ind: Option<BindingIndication>,
pub vunit_bind_inds: Vec<VUnitBindingIndication>,
pub block_config: Option<BlockConfiguration>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum ConfigurationItem {
Block(BlockConfiguration),
Component(ComponentConfiguration),
}
#[derive(PartialEq, Debug, Clone)]
pub struct BlockConfiguration {
pub block_spec: WithPos<Name>,
pub use_clauses: Vec<UseClause>,
pub items: Vec<ConfigurationItem>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct ConfigurationDeclaration {
pub context_clause: ContextClause,
pub ident: Ident,
pub entity_name: WithPos<SelectedName>,
pub decl: Vec<ConfigurationDeclarativeItem>,
pub vunit_bind_inds: Vec<VUnitBindingIndication>,
pub block_config: BlockConfiguration,
}
#[derive(PartialEq, Debug, Clone)]
pub struct EntityDeclaration {
pub context_clause: ContextClause,
pub ident: Ident,
pub generic_clause: Option<Vec<InterfaceDeclaration>>,
pub port_clause: Option<Vec<InterfaceDeclaration>>,
pub decl: Vec<Declaration>,
pub statements: Vec<LabeledConcurrentStatement>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct ArchitectureBody {
pub context_clause: ContextClause,
pub ident: Ident,
pub entity_name: WithRef<Ident>,
pub decl: Vec<Declaration>,
pub statements: Vec<LabeledConcurrentStatement>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct PackageDeclaration {
pub context_clause: ContextClause,
pub ident: Ident,
pub generic_clause: Option<Vec<InterfaceDeclaration>>,
pub decl: Vec<Declaration>,
}
#[derive(PartialEq, Debug, Clone)]
pub struct PackageBody {
pub context_clause: ContextClause,
pub ident: WithRef<Ident>,
pub decl: Vec<Declaration>,
}
#[derive(PartialEq, Debug, Clone)]
pub enum AnyPrimaryUnit {
Entity(EntityDeclaration),
Configuration(ConfigurationDeclaration),
Package(PackageDeclaration),
PackageInstance(PackageInstantiation),
Context(ContextDeclaration),
}
#[derive(PartialEq, Debug, Clone)]
pub enum AnySecondaryUnit {
Architecture(ArchitectureBody),
PackageBody(PackageBody),
}
pub type ContextClause = Vec<WithPos<ContextItem>>;
#[derive(PartialEq, Debug, Clone)]
pub enum AnyDesignUnit {
Primary(AnyPrimaryUnit),
Secondary(AnySecondaryUnit),
}
#[derive(PartialEq, Debug, Clone, Default)]
pub struct DesignFile {
pub design_units: Vec<AnyDesignUnit>,
}