META(1)

Table of Contents

Name

meta the ivy*meta SDTB command used to create SDTools

Synopsis

meta [ -?2345cglmpstvyMSV -d directory ] source-description-file

Description

The meta command generates an SDTool from a specification divided into a source description file and a collection of product description files. Source description files have the suffix .sd and product description files have the suffix .pd. The formats of both the source and product description files consist of sections that are described in parts two and three of this reference manual, respectively (see INTRO(2) and INTRO(3) ). The names of the product description files do not appear on the meta command line because the source description file contains references to the product description files (see PRODUCT(2) ). The name of the SDTool is the prefix of the source description file name. The suffix .sd may be omitted from the name of the source description file when it is used on the meta command line.

For example, both commands:
meta sdt.sd
and:
meta sdt
create an SDTool named sdt from a source description file named sdt.sd.

The source and product description files should all be in the same directory, and the meta command should be executed from this directory (referred to as the current directory). The meta command does three things: it creates the source files of an SDTool in an auxiliary directory; it compiles the files; and it links the resulting executable SDTool to the current directory. The source files are created in an auxiliary directory to keep from cluttering up the current directory with the generated files. By default the auxiliary directory is a subdirectory of the current directory named sdt.cc, where sdt is the name of the SDTool. The -d option overrides this default. To compile the source files, meta uses the make program (one of the generated files is a make file which contains the instructions on how to build the SDTool). The make program is automatically executed in the auxiliary directory unless the -S option is specified on the command line. Finally, the executable version of the SDTool is linked to the current directory and given the same name as the source description file, but with the .sd suffix omitted.

If no options are given on the meta command line, only the out-of-date source files of the SDTool are generated. However, options are available to selectively regenerate each source file unconditionally. The options to the meta command are:

-?
Print a one line message about each option.
-2
Print the parse tree of the source description file (see PRINTTREE(5) ).
-3
Generate all products unconditionally.
-4
Output ivy*meta SDTB statistics.
-5
Output the token trace of the source description file.
-c
Create an SDTool release (see OBJECTS(2) ).
-g
Generate global.h, the SDTool's header file.
-l
Generate lex.l, the SDTool's lex program.
-m
Generate main.c, the SDTool's main program.
-p
Generate printtree.c, an SDTool subprogram.
-s
Generate space.c, an SDTool subprogram.
-t
Generate traverse.c, an SDTool subprogram.
-v
Generate version.c, an SDTool subprogram.
-y
Generate yacc.y, the SDTool's yacc program.
-M
Generate Makefile, the make file that builds the SDTool.
-S
Do not issue the make command in the auxiliary directory.
-V
Output version information.
-d directory
Generate the products in directory.

Warnings

Out-of-date products are determined by the dates on files. ivy*meta SDTB assumes that users do not alter these dates except in the usual ways, such as editing, touching, etc.

Example

Here is an example source description file named sdt.sd: %grammar
spec: ( item* )
item: <[a-zA-Z0-9]+>
%product out
Here is an example product description file named out.pd: %template
char *strings[] = {
%forall x:ITEM %loop «%(tok(x))",%end-loop }; Using the meta command to create the SDTool sdt: meta sdt.sd
Using the SDTool to produce out:
sdt input
Assuming that file input contains:
blue green purple
then the output file out contains:
char *strings[] = { «blue", «green", «purple", };

See Also

INTRO(2)
OBJECTS(2)
PRODUCT(2)
INTRO(3)
PRINTTREE(5)


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