oak_delphi/ast/
mod.rs

1/// Strongly-typed AST root for Delphi language
2#[derive(Debug, PartialEq, Clone)]
3pub struct DelphiRoot {
4    pub items: Vec<DelphiItem>,
5}
6
7/// Top-level items in Delphi language
8#[derive(Debug, PartialEq, Clone)]
9pub enum DelphiItem {
10    Program(DelphiProgram),
11    Unit(DelphiUnit),
12    Statement(DelphiStatement),
13}
14
15/// Represents a Delphi program
16#[derive(Debug, PartialEq, Clone)]
17pub struct DelphiProgram {
18    pub name: String,
19    pub statements: Vec<DelphiStatement>,
20}
21
22/// Represents a Delphi unit
23#[derive(Debug, PartialEq, Clone)]
24pub struct DelphiUnit {
25    pub name: String,
26    pub interface_section: Vec<DelphiStatement>,
27    pub implementation_section: Vec<DelphiStatement>,
28}
29
30/// Represents various statements in Delphi language
31#[derive(Debug, PartialEq, Clone)]
32pub enum DelphiStatement {
33    /// Empty statement
34    Empty,
35}