Vous êtes sur la page 1sur 4

Deliration CFG : Element First Follow

<Decl> DT $
<Decl>  DT ID <array> <init> <list>
<array> [ =
<array>  [int_const] <array> | NULL <list> ID $
<init> NULL,= ID,$
<list>  ID <array> <init> <list> | ; <init1> { ID $
<init>  NULL | =<init1> <array- { ID,$
init>
<init1>  <array_init> | ID <init> | <exp> <array- { NULL ID,$
<array_init>  { <constant><constant_list>} more>
<constant- NULL , }
<constant_list>  NULL | , <constant><constant_list> list>

Deliration of Function & Definition CFG : Element First Follow


<fun_decl_deff> func $
<fun_decl_deff>  func DT ID (<param>)<body>
<body> ;,{ $
<body>  ; | {<m_st>} <param> DT,NULL )
<param_more> NULL, , )
<param>  DT ID <array><param_more> | NULL
<array> [ ,,)
<param_more>  NULL | ,DTIP<array><param_more>
<array>  [ ] <array>|NULL Element First Follow
While loop CFG : <while_st> while $
<condition> ID,Const )
<while_st>  while (<condition>)<body>
<ID_constant> ID,Const Ro, )
<condition> <body> ; , { $
<ID_constant>  ID | <Constant> M-st NULL }

<Constant>  int_const | float_const |char_const| string_const


<body>  ; | <s_st> | { <m_st>}
<s_st>  all the statements deliration, loops etc
<m_st>  NULL | <s_st><m_st>
ELEMENT FIRST FOLLLOW
For loop CFG : <for_st> For $
X DT,ID,; ;,ID,constant
<for_st>  for (<x><y>; <z>) <body> Y NULL,ID,constant ;
<x>  <Decl> | <Ass_st> | ; Z ID, ID INCDEC )
, INCDEC
<y>  <Condition> | NULL ID,NULL
body ;,NULL $
<z>  ID INCDEC | INCDEC ID | NULL | ID
<Ass_Op> <ID_Const>
<body>  ; | <s_st> | {<m_st>}
Do While loop CFG : Element First Follow
<do_while> do $
<do_while>  do { <m_st> } while (<condition>);
<m_st> NULL }
<m_st>  NULL | <s_st><m_st> <condition> ID, )
Const
<ID_constant>  ID | <Constant> <ID_constant> ID, Ro,)
<Constant>  int_const | float_const |char_const| string_const Const
<Constant> All Ro,)
constant

Element First Follow


Assignment CFG : Assgn-st ID $
Assign Assign ID
<Assgn_st>  ID <Assgn> <exp> OP = Constant
Op NULL * ID
<Assgn>  <Assgn_op> | =
ADDSUB constant
<op>  NULL | <Operations> <exp> DIVMUL
Operation *ADDSUB First of
<Operations>  * | ADDSUB | DIVMUL DIVMUL Exp
Structure CFG :
<struct>  struct ID <body> <object>; Element First Follow
<body>  NULL | {<m_st>} Struct struct $
Body NULL,{ {,;
<object>  NULL | ID <object> | , ID <object> object NULL,ID, ;
<m_st>  NULL | <s_st><m_st> ,

Expression CFG :
<E>  <B><E’>
<E’>  || <B> <E’> | NULL
<B> <C> <B’>
<B’> && <C><B’> | NULL
<C>  <A> <C’>
<C’> RO <A><C’> | NULL
<A> <T><A’>
<A’> NULL | ADDSUB<T><A’>
<T>  <F><T’>
<T’> NULL | DIVMUL<F><T>| *<F><T’>
<F> ( E )|ID<member><F1>|INCDEC ID <member> | <constant>| *<m_st> ID | !<F>
<F1> NULL | INCDEC
<member> NULL | ID <member>| [E] <m-dim><member>| (<arg>)
<m-dim>  NULL | [E] <m-dim>
<arg>  NULL | E<m-arg>
<m-arg> NULL | , E<m-arg>
<m-st>  NULL | *<m-st>
Element First Follow
SWITCH-CASE CFG :
Element First Follow
Switch- switch $
case
<switch-case> switch(ID)<body> body ; DT for $
<body> ; | {<m-Case_st>} <Defult> |<single_Case_St> while do
if switch
<single_Case_St>  <s_st> | <case_st> INCDEC
ID case {
<case_st>  case<IDConstant>: <m_st><break_st>
defult
<break_st>break;| NULL S_case_st_

<defult> defult : <m-st> | NULL


<m_case_st> <single_case_st><m_case_st>|NULL|<defult>

IF-ELSE CFG :

<if_else> if(<condition>)<body><o_else> Element First follow


If_else If $
O_else Else,NULL $

Vous aimerez peut-être aussi