C grammar HTML, generated by LRSTAR from Compilerware.
0 Start
0 -> [ExternalDef]... <eof>
1 ExternalDef
1 -> ExtDeclaration
2 -> FunctionDef
2 ExtDeclaration
3 -> [DeclarationSpec]... [InitDeclarator]/','... ';'
3 Declaration
4 -> DeclarationSpec... InitDeclarator/','... ';'
4 FunctionDef
5 -> FunctionDecl FunctionBody
5 FunctionDecl
6 -> [DeclarationSpec]... Declarator [Declaration]...
6 FunctionBody
7 -> Block
7 DeclarationSpec
8 -> TypeSpec
9 -> StorageClassSpec
8 TypeSpec
10 -> int
11 -> char
12 -> long
13 -> void
14 -> short
15 -> const
16 -> float
17 -> double
18 -> signed
19 -> unsigned
20 -> volatile
21 -> far
22 -> near
23 -> huge
24 -> cdecl
25 -> pascal
26 -> interrupt
27 -> EnumSpec
28 -> StructSpec
29 -> UnionSpec
30 -> {typedef}
9 StorageClassSpec
31 -> typedef
32 -> extern
33 -> static
34 -> auto
35 -> register
10 InitDeclarator
36 -> Declarator
37 -> Declarator '=' Init
11 StructSpec
38 -> struct <identifier>
39 -> struct '{' StructDeclaration... '}'
40 -> struct <identifier> '{' StructDeclaration... '}'
12 UnionSpec
41 -> union <identifier>
42 -> union '{' StructDeclaration... '}'
43 -> union <identifier> '{' StructDeclaration... '}'
13 StructDeclaration
44 -> TypeSpec... StructDeclarator/','... ';'
14 StructDeclarator
45 -> ':' ConstExp
46 -> Declarator ':' ConstExp
47 -> Declarator
15 EnumSpec
48 -> enum <identifier>
49 -> enum '{' Enumerator/','... '}'
50 -> enum <identifier> '{' Enumerator/','... '}'
16 Enumerator
51 -> <identifier>
52 -> <identifier> '=' ConstExp
17 Declarator
53 -> DirectDeclarator
54 -> Pointer DirectDeclarator
18 DirectDeclarator
55 -> Identifier
56 -> '(' Declarator ')'
57 -> DirectDeclarator '[' [ConstExp] ']'
58 -> DirectDeclarator '(' Arguments ')'
59 -> DirectDeclarator '(' AbsArguments ')'
19 Pointer
60 -> '*' [TypeSpec]...
61 -> '*' [TypeSpec]... Pointer
20 Arguments
62 -> ArgDecl/','...
63 -> ArgDecl/','... ',' '...'
21 AbsArguments
64 -> AbsArgDecl/','...
65 -> AbsArgDecl/','... ',' '...'
22 ArgDecl
66 -> Declarator
67 -> DeclarationSpec... Declarator
23 AbsArgDecl
68 ->
69 -> DeclarationSpec...
70 -> AbstractDeclarator
71 -> DeclarationSpec... AbstractDeclarator
24 TypeName
72 -> TypeSpec...
73 -> TypeSpec... AbstractDeclarator
25 AbstractDeclarator
74 -> Pointer
75 -> DirectAbstractDeclarator
76 -> Pointer DirectAbstractDeclarator
26 DirectAbstractDeclarator
77 -> '[' [ConstExp] ']'
78 -> '(' AbstractDeclarator ')'
79 -> DirectAbstractDeclarator '[' [ConstExp] ']'
80 -> DirectAbstractDeclarator '(' AbsArguments ')'
27 Init
81 -> AssignExp
82 -> '{' Init/','... [','] '}'
28 Stmt
83 -> ';'
84 -> Exp ';'
85 -> goto Identifier ';'
86 -> continue ';'
87 -> break ';'
88 -> return [Exp] ';'
89 -> Label Stmt
90 -> Block
91 -> if '(' Exp ')' Stmt
92 -> if '(' Exp ')' Stmt else Stmt
93 -> switch '(' Exp ')' '{' Case Default '}'
94 -> while '(' Exp ')' Stmt
95 -> do Stmt while '(' Exp ')' ';'
96 -> for '(' Exp1 ';' Exp2 ';' Exp3 ')' Stmt
29 Case
97 -> [case ConstExp ':' [Stmt]...]...
30 Default
98 -> [default ':' [Stmt]...]
31 Exp1
99 ->
100 -> Exp
32 Exp2
101 ->
102 -> Exp
33 Exp3
103 ->
104 -> Exp
34 Label
105 -> Identifier ':'
35 Block
106 -> '{' '}'
107 -> '{' Declaration... '}'
108 -> '{' Stmt... '}'
109 -> '{' Declaration... Stmt... '}'
36 ConstExp
110 -> CondExp
37 Exp
111 -> AssignExp
112 -> Exp ',' AssignExp
38 AssignExp
113 -> CondExp
114 -> UnaryExp '=' AssignExp
115 -> UnaryExp '*=' AssignExp
116 -> UnaryExp '/=' AssignExp
117 -> UnaryExp '%=' AssignExp
118 -> UnaryExp '+=' AssignExp
119 -> UnaryExp '-=' AssignExp
120 -> UnaryExp '<<=' AssignExp
121 -> UnaryExp '>>=' AssignExp
122 -> UnaryExp '&=' AssignExp
123 -> UnaryExp '^=' AssignExp
124 -> UnaryExp '|=' AssignExp
39 CondExp
125 -> CastExp
126 -> CondExp '?' CondExp ':' CondExp
127 -> CondExp '||' CondExp
128 -> CondExp '&&' CondExp
129 -> CondExp '|' CondExp
130 -> CondExp '^' CondExp
131 -> CondExp '&' CondExp
132 -> CondExp '==' CondExp
133 -> CondExp '!=' CondExp
134 -> CondExp '<' CondExp
135 -> CondExp '>' CondExp
136 -> CondExp '<=' CondExp
137 -> CondExp '>=' CondExp
138 -> CondExp '<<' CondExp
139 -> CondExp '>>' CondExp
140 -> CondExp '+' CondExp
141 -> CondExp '-' CondExp
142 -> CondExp '*' CondExp
143 -> CondExp '/' CondExp
144 -> CondExp '%' CondExp
40 CastExp
145 -> UnaryExp
146 -> '(' TypeName ')' CastExp
41 UnaryExp
147 -> PostfixExp
148 -> '++' UnaryExp
149 -> '--' UnaryExp
150 -> '~' CastExp
151 -> '&' CastExp
152 -> '*' CastExp
153 -> '+' CastExp
154 -> '-' CastExp
155 -> '!' CastExp
156 -> sizeof UnaryExp
157 -> sizeof '(' TypeName ')'
42 PostfixExp
158 -> PrimaryExp
159 -> PostfixExp '[' Subscript ']'
160 -> PostfixExp '.' Identifier
161 -> PostfixExp '(' Args ')'
162 -> PostfixExp '->' Identifier
163 -> PostfixExp '++'
164 -> PostfixExp '--'
43 Subscript
165 -> Exp
44 Args
166 -> [AssignExp]/','...
45 PrimaryExp
167 -> <string>...
168 -> <constant>
169 -> Identifier
170 -> '(' Exp ')'
46 Identifier
171 -> <identifier>
47 [ExternalDef]...
172 ->
173 -> [ExternalDef]... ExternalDef
48 [DeclarationSpec]...
174 ->
175 -> [DeclarationSpec]... DeclarationSpec
49 [InitDeclarator]/','...
176 ->
177 -> InitDeclarator/','...
50 InitDeclarator/','...
178 -> InitDeclarator
179 -> InitDeclarator/','... ',' InitDeclarator
51 DeclarationSpec...
180 -> DeclarationSpec
181 -> DeclarationSpec... DeclarationSpec
52 [Declaration]...
182 ->
183 -> [Declaration]... Declaration
53 StructDeclaration...
184 -> StructDeclaration
185 -> StructDeclaration... StructDeclaration
54 TypeSpec...
186 -> TypeSpec
187 -> TypeSpec... TypeSpec
55 StructDeclarator/','...
188 -> StructDeclarator
189 -> StructDeclarator/','... ',' StructDeclarator
56 Enumerator/','...
190 -> Enumerator
191 -> Enumerator/','... ',' Enumerator
57 [ConstExp]
192 ->
193 -> ConstExp
58 [TypeSpec]...
194 ->
195 -> [TypeSpec]... TypeSpec
59 ArgDecl/','...
196 -> ArgDecl
197 -> ArgDecl/','... ',' ArgDecl
60 AbsArgDecl/','...
198 -> AbsArgDecl
199 -> AbsArgDecl/','... ',' AbsArgDecl
61 Init/','...
200 -> Init
201 -> Init/','... ',' Init
62 [',']
202 ->
203 -> ','
63 [Exp]
204 ->
205 -> Exp
64 [Stmt]...
206 ->
207 -> [Stmt]... Stmt
65 (case ConstExp ':' [Stmt]...)
208 -> case ConstExp ':' [Stmt]...
66 [case ConstExp ':' [Stmt]...]...
209 ->
210 -> [case ConstExp ':' [Stmt]...]... (case ConstExp ':' [Stmt]...)
67 [default ':' [Stmt]...]
211 ->
212 -> default ':' [Stmt]...
68 Declaration...
213 -> Declaration
214 -> Declaration... Declaration
69 Stmt...
215 -> Stmt
216 -> Stmt... Stmt
70 [AssignExp]/','...
217 ->
218 -> AssignExp/','...
71 AssignExp/','...
219 -> AssignExp
220 -> AssignExp/','... ',' AssignExp
72 <string>...
221 -> <string>
222 -> <string>... <string>
End of C grammar listing.