use crate::rule::shape::{one_to_one, part_of};
use seesaw_tgg::rules::format::RuleFile;
const CATALOGUE_NAME: &str = "ada83";
pub const STRUCT_TO_RECORD: &str = "struct-to-record";
pub const MEMBER_TO_COMPONENT: &str = "member-to-component";
pub const ENUM_TO_CONSTANTS: &str = "enum-to-constants";
pub const ENUMERATOR_TO_CONSTANT: &str = "enumerator-to-constant";
pub const ALIAS_TO_SUBTYPE: &str = "alias-to-subtype";
pub const UNION_TO_RECORD: &str = "union-to-record";
pub const CASE_TO_VARIANT: &str = "case-to-variant";
pub const BITMASK_TO_TYPE: &str = "bitmask-to-type";
pub const BIT_TO_CONSTANT: &str = "bit-to-constant";
pub const BITSET_TO_RECORD: &str = "bitset-to-record";
pub const VALUETYPE_TO_RECORD: &str = "valuetype-to-record";
pub const MODULE_TO_PREFIX: &str = "module-to-prefix";
pub const CONST_TO_CONSTANT: &str = "const-to-constant";
pub const EXCEPTION_TO_RECORD: &str = "exception-to-record";
pub const NATIVE_TO_TYPE: &str = "native-to-type";
#[must_use]
pub fn catalogue() -> RuleFile {
RuleFile {
format: 3,
name: CATALOGUE_NAME.to_string(),
rules: vec![
one_to_one(
STRUCT_TO_RECORD,
"Structure",
"Ada83Record",
"Ada83RecordCorr",
),
part_of(
MEMBER_TO_COMPONENT,
("Member", "Structure", "Ada83RecordCorr"),
("Ada83Component", "Ada83Record", "Ada83ComponentCorr"),
),
one_to_one(
ENUM_TO_CONSTANTS,
"Enumeration",
"Ada83Enum",
"Ada83EnumCorr",
),
part_of(
ENUMERATOR_TO_CONSTANT,
("Enumerator", "Enumeration", "Ada83EnumCorr"),
("Ada83EnumConst", "Ada83Enum", "Ada83EnumConstCorr"),
),
one_to_one(
ALIAS_TO_SUBTYPE,
"Alias",
"Ada83Subtype",
"Ada83SubtypeCorr",
),
one_to_one(UNION_TO_RECORD, "Union", "Ada83Union", "Ada83UnionCorr"),
part_of(
CASE_TO_VARIANT,
("Case", "Union", "Ada83UnionCorr"),
("Ada83Case", "Ada83Union", "Ada83CaseCorr"),
),
one_to_one(
BITMASK_TO_TYPE,
"Bitmask",
"Ada83Bitmask",
"Ada83BitmaskCorr",
),
part_of(
BIT_TO_CONSTANT,
("BitValue", "Bitmask", "Ada83BitmaskCorr"),
("Ada83BitConst", "Ada83Bitmask", "Ada83BitCorr"),
),
one_to_one(BITSET_TO_RECORD, "Bitset", "Ada83Bitset", "Ada83BitsetCorr"),
one_to_one(
VALUETYPE_TO_RECORD,
"Valuetype",
"Ada83Value",
"Ada83ValueCorr",
),
one_to_one(MODULE_TO_PREFIX, "Module", "Ada83Module", "Ada83ModuleCorr"),
one_to_one(CONST_TO_CONSTANT, "Const", "Ada83Const", "Ada83ConstCorr"),
one_to_one(
EXCEPTION_TO_RECORD,
"Exception",
"Ada83Error",
"Ada83ErrorCorr",
),
one_to_one(NATIVE_TO_TYPE, "Native", "Ada83Native", "Ada83NativeCorr"),
],
}
}