RE: [sv-bc] Macro mantis proposals 1397 & 1478

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Thu Dec 06 2007 - 01:54:19 PST
Regarding 1478, without something like `begin_define...`end_define, I
don't see a way to embed a multi-line macro within another one. However,
we do embed one-line macros within multi-line macros. This requires
defining the behavior in the LRM to say that in such a case, the
backslash belongs to the multi-line macro. This is what you wrote, but
it is necessary to clarify (1) that when you say embedded macro, you
mean an embedded macro definition, as opposed to an embedded macro call,
and (2) since the backslash belongs to the multi-line macro, the
embedded macro definition ends at the end of the line, so that you can
embed a one-line macro, but not a multi-line macro definition. There
should be an example also.
 
Finally, the last sentence, "Any white space characters at the beginning
or end of the macro text shall be removed," should be moved or separated
so show that it is general and not describing only this special case.
 
Thanks,
Shalom


________________________________

	From: owner-sv-bc@server.eda.org
[mailto:owner-sv-bc@server.eda.org] On Behalf Of Alsop, Thomas R
	Sent: Thursday, December 06, 2007 3:47 AM
	To: sv-bc@server.eda.org
	Subject: [sv-bc] Macro mantis proposals 1397 & 1478
	
	

	Hi,

	 

	There are 3 different mantis items that I know of that address
this one paragraph in 21.5.1 `define.  I am working on Mantis items 1397
and 1478 now and just want to give everyone a heads up on the direction
I am taking thus far.

	 

	Draft4 text:

	 

	The macro text can be any arbitrary text specified on the same
line as the text macro name. If more than one line is necessary to
specify the text, the newline shall be preceded by a backslash ( \ ).
The first newline not preceded by a backslash shall end the macro text.
The newline preceded by a backslash shall be replaced in the expanded
macro with a newline (but without the preceding backslash character).

	 

	Mantis 1339 has been approved which adds the last sentence
below:

	 

	The macro text can be any arbitrary text specified on the same
line as the text macro name. If more than one line is necessary to
specify the text, the newline shall be preceded by a backslash ( \ ).
The first newline not preceded by a backslash shall end the macro text.
The newline preceded by a backslash shall be replaced in the expanded
macro with a newline (but without the preceding backslash character).
Any white space characters at the beginning or end of the macro text
shall be removed.

	 

	I am working on a proposal for Mantis issue 1397 - "LRM is
unclear about multi-line string literal in text macro".  Basically I am
taking a very clean approach to resolving this issue by stating that
both newlines and the escaped character are removed from the replaced
macro text.  This means that if anyone were to look at the replaced
text, it's all going to be on the same line.  I think it would be very
rare or unusual that anyone would do this. Shalom says he has done this
on occasion, but I think that proves my point:-):-) This change in the
LRM implies that both a string literal and the macro text continue on
the next line, which makes for a clean easy solution.

	 

	The macro text can be any arbitrary text specified on the same
line as the text macro name. If more than one line is necessary to
specify the text, the newline shall be preceded by a backslash ( \ ).
The first newline not preceded by a backslash shall end the macro text.
The newline preceded by a backslash and the backslash shall both be
removed in the expanded macro. replaced in the expanded macro with a
newline (but without the preceding backslash character).  

	 

	I am also working on a proposal for Mantis issue 1478 - "nested
macro definitions".  Notice that I am adding "multi-line macro" so I can
use it further on in the paragraph.  I don't know if we already have
another name for this.  Also, I am not sure if I have to define
"embedded" or if that is understood. I am also wondering if I should
mention anything about the recursiveness of embedded macros.  I think
this is mentioned somewhere else.

	 

	The macro text can be any arbitrary text specified on the same
line as the text macro name. If more than one line is necessary to
specify the text (i.e. a multi-line macro), the newline shall be
preceded by a backslash ( \ ). The first newline not preceded by a
backslash shall end the macro text. The newline preceded by a backslash
shall be replaced in the expanded macro with a newline (but without the
preceding backslash character). A multi-line macro may have an embedded
macro, however the backslash continues the multi-line macro and not the
embedded macro.  

	 

	If we combine all these Mantis items together we end up with the
following.  Let me know if this is going in the right direction.  

	 

	The macro text can be any arbitrary text specified on the same
line as the text macro name. If more than one line is necessary to
specify the text (i.e. a multi-line macro), the newline shall be
preceded by a backslash ( \ ). The first newline not preceded by a
backslash shall end the macro text. The newline preceded by a backslash
and the backslash shall both be removed in the expanded macro. replaced
in the expanded macro with a newline (but without the preceding
backslash character).  A multi-line macro may have an embedded macro,
however the backslash continues the multi-line macro and not the
embedded macro.  Any white space characters at the beginning or end of
the macro text shall be removed.

	 

	Thanks, -Tom

	 

	 

	 

	 

	 


	-- 
	This message has been scanned for viruses and 
	dangerous content by MailScanner <http://www.mailscanner.info/>
, and is 
	believed to be clean. 

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Dec 6 01:56:08 2007

This archive was generated by hypermail 2.1.8 : Thu Dec 06 2007 - 01:56:43 PST