CLI Reference

Command-line interface reference for the XXML compiler. Compile XXML source files to native executables or LLVM IR.

Synopsis

bash
xxml [options] <input.XXML> -o <output>

Basic Usage

Compile to Executable

bash
xxml Hello.XXML -o hello.exe

Generate LLVM IR Only

bash
xxml Hello.XXML -o hello.ll --ir

Legacy Mode (LLVM IR Only)

bash
xxml Hello.XXML -o hello.ll 2

Options

OptionDescription
-o <file>Output file (.ll for IR, .exe/.dll for binary)
--irGenerate LLVM IR only (same as mode 2)
--processorCompile annotation processor to DLL
--use-processor=<dll>Load annotation processor DLL (can be repeated)
--stl-warningsShow warnings for standard library files (off by default)
2Legacy mode: LLVM IR only

Output Formats

Executable (.exe)

Default compilation target. Produces a native Windows executable.

bash
xxml MyApp.XXML -o myapp.exe

LLVM IR (.ll)

Human-readable LLVM intermediate representation. Useful for debugging and optimization analysis.

bash
xxml MyApp.XXML -o myapp.ll --ir

Dynamic Library (.dll)

For annotation processors or shared libraries.

bash
xxml --processor MyProcessor.XXML -o MyProcessor.dll

Annotation Processors

Compiling a Processor

bash
xxml --processor MyAnnotation.XXML -o MyAnnotation.dll

Using a Processor

bash
xxml --use-processor=MyAnnotation.dll App.XXML -o app.exe

Multiple Processors

bash
xxml --use-processor=Proc1.dll --use-processor=Proc2.dll App.XXML -o app.exe

Warning Control

By default, warnings from standard library files are suppressed. Enable them with:

bash
xxml MyApp.XXML -o myapp.exe --stl-warnings

Examples

Basic Compilation

bash
# Compile hello world
xxml Hello.XXML -o hello.exe

# Run the executable
./hello.exe

Debug with LLVM IR

bash
# Generate IR for inspection
xxml MyApp.XXML -o myapp.ll --ir

# View the generated IR
cat myapp.ll

Annotation Processor Workflow

bash
# 1. Create annotation processor source (MyLogger.XXML)
# 2. Compile to DLL
xxml --processor MyLogger.XXML -o MyLogger.dll

# 3. Use processor when compiling application
xxml --use-processor=MyLogger.dll App.XXML -o app.exe

Exit Codes

CodeMeaning
0Successful compilation
1Error (missing arguments, file not found, compilation error)

File Extensions

ExtensionDescription
.XXMLXXML source file
.exeNative executable
.dllDynamic library
.llLLVM IR text format

Environment

The compiler expects:

  • Standard library files in Language/ subdirectory relative to compiler location
  • LLVM tools (llc, lld-link) available in PATH for executable generation
  • Visual Studio Build Tools for Windows linking

Compilation Pipeline

text
Source (.XXML)
    ↓
Lexical Analysis
    ↓
Syntax Analysis (AST)
    ↓
Semantic Analysis
    ↓
LLVM IR Generation (.ll)
    ↓
LLVM Compilation (.obj)
    ↓
Linking (.exe / .dll)

Troubleshooting

"Could not open file"

Verify the input file path exists and is accessible.

"No output file specified"

Use -o flag to specify output: xxml input.XXML -o output.exe

Linker Errors

Ensure LLVM tools and Visual Studio Build Tools are installed and in PATH.

Standard Library Not Found

Verify Language/ directory exists relative to compiler location with core STL files.

Note

For debugging compilation issues, use the --ir flag to generate LLVM IR and inspect the generated code.

Next Steps

Learn about the Import System for module organization, or explore the Compiler Architecture for internals.