Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #152629 > unrolled thread
| Started by | Avicenna <itsme.susila@gmx.com> |
|---|---|
| First post | 2020-06-03 11:49 +0800 |
| Last post | 2020-06-08 07:34 -0700 |
| Articles | 19 — 11 participants |
Back to article view | Back to comp.lang.c
How to understand official C document- ISO/IEC 9899:201x Avicenna <itsme.susila@gmx.com> - 2020-06-03 11:49 +0800
Re: How to understand official C document- ISO/IEC 9899:201x James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-06-03 01:08 -0400
Re: How to understand official C document- ISO/IEC 9899:201x Avicenna <itsme.susila@gmx.com> - 2020-06-03 15:30 +0800
Re: How to understand official C document- ISO/IEC 9899:201x James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-06-03 04:03 -0400
Re: How to understand official C document- ISO/IEC 9899:201x Avicenna <itsme.susila@gmx.com> - 2020-06-03 18:29 +0800
Re: How to understand official C document- ISO/IEC 9899:201x Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-06-03 03:46 -0700
Re: How to understand official C document- ISO/IEC 9899:201x Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-06-03 12:55 +0100
Re: How to understand official C document- ISO/IEC 9899:201x Bart <bc@freeuk.com> - 2020-06-03 13:55 +0100
Re: How to understand official C document- ISO/IEC 9899:201x Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-06-03 16:09 +0100
Re: How to understand official C document- ISO/IEC 9899:201x James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-06-03 10:19 -0400
Re: How to understand official C document- ISO/IEC 9899:201x Avicenna <itsme.susila@gmx.com> - 2020-06-04 04:24 +0800
Re: How to understand official C document- ISO/IEC 9899:201x Vir Campestris <vir.campestris@invalid.invalid> - 2020-06-04 21:45 +0100
Re: How to understand official C document- ISO/IEC 9899:201x Avicenna <itsme.susila@gmx.com> - 2020-06-05 22:29 +0800
Re: How to understand official C document- ISO/IEC 9899:201x Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-06-20 05:13 -0700
Re: How to understand official C document- ISO/IEC 9899:201x scott@slp53.sl.home (Scott Lurndal) - 2020-06-11 15:39 +0000
Re: How to understand official C document- ISO/IEC 9899:201x Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2020-06-11 16:50 -0600
Re: How to understand official C document- ISO/IEC 9899:201x Bart <bc@freeuk.com> - 2020-06-03 11:42 +0100
Re: How to understand official C document- ISO/IEC 9899:201x fir <profesor.fir@gmail.com> - 2020-06-06 01:57 -0700
Re: How to understand official C document- ISO/IEC 9899:201x John Bode <jfbode1029@gmail.com> - 2020-06-08 07:34 -0700
| From | Avicenna <itsme.susila@gmx.com> |
|---|---|
| Date | 2020-06-03 11:49 +0800 |
| Subject | How to understand official C document- ISO/IEC 9899:201x |
| Message-ID | <rb76l4$11v4$1@gioia.aioe.org> |
How to understand official C document- ISO/IEC 9899:201x Can someone explain what topics in computer science I must read up to understand the syntax in the official C documents; e.g. what dose the following mean: Syntax 1 universal-character-name: \u hex-quad \U hex-quad hex-quad hex-quad: hexadecimal-digit hexadecimal-digit hexadecimal-digit hexadecimal-digit
[toc] | [next] | [standalone]
| From | James Kuyper <jameskuyper@alumni.caltech.edu> |
|---|---|
| Date | 2020-06-03 01:08 -0400 |
| Message-ID | <rb7b8i$ma0$1@dont-email.me> |
| In reply to | #152629 |
On 6/2/20 11:49 PM, Avicenna wrote:
> How to understand official C document- ISO/IEC 9899:201x
>
> Can someone explain what topics in computer science I must read up to
> understand the
> syntax in the official C documents; e.g. what dose the following mean:
>
> Syntax
> 1
> universal-character-name:
> \u hex-quad
> \U hex-quad hex-quad
> hex-quad:
> hexadecimal-digit hexadecimal-digit
> hexadecimal-digit hexadecimal-digit
The notation being used is actually documented within the standard itself:
"In the syntax notation used in this clause, syntactic categories
(nonterminals) are indicated by italic type, and literal words and
character set members (terminals) by bold type. A colon (:) following a
nonterminal introduces its definition. Alternative definitions are
listed on separate lines, except when prefaced by the words ‘‘one of’’.
An optional symbol is indicated by the subscript ‘‘opt’’, so that
{ expression opt }
indicates an optional expression enclosed in braces." (6.1p1)
In the case you're referring to, the first syntactic category is
"universal-character-name". There's two different ways that a universal
character name can be formed, and they are listed one per line. \u and
\U are in bold type, meaning that they are to be interpreted literally.
hex-quad is in italic type, indicating that it is itself a syntactic
category.
The second syntactic category is "hex-quad". There's only one way to
create one, and that consists of four copies of hexadecimal-digit. Since
that's italicized, it's also a syntactic category. You'll find that
category's syntax rule in 6.4.4.1p1.
[toc] | [prev] | [next] | [standalone]
| From | Avicenna <itsme.susila@gmx.com> |
|---|---|
| Date | 2020-06-03 15:30 +0800 |
| Message-ID | <rb7jj0$1r0c$1@gioia.aioe.org> |
| In reply to | #152630 |
On 6/3/20 1:08 PM, James Kuyper wrote:
> On 6/2/20 11:49 PM, Avicenna wrote:
>> How to understand official C document- ISO/IEC 9899:201x
>>
>> Can someone explain what topics in computer science I must read up to
>> understand the
>> syntax in the official C documents; e.g. what dose the following mean:
>>
>> Syntax
>> 1
>> universal-character-name:
>> \u hex-quad
>> \U hex-quad hex-quad
>
>> hex-quad:
>> hexadecimal-digit hexadecimal-digit
>> hexadecimal-digit hexadecimal-digit
>
> The notation being used is actually documented within the standard itself:
>
> "In the syntax notation used in this clause, syntactic categories
> (nonterminals) are indicated by italic type, and literal words and
> character set members (terminals) by bold type. A colon (:) following a
> nonterminal introduces its definition. Alternative definitions are
> listed on separate lines, except when prefaced by the words ‘‘one of’’.
> An optional symbol is indicated by the subscript ‘‘opt’’, so that
>
> { expression opt }
>
> indicates an optional expression enclosed in braces." (6.1p1)
>
> In the case you're referring to, the first syntactic category is
> "universal-character-name". There's two different ways that a universal
> character name can be formed, and they are listed one per line. \u and
> \U are in bold type, meaning that they are to be interpreted literally.
> hex-quad is in italic type, indicating that it is itself a syntactic
> category.
>
> The second syntactic category is "hex-quad". There's only one way to
> create one, and that consists of four copies of hexadecimal-digit. Since
> that's italicized, it's also a syntactic category. You'll find that
> category's syntax rule in 6.4.4.1p1.
>
Thanks,
I'll study it to see what they mean.
[toc] | [prev] | [next] | [standalone]
| From | James Kuyper <jameskuyper@alumni.caltech.edu> |
|---|---|
| Date | 2020-06-03 04:03 -0400 |
| Message-ID | <rb7lgh$f6g$1@dont-email.me> |
| In reply to | #152632 |
On 6/3/20 3:30 AM, Avicenna wrote:
> On 6/3/20 1:08 PM, James Kuyper wrote:
>> On 6/2/20 11:49 PM, Avicenna wrote:
>>> How to understand official C document- ISO/IEC 9899:201x
>>>
>>> Can someone explain what topics in computer science I must read up to
>>> understand the
>>> syntax in the official C documents; e.g. what dose the following mean:
>>>
>>> Syntax
>>> 1
>>> universal-character-name:
>>> \u hex-quad
>>> \U hex-quad hex-quad
>>
>>> hex-quad:
>>> hexadecimal-digit hexadecimal-digit
>>> hexadecimal-digit hexadecimal-digit
>>
>> The notation being used is actually documented within the standard itself:
>>
>> "In the syntax notation used in this clause, syntactic categories
>> (nonterminals) are indicated by italic type, and literal words and
>> character set members (terminals) by bold type. A colon (:) following a
>> nonterminal introduces its definition. Alternative definitions are
>> listed on separate lines, except when prefaced by the words ‘‘one of’’.
>> An optional symbol is indicated by the subscript ‘‘opt’’, so that
>>
>> { expression opt }
>>
>> indicates an optional expression enclosed in braces." (6.1p1)
>>
>> In the case you're referring to, the first syntactic category is
>> "universal-character-name". There's two different ways that a universal
>> character name can be formed, and they are listed one per line. \u and
>> \U are in bold type, meaning that they are to be interpreted literally.
>> hex-quad is in italic type, indicating that it is itself a syntactic
>> category.
>>
>> The second syntactic category is "hex-quad". There's only one way to
>> create one, and that consists of four copies of hexadecimal-digit. Since
>> that's italicized, it's also a syntactic category. You'll find that
>> category's syntax rule in 6.4.4.1p1.
>>
> Thanks,
>
> I'll study it to see what they mean.
Examples might help:
hex-quad: F731
universal-character-name: \ufe54 \U000E8421
[toc] | [prev] | [next] | [standalone]
| From | Avicenna <itsme.susila@gmx.com> |
|---|---|
| Date | 2020-06-03 18:29 +0800 |
| Message-ID | <rb7u1o$13gi$1@gioia.aioe.org> |
| In reply to | #152630 |
On 6/3/20 1:08 PM, James Kuyper wrote: > On 6/2/20 11:49 PM, Avicenna wrote: A.1.3 Identifiers (6.4.2.1) identifier: identifier-nondigit identifier identifier-nondigit identifier digit (6.4.2.1) identifier-nondigit: nondigit universal-character-name other implementation-defined characters (6.4.2.1) nondigit: one of a b c d... (6.4.2.1) digit: one of 0 1 2 3 4 5 6 7 8 9 In the above, I could somehow see identifiers cannot begin with a digit; still a rather vague understanding. Long time ago, I remember reading about some "theory of computer languages", where they discuss about terminals, non-terminals, etc. and some trees and nodes. Is there such a formal course? Any formal name for such? I'll like to look for such a free computer textbook.
[toc] | [prev] | [next] | [standalone]
| From | Malcolm McLean <malcolm.arthur.mclean@gmail.com> |
|---|---|
| Date | 2020-06-03 03:46 -0700 |
| Message-ID | <f34ec763-aeea-4859-b8ff-84b37af23d89@googlegroups.com> |
| In reply to | #152637 |
On Wednesday, 3 June 2020 11:29:21 UTC+1, Avicenna wrote: > On 6/3/20 1:08 PM, James Kuyper wrote: > > On 6/2/20 11:49 PM, Avicenna wrote: > > > > A.1.3 Identifiers > (6.4.2.1) identifier: > identifier-nondigit > identifier identifier-nondigit > identifier digit > > (6.4.2.1) identifier-nondigit: > nondigit > universal-character-name > other implementation-defined characters > (6.4.2.1) nondigit: one of > a b c d... > (6.4.2.1) digit: one of > 0 1 2 3 4 5 6 7 8 9 > > In the above, I could somehow see identifiers cannot begin with a digit; > still a rather vague understanding. > > Long time ago, I remember reading about some "theory of computer > languages", where they discuss about terminals, non-terminals, etc. and > some trees and nodes. Is there such a formal course? Any formal name for > such? I'll like to look for such a free computer textbook. > Look up formal grammars. Using a grammar is rather a long-winded way of saying "an identifier consists of letters, universal character names, implementation-defined characters, and digits, but cannot start with a digit". However it's got the advantage that you can transcibe grammar rules into an automated parser.
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2020-06-03 12:55 +0100 |
| Message-ID | <87k10omki7.fsf@bsb.me.uk> |
| In reply to | #152637 |
Avicenna <itsme.susila@gmx.com> writes: > Long time ago, I remember reading about some "theory of computer > languages", where they discuss about terminals, non-terminals, > etc. and some trees and nodes. Is there such a formal course? Any > formal name for such? I'll like to look for such a free computer > textbook. There are lots of texts available for free, but it's not always obvious which one are good. This one https://www.cs.ucr.edu/~jiang/cs215/tao-new.pdf is sound, and relatively concise. You get a lot of terms explained in a few pages. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Bart <bc@freeuk.com> |
|---|---|
| Date | 2020-06-03 13:55 +0100 |
| Message-ID | <I4NBG.1700964$e1n.1543602@fx36.am4> |
| In reply to | #152641 |
On 03/06/2020 12:55, Ben Bacarisse wrote: > Avicenna <itsme.susila@gmx.com> writes: > >> Long time ago, I remember reading about some "theory of computer >> languages", where they discuss about terminals, non-terminals, >> etc. and some trees and nodes. Is there such a formal course? Any >> formal name for such? I'll like to look for such a free computer >> textbook. > > There are lots of texts available for free, but it's not always obvious > which one are good. This one > > https://www.cs.ucr.edu/~jiang/cs215/tao-new.pdf > > is sound, and relatively concise. You get a lot of terms explained in > a few pages. This is more concise and more accessible: http://marvin.cs.uidaho.edu/Teaching/CS445/grammar.pdf
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2020-06-03 16:09 +0100 |
| Message-ID | <874krsmbj2.fsf@bsb.me.uk> |
| In reply to | #152642 |
Bart <bc@freeuk.com> writes: > On 03/06/2020 12:55, Ben Bacarisse wrote: >> Avicenna <itsme.susila@gmx.com> writes: >> >>> Long time ago, I remember reading about some "theory of computer >>> languages", where they discuss about terminals, non-terminals, >>> etc. and some trees and nodes. Is there such a formal course? Any >>> formal name for such? I'll like to look for such a free computer >>> textbook. >> >> There are lots of texts available for free, but it's not always obvious >> which one are good. This one >> >> https://www.cs.ucr.edu/~jiang/cs215/tao-new.pdf >> >> is sound, and relatively concise. You get a lot of terms explained in >> a few pages. > > This is more concise and more accessible: > > http://marvin.cs.uidaho.edu/Teaching/CS445/grammar.pdf Not my cup of tea. Bad writing and too many inconsistencies for my taste. The OP mentioned "theory of computer languages" so I suggested something rather more theoretical, but you are probably more on the money with yours. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | James Kuyper <jameskuyper@alumni.caltech.edu> |
|---|---|
| Date | 2020-06-03 10:19 -0400 |
| Message-ID | <rb8bhr$i1u$1@dont-email.me> |
| In reply to | #152637 |
On 6/3/20 6:29 AM, Avicenna wrote: > On 6/3/20 1:08 PM, James Kuyper wrote: >> On 6/2/20 11:49 PM, Avicenna wrote: > > > > A.1.3 Identifiers > (6.4.2.1) identifier: > identifier-nondigit > identifier identifier-nondigit > identifier digit > > (6.4.2.1) identifier-nondigit: > nondigit > universal-character-name > other implementation-defined characters > (6.4.2.1) nondigit: one of > a b c d... > (6.4.2.1) digit: one of > 0 1 2 3 4 5 6 7 8 9 > > In the above, I could somehow see identifiers cannot begin with a digit; > still a rather vague understanding. That follows from the following observation about those rules: An identifier-non-digit can be an identifier all by itself. That's what the first definition says. A digit cannot be. Any identifier can be extended to create a new identifier by adding either a digit or an identifier-non-digit to the right hand side. That's what the second and third definitions say. There's no rule that allows you to extend an identifier by adding anything to the left side. Since the only rule that allows you to use an digit in an identifier reuires that it be on the right-hand side of something that already qualifies as an identifier, a digit can never be the first character of an identifier. Does that make your understanding a little less vague?
[toc] | [prev] | [next] | [standalone]
| From | Avicenna <itsme.susila@gmx.com> |
|---|---|
| Date | 2020-06-04 04:24 +0800 |
| Message-ID | <rb90ts$16gd$1@gioia.aioe.org> |
| In reply to | #152644 |
On 6/3/20 10:19 PM, James Kuyper wrote: > On 6/3/20 6:29 AM, Avicenna wrote: >> On 6/3/20 1:08 PM, James Kuyper wrote: >>> On 6/2/20 11:49 PM, Avicenna wrote: >> >> >> >> A.1.3 Identifiers >> (6.4.2.1) identifier: >> identifier-nondigit >> identifier identifier-nondigit >> identifier digit >> >> (6.4.2.1) identifier-nondigit: >> nondigit >> universal-character-name >> other implementation-defined characters >> (6.4.2.1) nondigit: one of >> a b c d... >> (6.4.2.1) digit: one of >> 0 1 2 3 4 5 6 7 8 9 >> >> In the above, I could somehow see identifiers cannot begin with a digit; >> still a rather vague understanding. > > That follows from the following observation about those rules: > An identifier-non-digit can be an identifier all by itself. That's what > the first definition says. A digit cannot be. > Any identifier can be extended to create a new identifier by adding > either a digit or an identifier-non-digit to the right hand side. That's > what the second and third definitions say. There's no rule that allows > you to extend an identifier by adding anything to the left side. > Since the only rule that allows you to use an digit in an identifier > reuires that it be on the right-hand side of something that already > qualifies as an identifier, a digit can never be the first character of > an identifier. > > Does that make your understanding a little less vague? > Yes! It is very clear now. The problem is there is a 'space' in "identifier identifier-nondigit". Probably everyone could just understand it is simple concatenations to form the parts. I think I'll follow along this example to see if I could understand the other parts of C syntax. Thanks.
[toc] | [prev] | [next] | [standalone]
| From | Vir Campestris <vir.campestris@invalid.invalid> |
|---|---|
| Date | 2020-06-04 21:45 +0100 |
| Message-ID | <rbbmhr$aj5$5@dont-email.me> |
| In reply to | #152651 |
On 03/06/2020 21:24, Avicenna wrote: >> > Yes! It is very clear now. The problem is there is a 'space' in > "identifier identifier-nondigit". > Probably everyone could just understand it is simple concatenations to > form the parts. > > I think I'll follow along this example to see if I could understand the > other parts of C syntax. Be aware however that the specifications are written to be precise. They are definitely not written to be comprehensible. The only time I've referred to them much is when working on compilers - which hasn't been often. Andy
[toc] | [prev] | [next] | [standalone]
| From | Avicenna <itsme.susila@gmx.com> |
|---|---|
| Date | 2020-06-05 22:29 +0800 |
| Message-ID | <rbdkru$eu8$1@gioia.aioe.org> |
| In reply to | #152664 |
On 6/5/20 4:45 AM, Vir Campestris wrote: > On 03/06/2020 21:24, Avicenna wrote: >>> >> Yes! It is very clear now. The problem is there is a 'space' in >> "identifier identifier-nondigit". >> Probably everyone could just understand it is simple concatenations to >> form the parts. >> >> I think I'll follow along this example to see if I could understand >> the other parts of C syntax. > > Be aware however that the specifications are written to be precise. > > They are definitely not written to be comprehensible. > > The only time I've referred to them much is when working on compilers - > which hasn't been often. > > Andy Someone mentioned earlier that they codified the syntax formally is because of the ease to produce an automated parser. This was exactly what I was reading years earlier about how to write a C compiler. I do expect that certain parts of the official document would not be easily comprehensible. But it is still a challenge to be able to decipher the "official canon".
[toc] | [prev] | [next] | [standalone]
| From | Tim Rentsch <tr.17687@z991.linuxsc.com> |
|---|---|
| Date | 2020-06-20 05:13 -0700 |
| Message-ID | <86h7v6j5pp.fsf@linuxsc.com> |
| In reply to | #152664 |
Vir Campestris <vir.campestris@invalid.invalid> writes: > On 03/06/2020 21:24, Avicenna wrote: > >> Yes! It is very clear now. The problem is there is a 'space' in >> "identifier identifier-nondigit". >> Probably everyone could just understand it is simple >> concatenations to form the parts. >> >> I think I'll follow along this example to see if I could >> understand the other parts of C syntax. > > Be aware however that the specifications are written to be > precise. Certainly the expectation is that the syntax rules in the ISO Standard accurately describe all possibly legal C programs (including some that may be rejected for non-syntax reasons such as constraint violations, et cetera). > They are definitely not written to be comprehensible. I believe the syntax rules for C were in fact written so that they would be comprehensible, including the earlier formulation in "The C Programming Language" by Kernighan and Ritchie. Furthermore the authors have in my view done a pretty good job of doing that. I find the grammar given in the ISO C standard to be decidedly easier to understand than the grammars of lots of other languages I've looked at.
[toc] | [prev] | [next] | [standalone]
| From | scott@slp53.sl.home (Scott Lurndal) |
|---|---|
| Date | 2020-06-11 15:39 +0000 |
| Message-ID | <2fsEG.20898$pC.11560@fx19.iad> |
| In reply to | #152637 |
ram@zedat.fu-berlin.de (Stefan Ram) writes: >Avicenna <itsme.susila@gmx.com> writes: >>Long time ago, I remember reading about some "theory of computer >>languages", where they discuss about terminals, non-terminals, etc. and >>some trees and nodes. Is there such a formal course? Any formal name for >>such? I'll like to look for such a free computer textbook. > > Simple and short railroad diagrams lessons for absolute beginners, > classroom tested: I think the OP would be better of starting with the Dragon book (aho & ullman).
[toc] | [prev] | [next] | [standalone]
| From | Joe Pfeiffer <pfeiffer@cs.nmsu.edu> |
|---|---|
| Date | 2020-06-11 16:50 -0600 |
| Message-ID | <1bmu59w721.fsf@pfeifferfamily.net> |
| In reply to | #152637 |
Avicenna <itsme.susila@gmx.com> writes: > On 6/3/20 1:08 PM, James Kuyper wrote: >> On 6/2/20 11:49 PM, Avicenna wrote: > > > > A.1.3 Identifiers > (6.4.2.1) identifier: > identifier-nondigit > identifier identifier-nondigit > identifier digit > > (6.4.2.1) identifier-nondigit: > nondigit > universal-character-name > other implementation-defined characters > (6.4.2.1) nondigit: one of > a b c d... > (6.4.2.1) digit: one of > 0 1 2 3 4 5 6 7 8 9 > > In the above, I could somehow see identifiers cannot begin with a > digit; still a rather vague understanding. > > Long time ago, I remember reading about some "theory of computer > languages", where they discuss about terminals, non-terminals, > etc. and > some trees and nodes. Is there such a formal course? Any formal name > for such? I'll like to look for such a free computer textbook. Yes, formal language theory is a standard course in computer science departments. It covers the study of sets of strings defined by grammars (and other, equivalent, mechanisms), and is *hugely* important in understanding compilers in particular, and language processors in general. What's a good text depends on what you're hoping to get out of it -- if you're interested in a practical introduction that ties the theory quite directly to the practical problem of writing a compiler, you could do much worse than Louden's "Compiler Construction, Theory and Practice" (which I used as my text when I taught an undergrad compiler construction a few times). I found a copy on line, though I'm not sure how legal the copy is, at https://csunplugged.files.wordpress.com/2012/12/compiler-construction-principles-and-practice-k-c-louden-pws-1997-cmp-2002-592s.pdf You can, of course, also buy it at https://www.amazon.com/Compiler-Construction-Principles-Kenneth-Louden/dp/0534939724 I don't have a strong recommendation on a more purely theoretical book.
[toc] | [prev] | [next] | [standalone]
| From | Bart <bc@freeuk.com> |
|---|---|
| Date | 2020-06-03 11:42 +0100 |
| Message-ID | <Q8LBG.495531$y34.328362@fx45.am4> |
| In reply to | #152629 |
On 03/06/2020 04:49, Avicenna wrote:
> How to understand official C document- ISO/IEC 9899:201x
>
> Can someone explain what topics in computer science I must read up to
> understand the
> syntax in the official C documents;
A lot of people here don't understand it either.
e.g. what dose the following mean:
>
> Syntax
> 1
> universal-character-name:
> \u hex-quad
> \U hex-quad hex-quad
> hex-quad:
> hexadecimal-digit hexadecimal-digit
> hexadecimal-digit hexadecimal-digit
Syntax or grammar is actually easier than it looks. It's written in that
peculiar way to make it formal.
Tabs have been lost from your example which I've put pack in. I assume
the last two lines are supposed to be on one line but they wouldn't fit.
A hex digit is 0-9 A-F. A 'hex-quad' is simply four such digits, such as:
97AB
A universal character name is then \u followed by 4 digits, or \U
followed by two hex-quads, or 8 digits:
\u1234
\u1234ABCD
[toc] | [prev] | [next] | [standalone]
| From | fir <profesor.fir@gmail.com> |
|---|---|
| Date | 2020-06-06 01:57 -0700 |
| Message-ID | <5b8d50c7-f239-4192-8109-b1a79c55ab84o@googlegroups.com> |
| In reply to | #152629 |
W dniu środa, 3 czerwca 2020 05:50:03 UTC+2 użytkownik Avicenna napisał: > How to understand official C document- ISO/IEC 9899:201x > > Can someone explain what topics in computer science I must read up to > understand the > syntax in the official C documents; e.g. what dose the following mean: > > Syntax > 1 > universal-character-name: > \u hex-quad > \U hex-quad hex-quad > hex-quad: > hexadecimal-digit hexadecimal-digit > hexadecimal-digit hexadecimal-digit being older i learned when doing coding you should do 'meat' of it, not the side things (i remember when being young there was always long 'wings' of side things and meat was belong that, side wings seemd like easier than meat - now the thing changed and side things almosd dissapeard from my eye, and its good) (i wondered for a while what is the meat of the meat and if i shouldnt do that, but i dont see that thing.. maybe if i would do programming business i would learn whet is most financially meat, but i dont do that, so i dont got even slight idea) whats the poit of this story? understanding that documentation is very side thing (this group worth note dwells in side things often, hovever also riding on more substantial ones from time to time, too)
[toc] | [prev] | [next] | [standalone]
| From | John Bode <jfbode1029@gmail.com> |
|---|---|
| Date | 2020-06-08 07:34 -0700 |
| Message-ID | <0a38a9fa-401e-4e9e-9a24-620eea1ce1d0o@googlegroups.com> |
| In reply to | #152629 |
On Tuesday, June 2, 2020 at 10:50:03 PM UTC-5, Avicenna wrote:
> How to understand official C document- ISO/IEC 9899:201x
>
> Can someone explain what topics in computer science I must read up to
> understand the
> syntax in the official C documents;
You'll want to read up on context-free grammars, which means learning at least
a little bit about formal languages and how parsing works to understand *why*
we use CFGs.
> e.g. what dose the following mean:
>
> Syntax
> 1
> universal-character-name:
> \u hex-quad
> \U hex-quad hex-quad
> hex-quad:
> hexadecimal-digit hexadecimal-digit
> hexadecimal-digit hexadecimal-digit
It means that a universal character name can take one of the following two
forms:
\uhhhh
\Uhhhhhhhh
where "h" represents any hexadecimal digit (0-9,a-f,A-F). If, while parsing
the code, the compiler sees the token "\u", it will *expect* to see exactly
four hexadecimal digits following it. If it sees "\U", it will expect to see
exactly 8 hexadecimal digits following it.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.c
csiph-web