8 Fragment and AST Properties

The metaprogramming system enables associating properties with each fragment and with the individual nodes in an AST. The fragment properties are defined as part of the fragment syntax (e.g. the ORIGIN and INCLUDE properties). The AST properties may be attached to the nodes by metaprogramming tools.

The properties are defined as instances of the propertyList pattern (defined in the property fragment). Properties are lists of (name, parameterList) pairs. Name may be any text string, and parameterList is a list of values, where each value may be an integer, a textstring or a name (also a textstring).

The attributes of propertyList are: addProp, findProp, deleteProp, scanProp and getProp.

The fragment properties are available through the prop attribute of the fragment pattern. The AST properties may be accessed through the following attributes of the AST pattern: setCommentProp, getCommentProp and hasCommentProp. SetCommentProp makes it possible to associate a propertyList with an AST, and getCommentProp makes it possible to gain access to the propertyList associated with an AST, and finally hasCommentProp is used for testing whether a propertyList is currently associated with an AST.

Please note, that the current implementation of properties of ASTs implies that the properties replaces any comments, which might have been associated with the AST.


The Metaprogramming System - Reference Manual
© 1991-2002 Mjølner Informatics
[Modified: Friday January 4th 2002 at 13:10]