#![doc = include_str!("readme.md")]
mod declaration_nodes;
mod expression_nodes;
mod statement_nodes;
pub use declaration_nodes::*;
pub use expression_nodes::*;
pub use statement_nodes::*;
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone, PartialEq)]
pub struct CRoot {
pub translation_unit: TranslationUnit,
#[cfg_attr(feature = "serde", serde(with = "oak_core::serde_range"))]
pub span: core::range::Range<usize>,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone, PartialEq)]
pub struct TranslationUnit {
pub external_declarations: Vec<ExternalDeclaration>,
#[cfg_attr(feature = "serde", serde(with = "oak_core::serde_range"))]
pub span: core::range::Range<usize>,
}
impl CRoot {
pub fn new(translation_unit: TranslationUnit, span: core::range::Range<usize>) -> Self {
Self { translation_unit, span }
}
}
impl TranslationUnit {
pub fn new(external_declarations: Vec<ExternalDeclaration>, span: core::range::Range<usize>) -> Self {
Self { external_declarations, span }
}
}