Generated versus Original SIDL files
Generated SIDL files may differ from their original SIDL files in several
respects in terms of content as well as layout. These differences are
summarized below.
- Packages.
- The code generation is limited to one high-level package
per generated file. In fact, the name of the generated file is currently
defined to be the concatenation of the name of the highest-level package and
.sidl.
- Versioning.
- The generation of requires statements is inferred from the
symbols that actually appear in the associated interface descriptions. The
intent is to provide a requires statement for only the highest level package
needed of a given version. Consequently, requires and imports statements that
were not necessary for resolving symbols will not appear. Also, fully
qualified names will be shortened in the generated files due to the automatic
generation of the associated requires statement(s). Finally, since an import
and require statement can be used in a SIDL file and no distinction is made in
the XML, only a require statement will appear in the generated file.
- Implements.
- Since there is no distinction between implements-all
and implements in the XML version of the interfaces, the generated code
outputs implements along with the inherited methods.
- Comments.
- Babel preserves only document, or doc, comments so any
comments that do not conform will not appear in the generated file
13.1.
- Whitespace.
- Obviously there may be whitespace differences in the
generated file. These include indentation, blank spaces and lines, and brace
placement.
As an example, suppose we have a package in the file foo.sidl. The
original file's contents are:
package foo version 1.0 {
class A {}
package bar version 2.0 {
class B {}
}
}
The resulting contents of the generated SIDL file are:
package foo version 1.0 {
class A {
}
package bar version 2.0 {
class B {
}
}
}
Notice the differences in white space. To illustrate more features, further
suppose we have a package in the file fooTest.sidl. The original file's
contents are:
// An ignored comment
require foo version 1.0;
require foo.bar version 2.0;
/**
* Test of doc comment with XML special characters < & >.
*/
package fooTest version 0.1 {
/**
* Another doc comment for an empty class.
*/
class A extends foo.bar.B {}
class B extends foo.A {}
}
The resulting contents of the generated SIDL file are:
require foo version 1.0;
require foo.bar version 2.0;
/**
* Test of doc comment with XML special characters < & >.
*/
package fooTest version 0.1 {
/**
* Another doc comment for an empty class.
*/
class A extends foo.bar.B {
}
class B extends foo.A {
}
}
Here we see the exclusion of non-document comments and the retention of
document comments. Refer to Section 5.2 and Appendix
C for more information about document comments.
babel-0.10.2
users_guide Last Modified 2005-03-23
http://www.llnl.gov/CASC/components
components@llnl.gov