|
| Previous: 2.12 Type Checking | TOC | Index | Back | Next: 2.14 The Main Program |
Meta commands are used to control the behaviour of the compiler. No code will be generated for meta commands. Meta command do not belong to the T3X language itself and different implementations may provide different sets of meta commands. The commands described in this section should be present in any implementation of the T3X language, though.
All meta commands begin with a hash sign (#) and like all other statements, they are terminated with a semicolon. They may occur at any place where a statement or a declaration (either local or global) is expected, but not inside of statements or declarations. The following meta command exist:
#! comment text !#
This is a so-called meta comment. Any text between #! and !# is ignored by the compiler. Meta comments may be nested, so code fragments containing meta comments can be made invisible using another meta comment. Meta comments may also be used to create bang headers for Unix:
#!/usr/local/bin/txgo !#
where /usr/local/bin/txgo could be a script that compiles SYSIN to a temporary work file, runs the program and then removes the work file.
#BPW size;
Turn on emission of Tcode with the given machine word size. Tcode dependends on a specific machine word size. By default, this word size is equal to the word size of the generating platform. #Bpw may override the default size. Valid sizes are 0,2,4,8. When using
#BPW 0;
portable Tcode is generated. Portable Tcode may be run on Tcode interpreters with any cell size. The drawback of portable Tcode is inefficient byte vector allocation: one machine word is allocated per byte. Cell-size-dependent (and hence non-portable) Tcode allocates the smallest number of machine words that is required to store a given number of bytes. For example, when using #BPW 0; , the statement
VAR s::1023;
would allocate 1023 machine words with 4 bytes each (= 4092 bytes) in a 32-bit environment, thereby wasting three bytes per byte requested. When not using the #BPW 0; option, 256 4-byte machine words (=1024 bytes) would be allocated on a 32-bit machine, 512 2-byte words would be allocated on a 16-bit machine, etc.
#CLASSPATH "path";
Specify an alternative path for searching class files. Normally, the translator searches class files in the current working directory and in some compiled-in paths. When bootstrapping the compiler or running it in some other non-standard environment, it may be necessary to specify the class path explicitly using this command. Only one path may be specified. When using multiple #classpath commands, only the last one will take effect. This solution is a makeshift and will probably be combined with a more flexible technique in the future. When a classpath is specified using this meta command, it will take precedence over all other class paths.
#DEBUG;
Turn on emission of debug information like source code line numbers and variable names and addresses. When used, this option should be placed at the beginning of a program. When this option is turned on, the T3X translator will generate a LINE instruction at the beginning of each statement and LSYM, ISYM, or GSYM instructions for each local variable, instance variable, or global variable. Debug information is intended for the use by a source level debugger.
| Previous: 2.12 Type Checking | TOC | Index | Back | Next: 2.14 The Main Program |