C syntax (simplified) BNF
Program ::= [ ]
Directives ::= [ ] ::= | |… ::=#include > ::=#define
Functions ::= [ ] ::= ::= ::=
Functions ::= ([ ]) ::= [, ] ::= |
Statements ::= [ ] ::= ; | ::= |return |break |continue |goto
Statements ::= { [declarations][ ] }
Declarations ::= [ ] ::= ; | ; ::= [= ]>[, ] ::= = [ ] ::= [ ] [[ ]…][={,…}]
Data types ::= [unsigned] [short|long] int | char | float | double
Identifiers ::= [ ] ::=_|A|B|…|z = [ ] = |
Expressions ::= | |& |…
Expressions |( ) | | | | ::= ? :
Arithmetic expressions ::= | ::=+|- ::=+|-|*|/|%
Relational Expression ::= ::= | =|==|!= ::= ! | && | ||
Assignments ::= ::= | [ ]… ::= =|+=|-=|*=|/=|%=
Increment/Decrement ::= | ::=++ ::= | ::=--
Decision Statements ::= | ::= if ( ) [else ]
Switch statement ::= switch ( ) { case : … [default: statements] }
Loop statements ::= while ( ) |do while (expression) |for ( ; ; )
Function calls ::= ::= ([ ]) :: = [, ]
Constants ::= | ::=[-]digits[.digits] ::= [ ] ::=0|1|…|9 ::=“ ” ::= ::=A|B|…|z|0|…|9|(|)|!| |.|*|…