Skip to main content

sim_shape/
citizen.rs

1//! Citizen integration for shape objects: class registration, codec, and
2//! construction wiring, plus the per-shape class-symbol accessors.
3
4#[path = "citizen/class.rs"]
5mod class;
6#[path = "citizen/codec.rs"]
7mod codec;
8#[path = "citizen/construct.rs"]
9mod construct;
10#[path = "citizen/inventory.rs"]
11mod inventory;
12#[path = "citizen/recursive_codec.rs"]
13mod recursive_codec;
14
15pub(crate) use class::register_shape_citizen_class;
16pub(crate) use codec::{
17    build_shape_value, decode_expr_kind, decode_extra, decode_hooks, decode_shape_list,
18    decode_shape_value, decode_symbol, decode_table_fields, decode_venn_members, encode_extra,
19    encode_hooks, encode_shape_expr, encode_shape_list, encode_table_fields, expr_kind_symbol,
20    or_strategy_symbol,
21};
22pub(crate) use recursive_codec::{decode_shape_defs, encode_shape_defs};
23
24/// Class symbol for the `Any` shape citizen (`shape/Any`).
25pub fn any_shape_class_symbol() -> sim_kernel::Symbol {
26    sim_kernel::Symbol::qualified("shape", "Any")
27}
28
29/// Class symbol for the exact-expression shape citizen (`shape/ExactExpr`).
30pub fn exact_expr_shape_class_symbol() -> sim_kernel::Symbol {
31    sim_kernel::Symbol::qualified("shape", "ExactExpr")
32}
33
34/// Class symbol for the expression-kind shape citizen (`shape/ExprKind`).
35pub fn expr_kind_shape_class_symbol() -> sim_kernel::Symbol {
36    sim_kernel::Symbol::qualified("shape", "ExprKind")
37}
38
39/// Class symbol for the class-membership shape citizen (`shape/Class`).
40pub fn class_shape_class_symbol() -> sim_kernel::Symbol {
41    sim_kernel::Symbol::qualified("shape", "Class")
42}
43
44/// Class symbol for the list shape citizen (`shape/List`).
45pub fn list_shape_class_symbol() -> sim_kernel::Symbol {
46    sim_kernel::Symbol::qualified("shape", "List")
47}
48
49/// Class symbol for the table shape citizen (`shape/Table`).
50pub fn table_shape_class_symbol() -> sim_kernel::Symbol {
51    sim_kernel::Symbol::qualified("shape", "Table")
52}
53
54/// Class symbol for the disjunction shape citizen (`shape/Or`).
55pub fn or_shape_class_symbol() -> sim_kernel::Symbol {
56    sim_kernel::Symbol::qualified("shape", "Or")
57}
58
59/// Class symbol for the conjunction shape citizen (`shape/And`).
60pub fn and_shape_class_symbol() -> sim_kernel::Symbol {
61    sim_kernel::Symbol::qualified("shape", "And")
62}
63
64/// Class symbol for the negation shape citizen (`shape/Not`).
65pub fn not_shape_class_symbol() -> sim_kernel::Symbol {
66    sim_kernel::Symbol::qualified("shape", "Not")
67}
68
69/// Class symbol for the repetition shape citizen (`shape/Repeat`).
70pub fn repeat_shape_class_symbol() -> sim_kernel::Symbol {
71    sim_kernel::Symbol::qualified("shape", "Repeat")
72}
73
74/// Class symbol for the recursive shape definitions citizen (`shape/Defs`).
75pub fn shape_defs_class_symbol() -> sim_kernel::Symbol {
76    sim_kernel::Symbol::qualified("shape", "Defs")
77}
78
79/// Class symbol for the recursive shape reference citizen (`shape/Ref`).
80pub fn shape_def_ref_class_symbol() -> sim_kernel::Symbol {
81    sim_kernel::Symbol::qualified("shape", "Ref")
82}
83
84/// Class symbol for the hook-wrapped shape citizen (`shape/Hooked`).
85pub fn hooked_shape_class_symbol() -> sim_kernel::Symbol {
86    sim_kernel::Symbol::qualified("shape", "Hooked")
87}
88
89/// Class symbol for the Venn-set shape citizen (`shape/Venn`).
90pub fn venn_shape_set_class_symbol() -> sim_kernel::Symbol {
91    sim_kernel::Symbol::qualified("shape", "Venn")
92}