mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2026-04-05 17:49:26 +02:00
Author:halw
Date:2010-01-22T18:19:26.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@412 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -61,7 +61,7 @@ The body of the feature is introduced by the <code>do</code> keyword and termina
|
|||||||
* <code>put_string</code> outputs a string, passed as argument, here <code>"Hello World"</code>.
|
* <code>put_string</code> outputs a string, passed as argument, here <code>"Hello World"</code>.
|
||||||
* <code>put_new_line</code> terminates the line.
|
* <code>put_new_line</code> terminates the line.
|
||||||
|
|
||||||
Rather than using a call to <code>put_new_line</code>, the first version of the class simply includes a new-line character, denoted as <code>%N</code> , at the end of the string. Either technique is acceptable.
|
Rather than using a call to <code>put_new_line</code>, the first version of the class simply includes a new-line character, denoted as <code>%N</code> (the percent sign is used to introduce codes for [[Eiffel language syntax#Special characters|special characters]]), at the end of the string. Either technique is acceptable.
|
||||||
|
|
||||||
You may have noticed another difference between the two versions. The first version uses a call to <code>print</code> where the second uses <code>io.put_string</code> . Here too, the effect is identical and either technique is acceptable. In the next section, you will begin to see how things like <code>io</code> and <code>print</code> become available for use in a class like <code>HELLO</code>.
|
You may have noticed another difference between the two versions. The first version uses a call to <code>print</code> where the second uses <code>io.put_string</code> . Here too, the effect is identical and either technique is acceptable. In the next section, you will begin to see how things like <code>io</code> and <code>print</code> become available for use in a class like <code>HELLO</code>.
|
||||||
|
|
||||||
|
|||||||
@@ -40,11 +40,60 @@ No intervening character (blank or otherwise) is permitted between these element
|
|||||||
|
|
||||||
===Strings===
|
===Strings===
|
||||||
|
|
||||||
A string -- specimen of construct String -- is a sequence of zero or more manifest characters, possibly containing [[#Special characters|codes for special characters]].
|
A string -- specimen of construct String -- is a sequence of zero or more manifest characters.
|
||||||
|
|
||||||
===Simple strings===
|
===Simple strings===
|
||||||
|
|
||||||
A simple string -- specimen of Simple_string -- is a [[#Strings|String]] consisting of at most one line (that is to say, containing no embedded new-line manifest character).
|
A simple string -- specimen of Simple_string -- is a [[#Strings|String]] consisting of at most one line (that is to say, containing no embedded new-line manifest character), possibly containing [[#Special characters|codes for special characters]].
|
||||||
|
|
||||||
|
===Special characters===
|
||||||
|
|
||||||
|
{| border="2"
|
||||||
|
|+ Special Characters and Their Codes
|
||||||
|
! Character || Code || Mnemonic name
|
||||||
|
|-
|
||||||
|
| @ || %A || At-sign
|
||||||
|
|-
|
||||||
|
| BS || %B || Backspace
|
||||||
|
|-
|
||||||
|
| ^ || %C || Circumflex
|
||||||
|
|-
|
||||||
|
| $ || %D || Dollar
|
||||||
|
|-
|
||||||
|
| FF || %F || Form feed
|
||||||
|
|-
|
||||||
|
| \ || %H || Backslash
|
||||||
|
|-
|
||||||
|
| ~ || %L || Tilde
|
||||||
|
|-
|
||||||
|
| NL (LF) || %N || Newline
|
||||||
|
|-
|
||||||
|
| ` || %Q || Backquote
|
||||||
|
|-
|
||||||
|
| CR || %R || Carriage return
|
||||||
|
|-
|
||||||
|
| # || %S || Sharp
|
||||||
|
|-
|
||||||
|
| HT || %T || Horizontal tab
|
||||||
|
|-
|
||||||
|
| NUL || %U || Null
|
||||||
|
|-
|
||||||
|
| <nowiki>|</nowiki> || %V || Vertical bar
|
||||||
|
|-
|
||||||
|
| % || %% || Percent
|
||||||
|
|-
|
||||||
|
| ' || %' || Single quote
|
||||||
|
|-
|
||||||
|
| " || %" || Double quote
|
||||||
|
|-
|
||||||
|
| [ || %( || Opening bracket
|
||||||
|
|-
|
||||||
|
| ] || %) || Closing bracket
|
||||||
|
|-
|
||||||
|
| { || %< || Opening brace
|
||||||
|
|-
|
||||||
|
| } || %> || Closing brace
|
||||||
|
|}
|
||||||
|
|
||||||
===Line wrapping parts===
|
===Line wrapping parts===
|
||||||
|
|
||||||
@@ -548,52 +597,5 @@ Digit ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | <br/>
|
|||||||
"a" | "b" | "c" | "d" | "e" | "f" | <br/>
|
"a" | "b" | "c" | "d" | "e" | "f" | <br/>
|
||||||
"A" | "B" | "C" | "D" | "E" | "F" | "_"<br/>
|
"A" | "B" | "C" | "D" | "E" | "F" | "_"<br/>
|
||||||
<br/>
|
<br/>
|
||||||
===Special characters===
|
|
||||||
|
|
||||||
{| border="2"
|
|
||||||
|+ Special Characters and Their Codes
|
|
||||||
! Character || Code || Mnemonic name
|
|
||||||
|-
|
|
||||||
| @ || %A || At-sign
|
|
||||||
|-
|
|
||||||
| BS || %B || Backspace
|
|
||||||
|-
|
|
||||||
| ^ || %C || Circumflex
|
|
||||||
|-
|
|
||||||
| $ || %D || Dollar
|
|
||||||
|-
|
|
||||||
| FF || %F || Form feed
|
|
||||||
|-
|
|
||||||
| \ || %H || Backslash
|
|
||||||
|-
|
|
||||||
| ~ || %L || Tilde
|
|
||||||
|-
|
|
||||||
| NL (LF) || %N || Newline
|
|
||||||
|-
|
|
||||||
| ` || %Q || Backquote
|
|
||||||
|-
|
|
||||||
| CR || %R || Carriage return
|
|
||||||
|-
|
|
||||||
| # || %S || Sharp
|
|
||||||
|-
|
|
||||||
| HT || %T || Horizontal tab
|
|
||||||
|-
|
|
||||||
| NUL || %U || Null
|
|
||||||
|-
|
|
||||||
| <nowiki>|</nowiki> || %V || Vertical bar
|
|
||||||
|-
|
|
||||||
| % || %% || Percent
|
|
||||||
|-
|
|
||||||
| ' || %' || Single quote
|
|
||||||
|-
|
|
||||||
| " || %" || Double quote
|
|
||||||
|-
|
|
||||||
| [ || %( || Opening bracket
|
|
||||||
|-
|
|
||||||
| ] || %) || Closing bracket
|
|
||||||
|-
|
|
||||||
| { || %< || Opening brace
|
|
||||||
|-
|
|
||||||
| } || %> || Closing brace
|
|
||||||
|}
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user