TGS-II(ID:479/tgs001)for Translator Generator System, Mark II Cheatham, Computer Associates of Massachusetts, 1964 Contained TRANDIR Places
Related languages
References: in [AFIPS JCC 25] Proceedings of the 1964 Spring Joint Computer Conference SJCC 1964 view details in Information System Sciences, Proc. of the Second Congress, 1965, Spartan Books, New York, 1965 view details in [ACM/IEEE] Proceedings of the SHARE Design Automation Project Annual ACM IEEE Design Automation Conference 1965 view details in [ACM/IEEE] Proceedings of the SHARE Design Automation Project Annual ACM IEEE Design Automation Conference 1965 view details Cheatham proposes two different classes of syntactic macros, called SMACROs and MACROS. Each SMACRO is associated with a given syntactic class of the base language, and calls of the SMACRO are only recognized in a context where that syntactic class may occur. SMACROs behave as if they had been built into the original syntax of the base language and their syntax can be chosen to fit in neatly with the syntax of the rest of the base language. This compares favourably with macros which require some special marker to announce their occurrence and/or require a speciai syntax for macro calls, which might clash with that of the base language. Cheatham supplies the following example of an SMACRO in his paper : LET N BE INTEGER SMACRO MATRIX(N) AS ATTRIBUTE MEANS 'ARRAY (1 : N, 1 : N)' where ATTRIBUTE is a previously defined syntactic class of the base language. This definition specifies that if text of form MATRIX (argumerzt) occurs in a context of the base language where an ATTRIBUTE is to be expected, then the macro processor is to check that the argument is an integer and replace the original text by ARRAY (1 : argument, 1 : argument) Cheatham's MACROs differ from his SMACROs in that they do not have to form a syntactic class of the base language and can occur anywhere in the source text. They do, however, have to be preceded by a special marker. MACROs are, therefore, similar in many ways to some existing schemes for text macros. However, the advantage of MACROs is that the syntax of their arguments is specified and hence, in the case of an error in the form of an argument, a message can be produced when the macro is called. In the case of text macros it is often the case that error messages are produced in a stage of compilation after macro processing has been completed, and it may be difficult to relate an error message with the macro call that produced it. in Halpern, Mark I and Shaw Christopher J (eds) "Annual Review in Automatic Programming" (6) 1969 Pergamon Press, Oxford view details in Halpern, Mark I and Shaw Christopher J (eds) "Annual Review in Automatic Programming" (6) 1969 Pergamon Press, Oxford view details |