Continuing lines in the "C" part of an external

3 messages Options
Embed this post
Permalink
Chris Saunders-4

Continuing lines in the "C" part of an external

Reply Threaded More More options
Print post
Permalink
I have previously found the answer to this question in ECMA-367 but I have
been looking again and can't seem to find it.  I've been interfacing to some
"C" code and some of the lines are quite long and I would like to split them
up.  I thought that I used to use % but this is not working.  Could someone
either let me know what I need to use or direct me to the section of
ECMA-367 that I need to re-read?

Regards
Chris Saunders

rfo

RE: Continuing lines in the "C" part of an external

Reply Threaded More More options
Print post
Permalink
Hi Chris!

In an external, you are already using verbatim strings.  They insert
newlines into the generated code whereever they appear in the verbatim
string, so no continuation characters are needed.  As long as the
newline is a benign occurrance in the C sequence, you can add them where
you wish.
If you need to unwrap the actual text going to the C compiler, then you
need to follow the C rules.  The '\' character I think is passed as is
by Eiffel, so that can be used to escape a newline.
The trick is to realize that everything between the start and end
sequence of a verbatim string is taken, well, verbatim.


     R

==================================================
Roger F. Osmond


> -------- Original Message --------
> Subject: [eiffel_software] Continuing lines in the "C" part of an
> external
> From: "Chris Saunders" <[hidden email]>
> Date: Sun, October 25, 2009 4:38 pm
> To: "Eiffel Software Mailing List" <[hidden email]>
> I have previously found the answer to this question in ECMA-367 but I have
> been looking again and can't seem to find it.  I've been interfacing to some
> "C" code and some of the lines are quite long and I would like to split them
> up.  I thought that I used to use % but this is not working.  Could someone
> either let me know what I need to use or direct me to the section of
> ECMA-367 that I need to re-read?
> Regards
> Chris Saunders

Chris Saunders-4

Re: Continuing lines in the "C" part of an external

Reply Threaded More More options
Print post
Permalink
Thanks Roger, now I'm wondering what I thought I was remembering!  Anyway,
what you suggested worked fine.

Regards
Chris Saunders

----- Original Message -----
From: [hidden email]
To: [hidden email]
Sent: Sunday, October 25, 2009 5:04 PM
Subject: RE: [eiffel_software] Continuing lines in the "C" part of an
external


  Hi Chris!

In an external, you are already using verbatim strings. They insert
newlines into the generated code whereever they appear in the verbatim
string, so no continuation characters are needed. As long as the
newline is a benign occurrance in the C sequence, you can add them where
you wish.
If you need to unwrap the actual text going to the C compiler, then you
need to follow the C rules. The '\' character I think is passed as is
by Eiffel, so that can be used to escape a newline.
The trick is to realize that everything between the start and end
sequence of a verbatim string is taken, well, verbatim.

R

==================================================
Roger F. Osmond

> -------- Original Message --------
> Subject: [eiffel_software] Continuing lines in the "C" part of an
> external
> From: "Chris Saunders" <[hidden email]>
> Date: Sun, October 25, 2009 4:38 pm
> To: "Eiffel Software Mailing List" <[hidden email]>
> I have previously found the answer to this question in ECMA-367 but I have
> been looking again and can't seem to find it. I've been interfacing to
> some
> "C" code and some of the lines are quite long and I would like to split
> them
> up. I thought that I used to use % but this is not working. Could someone
> either let me know what I need to use or direct me to the section of
> ECMA-367 that I need to re-read?
> Regards
> Chris Saunders