[Next] [Previous] [Up] [Top] [Contents] [Index]

11.3 Script Utilities

11.3.4 Inheritance


PsyScript includes a concept known as attribute inheritance, which associates certain attributes to the token resolved from a script expression. (See ?? for details.) Script-reading agents obtain EntryRefs to inherited attributes ot tokens information through the TokInfo structure.

	typedef struct {
		int		isLiteral;		/* 1 if from literal expression */
		InheritRec 		*refs;		/* Used to get inherited attribs */
	} TokInfo;
 

A TokInfo structure is included in every TokenValue structure, so that inherited attributes can be obtained for any token in a TokenValue array. Additionally, many functions which return individual tokens accept the address of a TokenValue structure to fill in with inheritance information.

Unlike TokenValue and VersionMarker structures, TokInfo structures are created directly. However, the information within a TokInfo structure is still always set by some Script Utility. The refs field is passed to Script Utilties to get inherited attributes.

Once information has been put into a TokInfo structure, it must be freed with FreeTokInfo(); only the information contained in the structure is released, not the structure itself. FreeTokInfo() must be called between multiple informaion assignments to a TokInfo structure.


PSYX Programmer's Manual - 24 AUG 95
[Next] [Previous] [Up] [Top] [Contents] [Index]

Generated with CERN WebMaker