CLI Reference¶
This document provides a comprehensive reference for the RuneScript Compiler command-line interface.
Basic Usage¶
The RuneScript Compiler is executed using the Java Runtime Environment:
Command Options¶
Execution Options¶
-h, --help: Display help information and exit-v, --version: Show the compiler version and exit-r, --run: Execute the script after compilation (default behavior)-c, --compile-only: Compile the script without executing it-d, --debug: Enable debug mode with detailed compilation information-t, --timing: Show timing information for compilation phases
Output Options¶
-o, --output <file>: Specify output file for compiled bytecode--dump-ast: Print the Abstract Syntax Tree after parsing--dump-bytecode: Print the generated bytecode instructions--verbose: Enable verbose output during compilation
Configuration Options¶
--memory-limit <size>: Set memory limit for execution (e.g., 512M, 1G)--stack-size <size>: Set maximum stack size (e.g., 1M, 2M)--no-cache: Disable compilation caching--strict: Enable strict mode with additional type checking
Examples¶
Running a Script¶
Execute a RuneScript file:
Compiling Only¶
Compile a script without executing it:
Debug Mode¶
Run with debug information:
Verbose Output¶
Get detailed compilation information:
Dump AST¶
View the parsed Abstract Syntax Tree:
Dump Bytecode¶
View the generated bytecode:
Timing Information¶
Show timing for compilation phases:
Memory Configuration¶
Set memory limits for execution:
Strict Mode¶
Enable strict type checking:
Exit Codes¶
The RuneScript Compiler returns the following exit codes:
0: Success - script executed without errors1: Compilation error - syntax or semantic error in the script2: Runtime error - error occurred during script execution3: System error - issue with the compiler or environment4: Invalid arguments - incorrect command-line options provided
Environment Requirements¶
- Java Version: Java 21 or higher is required
- Memory: Minimum 256MB RAM recommended for compilation
- Disk Space: At least 50MB free space for temporary files
Troubleshooting¶
Common Issues¶
"Could not find or load main class" - Ensure you're using the correct JAR filename - Check that the JAR file exists in the specified path
"Unsupported class file major version" - Update to Java 21 or higher
"Out of memory" error
- Increase heap size: java -Xmx2g -jar runescript.jar script.rn
- Reduce memory usage in your script
"Permission denied"
- Ensure the JAR file has execute permissions
- On Unix systems: chmod +x runescript.jar
Getting Help¶
For additional help, use the built-in help option:
Or visit the online documentation for more detailed information.