AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
VM VM
 
A Dictionary that contains entries that describe and control the Yoix interpreter. Many of the fields are initialized by the command line options used to start the interpreter. You can type
yoix -?
to get a short summary of the options or
yoix --info
to get a longer explanation, and in both cases the information goes to standard output. The fields in VM are:
acceptcertificates A read-only int that is non-zero when the interpreter is supposed to automatically to accept all SSL certificates and zero (the default) when the user should be prompted to decide about questionable certificates. acceptcertificates can only be set to non-zero by the --acceptcertificates command line option.
addtags An int that is non-zero (the default) when line number and source file information is included in parse trees that the interpreter executes and zero when that information should be omitted. The value can be set using the --addtags command line option, however if the debugging or trace fields are non-zero the interpreter always includes the line number and source file information, even when addtags is zero. In other words, using either -g or -g:trace on the command line means you want as much information as possible in error messages, even if addtags is zero.
applet A read-only int that is non-zero when the interpreter is running in applet mode. The value is set using the --applet command line option, but it is also automatically set when the script named on the command line ends in securesuffix (i.e., .yxs).
autoimport A read-only int that controls some undocumented low level behavior of the interpreter.
bind An int that is non-zero (the default) when the interpreter's low level name binding code is enabled and zero when it is not. Name binding improves performance, so there is almost no reason to disable it. The field was added a long time ago, as a precaution, when the binding code was added to the interpreter.
buttonmodel An int that can be used to tell the interpreter to automatically adjust the modifier flags stored in events that are generated when the user interacts with the mouse. The value can be set directly or by using the -b or --buttonmodel command line options. The supported models are:
  • Model 0, which is the default, tells the interpreter to make no changes to the modifier flags.

  • Model 1 tells the interpreter to only change event modifiers on a Mac, and in that case it maps button 1 with CTRL pressed to button 3.

  • Model 2 tells the interpreter to map button 2 to button 3, which essentially converts a three button mouse to a two button mouse.

  • Model 3 exists in the source code, but it will not be documented and should not be used.
Assigning a value to buttonmodel that is not in this list is treated like model 0. This field was sometimes useful a long time ago with very old version of Java, particularly on platforms like IRIX, but it is rarely used today.
compiler A Compiler that is automatically installed when the interpreter starts and can be used by applications that want to translate functions or separate scripts into bytecode. There is nothing special about compiler except for the fact that it is always available.
create An int that is non-zero (the default) if the interpreter is supposed to create a new variable in the global environment when an application assigns a value to an undeclared variable, and zero if it should be considered an error. The value can be set directly or by using the --create command line options.

A non-zero value is convenient, particularly when the interpreter is run in interactive mode, but production applications should almost always explicitly set create to zero, usually by including something like

VM.create = 0;
in their startup script.
Created A read-only String that is the date associated with the source code that was used to build the interpreter.
debug An int whose individual bits are used to control non-standard features of the interpreter that are sometimes used when you are debugging a Yoix application or adding source code to the interpreter. The value can be set directly or on the command line using the -d or --debug options.

As you would expect, the values associated with individual bits can be or'ed together and the result can be assigned to debug on the command line or in a script. The only flags that are currently guaranteed not to change in future releases are:

  • Setting bit 0 asks the interpreter for special handling of expressions like
    VM.starttime + 60*60;
    
    that also happen to be complete statements. When bit 0 is set, the interpreter dumps the value of all such expressions on standard output whenever that statement is executed.

    The value assigned to dumpdepth determines how many levels are dumped when the expression ends up being an object, like an Array or Dictionary, that can contain other objects. Individual Yoix objects can also be dumped using the %O format specification with the printf or fprintf builtins. Including a precision in that format specification can be used to control the number of levels that are dumped, so something like

    printf("%.3O", VM);
    
    is how you can use printf to dump three levels of the VM dictionary.

  • Setting bit 1 asks the interpreter to dump every statement parse tree that it creates. The output goes to standard output and is in a format that is currently undocumented, but often is not hard to understand. Setting this bit also means the parse tree associated with a function is dumped whenever the function itself is dumped.

    Parse trees can be simplified using addtags or the -g:none or -O command line options to eliminate the tag nodes that contain line number and source file information.

  • Setting bit 2 asks the interpreter to include the complete list of the tokens that it would have accepted whenever there is a syntax error. The token list can be long and often is not particularly helpful, so this flag is not used much.

  • Setting bit 3 asks the interpreter to print Yoix script line number and source file information, if it is available, on standard output whenever a statement is executed. Setting this flag can generate lots of output, so it is often most useful when a small set of statements is surrounded by
    VM.debug |= 8;
    
    to enable the debugging, and
    VM.debug &= ~8;
    
    to disable it.

  • Setting bit 4, which is primarily for developers, asks the interpreter for a full Java trace whenever the interpreter handles an error. The output goes to standard error and is a Java trace that usually includes information about line numbers and source files in the interpreter's source code.

  • Setting bit 5 asks the interpreter to dump detailed information on standard output whenever a synchronized statement is executed. The information includes timestamps, in milliseconds, that indicate when the lock was requested, acquired, and released. In addition, if the lock is a String its value is also included in the dump.
Bits that we have not documented may or may not be implemented and are subject to change without notice in future releases.
debugging A read-only int that is used, when addtags is zero, to decide if line number and source file information should be included in the parse trees that the interpreter executes. It is zero by default, but using the -g or -g:trace command line options sets it to non-zero and means line number and source file information will be included in error messages, even when addtags is zero.
dumpdepth An int that is 1 by default and is used to decide how many levels are printed when the interpreter automatically dumps the contents of an object, like an Array or Dictionary, that can contain other objects.
encoding A Dictionary with entries that identify the various encodings that are currently used by the interpreter.
eventflags An int that can be used to control some undocumented low level event related behavior.
exitmodel An int that should be 0, 1, or 2 that determines what happens when the main thread quits. The value can be set directly or by using the -e or --exitmodel command line options and should be 0 if nothing special should happen (i.e., the script must call exit() to quit), 1 (the default) if the interpreter should look at things like active threads and visible windows before deciding what to do, or 2 if the interpreter always exits when the main thread quits. Assigning any other value to exitmodel is treated like 0.
fixfontmetrics An int that is non-zero when the interpreter should make small adjustments to the ascent and maxascent metric values associated with Java fonts. The value is initialized on a platform independent basis and right now only Windows platforms start with a non-zero value.
fixfonts A read-only int that is non-zero when the interpreter should use low level platform dependent tuning to calculate a scaling factor that can be applied to the font sizes that are passed to Java, and zero (the default) when is should not. The value can be set using +f or --fixfonts command line options. The -f option is also recognized, but it is not necessary because it makes sure fixfonts is starts at zero, which is now the default value.
flags An int that is currently unused.
fontmagnification A double that is used to automatically scale font size requests, It is 1.0 by default but can be set directly or by using the -m or --fontmagnification command line options.
menuflags An int that controls some undocumented low level behavior of the interpreter.
Notice A read-only String that is the copyright notice associated with the Yoix interpreter.
Package A read-only String that is the internal name of the Java package that is assigned to the interpreter.
screen A Screen object that describes the default monitor that is attached to the system. Exactly the same description can be found in the first element in the screens array. Right now screen is initialized once, which means changing the system's default monitor while the interpreter is running will usually not be reflected in screen.
screens An Array of Screens that describe all the monitors that are attached to the system. The first element in the array is a description of the default monitor, so the fields in screens[0] and screen always match. Right now the elements in the array are initialized once, which means monitors that are added or removed while the interpreter is running will usually not be represented in screens.
securesuffix A read-only String with the value .yxs that is the suffix of a command line script files that are automatically run with limited capabilities that pretty much duplicate the restrictions imposed on a Java applet by a browser. Running a script that ends in .yxs is essentially like adding --applet as the last command option.
securityoptions A read-only String that contains the security options that were specified when the interpreter was started using the -S or --securityoption command line options.
SerialNumber A read-only String that is currently unused.
starttime A read-only double that is the time when this instance of the interpreter was started.
tmpdir A read-only String that is the default directory that the interpreter uses when it creates temporary files. The value can be set using the -T or --tmpdir command line options.
trace An int that should be 1 to enable function tracing whenever an error occurs and 0 (the default) to disable function tracing. The value can be set using the --trace command line option, but it is also changed by the -O, -g:none, and -g:trace options.
Version A read-only String that is the interpreter's official version. It is also the value reported using the -V or +V command line options.
zipped A read-only int that is 1 by default, and are flags that control how the interpreter handles gzipped scripts or the zip archives that are created by the compiler. The value can be set using the -z or --zipped command line options. Setting bit 0 (the default) means any gzipped Yoix script can be executed, while setting bit 1 means any zipped archive created by the compiler can be executed.
 
 See Also:   Screen

 

Yoix is a registered trademark of AT&T Inc.