Skip to content

Architecture

Andrew Lind edited this page Jun 19, 2026 · 3 revisions

Source layout (src/):

Module Responsibility
main.rs / cli.rs CLI parsing, interactive prompts, the top-level driver
discover.rs Find .hx files; package/path helpers
lexer.rs Haxe tokenizer ('${...}' interpolation, 1...6 ranges, @:meta, etc.)
ast.rs Typed AST for the supported Haxe subset
parser.rs Recursive-descent + precedence-climbing parser
sema/ Symbol table, Haxe→C++ type & namespace mapping (types.rs), @:include resolution (includes.rs), pre-codegen validation (validate.rs), and the whole-program escape / ownership analysis (escape.rs)
codegen/ C++ generation: mod.rs (headers), source.rs (.cpp bodies), holder.rs (base-from-member idiom), ownership.rs (destructor delete emission, driven by sema/escape.rs)
stdafx.rs StdAfx.hxStdAfx.h, and the generated standard-library prelude
scan.rs Small comment-aware scanning helpers
diag.rs Diagnostics (error: / unsupported-feature reporting)

Architecture

Clone this wiki locally