le compilateur super performant
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

grammaire_c 956B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. les fonctions (avec parametres)
  2. le if
  3. le while
  4. les declarations
  5. les affectations
  6. les operations arith.
  7. le retour de fonction
  8. l'invocation de fonctions
  9. C : Fonctions ;
  10. Fonctions : Fonction Fonctions | Fonction ;
  11. Fonction : tInt tID tPO Params tPF Body ;
  12. Params : | Param SuiteParams ;
  13. Param : tInt tID ;
  14. SuiteParams : tVirgule Param SuiteParams | ;
  15. // Ps : P Ps | ;
  16. // P : tInt tID tVirgule
  17. // Ps =>* tInt tID tVirgule tInt tID tVirgule
  18. // Ps => P Ps => P P Ps ...
  19. Body : tAO Instructions tAF ;
  20. Instructions : Instruction Instructions | ;
  21. Instruction : Aff | If | While | Return | Decl | Invocation tPV ;
  22. Aff : tID tEQ E tPV ;
  23. E : tNB | tID | E tADD E | E tMUL E | E tMINUS E | E tDIV E | Invocation | tPO E tPF | tMINUS E ;
  24. // E : tID tADD tID | ...
  25. If : tIF tPO Cond tPF Body ;
  26. Cond : Cond tAND Cond | Cond tOR Cond | E tEQ2 E | E tINF E | tNOT Cond ;
  27. Invocation : tID tPO Args tPF ;
  28. Args : .... cf params
  29. Return : tRET E tPV ;