VERSION(5)

Table of Contents

Name

agname
name of the SDTool agversion version of the SDTool userlogin login-id of the SDTool user
curdate
formatted version of current date and time
rawdate
unformatted version of current date and time
sourcename
file name parameter passed to the SDTool
sourcefn
full path name of the specification file
productdir
product generation directory
yacctraceflag
grammar rule trace flag tokentraceflag token trace flag
agoption
option flags set on the command line
agoptarg
option arguments specified on the command line
getversion
returns version information from a parse tree

Synopsis

STRING agname, agversion, userlogin, curdate; LONG rawdate;
STRING sourcename, sourcefn, productdir;
BOOLEAN yacctraceflag, tokentraceflag;
BOOLEAN agoption[];
STRING agoptarg[];
STRING getversion(any)
ANY any;

Description

These components of the run-time library are general global variables and a function that returns version information.

agname is the name of the SDTool (i.e., the prefix of the tool's source description file). agversion is the version of the SDTool. The version of an SDTool is specified in its source description file by including the control string «@(#)» somewhere in the file's white space; the version string is the information that follows this control string.

userlogin is the login name of the person using the SDTool. curdate is the current date and time as formatted by the standard library ctime function. rawdate is the raw UNIX System time (seconds since January 1, 1970).

sourcename is the name of the specification file as given on the meta command line; its value is < when no file name is specified. sourcefn is the full path name of the specification file; its value is «Unknown» if sourcename is <.

productdir specifies the directory where the SDTool's products are generated; it is initialized to «.» (the current directory) and may be changed with the standard -d option (see OPTION(2) ).
yacctraceflag is the grammar rule trace flag; setting it to TRUE turns on the option (the option can also be selected by the standard -1 option (see OPTION(2) ). Similarly, tokentraceflag is the token trace flag; setting it to TRUE turns on the option (the option can also be selected by the standard -5 option (see OPTION(2) ).

The command line options and their arguments are stored in the two arrays, agoption and agoptarg, both indexed by the option character. agoption returns TRUE if the option character appears on the command line, and agoptarg returns an option's string argument value from the command line. The argument value will be NULL if there were no such argument on the command line.

The function getversion searches through the white space of the specification file for the string «@(#)» and returns the information that follows the first such string. If there is no such string then getversion returns the string «Unknown".

Example

%template
/* This product produced by %(userlogin) on %(curdate) from file %(sourcefn) using %(agname) version %(agversion) */

See Also

OPTION(2)


© 1990 Lucent Technologies, Inc
© 1998 Harmony Software, Inc