< programs >→< external declarations >|< programs >< external declarations >
< external declarations >→< function definitions >|< declarations >
< function definitions >→< type Descriptions >< declarators >< compliant statements >
< type description >→<void>|<char>|<int>|<float>
< declarator >→< Pointer direct declarator >|< direct declarator >
< pointer >→< ' * ' >|< ' * ' pointer >
< direct declarator >→< identifier >|< ' ['] ' >|<[' constant expression '] ' >|< parameter table >|< (') >|< identifier list >
< compound statement >→< ' {'} ' >|< statement list >|< Declaration list >
< declaration list >→< declaration >|< claim List declaration >
< identifier list >→< identifier >|< identifier column >< identifier >
< constant expressions >→< conditional expressions >
< parameter table >→< parameter declaration >|< parameter list >< parameter declaration >
< declarations >→< declarations >|< Declaration List declarations >
< initialization >→< Assignment expression >|< "{}" "Initialization list" >|< "{}" initialization list >
< Initialize list >→< initialize >|< initialize list ' >< initialize >
< statement list >→< Statement >|< statement list >< statements >
< statements >→< Compound statements >|< expression Statements >|< SELECT statements >|< iteration statements >|< jump statements >
< SELECT statement >→<if>|<if ("expression") the declaration of the Else statement >
< iteration statements >→< while >|< for >|< for >< statements >
< jump statements >→< CONTINUE >|< break >< return >< return >< statements >
< unary operator >→ ' & ' | ' * ' | ' + ' | '-' | ' ~ ' | ‘!‘
< storage class Descriptor >→< TYPEDEF >|< EXTERN >|< STATIC >|< AUTO >|< REGISTER >
< struct or union specifier >→< struct or union specifier >< struct declaration list >|< struct or union >< struct declaration list >|< struct or union >< identifier >
< structure or union >→< struct >|< Union >
< struct declaration list >→< struct declaration >|< struct declaration >< struct Declaration list >
< struct declaration >→< specifier qualifier list >< struct specifier >
< descriptor qualifier List >→< type specifier >< specifier qualifier list >|< type specifier >|< specifier qualifier list >|< type qualifier >
< structure description list characters >→< structure specifier >|< structure Description list characters >< struct specifier >
< structure specifier >→< specifier >|< constant expression >|< constant expression >< Descriptor >
< enumeration specifier >→< Enumerator list >|< enum identifier >< enumerator list >|< enum identifier >
< enumeration identifiers >→< enumerations >|< enumeration identifiers >< Enumerations >
< enumerations >→< identifiers >|< constant expressions >< identifiers >
< function definition >-〉< type description >< function name >< parameter list >< Compound statement >
< function names >-〉< identifiers >
< parameter list 〉-〉< type description >< variable name >
< compound statements >-〉< variables >|< statements >
< statements >-〉< expression statements 〉|< SELECT statements >|< loop statements >|< jump statements >
< expression statements >-〉< assignment expressions >|< relational Expressions >|< Logical Expressions >
< Assignment expression >-〉= | += | =+ | -= | =-
< relationship expression >->〉| < | 〉=| <=
< Logical Expressions >-〉+ | - | * | /
< SELECT statement >-〉if Else Statement | Switch statement
< loop statement >-〉for statement |while statement |do while statement
< SKIP statement >-> return statement |break statement |continue statement
< variables >-> < types > 丨 < variable names > 丨 < variable values >
< type description >-> int 丨 char 丨 double 丨 float 丨 long
< variable name > <==> S
S-> a| SB
A-> a|b|c|......y|z
B-> 0|1|2|3|4|5|6|7|8| 9
< variable values >-> < letters > 丨 numbers
< identifier >〈==〉s
S-> a|b|c|......y|z| S
< letters >-> A|b|c|......y|z
< digital >〈==〉s
A-> 1|2|3|4|5|6|7|8| 9
S-> a|sa| SA0
Simple C language Grammar