forked from acsl-language/acsl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathc-type-name.tex
55 lines (55 loc) · 1.85 KB
/
c-type-name.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
\begin{syntax}
C-type-expr ::= C-specifier-qualifier+ C-abstract-declarator?
\
C-type-name ::= C-declaration-specifier+
\
C-specifier-qualifier ::= C-type-specifier | C-type-qualifier
\
C-type-qualifier ::= "const" | "volatile"
\
C-type-specifier ::= "void" ;
| "char" ;
| "short" ;
| "int" ;
| "long" ;
| "float" ;
| "double" ;
| "signed" ;
| "unsigned" ;
| ( "struct" | "union" | "enum" ) ident [ACSL does not permit declaring a new type within the type-specifier] ;
| ident
\
C-abstract-declarator ::= C-pointer ;
| C-pointer C-direct-abstract-declarator ;
| C-direct-abstract-declarator
\
C-pointer ::= ( "*" C-type-qualifier* )+
\
C-direct-abstract-declarator ::= "(" C-abstract-declarator ")" ;
| C-direct-abstract-declarator? ;
"[" C-constant-expression "]" ;
| C-direct-abstract-declarator? ;
"(" C-parameter-type-list? ")"
\
C-parameter-type-list ::= C-parameter-declaration;
("," C-parameter-declaration )+
\
C-parameter-declaration ::= C-declaration-specifier+ C-declarator ;
| C-declaration-specifier+ ;
C-abstract-declarator ;
| C-declaration-specifier+ ;
\
C-declaration-specifier ::= C-type-specifier | C-type-qualifier
\
C-declarator ::= C-pointer? C-direct-declarator
\
C-direct-declarator ::= ident ;
| "(" C-declarator ")" ;
| C-direct-declarator;
"[" C-constant-expression? "]" ;
| C-direct-declarator;
"(" C-parameter-type-list ")" ;
| C-direct-declarator "(" ident* ")"
\
C-constant-expression ::= ... [An expression formed from constant literals]
\end{syntax}