use crate::ast::{AttributeDesignator, RangeAttribute, SignalAttribute, TypeAttribute};
use crate::standard::VHDLStandard;
use crate::syntax::Kind;
use crate::syntax::Kind::*;
const KEYWORDS_1993: &[Kind] = &[
Abs,
Access,
After,
Alias,
All,
And,
Architecture,
Array,
Assert,
Attribute,
Begin,
Block,
Body,
Buffer,
Bus,
Case,
Component,
Configuration,
Constant,
Disconnect,
Downto,
Else,
Elsif,
End,
Entity,
Exit,
File,
For,
Function,
Generate,
Generic,
Group,
Guarded,
If,
Impure,
In,
Inertial,
InOut,
Is,
Label,
Library,
Linkage,
Literal,
Loop,
Map,
Mod,
Nand,
New,
Next,
Nor,
Not,
Null,
Of,
On,
Open,
Or,
Others,
Out,
Package,
Port,
Postponed,
Procedure,
Process,
Pure,
Range,
Record,
Register,
Reject,
Rem,
Report,
Return,
ROL,
ROR,
Select,
Severity,
Signal,
Shared,
SLA,
SLL,
SRA,
SRL,
Subtype,
Then,
To,
Transport,
Type,
Unaffected,
Units,
Until,
Use,
Variable,
Wait,
When,
While,
With,
Xor,
Xnor,
];
const KEYWORDS_2008: &[Kind] = &[
Abs,
Access,
After,
Alias,
All,
And,
Architecture,
Array,
Assert,
Assume,
AssumeGuarantee,
Attribute,
Begin,
Block,
Body,
Buffer,
Bus,
Case,
Component,
Configuration,
Constant,
Context,
Cover,
Default,
Disconnect,
Downto,
Else,
Elsif,
End,
Entity,
Exit,
Fairness,
File,
For,
Force,
Function,
Generate,
Generic,
Group,
Guarded,
If,
Impure,
In,
Inertial,
InOut,
Is,
Label,
Library,
Linkage,
Literal,
Loop,
Map,
Mod,
Nand,
New,
Next,
Nor,
Not,
Null,
Of,
On,
Open,
Or,
Others,
Out,
Package,
Parameter,
Port,
Postponed,
Procedure,
Process,
Property,
Protected,
Pure,
Range,
Record,
Register,
Reject,
Release,
Rem,
Report,
Restrict,
RestrictGuarantee,
Return,
ROL,
ROR,
Select,
Sequence,
Severity,
Signal,
Shared,
SLA,
SLL,
SRA,
SRL,
Strong,
Subtype,
Then,
To,
Transport,
Type,
Unaffected,
Units,
Until,
Use,
Variable,
Vmode,
Vprop,
Vunit,
Wait,
When,
While,
With,
Xor,
Xnor,
];
const KEYWORDS_2019: &[Kind] = &[
Abs,
Access,
After,
Alias,
All,
And,
Architecture,
Array,
Assert,
Assume,
Attribute,
Begin,
Block,
Body,
Buffer,
Bus,
Case,
Component,
Configuration,
Constant,
Context,
Cover,
Default,
Disconnect,
Downto,
Else,
Elsif,
End,
Entity,
Exit,
Fairness,
File,
For,
Force,
Function,
Generate,
Generic,
Group,
Guarded,
If,
Impure,
In,
Inertial,
InOut,
Is,
Label,
Library,
Linkage,
Literal,
Loop,
Map,
Mod,
Nand,
New,
Next,
Nor,
Not,
Null,
Of,
On,
Open,
Or,
Others,
Out,
Package,
Parameter,
Port,
Postponed,
Procedure,
Process,
Property,
Protected,
Private,
Pure,
Range,
Record,
Register,
Reject,
Release,
Rem,
Report,
Restrict,
Return,
ROL,
ROR,
Select,
Sequence,
Severity,
Signal,
Shared,
SLA,
SLL,
SRA,
SRL,
Strong,
Subtype,
Then,
To,
Transport,
Type,
Unaffected,
Units,
Until,
Use,
Variable,
View,
Vpkg,
Vmode,
Vprop,
Vunit,
Wait,
When,
While,
With,
Xor,
Xnor,
];
const ATTRIBUTES_1993: &[AttributeDesignator] = &[
AttributeDesignator::Left,
AttributeDesignator::Right,
AttributeDesignator::High,
AttributeDesignator::Low,
AttributeDesignator::Ascending,
AttributeDesignator::Image,
AttributeDesignator::Value,
AttributeDesignator::Pos,
AttributeDesignator::Val,
AttributeDesignator::Succ,
AttributeDesignator::Pred,
AttributeDesignator::LeftOf,
AttributeDesignator::RightOf,
AttributeDesignator::Range(RangeAttribute::Range),
AttributeDesignator::Range(RangeAttribute::ReverseRange),
AttributeDesignator::Length,
AttributeDesignator::Signal(SignalAttribute::Delayed),
AttributeDesignator::Signal(SignalAttribute::Stable),
AttributeDesignator::Signal(SignalAttribute::Quiet),
AttributeDesignator::Signal(SignalAttribute::Transaction),
AttributeDesignator::Signal(SignalAttribute::Event),
AttributeDesignator::Signal(SignalAttribute::Active),
AttributeDesignator::Signal(SignalAttribute::LastEvent),
AttributeDesignator::Signal(SignalAttribute::LastActive),
AttributeDesignator::Signal(SignalAttribute::LastValue),
AttributeDesignator::Signal(SignalAttribute::Driving),
AttributeDesignator::Signal(SignalAttribute::DrivingValue),
AttributeDesignator::SimpleName,
AttributeDesignator::InstanceName,
AttributeDesignator::PathName,
];
const ATTRIBUTES_2008: &[AttributeDesignator] = &[
AttributeDesignator::Left,
AttributeDesignator::Right,
AttributeDesignator::High,
AttributeDesignator::Low,
AttributeDesignator::Ascending,
AttributeDesignator::Image,
AttributeDesignator::Value,
AttributeDesignator::Pos,
AttributeDesignator::Val,
AttributeDesignator::Succ,
AttributeDesignator::Pred,
AttributeDesignator::LeftOf,
AttributeDesignator::RightOf,
AttributeDesignator::Type(TypeAttribute::Subtype),
AttributeDesignator::Range(RangeAttribute::Range),
AttributeDesignator::Range(RangeAttribute::ReverseRange),
AttributeDesignator::Length,
AttributeDesignator::Type(TypeAttribute::Element),
AttributeDesignator::Signal(SignalAttribute::Delayed),
AttributeDesignator::Signal(SignalAttribute::Stable),
AttributeDesignator::Signal(SignalAttribute::Quiet),
AttributeDesignator::Signal(SignalAttribute::Transaction),
AttributeDesignator::Signal(SignalAttribute::Event),
AttributeDesignator::Signal(SignalAttribute::Active),
AttributeDesignator::Signal(SignalAttribute::LastEvent),
AttributeDesignator::Signal(SignalAttribute::LastActive),
AttributeDesignator::Signal(SignalAttribute::LastValue),
AttributeDesignator::Signal(SignalAttribute::Driving),
AttributeDesignator::Signal(SignalAttribute::DrivingValue),
AttributeDesignator::SimpleName,
AttributeDesignator::InstanceName,
AttributeDesignator::PathName,
];
const ATTRIBUTES_2019: &[AttributeDesignator] = &[
AttributeDesignator::Left,
AttributeDesignator::Right,
AttributeDesignator::High,
AttributeDesignator::Low,
AttributeDesignator::Ascending,
AttributeDesignator::Length,
AttributeDesignator::Range(RangeAttribute::Range),
AttributeDesignator::Range(RangeAttribute::ReverseRange),
AttributeDesignator::Type(TypeAttribute::Subtype),
AttributeDesignator::Image,
AttributeDesignator::Pos,
AttributeDesignator::Succ,
AttributeDesignator::Pred,
AttributeDesignator::LeftOf,
AttributeDesignator::RightOf,
AttributeDesignator::Value,
AttributeDesignator::Val,
AttributeDesignator::Type(TypeAttribute::Element),
AttributeDesignator::Signal(SignalAttribute::Delayed),
AttributeDesignator::Signal(SignalAttribute::Stable),
AttributeDesignator::Signal(SignalAttribute::Quiet),
AttributeDesignator::Signal(SignalAttribute::Transaction),
AttributeDesignator::Signal(SignalAttribute::Event),
AttributeDesignator::Signal(SignalAttribute::Active),
AttributeDesignator::Signal(SignalAttribute::LastEvent),
AttributeDesignator::Signal(SignalAttribute::LastActive),
AttributeDesignator::Signal(SignalAttribute::LastValue),
AttributeDesignator::Signal(SignalAttribute::Driving),
AttributeDesignator::Signal(SignalAttribute::DrivingValue),
AttributeDesignator::SimpleName,
AttributeDesignator::InstanceName,
AttributeDesignator::PathName,
AttributeDesignator::Converse,
];
impl VHDLStandard {
pub fn keywords(&self) -> &'static [Kind] {
match self {
VHDLStandard::VHDL1993 => KEYWORDS_1993,
VHDLStandard::VHDL2008 => KEYWORDS_2008,
VHDLStandard::VHDL2019 => KEYWORDS_2019,
}
}
pub fn builtin_attributes(&self) -> &'static [AttributeDesignator] {
match self {
VHDLStandard::VHDL1993 => ATTRIBUTES_1993,
VHDLStandard::VHDL2008 => ATTRIBUTES_2008,
VHDLStandard::VHDL2019 => ATTRIBUTES_2019,
}
}
}