18.11.2014 Views

Langages de l'informatique

Langages de l'informatique

Langages de l'informatique

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Exemple <strong>de</strong> génération<br />

<strong>Langages</strong> <strong>de</strong> l’informatique<br />

Patrick Bellot<br />

Introduction<br />

Les langages<br />

Les paradigmes<br />

Modèle impératif abstrait<br />

Boehm et Jacopini<br />

Programmation impérative<br />

Programmation fonctionnelle<br />

Programmation en logique<br />

Le co<strong>de</strong> C suivant :<br />

{<br />

}<br />

int i = 2 ;<br />

int j = 2*i + 1 ;<br />

int k = 0 ;<br />

while (i < j) {<br />

k *= 2 ;<br />

i = i+1 ;<br />

} ;<br />

Gestion <strong>de</strong> la mémoire<br />

Quatre types <strong>de</strong> mémoire<br />

peut <strong>de</strong>venir:<br />

Gérer sa mémoire<br />

Comptage <strong>de</strong> référence 0 : _i := 2<br />

Syntaxe et sémantique 1 : _j := 2 * _i<br />

Sémantiques 2 : _j := _j + 1<br />

Analyse lexicale 3 : _k = 0 ;<br />

4 : if _i >= _j goto 8<br />

Analyse syntaxique<br />

5 : _k := _k * 2<br />

Compilation 6 : _i := _i + 1<br />

Interprétation 7 : if _i < _j goto 5<br />

8 :<br />

Machine p. 149 - virtuelle Licence <strong>de</strong>s droits d’usage en page 2.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!