crefman.doc 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. .EQ
  2. delim $$
  3. .EN
  4. .RP
  5. .TL
  6. ACK/CEM Compiler
  7. .br
  8. Reference Manual
  9. .AU
  10. Erik H. Baalbergen
  11. .AI
  12. Department of Mathematics and Computer Science
  13. Vrije Universiteit
  14. Amsterdam
  15. The Netherlands
  16. .AB no
  17. .AE
  18. .NH
  19. C Language
  20. .PP
  21. This section discusses the extensions to and deviations from the C language,
  22. as described in [1].
  23. The issues are numbered according to the reference manual.
  24. .SH
  25. 2.2 Identifiers
  26. .PP
  27. Upper and lower case letters are different.
  28. The number of significant letters
  29. is 32 by default, but may be set to another value using the \fB\-M\fP option.
  30. The identifier length should be set according to the rest of the compilation
  31. programs.
  32. .SH
  33. 2.3 Keywords
  34. .SH
  35. \f5asm\fP
  36. .PP
  37. The keyword \f5asm\fP
  38. is recognized.
  39. However, the statement
  40. .DS
  41. .ft 5
  42. asm(string);
  43. .ft R
  44. .DE
  45. is skipped, while a warning is given.
  46. .SH
  47. \f5enum\fP
  48. .PP
  49. The \f5enum\fP keyword is recognized and interpreted.
  50. .SH
  51. \f5entry\fP, \f5fortran\fP
  52. .PP
  53. The words \f5entry\fP and \f5fortran\fP
  54. are reserved under the restricted option.
  55. The words are not interpreted by the compiler.
  56. .SH
  57. 2.4.1 Integer Constants
  58. .PP
  59. An octal or hex constant which is less than or equal to the largest unsigned
  60. (target) machine integer is taken to be \f5unsigned\fP.
  61. An octal or hex constant which exceeds the largest unsigned (target) machine
  62. integer is taken to be \f5long\fP.
  63. .SH
  64. 2.4.3 Character Constants
  65. .PP
  66. A character constant is a sequence of 1 up to \f5sizeof(int)\fP characters
  67. enclosed in single quotes.
  68. The value of a character constant '$c sub 1 c sub 2 ... c sub n$'
  69. is $d sub n + M \(mu d sub {n - 1} + ... + M sup {n - 1} \(mu d sub 2 + M sup n \(mu d sub 1$,
  70. where M is 1 + maximum unsigned number representable in an \f5unsigned char\fP,
  71. and $d sub i$ is the signed value (ASCII)
  72. of character $c sub i$.
  73. .SH
  74. 2.4.4 Floating Constants
  75. .PP
  76. The compiler does not support compile-time floating point arithmetic.
  77. .SH
  78. 2.6 Hardware characteristics
  79. .PP
  80. The compiler is capable of producing EM code for machines with the following
  81. properties
  82. .IP \(bu
  83. a \f5char\fP is 8 bits
  84. .IP \(bu
  85. the size of \f5int\fP is equal to the word size
  86. .IP \(bu
  87. the size of \f5short\fP may not exceed the size of \f5int\fP
  88. .IP \(bu
  89. the size of \f5int\fP may not exceed the size of \f5long\fP
  90. .IP \(bu
  91. the size of pointers is equal to the size of either \f5short\fP, \f5int\fP
  92. or \f5long\fP
  93. .LP
  94. .SH
  95. 4 What's in a name?
  96. .SH
  97. \f5char\fP
  98. .PP
  99. Objects of type \f5char\fP are taken to be signed.
  100. The combination \f5unsigned char\fP is legal.
  101. .SH
  102. \f5unsigned\fP
  103. .PP
  104. The type combinations \f5unsigned char\fP, \f5unsigned short\fP and
  105. \f5unsigned long\fP are supported.
  106. .SH
  107. \f5enum\fP
  108. .PP
  109. The data type \f5enum\fP is implemented as described
  110. in \fIRecent Changes to C\fP (see appendix A).
  111. .I Cem
  112. treats enumeration variables as if they were \f5int\fP.
  113. .SH
  114. \f5void\fP
  115. .PP
  116. Type \f5void\fP is implemented.
  117. The type specifies an empty set of values, which takes no storage space.
  118. .SH
  119. \fRFundamental types\fP
  120. .PP
  121. The names of the fundamental types can be redefined by the user, using
  122. \f5typedef\fP.
  123. .SH
  124. 7 Expressions
  125. .PP
  126. The order of evaluation of expressions depends on the complexity of the
  127. subexpressions.
  128. In case of commutative operations, the most complex subexpression is
  129. evaluated first.
  130. Parameter lists are evaluated from right to left.
  131. .SH
  132. 7.2 Unary operators
  133. .PP
  134. The type of a \f5sizeof\fP expression is \f5unsigned int\fP.
  135. .SH
  136. 7.13 Conditional operator
  137. .PP
  138. Both the second and the third expression in a conditional expression may
  139. include assignment operators.
  140. They may be structs or unions.
  141. .SH
  142. 7.14 Assignment operators
  143. .PP
  144. Structures may be assigned, passed as arguments to functions, and returned
  145. by functions.
  146. The types of operands taking part must be the same.
  147. .SH
  148. 8.2 Type specifiers
  149. .PP
  150. The combinations \f5unsigned char\fP, \f5unsigned short\fP
  151. and \f5unsigned long\fP are implemented.
  152. .SH
  153. 8.5 Structure and union declarations
  154. .PP
  155. Fields of any integral type, either signed or unsigned,
  156. are supported, as long as the type fits in a word on the target machine.
  157. .PP
  158. Fields are left adjusted by default; the first field is put into the left
  159. part of a word, the next one on the right side of the first one, etc.
  160. The \f5-Vr\fP option in the call of the compiler
  161. causes fields to be right adjusted within a machine word.
  162. .PP
  163. The tags of structs and unions occupy a different name space from that of
  164. variables and that of member names.
  165. .SH
  166. 9.7 Switch statement
  167. .PP
  168. The type of \fIexpression\fP in
  169. .DS
  170. .ft 5
  171. \f5switch (\fP\fIexpression\fP\f5)\fP \fIstatement\fP
  172. .ft
  173. .DE
  174. must be integral.
  175. A warning is given under the restricted option if the type is \f5long\fP.
  176. .SH
  177. 10 External definitions
  178. .PP
  179. See [4] for a discussion on this complicated issue.
  180. .SH
  181. 10.1 External function definitions
  182. .PP
  183. Structures may be passed as arguments to functions, and returned
  184. by functions.
  185. .SH
  186. 11.1 Lexical scope
  187. .PP
  188. Typedef names may be redeclared like any other variable name; the ice mentioned
  189. in \(sc11.1 is walked correctly.
  190. .SH
  191. 12 Compiler control lines
  192. .PP
  193. Lines which do not occur within comment, and with \f5#\fP as first
  194. character, are interpreted as compiler control line.
  195. There may be an arbitrary number of spaces, tabs and comments (collectively
  196. referred as \fIwhite space\fP) following the \f5#\fP.
  197. Comments may contain newline characters.
  198. Control lines with only white space between the \f5#\fP and the line separator
  199. are skipped.
  200. .PP
  201. The #\f5include\fP, #\f5ifdef\fP, #\f5ifndef\fP, #\f5undef\fP, #\f5else\fP and
  202. #\f5endif\fP control lines and line directives consist of a fixed number of
  203. arguments.
  204. The list of arguments may be followed an arbitrary sequence of characters,
  205. in which comment is interpreted as such.
  206. (I.e., the text between \f5/*\fP and \f5*/\fP is skipped, regardless of
  207. newlines; note that commented-out lines beginning with \f5#\fP are not
  208. considered to be control lines.)
  209. .SH
  210. 12.1 Token replacement
  211. .PP
  212. The replacement text of macros is taken to be a string of characters, in which
  213. an identifier may stand for a formal parameter, and in which comment is
  214. interpreted as such.
  215. Comments and newline characters, preceeded by a backslash, in the replacement
  216. text are replaced by a space character.
  217. .PP
  218. The actual parameters of a macro are considered tokens and are
  219. balanced with regard to \f5()\fP, \f5{}\fP and \f5[]\fP.
  220. This prevents the use of macros like
  221. .DS
  222. .ft 5
  223. CTL([)
  224. .ft
  225. .DE
  226. .PP
  227. Formal parameters of a macro must have unique names within the formal-parameter
  228. list of that macro.
  229. .PP
  230. A message is given at the definition of a macro if the macro has
  231. already been #\f5defined\fP, while the number of formal parameters differ or
  232. the replacement texts are not equal (apart from leading and trailing
  233. white space).
  234. .PP
  235. Recursive use of macros is detected by the compiler.
  236. .PP
  237. Standard #\f5defined\fP macros are
  238. .DS
  239. \f5__FILE__\fP name of current input file as string constant
  240. \f5__DATE__\fP curent date as string constant; e.g. \f5"Tue Wed 2 14:45:23 1986"\fP
  241. \f5__LINE__\fP current line number as an integer
  242. .DE
  243. .PP
  244. No message is given if \fIidentifier\fP is not known in
  245. .DS
  246. .ft 5
  247. #undef \fIidentifier\fP
  248. .ft
  249. .DE
  250. .SH
  251. 12.2 File inclusion
  252. .PP
  253. A newline character is appended to each file which is included.
  254. .SH
  255. 12.3 Conditional compilation
  256. .PP
  257. The #\f5if\fP, #\f5ifdef\fP and #\f5ifndef\fP control lines may be followed
  258. by an arbitrary number of
  259. .DS
  260. .ft 5
  261. #elif \fIconstant-expression\fP
  262. .ft
  263. .DE
  264. control lines, before the corresponding #\f5else\fP or #\f5endif\fP
  265. is encountered.
  266. The construct
  267. .DS
  268. .ft 5
  269. #elif \fIconstant-expression\fP
  270. some text
  271. #endif /* corresponding to #elif */
  272. .ft
  273. .DE
  274. is equivalent to
  275. .DS
  276. .ft 5
  277. #else
  278. #if \fIconstant-expression\fP
  279. some text
  280. #endif /* corresponding to #if */
  281. #endif /* corresponding to #else */
  282. .ft
  283. .DE
  284. .PP
  285. The \fIconstant-expression\fP in #\f5if\fP and #\f5elif\fP control lines
  286. may contain the construction
  287. .DS
  288. .ft 5
  289. defined(\fIidentifier\fP)
  290. .ft
  291. .DE
  292. which is replaced by \f51\fP, if \fIidentifier\fP has been #\f5defined\fP,
  293. and by \f50\fP, if not.
  294. .PP
  295. Comments in skipped lines are interpreted as such.
  296. .SH
  297. 12.4 Line control
  298. .PP
  299. Line directives may occur in the following forms:
  300. .DS
  301. .ft 5
  302. #line \fIconstant\fP
  303. #line \fIconstant\fP "\fIfilename\fP"
  304. #\fIconstant\fP
  305. #\fIconstant\fP "\fIfilename\fP"
  306. .ft
  307. .DE
  308. Note that \fIfilename\fP is enclosed in double quotes.
  309. .SH
  310. 14.2 Functions
  311. .PP
  312. If a pointer to a function is called, the function the pointer points to
  313. is called instead.
  314. .SH
  315. 15 Constant expressions
  316. .PP
  317. The compiler distinguishes the following types of integral constant expressions
  318. .IP \(bu
  319. field-width specifier
  320. .IP \(bu
  321. case-entry specifier
  322. .IP \(bu
  323. array-size specifier
  324. .IP \(bu
  325. global variable initialization value
  326. .IP \(bu
  327. enum-value specifier
  328. .IP \(bu
  329. truth value in \f5#if\fP control line
  330. .LP
  331. .PP
  332. Constant integral expressions are compile-time evaluated while an effort
  333. is made to report overflow.
  334. Constant floating expressions are not compile-time evaluated.
  335. .NH
  336. Compiler flags
  337. .IP \fB\-C\fR
  338. Run the preprocessor stand-alone while maintaining the comments.
  339. Line directives are produced whenever needed.
  340. .IP \fB\-D\fP\fIname\fP=\fIstring-of-characters\fP
  341. .br
  342. Define \fIname\fR as macro with \fIstring-of-characters\fR as
  343. replacement text.
  344. .IP \fB\-D\fP\fIname\fP
  345. .br
  346. Equal to \fB\-D\fP\fIname\fP\fB=1\fP.
  347. .IP \fB\-E\fP
  348. Run the preprocessor stand alone, i.e.,
  349. list the sequence of input tokens and delete any comments.
  350. Line directives are produced whenever needed.
  351. .IP \fB\-I\fIpath\fR
  352. .br
  353. Prepend \fIpath\fR to the list of include directories.
  354. To put the directories "include", "sys/h" and "util/h" into the
  355. include directory list in that order, the user has to specify
  356. .DS
  357. .ft 5
  358. -Iinclude -Isys/h -Iutil/h
  359. .ft R
  360. .DE
  361. An empty \fIpath\fP causes the standard include
  362. directory (usually \f5/usr/include\fP) to be forgotten.
  363. .IP \fB\-M\fP\fIn\fP
  364. .br
  365. Set maximum significant identifier length to \fIn\fP.
  366. .IP \fB\-n\fP
  367. Suppress EM register messages.
  368. The user-declared variables are not stored into registers on the target
  369. machine.
  370. .IP \fB\-p\fP
  371. Generate the EM \fBfil\fP and \fBlin\fP instructions in order to enable
  372. an interpreter to keep track of the current location in the source code.
  373. .IP \fB\-P\fP
  374. Equivalent with \fB\-E\fP, but without line directives.
  375. .IP \fB\-R\fP
  376. Interpret the input as restricted C (according to the language as
  377. described in [1]).
  378. .IP \fB\-T\fP\fIpath\fP
  379. .br
  380. Create temporary files, if necessary, in directory \fIpath\fP.
  381. .IP \fB\-U\fP\fIname\fP
  382. .br
  383. Get rid of the compiler-predefined macro \fIname\fP, i.e.,
  384. consider
  385. .DS
  386. .ft 5
  387. #undef \fIname\fP
  388. .ft R
  389. .DE
  390. to appear in the beginning of the file.
  391. .IP \fB\-V\fIcm\fR.\fIn\fR,\ \fB\-V\fIcm\fR.\fIncm\fR.\fIn\fR\ ...
  392. .br
  393. Set the size and alignment requirements.
  394. The letter \fIc\fR indicates the simple type, which is one of
  395. \fBs\fR(short), \fBi\fR(int), \fBl\fR(long), \fBf\fR(float), \fBd\fR(double)
  396. or \fBp\fR(pointer).
  397. If \fIc\fR is \fBS\fP or \fBU\fP, then \fIn\fP is taken to be the initial
  398. alignment of structs or unions, respectively.
  399. The effective alignment of a struct or union is the least common multiple
  400. of the initial struct/union alignment and the alignments of its members.
  401. The \fIm\fR parameter can be used to specify the length of the type (in bytes)
  402. and the \fIn\fR parameter for the alignment of that type.
  403. Absence of \fIm\fR or \fIn\fR causes the default value to be retained.
  404. To specify that the bitfields should be right adjusted instead of the
  405. default left adjustment, specify \fBr\fR as \fIc\fR parameter.
  406. .IP \fB\-w\fR
  407. Suppress warning messages
  408. .IP \fB\-\-\fIcharacter\fR
  409. .br
  410. Set debug-flag \fIcharacter\fP.
  411. This enables some special features offered by a debug and develop version of
  412. the compiler.
  413. Some particular flags may be recognized, others may have surprising effects.
  414. .RS
  415. .IP \fBd\fP
  416. Generate a dependency graph, reflecting the calling structure of functions.
  417. Lines of the form
  418. .DS
  419. .ft 5
  420. DFA: \fIcalling-function\fP: \fIcalled-function\fP
  421. .ft
  422. .DE
  423. are generated whenever a function call is encountered.
  424. .IP \fBf\fP
  425. Dump whole identifier table, including macros and reserved words.
  426. .IP \fBh\fP
  427. Supply hash-table statistics.
  428. .IP \fBi\fP
  429. Print names of included files.
  430. .IP \fBm\fP
  431. Supply statistics concerning the memory allocation.
  432. .IP \fBt\fP
  433. Dump table of identifiers.
  434. .IP \fBu\fP
  435. Generate extra statistics concerning the predefined types and identifiers.
  436. Works in combination with \fBf\fP or \fBt\fP.
  437. .IP \fBx\fP
  438. Print expression trees in human-readable format.
  439. .RE
  440. .LP
  441. .SH
  442. References
  443. .IP [1]
  444. Brian W. Kernighan, Dennis M. Ritchie,
  445. .I
  446. The C Programming Language
  447. .R
  448. .IP [2]
  449. L. Rosler,
  450. .I
  451. Draft Proposed Standard - Programming Language C,
  452. .R
  453. ANSI X3J11 Language Subcommittee
  454. .IP [3]
  455. Erik H. Baalbergen, Dick Grune, Maarten Waage,
  456. .I
  457. The CEM Compiler,
  458. .R
  459. Informatica Manual IM-4, Dept. of Mathematics and Computer Science, Vrije
  460. Universiteit, Amsterdam, The Netherlands
  461. .IP [4]
  462. Erik H. Baalbergen,
  463. .I
  464. Modeling global declarations in C,
  465. .R
  466. internal paper
  467. .LP
  468. .bp
  469. .SH
  470. Appendix A - Enumeration Type
  471. .PP
  472. The syntax is
  473. .sp
  474. .RS
  475. .I enum-specifier :
  476. .RS
  477. \&\f5enum\fP { \fIenum-list\fP }
  478. .br
  479. \&\f5enum\fP \fIidentifier\fP { \fIenum-list\fP }
  480. .br
  481. \&\f5enum\fP \fIidentifier\fP
  482. .RE
  483. .sp
  484. \&\fIenum-list\fP :
  485. .RS
  486. \&\fIenumerator\fP
  487. .br
  488. \&\fIenum-list\fP , \fIenumerator\fP
  489. .RE
  490. .sp
  491. \&\fIenumerator\fP :
  492. .RS
  493. \&\fIidentifier\fP
  494. .br
  495. \&\fIidentifier\fP = \fIconstant-expression\fP
  496. .RE
  497. .sp
  498. .RE
  499. The identifier has the same role as the structure tag in a struct specification.
  500. It names a particular enumeration type.
  501. .PP
  502. The identifiers in the enum-list are declared as constants, and may appear
  503. whenever constants are required.
  504. If no enumerators with
  505. .B =
  506. appear, then the values of the constants begin at 0 and increase by 1 as the
  507. declaration is read from left to right.
  508. An enumerator with
  509. .B =
  510. gives the associated identifier the value indicated; subsequent identifiers
  511. continue the progression from the assigned value.
  512. .PP
  513. Enumeration tags and constants must all be distinct, and, unlike structure
  514. tags and members, are drawn from the same set as ordinary identifiers.
  515. .PP
  516. Objects of a given enumeration type are regarded as having a type distinct
  517. from objects of all other types.
  518. .bp
  519. .SH
  520. Appendix B: C grammar in LL(1) form
  521. .PP
  522. The \fBbold-faced\fP and \fIitalicized\fP tokens represent terminal symbols.
  523. .vs 16
  524. .nf
  525. \fBexternal definitions\fP
  526. program: external-definition*
  527. external-definition: ext-decl-specifiers [declarator [function | non-function] | '\fB;\fP'] | asm-statement
  528. ext-decl-specifiers: decl-specifiers?
  529. non-function: initializer? ['\fB,\fP' init-declarator]* '\fB;\fP'
  530. function: declaration* compound-statement
  531. .sp 1
  532. \fBdeclarations\fP
  533. declaration: decl-specifiers init-declarator-list? '\fB;\fP'
  534. decl-specifiers: other-specifier+ [single-type-specifier other-specifier*]? | single-type-specifier other-specifier*
  535. other-specifier: \fBauto\fP | \fBstatic\fP | \fBextern\fP | \fBtypedef\fP | \fBregister\fP | \fBshort\fP | \fBlong\fP | \fBunsigned\fP
  536. type-specifier: decl-specifiers
  537. single-type-specifier: \fItype-identifier\fP | struct-or-union-specifier | enum-specifier
  538. init-declarator-list: init-declarator ['\fB,\fP' init-declarator]*
  539. init-declarator: declarator initializer?
  540. declarator: primary-declarator ['\fB(\fP' formal-list ? '\fB)\fP' | arrayer]* | '\fB*\fP' declarator
  541. primary-declarator: identifier | '\fB(\fP' declarator '\fB)\fP'
  542. arrayer: '\fB[\fP' constant-expression? '\fB]\fP'
  543. formal-list: formal ['\fB,\fP' formal]*
  544. formal: identifier
  545. enum-specifier: \fBenum\fP [enumerator-pack | identifier enumerator-pack?]
  546. enumerator-pack: '\fB{\fP' enumerator ['\fB,\fP' enumerator]* '\fB,\fP'? '\fB}\fP'
  547. enumerator: identifier ['\fB=\fP' constant-expression]?
  548. struct-or-union-specifier: [ \fBstruct\fP | \fBunion\fP] [ struct-declaration-pack | identifier struct-declaration-pack?]
  549. struct-declaration-pack: '\fB{\fP' struct-declaration+ '\fB}\fP'
  550. struct-declaration: type-specifier struct-declarator-list '\fB;\fP'?
  551. struct-declarator-list: struct-declarator ['\fB,\fP' struct-declarator]*
  552. struct-declarator: declarator bit-expression? | bit-expression
  553. bit-expression: '\fB:\fP' constant-expression
  554. initializer: '\fB=\fP'? initial-value
  555. cast: '\fB(\fP' type-specifier abstract-declarator '\fB)\fP'
  556. abstract-declarator: primary-abstract-declarator ['\fB(\fP' '\fB)\fP' | arrayer]* | '\fB*\fP' abstract-declarator
  557. primary-abstract-declarator: ['\fB(\fP' abstract-declarator '\fB)\fP']?
  558. .sp 1
  559. \fBstatements\fP
  560. statement:
  561. expression-statement
  562. | label '\fB:\fP' statement
  563. | compound-statement
  564. | if-statement
  565. | while-statement
  566. | do-statement
  567. | for-statement
  568. | switch-statement
  569. | case-statement
  570. | default-statement
  571. | break-statement
  572. | continue-statement
  573. | return-statement
  574. | jump
  575. | '\fB;\fP'
  576. | asm-statement
  577. ;
  578. expression-statement: expression '\fB;\fP'
  579. label: identifier
  580. if-statement: \fBif\fP '\fB(\fP' expression '\fB)\fP' statement [\fBelse\fP statement]?
  581. while-statement: \fBwhile\fP '\fB(\fP' expression '\fB)\fP' statement
  582. do-statement: \fBdo\fP statement \fBwhile\fP '\fB(\fP' expression '\fB)\fP' '\fB;\fP'
  583. for-statement: \fBfor\fP '\fB(\fP' expression? '\fB;\fP' expression? '\fB;\fP' expression? '\fB)\fP' statement
  584. switch-statement: \fBswitch\fP '\fB(\fP' expression '\fB)\fP' statement
  585. case-statement: \fBcase\fP constant-expression '\fB:\fP' statement
  586. default-statement: \fBdefault\fP '\fB:\fP' statement
  587. break-statement: \fBbreak\fP '\fB;\fP'
  588. continue-statement: \fBcontinue\fP '\fB;\fP'
  589. return-statement: \fBreturn\fP expression? '\fB;\fP'
  590. jump: \fBgoto\fP identifier '\fB;\fP'
  591. compound-statement: '\fB{\fP' declaration* statement* '\fB}\fP'
  592. asm-statement: \fBasm\fP '\fB(\fP' \fIstring\fP '\fB)\fP' '\fB;\fP'
  593. .sp 1
  594. \fBexpressions\fP
  595. initial-value: assignment-expression | initial-value-pack
  596. initial-value-pack: '\fB{\fP' initial-value-list '\fB}\fP'
  597. initial-value-list: initial-value ['\fB,\fP' initial-value]* '\fB,\fP'?
  598. primary: \fIidentifier\fP | constant | \fIstring\fP | '\fB(\fP' expression '\fB)\fP'
  599. secundary: primary [index-pack | parameter-pack | selection]*
  600. index-pack: '\fB[\fP' expression '\fB]\fP'
  601. parameter-pack: '\fB(\fP' parameter-list? '\fB)\fP'
  602. selection: ['\fB.\fP' | '\fB\->\fP'] identifier
  603. parameter-list: assignment-expression ['\fB,\fP' assignment-expression]*
  604. postfixed: secundary postop?
  605. unary: cast unary | postfixed | unop unary | size-of
  606. size-of: \fBsizeof\fP [cast | unary]
  607. binary-expression: unary [binop binary-expression]*
  608. conditional-expression: binary-expression ['\fB?\fP' expression '\fB:\fP' assignment-expression]?
  609. assignment-expression: conditional-expression [asgnop assignment-expression]?
  610. expression: assignment-expression ['\fB,\fP' assignment-expression]*
  611. unop: '\fB*\fP' | '\fB&\fP' | '\fB\-\fP' | '\fB!\fP' | '\fB~ \fP' | '\fB++\fP' | '\fB\-\-\fP'
  612. postop: '\fB++\fP' | '\fB\-\-\fP'
  613. multop: '\fB*\fP' | '\fB/\fP' | '\fB%\fP'
  614. addop: '\fB+\fP' | '\fB\-\fP'
  615. shiftop: '\fB<<\fP' | '\fB>>\fP'
  616. relop: '\fB<\fP' | '\fB>\fP' | '\fB<=\fP' | '\fB>=\fP'
  617. eqop: '\fB==\fP' | '\fB!=\fP'
  618. arithop: multop | addop | shiftop | '\fB&\fP' | '\fB^ \fP' | '\fB|\fP'
  619. binop: arithop | relop | eqop | '\fB&&\fP' | '\fB||\fP'
  620. asgnop: '\fB=\fP' | '\fB+\fP' '\fB=\fP' | '\fB\-\fP' '\fB=\fP' | '\fB*\fP' '\fB=\fP' | '\fB/\fP' '\fB=\fP' | '\fB%\fP' '\fB=\fP'
  621. | '\fB<<\fP' '\fB=\fP' | '\fB>>\fP' '\fB=\fP' | '\fB&\fP' '\fB=\fP' | '\fB^ \fP' '\fB=\fP' | '\fB|\fP' '\fB=\fP'
  622. | '\fB+=\fP' | '\fB\-=\fP' | '\fB*=\fP' | '\fB/=\fP' | '\fB%=\fP'
  623. | '\fB<<=\fP' | '\fB>>=\fP' | '\fB&=\fP' | '\fB^=\fP' | '\fB|=\fP'
  624. constant: \fIinteger\fP | \fIfloating\fP
  625. constant-expression: assignment-expression
  626. identifier: \fIidentifier\fP | \fItype-identifier\fP
  627. .fi