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