Expand description
Rust port of the backend-independent part of XamlX, the XAML compiler library by
Nikita Tsukanov (MIT, see external/XamlX/NOTICE.md).
The crate mirrors the upstream layout module for module:
| Module | Upstream | Contents |
|---|---|---|
ast | Ast/ | AST nodes, visitors, type/property references, intrinsics |
parsers | Parsers/ | XML based XAML parser and the markup extension parser |
type_system | TypeSystem/ | the type system abstraction and its helpers |
transform | Transform/ | transformation context, configuration and all AST transformers |
emit | Emit/ | backend-agnostic emit contracts |
compiler | Compiler/ | the backend-independent compiler driver |
diagnostics | Diagnostics/ | diagnostics and their severity |
exceptions | Exceptions.cs | the error type |
The IL backend (IL/) is not part of the port. Upstream AST nodes implement the IL
emitting interfaces directly; here the nodes carry only their data, and a backend supplies
node emitters (emit::IXamlAstNodeEmitter) for them.
§Conventions
- C# interfaces keep their
Iprefix as trait names and are used throughRc<dyn ...>handles; a C# property namedTypebecomestype_. - Nodes are mutable through
Cell/RefCellfields, which keeps the upstream in-place visitor semantics and node identity. - Exceptions become
XamlResultvalues carrying anXamlError.
Re-exports§
pub use diagnostics::XamlDiagnostic;pub use diagnostics::XamlDiagnosticSeverity;pub use diagnostics::XamlXWellKnownDiagnosticCodes;pub use exceptions::XamlError;pub use exceptions::XamlParseException;pub use exceptions::XamlResult;pub use exceptions::XamlTypeSystemException;pub use xaml_namespaces::XamlNamespaces;
Modules§
- ast
- Port of the
Ast/directory. - compiler
- Port of the
Compiler/directory: the backend-independent compiler driver. - diagnostics
- Port of the
Diagnostics/directory. - emit
- Port of the
Emit/directory: the backend-agnostic emit abstractions. - exceptions
- Port of
Exceptions.cs. - extensions
- Port of the
Extensions/directory. - parsers
- Port of the
Parsers/directory. - transform
- Port of the
Transform/directory. - type_
system - Port of the
TypeSystem/directory: the type system abstraction used by the compiler. - xaml_
namespaces - Port of
XamlNamespaces.cs.
Macros§
- xaml_
ast_ node_ members - Implements the bookkeeping members of
IXamlAstNodeinside animplblock. - xaml_
line_ info_ impl - Implements
IXamlLineInfoby delegating to an embeddedXamlAstNode(or any otherIXamlLineInfofield):xaml_line_info_impl!(MyNode, base). - xaml_
query_ interface - Answers a
query_interfacerequest for each listed interface type.