From 1b98bedd6f7b4ecdb001ecb436cebed3751d96bc Mon Sep 17 00:00:00 2001 From: NovaRain Date: Mon, 11 Mar 2024 10:08:31 +0800 Subject: [PATCH] Edits to sslc documents * edited the description of command line options. * removed old references of dos4gw.exe (only for pre-2.10) and FSE. --- artifacts/scripting/compiler/optimization.md | 4 ++-- artifacts/scripting/compiler/sslc_readme.md | 18 ++++++++---------- docs/optimization.md | 4 ++-- docs/sslc.md | 18 ++++++++---------- 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/artifacts/scripting/compiler/optimization.md b/artifacts/scripting/compiler/optimization.md index 08dd1b93..4a5c9b0f 100644 --- a/artifacts/scripting/compiler/optimization.md +++ b/artifacts/scripting/compiler/optimization.md @@ -9,9 +9,9 @@ The execution speed of scripts is not typically important in an unmodded game, g The sfall build of sslc supports a `-O` command line option to perform an optimization pass over the generated code. This isn't a magic make-my-code-go-faster bullet; most of what it does is very limited in scope. It's primary purpose was to strip out the procedures and variables which get automatically pulled into every script that includes **define.h**, whether you use them or not, and to do something about the additional variables that get created by `foreach` loops. **There are several levels of optimization available:** -- `-O1` - Basic, only removes unreferenced globals variables and procedures, code itself remains untouched. +- `-O1` - Basic, only removes unreferenced variables and procedures, code itself remains untouched. - `-O2` - Full, most code optimizations are on, but only those that were tested on complex scripts. -- `-O3` - Experimental, provides most efficiency, but tend to break some complex code due to bugs. +- `-O3` - Experimental, provides the most efficiency, but tends to break some complex code due to bugs. **The following optimizations are performed:** diff --git a/artifacts/scripting/compiler/sslc_readme.md b/artifacts/scripting/compiler/sslc_readme.md index 27fa1ced..fa8d5152 100644 --- a/artifacts/scripting/compiler/sslc_readme.md +++ b/artifacts/scripting/compiler/sslc_readme.md @@ -3,13 +3,11 @@ SSLC This is a modified copy of sslc, that has a few bugfixes from the original, that will recognise and compile the additional script functions provided by sfall, that can also understand some additional syntax, and that has an integrated preprocessor and optimizer. -Unlike the original script compiler, this has not been compiled as a dos program. When using this in place of the original compile.exe but still using p.bat, you need to either get rid of the dos4gw.exe reference from p.bat or replace the original dos4gw.exe with the one in this archive. +Unlike the original script compiler, this has not been compiled as a DOS program. When using this in place of the original `compile.exe` but still using `p.bat`, you need to get rid of the `dos4gw.exe` reference from `p.bat`. -If you use Fallout Script Editor, you can extract `compile.exe` and `dos4gw.exe` to its `\binary` folder, or extract them somewhere else and change your preferences in FSE to point there. FSE doesn't seem to be able to tell when errors occur when using this compiler though, so I'd recommend either using sfall's script editor instead or compiling by hand if possible. +When compiling global or hook scripts for sfall 3.4 or below, you _must_ include the line `procedure start;` before any `#include` files that define procedures to avoid a few weird problems. This is no longer required starting from 3.5. -When compiling global or hook scripts for sfall 3.4 or below, you _must_ include the line `procedure start;` before any `#include` files that define procedures to avoid a few weird problems. (this is no longer required starting from 3.5) - -This version of compiler was designed primarily for new sfall functions, but it can safely (and is recommended) to be used with non-sfall scripts as well, as long as you don't use any of the arrays syntax and any sfall script functions. +This version of compiler was designed primarily for new sfall functions, but it can be safely used (and is recommended) with non-sfall scripts as well. The original unmodified sslc source is over here: [https://teamx.ru/site_arc/utils/index.html](https://teamx.ru/site_arc/utils/index.html) @@ -18,19 +16,19 @@ The original unmodified sslc source is over here: [https://teamx.ru/site_arc/uti ``` -q don't wait for input on error -n no warnings --b backward compatibility mode +-b use backward compatibility mode -l no logo -p preprocess source -P preprocess only (don't generate .int) -F write full file paths in "#line" directives --O optimize code (full by default, see optimization.md) --O set specific level of optimization (0 - off, 1 - basic, 2 - full, 3 - experimental) +-O optimize code (full optimization, see optimization.md) +-O set specific level of optimization (0 - none, 1 - basic, 2 - full, 3 - experimental) -d print debug messages -D output an abstract syntax tree of the program -o set output path (follows the input file name) -s enable short-circuit evaluation for all AND, OR operators --m define a macro named "macro" for conditional compilation --I specify an additional directory to search for include files +-m[=] define a macro named "macro" for conditional compilation +-I specify an additional directory to search for include files ``` The original command line option `-w` to turn on warnings no longer has an effect, since warnings are now on by default diff --git a/docs/optimization.md b/docs/optimization.md index 2f6e3efb..719ec4d8 100644 --- a/docs/optimization.md +++ b/docs/optimization.md @@ -19,9 +19,9 @@ The execution speed of scripts is not typically important in an unmodded game, g The sfall build of sslc supports a `-O` command line option to perform an optimization pass over the generated code. This isn't a magic make-my-code-go-faster bullet; most of what it does is very limited in scope. It's primary purpose was to strip out the procedures and variables which get automatically pulled into every script that includes **define.h**, whether you use them or not, and to do something about the additional variables that get created by `foreach` loops. **There are several levels of optimization available:** -- `-O1` - Basic, only removes unreferenced globals variables and procedures, code itself remains untouched. +- `-O1` - Basic, only removes unreferenced variables and procedures, code itself remains untouched. - `-O2` - Full, most code optimizations are on, but only those that were tested on complex scripts. -- `-O3` - Experimental, provides most efficiency, but tend to break some complex code due to bugs. +- `-O3` - Experimental, provides the most efficiency, but tends to break some complex code due to bugs. **The following optimizations are performed:** diff --git a/docs/sslc.md b/docs/sslc.md index 707e9e0f..54e0bb77 100644 --- a/docs/sslc.md +++ b/docs/sslc.md @@ -13,13 +13,11 @@ nav_order: 4 This is a modified copy of sslc, that has a few bugfixes from the original, that will recognise and compile the additional script functions provided by sfall, that can also understand some additional syntax, and that has an integrated preprocessor and optimizer. -Unlike the original script compiler, this has not been compiled as a dos program. When using this in place of the original compile.exe but still using p.bat, you need to either get rid of the dos4gw.exe reference from p.bat or replace the original dos4gw.exe with the one in this archive. +Unlike the original script compiler, this has not been compiled as a DOS program. When using this in place of the original `compile.exe` but still using `p.bat`, you need to get rid of the `dos4gw.exe` reference from `p.bat`. -If you use Fallout Script Editor, you can extract `compile.exe` and `dos4gw.exe` to its `\binary` folder, or extract them somewhere else and change your preferences in FSE to point there. FSE doesn't seem to be able to tell when errors occur when using this compiler though, so I'd recommend either using sfall's script editor instead or compiling by hand if possible. +When compiling global or hook scripts for sfall 3.4 or below, you _must_ include the line `procedure start;` before any `#include` files that define procedures to avoid a few weird problems. This is no longer required starting from 3.5. -When compiling global or hook scripts for sfall 3.4 or below, you _must_ include the line `procedure start;` before any `#include` files that define procedures to avoid a few weird problems. (this is no longer required starting from 3.5) - -This version of compiler was designed primarily for new sfall functions, but it can safely (and is recommended) to be used with non-sfall scripts as well, as long as you don't use any of the arrays syntax and any sfall script functions. +This version of compiler was designed primarily for new sfall functions, but it can be safely used (and is recommended) with non-sfall scripts as well. The original unmodified sslc source is over here: [https://teamx.ru/site_arc/utils/index.html](https://teamx.ru/site_arc/utils/index.html) @@ -28,19 +26,19 @@ The original unmodified sslc source is over here: [https://teamx.ru/site_arc/uti ``` -q don't wait for input on error -n no warnings --b backward compatibility mode +-b use backward compatibility mode -l no logo -p preprocess source -P preprocess only (don't generate .int) -F write full file paths in "#line" directives --O optimize code (full by default, see "Optimization" page) --O set specific level of optimization (0 - off, 1 - basic, 2 - full, 3 - experimental) +-O optimize code (full optimization, see "Optimization" page) +-O set specific level of optimization (0 - none, 1 - basic, 2 - full, 3 - experimental) -d print debug messages -D output an abstract syntax tree of the program -o set output path (follows the input file name) -s enable short-circuit evaluation for all AND, OR operators --m define a macro named "macro" for conditional compilation --I specify an additional directory to search for include files +-m[=] define a macro named "macro" for conditional compilation +-I specify an additional directory to search for include files ``` The original command line option `-w` to turn on warnings no longer has an effect, since warnings are now on by default