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