Skip to main content

xidl_parser/hir/
mod.rs

1mod annotation;
2mod annotation_builtin;
3pub(crate) mod builtin;
4mod compound;
5mod const_dcl;
6mod declarator;
7mod enum_dcl;
8mod exception_dcl;
9mod expr;
10mod include;
11mod interface;
12mod interface_codegen;
13mod pragma;
14mod scoped_name;
15mod spec;
16mod struct_dcl;
17mod type_dcl;
18mod types;
19mod versioned_include;
20
21pub use annotation::*;
22pub use compound::*;
23pub use const_dcl::*;
24pub use declarator::*;
25pub use enum_dcl::*;
26pub use exception_dcl::*;
27pub use expr::*;
28pub use include::*;
29pub use interface::*;
30pub use pragma::*;
31pub use scoped_name::*;
32pub use struct_dcl::*;
33pub use type_dcl::*;
34pub use types::*;
35pub(crate) use versioned_include::VersionedIncludes;
36
37use serde::{Deserialize, Serialize};
38use serde_json::Value;
39use std::collections::HashMap;
40
41#[derive(Debug, Serialize, Deserialize, Clone)]
42pub struct Specification(pub Vec<Definition>);
43
44pub type ParserProperties = HashMap<String, Value>;
45
46#[derive(Debug, Serialize, Deserialize, Clone)]
47pub enum Definition {
48    ModuleDcl(ModuleDcl),
49    Pragma(Pragma),
50    ConstrTypeDcl(ConstrTypeDcl),
51    TypeDcl(TypeDcl),
52    ConstDcl(ConstDcl),
53    ExceptDcl(ExceptDcl),
54    InterfaceDcl(InterfaceDcl),
55}
56
57#[derive(Debug, Serialize, Deserialize, Clone)]
58pub struct ModuleDcl {
59    pub annotations: Vec<Annotation>,
60    pub ident: String,
61    pub definition: Vec<Definition>,
62}