IBM SC34-4499-03 manual Writing a parser command le

Models: SC34-4499-03

1 356
Download 356 pages 55.74 Kb
Page 197
Image 197

vA dependency in which the ®le is stored in the TeamConnection database. For example, hello.c includes hello.h, and both ®les 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.

vA dependency on a ®le 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 de®ne 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 ®le 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 ®rst to ®nd 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 ®le is a dependent with the dependent's ®le name. In this example, that means the TeamConnection database is queried to ®nd a part named src\example.hpp.

Writing a parser command ®le

A parser command ®le accepts two parameters as input:

vsource ®leÐthe name of the ®le that contains the source to be parsed.

vdependency list ®leÐthe name of a ®le into which the names of the dependent ®les should be written, one per line. For example, the contents of the ®le might look like this:

hello.h

stdio.h

vfamilyÐthe family that contains the source to be passed.

vreleaseÐthe release that contains the source to be passed.

vworkareaÐthe workarea that contains the source to be passed.

Both the source ®le and the dependency list ®le are created by the TeamConnection family server. They are erased after the parse is complete.

To write a command ®le, write a program, in any language, that does the following:

1.Reads the source ®le

2.Determines which other ®les are used by it

Chapter 14. Working with parsers 177

Page 197
Image 197
IBM SC34-4499-03 manual Writing a parser command le