oak_objective_c/ast/mod.rs
1#![doc = include_str!("readme.md")]
2//! Objective-C AST definitions.
3
4/// Root node of the Objective-C syntax tree.
5#[derive(Debug, Clone, PartialEq)]
6pub struct ObjectiveCRoot {
7 /// All top-level items in the source file.
8 pub items: Vec<ObjectiveCItem>,
9}
10
11/// Objective-C top-level item.
12#[derive(Debug, Clone, PartialEq)]
13pub enum ObjectiveCItem {
14 /// Interface definition (@interface).
15 Interface,
16 /// Implementation definition (@implementation).
17 Implementation,
18 /// Protocol definition (@protocol).
19 Protocol,
20 /// Function definition.
21 Function,
22 /// Variable declaration.
23 Variable,
24 /// Import statement (#import/#include).
25 Import,
26}
27
28impl Default for ObjectiveCRoot {
29 fn default() -> Self {
30 Self { items: Vec::new() }
31 }
32}