Permalink
Browse files

a couple of C grammars, another C# one

git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@792 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information...
grammarware committed May 6, 2010
1 parent 76c8366 commit e3fcb5912ed6d1d8cbdaac7f4ba1d00eeba48ce1
Showing with 2,109 additions and 7 deletions.
  1. +9 −0 topics/grammars/c/iso-9899-1999/Makefile
  2. +20 −0 topics/grammars/c/iso-9899-1999/README.txt
  3. +3 −0 topics/grammars/c/iso-9899-1999/banned-lines.lst
  4. +273 −0 topics/grammars/c/iso-9899-1999/iso-is-annex.txt
  5. +44 −0 topics/grammars/c/iso-9899-1999/keywords.lst
  6. +9 −0 topics/grammars/c/iso-9899-tc2/Makefile
  7. +19 −0 topics/grammars/c/iso-9899-tc2/README.txt
  8. +3 −0 topics/grammars/c/iso-9899-tc2/banned-lines.lst
  9. +272 −0 topics/grammars/c/iso-9899-tc2/iso-is-annex.txt
  10. +45 −0 topics/grammars/c/iso-9899-tc2/keywords.lst
  11. +9 −0 topics/grammars/c/iso-9899-tc3/Makefile
  12. +19 −0 topics/grammars/c/iso-9899-tc3/README.txt
  13. +3 −0 topics/grammars/c/iso-9899-tc3/banned-lines.lst
  14. +277 −0 topics/grammars/c/iso-9899-tc3/iso-is-annex.txt
  15. +45 −0 topics/grammars/c/iso-9899-tc3/keywords.lst
  16. +9 −0 topics/grammars/csharp/iso-23270-2006/Makefile
  17. +29 −0 topics/grammars/csharp/iso-23270-2006/README.txt
  18. +4 −0 topics/grammars/csharp/iso-23270-2006/banned-lines.lst
  19. +978 −0 topics/grammars/csharp/iso-23270-2006/iso-is-annex.txt
  20. +24 −0 topics/grammars/csharp/iso-23270-2006/keywords.lst
  21. +6 −3 topics/grammars/csharp/msft-ls-1.0/Makefile
  22. +3 −1 topics/grammars/csharp/msft-ls-1.0/README.txt
  23. 0 topics/grammars/csharp/msft-ls-1.0/{msft-ls-1.0-annex.txt → msft-ls-annex.txt}
  24. +6 −3 topics/grammars/csharp/msft-ls-3.0/Makefile
  25. 0 topics/grammars/csharp/msft-ls-3.0/{msft-ls-3.0-annex.txt → msft-ls-annex.txt}
@@ -0,0 +1,9 @@
all:
../../../../shared/tools/pdf2bgf iso-is-annex.txt iso-output.bgf banned-lines.lst keywords.lst
../../../../shared/tools/checkxml bgf iso-output.bgf
../../../../shared/tools/normbgf iso-output.bgf iso-is-grammar.bgf
../../../../shared/tools/bgf2bnf iso-is-grammar.bgf iso-is.bnf
rm -f iso-output.bgf
clean:
rm -f iso-output.bgf iso-is-grammar.bgf iso-is.bnf
@@ -0,0 +1,20 @@
INTERNATIONAL STANDARD ISO/IEC 9899
Second edition
1999-12-01
Programming languages — C
Reference number
ISO/IEC 9899:1999(E)
© ISO/IEC 1999
All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by any means, electronic
or mechanical, including photocopying and microfilm, without permission in writing from either ISO at the address below or ISO's member body
in the country of the requester.
ISO copyright office
Case postale 56 ������ CH-1211 Geneva 20
Tel. + 41 22 749 01 11
Fax + 41 22 734 10 79
E-mail copyright@iso.ch
Web www.iso.ch
Printed in Switzerland
@@ -0,0 +1,3 @@
9899:1999
A.2
Language syntax summary
@@ -0,0 +1,273 @@
A.2 Phrase structure grammar
A.2.1 Expressions
(6.5.1) primary-expression:
identifier
constant
string-literal
(expression )
(6.5.2) postfix-expression:
primary-expression
postfix-expression [expression ]
postfix-expression (argument-expression-listopt )
postfix-expression . identifier
postfix-expression ->identifier
postfix-expression ++
postfix-expression --
(type-name ) {initializer-list }
(type-name ) {initializer-list , }
(6.5.2) argument-expression-list:
assignment-expression
argument-expression-list ,assignment-expression
(6.5.3) unary-expression:
postfix-expression
++ unary-expression
-- unary-expression
unary-operator cast-expression
sizeof unary-expression
sizeof (type-name )
(6.5.3) unary-operator: one of
& * + - ~ !
(6.5.4) cast-expression:
unary-expression
(type-name )cast-expression
(6.5.5) multiplicative-expression:
cast-expression
multiplicative-expression *cast-expression
multiplicative-expression /cast-expression
multiplicative-expression %cast-expression
408 Language syntax summary §A.2.1
©ISO/IEC ISO/IEC 9899:1999 (E)
(6.5.6) additive-expression:
multiplicative-expression
additive-expression +multiplicative-expression
additive-expression -multiplicative-expression
(6.5.7) shift-expression:
additive-expression
shift-expression <<additive-expression
shift-expression >>additive-expression
(6.5.8) relational-expression:
shift-expression
relational-expression < shift-expression
relational-expression > shift-expression
relational-expression <=shift-expression
relational-expression >=shift-expression
(6.5.9) equality-expression:
relational-expression
equality-expression ==relational-expression
equality-expression !=relational-expression
(6.5.10) AND-expression:
equality-expression
AND-expression &equality-expression
(6.5.11) exclusive-OR-expression:
AND-expression
exclusive-OR-expression ^AND-expression
(6.5.12) inclusive-OR-expression:
exclusive-OR-expression
inclusive-OR-expression |exclusive-OR-expression
(6.5.13) logical-AND-expression:
inclusive-OR-expression
logical-AND-expression &&inclusive-OR-expression
(6.5.14) logical-OR-expression:
logical-AND-expression
logical-OR-expression ||logical-AND-expression
(6.5.15) conditional-expression:
logical-OR-expression
logical-OR-expression ?expression :conditional-expression
§A.2.1 Language syntax summary 409
ISO/IEC 9899:1999 (E) ©ISO/IEC
(6.5.16) assignment-expression:
conditional-expression
unary-expression assignment-operator assignment-expression
(6.5.16) assignment-operator: one of
= *= /= %= += -= <<= >>= &= ^= |=
(6.5.17) expression:
assignment-expression
expression ,assignment-expression
(6.6) constant-expression:
conditional-expression
A.2.2 Declarations
(6.7) declaration:
declaration-specifiers init-declarator-listopt ;
(6.7) declaration-specifiers:
storage-class-specifier declaration-specifiersopt
type-specifier declaration-specifiersopt
type-qualifier declaration-specifiersopt
function-specifier declaration-specifiersopt
(6.7) init-declarator-list:
init-declarator
init-declarator-list ,init-declarator
(6.7) init-declarator:
declarator
declarator =initializer
(6.7.1) storage-class-specifier:
typedef
extern
static
auto
register
410 Language syntax summary §A.2.2
©ISO/IEC ISO/IEC 9899:1999 (E)
(6.7.2) type-specifier:
void
char
short
int
long
float
double
signed
unsigned
_Bool
_Complex
_Imaginary
struct-or-union-specifier
enum-specifier
typedef-name
(6.7.2.1) struct-or-union-specifier:
struct-or-union identifieropt {struct-declaration-list }
struct-or-union identifier
(6.7.2.1) struct-or-union:
struct
union
(6.7.2.1) struct-declaration-list:
struct-declaration
struct-declaration-list struct-declaration
(6.7.2.1) struct-declaration:
specifier-qualifier-list struct-declarator-list ;
(6.7.2.1) specifier-qualifier-list:
type-specifier specifier-qualifier-listopt
type-qualifier specifier-qualifier-listopt
(6.7.2.1) struct-declarator-list:
struct-declarator
struct-declarator-list ,struct-declarator
(6.7.2.1) struct-declarator:
declarator
declaratoropt :constant-expression
§A.2.2 Language syntax summary 411
ISO/IEC 9899:1999 (E) ©ISO/IEC
(6.7.2.2) enum-specifier:
enumidentifieropt {enumerator-list }
enumidentifieropt {enumerator-list , }
enumidentifier
(6.7.2.2) enumerator-list:
enumerator
enumerator-list ,enumerator
(6.7.2.2) enumerator:
enumeration-constant
enumeration-constant =constant-expression
(6.7.3) type-qualifier:
const
restrict
volatile
(6.7.4) function-specifier:
inline
(6.7.5) declarator:
pointeropt direct-declarator
(6.7.5) direct-declarator:
identifier
(declarator )
direct-declarator[type-qualifier-listopt assignment-expressionopt ]
direct-declarator[statictype-qualifier-listopt assignment-expression]
direct-declarator[type-qualifier-list staticassignment-expression]
direct-declarator[type-qualifier-listopt *]
direct-declarator(parameter-type-list)
direct-declarator(identifier-listopt )
(6.7.5) pointer:
*type-qualifier-listopt
*type-qualifier-listopt pointer
(6.7.5) type-qualifier-list:
type-qualifier
type-qualifier-list type-qualifier
(6.7.5) parameter-type-list:
parameter-list
parameter-list ,...
412 Language syntax summary §A.2.2
©ISO/IEC ISO/IEC 9899:1999 (E)
(6.7.5) parameter-list:
parameter-declaration
parameter-list ,parameter-declaration
(6.7.5) parameter-declaration:
declaration-specifiers declarator
declaration-specifiers abstract-declaratoropt
(6.7.5) identifier-list:
identifier
identifier-list ,identifier
(6.7.6) type-name:
specifier-qualifier-list abstract-declaratoropt
(6.7.6) abstract-declarator:
pointer
pointeropt direct-abstract-declarator
(6.7.6) direct-abstract-declarator:
(abstract-declarator )
direct-abstract-declaratoropt [assignment-expressionopt ]
direct-abstract-declaratoropt [ * ]
direct-abstract-declaratoropt (parameter-type-listopt )
(6.7.7) typedef-name:
identifier
(6.7.8) initializer:
assignment-expression
{initializer-list }
{initializer-list , }
(6.7.8) initializer-list:
designationopt initializer
initializer-list ,designationopt initializer
(6.7.8) designation:
designator-list =
(6.7.8) designator-list:
designator
designator-list designator
§A.2.2 Language syntax summary 413
ISO/IEC 9899:1999 (E) ©ISO/IEC
(6.7.8) designator:
[constant-expression ]
.identifier
A.2.3 Statements
(6.8) statement:
labeled-statement
compound-statement
expression-statement
selection-statement
iteration-statement
jump-statement
(6.8.1) labeled-statement:
identifier :statement
caseconstant-expression :statement
default :statement
(6.8.2) compound-statement:
{block-item-listopt }
(6.8.2) block-item-list:
block-item
block-item-list block-item
(6.8.2) block-item:
declaration
statement
(6.8.3) expression-statement:
expressionopt ;
(6.8.4) selection-statement:
if (expression )statement
if (expression )statement elsestatement
switch (expression )statement
(6.8.5) iteration-statement:
while ( expression )statement
do statement while (expression ) ;
for ( expressionopt ;expressionopt ;expressionopt )statement
for ( declaration expressionopt ;expressionopt )statement
414 Language syntax summary §A.2.3
©ISO/IEC ISO/IEC 9899:1999 (E)
(6.8.6) jump-statement:
gotoidentifier ;
continue ;
break ;
return expressionopt ;
A.2.4 External definitions
(6.9) translation-unit:
external-declaration
translation-unit external-declaration
(6.9) external-declaration:
function-definition
declaration
(6.9.1) function-definition:
declaration-specifiers declarator declaration-listopt compound-statement
(6.9.1) declaration-list:
declaration
declaration-list declaration
@@ -0,0 +1,44 @@
auto
break
case
char
const
continue
default
do
double
else
enum
extern
float
for
goto
if
inline
int
long
register
restrict
return
short
signed
sizeof
static
struct
switch
typedef
union unsigned
void
volatile
while
_Bool
_Complex
_Imaginary
[ ] ( ) { } . ->
++ -- & * + - ~ !
/ % << >> < > <= >= == != ^ | && ||
? : ; ...
= *= /= %= += -= <<= >>= &= ^= |=
, # ##
<: :> <% %> %: %:%:
@@ -0,0 +1,9 @@
all:
../../../../shared/tools/pdf2bgf iso-is-annex.txt iso-output.bgf banned-lines.lst keywords.lst
../../../../shared/tools/checkxml bgf iso-output.bgf
../../../../shared/tools/normbgf iso-output.bgf iso-is-grammar.bgf
../../../../shared/tools/bgf2bnf iso-is-grammar.bgf iso-is.bnf
rm -f iso-output.bgf
clean:
rm -f iso-output.bgf iso-is-grammar.bgf iso-is.bnf
@@ -0,0 +1,19 @@
INTERNATIONAL STANDARD ISO/IEC 9899
Committee Draft
May 6, 2005
Programming languages — C
http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf
Reference number
WG14/N1124 ISO/IEC 9899:TC2
© ISO/IEC 2005
Errors spotted right away:
page 412, §A.2.2:
struct-or-union-specifier ∗
(strange asterisk at the end of the line is manually removed)
(perhaps it indicates that the preceding line is the only change in the standard)
@@ -0,0 +1,3 @@
9899:TC2
A.2
Language syntax summary
Oops, something went wrong.

0 comments on commit e3fcb59

Please sign in to comment.