Under Construction
Running W requires two mandatory and one optional environment variable :
*.so and *.dll), external modules *.o. Any subdirectories will not be considered.*.w: used by the interpreter and during compilation (for the include instructions). This directory is also used by the debugger. If this variable is not set, it will not be possible to interpret the source code, and in debug mode, navigation within the original source code will not be available. Note that the source code will be searched for in the directory tree within WSRC.To run a W program, both the main program and the library, three commands must be executed:
Note: Modules called by invoke are shared libraries at the OS level (DLLs on Windows, so on Unix).
Additional executables:
> > Usage: lwc [-WSRC:<path>] [-WLIB:<path>] <file>.w >
The lwc compiler needs to know:
<file>.w: environment variable WSRC, or failing that, the value of the -WSRC parameter on the command line
The compiler stops at the first error encountered, displaying the error label, the line of source code concerned, and the error location.
Once the W program is compiled without errors, a file named <file>.wa will be created in the WLIB directory.
> > Usage: lwa [-c|u] [-WLIB:<path>] <file.wa|file.wp> >
The assembler “lwa” needs to know the directory where to read the source assembler file and where to write the generated w binary : the contents of the WLIB environment variable, or failing that, the value of the -WLIB command-line parameter. The assembler converts a *.wa file to a *.wp file.
The -c option in the assembly allows you to compress the generated wp binary. Compressed binaries are automatically handled by the disassembler (option -u) and by the w runtime (program lw below).\
The assembler also allows disassembling a W binary by producing the assembler source code in text format : add the option -u to the command. The disassembler converts a *.wp file to *.wa. The rule regarding the WLIB directory applies to both disassembly and assembly.
> > Usage: lw [-d] [-t] [-WBIN:<path>] [-WLIB:<path>] [-WSRC:<path>] <prog> [parms...] >
The W runtime is launched with the executable lw. The W runtime needs to know :
The W runtime is located in a directory present in the OS's PATH, and should therefore be found automatically by the shell.
The directory containing the base path to the sources (WSRC) is optional. It is useful if the debugger needs to be used. The -d option starts the runtime in debug mode on the program. The -t option displays the assembler instructions executed by the runtime for the requested program in the console. The runtime executes the binary program W <prog> (the .wp extension is not required).
The following are potential parameters that will be used by the W program (not by the runtime).
> > Usage: lwf <file.w> >
The formatter reads the input file, <file.w>, reformats it, and then overwrites the original file with the formatted version. The formatted version is also sent to standard output.
Formatting is done according to the W standard :
;, are separated from the code by spaces to align to a column width that is a multiple of 8begin library background sub if loop foreachUnder Construction