pub enum NodeContent {
Show 20 variants
RecInt {
bit_size: u32,
signed: bool,
},
RecFloat {
size: u32,
},
RecList,
RecMap,
RecEnum {
key_type: RecTypeId,
},
RecEnumItem {
value: BigInt,
},
RecStruct,
RecStructMember,
RecTupleMember {
tid: RecTypeId,
},
RecTypeInst {
tid: RecTypeId,
},
RecGeneric {
index: u32,
},
DatMap,
DatTuple,
DatList,
DatMapAssignment,
DatTupleMember,
RecTuple,
DatInt {
repr: String,
},
DatFloat {
repr: String,
},
DatEnum,
}
Expand description
Possible elements from recipe and data files
Values prefixed with Rec refer to recipe definition items. Values prefixed with Dat refer to content data.
Variants§
RecInt
Integer type
Nodes of this type are created by the compiler, to populate standard integer types such as i32, u32, etc.
RecFloat
Floating point type
Nodes of this type are created by the compiler, to populate standard f32 and f64 types. The stored value can be 32 or 64 for respectively f32 and f64.
RecList
Generic list type
RecMap
Generic map type
RecEnum
Recipe enumeration definition
RecEnum
nodes have one RecEnumItem
child node for each possible enumeration value.
RecEnumItem
An enumeration possible value
RecEnumItem can have one child, which can be a RecTuple or RecStruct
RecStruct
RecStructMember
Members of structures Name of the node is the member name in the structure Type of the structure member is first and unique child
RecTupleMember
Members of tuples Name of the node is None
RecTypeInst
Node designating another existing type in the tree Firstly stores the path string to the type, and then is resolved as the pointed type node Id. This node can have children, and each RecTypeInst children is a generic type argument to the parent node.
RecGeneric
Generic type node which may be child of RecStruct
or native generic types such as
RecList
.
index
field corresponds to the index of the generic type in the parent type.
DatMap
DatTuple
DatList
DatMapAssignment
This node corresponds to a map or structure assignment (we can consider structures as a subset of maps from a grammar perspective). Such node have two childen, one for the name or key, and a second for the value.
DatTupleMember
RecTuple
DatInt
DatFloat
DatEnum
Enumeration identifier (works for boolean too) Enumeration value name stored in node name Also used for structure assignments.
Trait Implementations§
Source§impl Clone for NodeContent
impl Clone for NodeContent
Source§fn clone(&self) -> NodeContent
fn clone(&self) -> NodeContent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more