Skip to main content

ptx_parser/type/
mod.rs

1//! PTX type definitions - Abstract Syntax Tree (AST) nodes.
2//!
3//! All types are re-exported at the top level for easy access:
4//! - `ptx_parser::r#type::Module` - Root module type
5//! - `ptx_parser::r#type::Instruction` - Instruction with label/predicate
6//! - `ptx_parser::r#type::Operand` - Operand types
7//! - etc.
8//!
9//! Instruction variants are under a separate namespace:
10//! - `ptx_parser::r#type::instruction::Inst` - Enum of all instruction variants
11//! - Individual instruction modules under `ptx_parser::r#type::instruction::*`
12
13// Internal modules - accessible within crate but not publicly exposed
14// Types are re-exported at top level for public API
15pub(crate) mod common;
16pub(crate) mod function;
17pub(crate) mod module;
18pub(crate) mod variable;
19
20// Only instruction module is public
21pub mod instruction;
22
23// Re-export all common types at the top level (explicit list)
24pub use common::{
25    AddressBase, AddressOffset, AddressOperand, AttributeDirective, Axis, CodeLinkage, DataLinkage,
26    DataType, FunctionSymbol, GeneralOperand, Immediate, Instruction, Label, Operand, Predicate,
27    PredicateRegister, RegisterOperand, Sign, SpecialRegister, TexHandler2, TexHandler3,
28    TexHandler3Optional, VariableSymbol, VectorOperand,
29};
30
31// Re-export module types
32pub use module::{
33    AddressSize, AddressSizeDirective, FileDirective, Module, ModuleDebugDirective,
34    ModuleDirective, ModuleInfoDirectiveKind, TargetDirective, TargetString, VersionDirective,
35};
36
37// Re-export function types
38pub use function::{
39    AliasFunctionDirective, BranchTargetsDirective, CallPrototypeDirective, CallTargetsDirective,
40    DwarfDirective, DwarfDirectiveKind, EntryFunctionDirective, EntryFunctionHeaderDirective,
41    FuncFunctionDirective, FuncFunctionHeaderDirective, FunctionBody, FunctionDim,
42    FunctionStatement, LocationDirective, LocationInlinedAt, PragmaDirective, PragmaDirectiveKind,
43    RegisterDirective, RegisterTarget, SectionDirective, SectionEntry, StatementDirective,
44    StatementSectionDirectiveLine,
45};
46
47// Re-export variable types
48pub use variable::{
49    GlobalInitializer, InitializerValue, ModuleVariableDirective, ParamStateSpace,
50    ParameterDirective, VariableDirective, VariableModifier,
51};