fips_md/parser/
unit.rs

1//! A single unit of FIPS code (typically one source file)
2
3use super::{ExternFunctionDecl, Interaction, Particle, Simulation, GlobalStateMember};
4
5pub struct Unit {
6    pub(crate) global_state_members: Vec<GlobalStateMember>,
7    pub(crate) particles: Vec<Particle>,
8    pub(crate) interactions: Vec<Interaction>,
9    pub(crate) simulations: Vec<Simulation>,
10    pub(crate) extern_functiondecls: Vec<ExternFunctionDecl>
11}
12
13impl Unit {
14    pub fn new() -> Self {
15        Unit {
16            global_state_members: vec![],
17            particles: vec![],
18            interactions: vec![],
19            simulations: vec![],
20            extern_functiondecls: vec![],
21        }
22    }
23}
24
25/// All top level tokens of FIPS
26#[derive(Debug,PartialEq)]
27pub(crate) enum UnitMember {
28    GlobalStateMember(GlobalStateMember),
29    Particle(Particle),
30    Interaction(Interaction),
31    Simulation(Simulation),
32    ExternFunctionDecl(ExternFunctionDecl)
33}