Alias File


Danish has an alias file which allows aliases to be assigned to type and function names in the axiom file specifications. This functionality must be used in certain cases to provide the parser with simple one-string-variable and method names. For example, the single function 'new Stack' cannot be correctly parsed by Danish, so an alias must be created. Similarly, the common Java method 'System.out.print' is incorrectly parsed due to the periods in the name, and must have an alias. Note that any method name with periods in it that is specified in the signature file must have an alias.

However, abilitiy to create aliases extends beyond making up for Danish's simple parser. Using aliases, the user can limit how variables are used in order to reduce the number of combinations in the test vector space and therefore the number of tests that are conducted. This is useful in a case where one data type is used in two (or more) different ways. For example, in an array ADT, an integer may be used as either data that is being put into an array, or an index for addressing a location in the array. By creating two new data types (and using the new data types in the signature, axiom, and vector files) and mapping the two new data types to ints using aliases, state explosions and other errors where a data type is incorrectly used can be avoided.

Aliases can also be used in creating artificial constants within the axiom file, such as with a function without a parameter list.

The alias file must be written in the following form:

	"alias name" "real name"

with the rest of the line being left blank, i.e. only one alias allowed per line. Here, "alias name" will be the one word description, and "real name" will be the actual definition of the alias, or what will be put in place of "alias name" wherever it occurs in the generated code.

For example, use of 'new' must be aliased to create a simple identifier for the parser as mentioned above. A constructor which uses 'new' to create a new instance of an object can thus be aliased as follows:

	newId	new Id

where "newId" will be replaced with "new Id" in the generation of the code, provided that 'Id' is the name of the object (but 'newId' is arbitrarily chosen), and that 'Id' has no parameter list.

>adapted from Daistish++ manual, by Hughes, September 25, 1995.


Goto Previous Topic Goto Next Topic
Created 02/11/98 by kennedy.
Modified 04/27/98.