Skip to main content

xidl_parser/hir/
mod.rs

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