(j3.2006) (j3.2005) question on token replacement/concatenation
Aleksandar Donev
donev1
Thu Nov 30 16:40:30 EST 2006
On Thursday 30 November 2006 11:23, Michael Ingrassia wrote:
> 3 %% .14159 %% E %% + %% 0
First, did you mean to put spaces after the 3, around the E, etc.? Is this
fixed or free source form?
I ask because the token's in the concatenation must be *single* lexical
tokens, which are defined as:
"Lexical tokens are sequences of characters that constitute the building
blocks of a program. They are keywords, names, literal constants other than
complex literal constants, operators, labels, delimiters, comma, =,
=>, :, ::, ;, and %."
I don't think a token can have a space in it, at least not in free form:
"Blank characters shall not appear within lexical tokens other than in a
character context or in a format specification."
> "3.14159E+0" is not immune to
> change in its individual tokens via token replacement. Right?
"3.14159%%E%%+0" is not immune, while "3.14159E+0" is immune (that is, the E
is an E no matter whether there is a macro argument/variable E).
The whole of "3.14159E+0" is a single token.
Eliminating the extra spaces around the %%,
3%%.14159%%8 D%%+0
produces
3.141598 D+0
which in free source form violates the rule:
"C314 (R334) The concatenated textual tokens in a result-token shall have the
form of a lexical token."
so it is not OK.
Aleks
More information about the J3
mailing list