oak-objective-c 0.0.11

Objective-C object-oriented programming language parser with support for Apple platform development and runtime features.
Documentation
#![doc = include_str!("readme.md")]

/// Root node of the Objective-C syntax tree.
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ObjectiveCRoot {
    /// All top-level items in the source file.
    pub items: Vec<ObjectiveCItem>,
}

/// Objective-C top-level item.
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum ObjectiveCItem {
    /// Interface definition (@interface).
    Interface,
    /// Implementation definition (@implementation).
    Implementation,
    /// Protocol definition (@protocol).
    Protocol,
    /// Function definition.
    Function,
    /// Variable declaration.
    Variable,
    /// Import statement (#import/#include).
    Import,
}

impl Default for ObjectiveCRoot {
    fn default() -> Self {
        Self { items: Vec::new() }
    }
}