use crate::rule::shape::{one_to_one, part_of};
use seesaw_tgg::rules::format::RuleFile;
const CATALOGUE_NAME: &str = "ada";
pub const STRUCT_TO_RECORD: &str = "struct-to-record";
pub const MEMBER_TO_COMPONENT: &str = "member-to-component";
pub const ENUM_TO_TYPE: &str = "enum-to-type";
pub const ENUMERATOR_TO_LITERAL: &str = "enumerator-to-literal";
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";
pub const INTERFACE_TO_INTERFACE: &str = "interface-to-interface";
#[must_use]
pub fn catalogue() -> RuleFile {
RuleFile {
format: 3,
name: CATALOGUE_NAME.to_string(),
rules: vec![
one_to_one(STRUCT_TO_RECORD, "Structure", "AdaRecord", "AdaRecordCorr"),
part_of(
MEMBER_TO_COMPONENT,
("Member", "Structure", "AdaRecordCorr"),
("AdaComponent", "AdaRecord", "AdaComponentCorr"),
),
one_to_one(ENUM_TO_TYPE, "Enumeration", "AdaEnum", "AdaEnumCorr"),
part_of(
ENUMERATOR_TO_LITERAL,
("Enumerator", "Enumeration", "AdaEnumCorr"),
("AdaLiteral", "AdaEnum", "AdaLiteralCorr"),
),
one_to_one(ALIAS_TO_SUBTYPE, "Alias", "AdaSubtype", "AdaSubtypeCorr"),
one_to_one(UNION_TO_RECORD, "Union", "AdaUnion", "AdaUnionCorr"),
part_of(
CASE_TO_VARIANT,
("Case", "Union", "AdaUnionCorr"),
("AdaCase", "AdaUnion", "AdaCaseCorr"),
),
one_to_one(BITMASK_TO_TYPE, "Bitmask", "AdaBitmask", "AdaBitmaskCorr"),
part_of(
BIT_TO_CONSTANT,
("BitValue", "Bitmask", "AdaBitmaskCorr"),
("AdaBitConst", "AdaBitmask", "AdaBitCorr"),
),
one_to_one(BITSET_TO_RECORD, "Bitset", "AdaBitset", "AdaBitsetCorr"),
one_to_one(VALUETYPE_TO_RECORD, "Valuetype", "AdaValue", "AdaValueCorr"),
one_to_one(MODULE_TO_PREFIX, "Module", "AdaModule", "AdaModuleCorr"),
one_to_one(CONST_TO_CONSTANT, "Const", "AdaConst", "AdaConstCorr"),
one_to_one(EXCEPTION_TO_RECORD, "Exception", "AdaError", "AdaErrorCorr"),
one_to_one(NATIVE_TO_TYPE, "Native", "AdaNative", "AdaNativeCorr"),
one_to_one(
INTERFACE_TO_INTERFACE,
"Interface",
"AdaInterface",
"AdaInterfaceCorr",
),
],
}
}