Command-Line Options

Usage: slangcc <source.sl> [-o output] [dump-options]
Option Result
-o output Select the native executable path
--ast-dump Write the parser AST as <stem>.ast.json
--ast-semantic-dump Write the checked AST as <stem>.semantic.json
--ir-dump Write textual SLangIR as <stem>.ir
--asm-dump Preserve generated assembly as <stem>.s

Output naming

Without -o:

./slangcc programs/factorial.sl

creates programs/factorial. Intermediate dumps are different: they use only the input stem and are written in the current working directory.

./slangcc programs/factorial.sl --ast-dump --ir-dump

creates factorial.ast.json and factorial.ir in the directory where the command runs, as well as the native executable.

Combining options

All dump flags may be used together:

./slangcc hello.sl -o hello \
  --ast-dump \
  --ast-semantic-dump \
  --ir-dump \
  --asm-dump

Unknown flags, a missing -o value, multiple source paths, multiple -o options, a missing source, or a source without the .sl extension cause usage to be printed and compilation to fail.

Note

The current driver does not implement --help, --version, --run, --emit-ast, or --emit-ir.