The ast command exposes a compiler-facing structural view of .pta source or MusicXML input.
Syntax
partitura ast <input>
Arguments
| Argument |
Required |
Description |
<input> |
Yes |
Input file (.pta, .xml, .musicxml, or .mxl) |
Supported Input Formats
| Extension |
Format |
.pta |
Partitura source |
.xml |
Uncompressed MusicXML |
.musicxml |
Uncompressed MusicXML |
.mxl |
Compressed MusicXML |
Examples
# View AST for .pta source
partitura ast score.pta
# View AST for MusicXML
partitura ast score.musicxml
Requirements
- Operates without changing source files
- Presents a structured representation of parsed source
Behavior
The command parses the input and prints a structured AST (Abstract Syntax Tree) representation to stdout. This is useful for:
- Debugging parser behavior
- Understanding how source maps to IR
- Inspecting the internal structure of parsed documents
Exit Codes
| Code |
Meaning |
0 |
Success |
1 |
Parse error |
2 |
Usage error |
See Also
- validate — Validate
.pta or MusicXML input
- compile — Compile
.pta to MusicXML