UsageΒΆ
In order to use Princess you can either download the package from Github or check out the repository and build it yourself.
Currentl llvm-13 is required for the compiler to run.
It is expected to find the compiler on the path, so you need
to hook it up like that. It tries to call clang
so make sure that
clang is supplied via the path.
There is currently no build for the VSCode extension available as
it is in very early stages of development. If you want to use it, you can
checkout the repo and use vsce package
to create a .vsix package which
you can install in your VSCode environment. Currently there is no support
for other editors, but you may adapt the .tmlanguage file you find inside
of the VSCode extension, if your editor supports it.
The princess compiler itself supports the Language Server Protocol, so you might be able to adapt it for other editors as well.
The command line arguments are as follows:
|
Print the AST of the program as JSON |
|
Print the parsed tokens as JSON |
|
Print the typechecked AST as JSON |
|
Continue compiling if any of the previous settings are applied |
|
Add directory to the include search path |
|
Add a globally available define like -DTest |
|
Add search directory for linked libraries |
|
Load library |
|
Pass flags directly to the linker |
|
Pass flag directly to clang |
|
Specify an output directory to put temporary files in (defaults to .princess) |
|
Specifies an output file |
|
Compiles debug information |
|
Inserts symbol information (for stack traces) |
|
Print a dependency graph and abort compilation |
|
Print the version of the compiler |
|
Print additional verbose output |
|
Print a progress bar |
|
Start the language server |
|
Compile without incremental support |
|
Set the name for the main file (if not main) |
|
Compile without the standard library |
This information can also be printed with the --help
flag.
In order to compile a file, simply pass it as an argument to princess
, with any additional
arguments supplied.
Warning
Do note that the default mode of the compiler is incremental compilation. This could speed up compilation significantly for big projects. As of right now the incremental compilation is basically unusable. If the compiler segfaults, try compiling with --no-incremental first before submitting a bug report.