RE: [sv-bc] Mantis 1338 - Clarificaion on String literal behavior in macros

From: Alsop, Thomas R <thomas.r.alsop_at_.....>
Date: Mon Nov 26 2007 - 12:11:14 PST
Shalom,

 

One issue I have with the mail link you forwarded deals with Rule 3:

 

Rule 3. You can use \" instead of " to get a quotation mark in the text
macro definition, but then Rule 1 does not apply, and then macro
expansion WILL occur if a macro call or a formal argument name is
encountered. (What happens if " is followed by \" or the reverse?)
 

I think you mean `" not \".  Unless you are proposing now that this be
part of the proposal.  You note that there are other open items dealing
with the backslash character.  If so, let's let the other mantis items
resolve them.  If the meaning changes what we are doing with this
proposal, then we can address it.  From what I understand it shouldn't
impact what we have already proposed.

 

Also, I have updated the proposal with a clearer example.  The nosubx
one was too hard to get right with the back tick stuff included. 

 

`define nosubx(x) "x: "

 

initial begin

   $display(`nosubx(left side));

end

 

Results in the follow display message:

 

$display("x: ");

 

 

 

________________________________

From: Bresticker, Shalom 
Sent: Thursday, November 22, 2007 9:28 AM
To: Alsop, Thomas R
Cc: sv-bc@server.eda.org
Subject: RE: [sv-bc] Mantis 1338 - Clarificaion on String literal
behavior in macros

 

No, you would get

 

$display("x: " \"right side\"");

 

Shalom

 

	 

	`define nosubx(x,y) "x: " `\`"y`\`"`"

	 

	Expands to :

	 

	$display("x: \"right side\"");


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Nov 26 12:12:34 2007

This archive was generated by hypermail 2.1.8 : Mon Nov 26 2007 - 12:13:09 PST