Presentation is loading. Please wait.

Presentation is loading. Please wait.

C syntax (simplified) BNF. Program ::= [ ] Directives ::= [ ] ::= | |… ::=#include > ::=#define.

Similar presentations


Presentation on theme: "C syntax (simplified) BNF. Program ::= [ ] Directives ::= [ ] ::= | |… ::=#include > ::=#define."— Presentation transcript:

1 C syntax (simplified) BNF

2 Program ::= [ ]

3 Directives ::= [ ] ::= | |… ::=#include > ::=#define

4 Functions ::= [ ] ::= ::= ::=

5 Functions ::= ([ ]) ::= [, ] ::= |

6 Statements ::= [ ] ::= ; | ::= |return |break |continue |goto

7 Statements ::= { [declarations][ ] }

8 Declarations ::= [ ] ::= ; | ; ::= [= ]>[, ] ::= = [ ] ::= [ ] [[ ]…][={,…}]

9 Data types ::= [unsigned] [short|long] int | char | float | double

10 Identifiers ::= [ ] ::=_|A|B|…|z = [ ] = |

11 Expressions ::= | |& |…

12 Expressions |( ) | | | | ::= ? :

13 Arithmetic expressions ::= | ::=+|- ::=+|-|*|/|%

14 Relational Expression ::= ::= | =|==|!= ::= ! | && | ||

15 Assignments ::= ::= | [ ]… ::= =|+=|-=|*=|/=|%=

16 Increment/Decrement ::= | ::=++ ::= | ::=--

17 Decision Statements ::= | ::= if ( ) [else ]

18 Switch statement ::= switch ( ) { case : … [default: statements] }

19 Loop statements ::= while ( ) |do while (expression) |for ( ; ; )

20 Function calls ::= ::= ([ ]) :: = [, ]

21 Constants ::= | ::=[-]digits[.digits] ::= [ ] ::=0|1|…|9 ::=“ ” ::= ::=A|B|…|z|0|…|9|(|)|!| |.|*|…


Download ppt "C syntax (simplified) BNF. Program ::= [ ] Directives ::= [ ] ::= | |… ::=#include > ::=#define."

Similar presentations


Ads by Google