!standard 02.01 (18) 99-05-27 AI95-00134/02 !class confirmation 96-05-07 !status WG9 approved 96-12-07 !status ARG approved 7-0-1 96-06-17 !status work item 96-05-08 !status received 96-05-07 !priority Medium !difficulty Easy !subject Source Representation !summary The language does not specify the source representation of programs. !question The NOTE in RM95-2.1(18) says "The language does not specify the source representation of programs." Is this intended to allow arbitrary preprocessing of what would otherwise be considered "source files", with the preprocessor integrated into the compiler, and with no need for a switch to disable such preprocessing? If so, there seems to be no limit to allowable language extensions, so long as such extensions can be described using a transformation to an allowable sequence of characters. !response AARM-2.1(18.a) clarifies the intent: 18.a Discussion: Any source representation is valid so long as the implementer can produce an (information-preserving) algorithm for translating both directions between the representation and the standard character set. (For example, every character in the standard character set has to be representable, even if the output devices attached to a given computer cannot print all of those characters properly.) From a practical point of view, every implementer will have to provide some way to process the ACVC. It is the intent to allow source representations, such as parse trees, that are not even linear sequences of characters. It is also the intent to allow different fonts: reserved words might be in bold face, and that should be irrelevant to the semantics. Thus, source representation does not represent a gaping loophole. !ACATS test Since the standard does not specify a format, no test is possible. (Note that in one sense, all ACATS tests test the source representation of a processor). !appendix !section 2.1(18) !subject allowable preprocessing !reference RM95-2.1(18) !from Dan Eilers 96-04-24 !reference 96-5512.a Dan Eilers 96-4-24>> !discussion The note in RM95-2.1(18) says "The language does not specify the source representation of programs." Is this intended to allow arbitrary preprocessing of what would otherwise be considered "source files", with the preprocessor integrated into the compiler, and with no need for a switch to disable such preprocessing? If so, there seems to be no limit to allowable language extensions, so long as such extensions can be described using a transformation to an allowable sequence of characters. -- Dan Eilers **************************************************************** !section 2.1(18) !subject allowable preprocessing !reference RM95-2.1(18) !reference as: 96-5512.a Dan Eilers 96-4-24 !from Bob Duff !reference 96-5525.a Robert A Duff 96-4-29>> !discussion > The note in RM95-2.1(18) says "The language does not specify the > source representation of programs." Is this intended to allow > arbitrary preprocessing of what would otherwise be considered > "source files", with the preprocessor integrated into the compiler, > and with no need for a switch to disable such preprocessing? > > If so, there seems to be no limit to allowable language extensions, > so long as such extensions can be described using a transformation > to an allowable sequence of characters. Dan, Why do you ask such esoteric questions? Yes, there's all kinds of weird things implementations *could* do. IMHO, if an implementation supports some weird representation of source programs, then it has to define an algorithm for translating that representation into a "normal" representation. Whether the RM actually *requires* that, I don't know, and I don't think I need to care. If an implementation chooses to represent Ada programs as Fortran source code, then it's going to have to define a mapping from Fortran to Ada (which might be kind of difficult;-)). - Bob ****************************************************************