IBM SC34-4499-03 Personal Computer User Manual


 
v A dependency in which the file is stored in the TeamConnection database.
For example, hello.c includes hello.h, and both files are stored in the
TeamConnection database. During a build, these dependencies must be
extracted to a path accessible by the build server. Because a build extracts
parts from TeamConnection, anyone requesting a build needs to have
PartExtract authority to all parts involved in the build.
v A dependency on a file that is not stored in the TeamConnection database.
An example of such a dependency is stdio.h, which is typically stored in a
compiler’s include path and not in the TeamConnection database.
Each path named in Include is queried in the TeamConnection database to
see if it contains a part matching the dependency name. For example,
suppose you define a parser named c_parser with an include path as follows:
src\include;src\package;.;src\comm\include;
One of the parts to which this parser is attached, src\example.cpp, contains
the statement #include "example.hpp". Thus the command file for c_parser
reports example.hpp as a dependency of src\example.cpp. The parser
concatenates each path listed in c_parser’s include path with the name
example.hpp, then inspects the contents of the TeamConnection database to
see if a part with that name exists. So the TeamConnection database is
queried first to find src\include\example.hpp, then src\package\example.hpp.
The period (.) in the include path tells TeamConnection to concatenate the
path of the part to which the file is a dependent with the dependent’s file
name. In this example, that means the TeamConnection database is queried to
find a part named src\example.hpp.
Writing a parser command file
A parser command file accepts two parameters as input:
v
source file
—the name of the file that contains the source to be parsed.
v
dependency list file
—the name of a file into which the names of the dependent files
should be written, one per line. For example, the contents of the file might look like
this:
hello.h
stdio.h
v
family
—the family that contains the source to be passed.
v
release
—the release that contains the source to be passed.
v
workarea
—the workarea that contains the source to be passed.
Both the source file and the dependency list file are created by the TeamConnection
family server. They are erased after the parse is complete.
To write a command file, write a program, in any language, that does the following:
1. Reads the source file
2. Determines which other files are used by it
Chapter 14. Working with parsers 177