[sv-bc] Re: [sv-ec] comment in compiler macros

From: Gordon Vreugdenhil <gordonv_at_.....>
Date: Thu Jun 25 2009 - 14:51:48 PDT
I believe there is some disagreement about this in various
implementations.  We apply the continuation character (not treating
it as part of the comment) and don't have an error.

There are many questions about macro application in terms of
what role "text" and "tokens" play and in what order various
things apply.  The LRM is quite ambiguous in this area; any
complex macro is highly subject to vendor interpretation at
this point.

Gord.

Daniel Mlynek wrote:
> Question is how should compiler treat comments  in precompiler macros - 
> i've browse LRM and I haven't found any answer. LRM states only :
> 
> If a one-line comment (that is, a comment specified with the characters 
> //) is included in the text, then the comment shall not become part of 
> the substituted text. The macro text can be blank, in which case the 
> text macro is defined to be empty and no text is substituted when the 
> macro is used.
> 
> But what for below case -  "//" comment out the end of line '\" needed 
> to split lines of define - so imho comments finishes the macros and 
> below code should fail
> 
> CODE:
> 
>  
> 
>     `define DAN \
>     // test \
>     // test \
>      $display("ok");
>     `define DAN1 //ref \
>     \
>      $display("ok1"); 
>      
>     module top;
>      initial begin
>       `DAN
>       `DAN1
>      end
>       
>     endmodule
> 
>  
>  
>  
> DANiel
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.

-- 
--------------------------------------------------------------------
Gordon Vreugdenhil                                503-685-0808
Model Technology (Mentor Graphics)                gordonv@model.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Jun 25 14:54:50 2009

This archive was generated by hypermail 2.1.8 : Thu Jun 25 2009 - 14:55:41 PDT