next up previous
Next: About this document Up: No Title Previous: Format Execution

Adding New Elements To the Syntax

To add a new elements to the present syntax, one would need to define the Name, Class, Type of the new symbol in the table of valid elements. This is done by adding to the table in the file table.h (make sure the last element of this list is left unaltered).

One also needs to add a piece of C-code, which will fill the required fields of the structure SymbType (depending upon the Type of the element - the ptr field for PTYPE elements and the func, fargv, and fargc fields for FTYPE elements). It is the responsibility of the programmer to make sure that this code is correct in terms of getting the numeric value of the element. Also, the programmer must make sure that this code is compatible with the Type of the element. Failing to do so will either generate wrong values or crash the program at the time of execution.

This code is to be added in the function Compile in the file Compile.c.

The new symbol will be recognized by the application, after it is compiled next time.


Sanjay Bhatnagar
Thu Jan 23 23:40:05 MST 1997