In the last grammar there is a case of left recursion, which will affect the future use of the syntax analysis, so the need to eliminate left recursion, so that the use of grammatical analysis.
< programs >→< external declarations > < programs > '
< programs > ' →< programs > | Ε
< external declarations >→< function Definitions > | < definition >
< function definition >→< function declaration > < function body >
< function declaration >→< function return type > < function header >
< function return type >→< return type > | < return type > < pointer >
< function head >→ (< parameters >) | ( )
< function Body >→{< declaration statement > < executable statement part >}
< return type >→void | int | char | float | Double
< hands >→* | * < hands >
< parameters >→< Identifier types > < identifiers > | < identifier types > < identifiers >, < parameters >
< identifier type >→int | char | Double | float | < marker type > < pointer >
< identifiers (variables) >→< Letters > | _ | < identifiers > < numbers > | < identifiers > < letters >
< identifiers (variables) >→< Letters > | _ | < identifiers (variables) > '
< identifiers (variables) > ' →< numbers > | < letters >
< Letter >→a | B | C |......| x | y | Z
< Digital >→0 | 1|......| 8 | 9
< declaration statements >→< Identifier types > < identifiers >; | < identifier type > < identifier >; < declaration statements >
< executable statement parts >→< Statements > | < executable statement Parts > < statements >
< statements >→< Expression Statements > | < conditional statements > | < looping statements > | < jump statements >
< loop statement >→<while (expression statement) {executable Statement part}> | <for (expression; expression; expression) {executable Statement part}> | do{executable Statement Part}while (expression statement);
< conditional statements >→< IF statements > | <if-else Statement > | <switch Statement >
< if statement >→<if (expression statement) {executable statement part}>
<if-else Statement >→<if (expression statement) {executable statement part} else {executable statement part}>
<switch statement >→<switch (variable) {SWITCH statement block}>
<switch statement block >→< case constant: Executable Statement part > | < default: executable statement part > | < Case constants: Executable statement section > <switch statement block >
< constants >→< numbers > | < go 0 numbers > < constants >
< go 0 Digital >→1 | 2 | 3 |......| 8 | 9
< jump statement >→continue; | break; | return; | return expression; |return
< expression statements >→< Assignment Expressions > | < logical Expressions > | < arithmetic expression e>
< Assignment expressions >→< variables > = < arithmetic expressions >
< logical Expressions >→ (< expressions > | < numbers >) < logical operators > (< expressions > | < numbers >)
E→t|te '
E ' → (+t|-t) e ' |ε
T→f| FT '
T ' → (*f|/F) T ' |ε
F→PF '
F ' → (↑p |ε) F '
P (E) | < Constants > | < identifiers >
< logical operators >→> | < |! = | <= | >= | = = | ? | : | ! | || | &&
Grammatical improvements (elimination of left recursion)