19.04.2013 Views

Apostila antiga - The Cyan Programming Language

Apostila antiga - The Cyan Programming Language

Apostila antiga - The Cyan Programming Language

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 4<br />

Geração de Código<br />

4.1 Introdução<br />

Estudaremos a geração de código para linguagem S2 a partir da ASA construída durante a análise<br />

sintática. O código será gerado na linguagem C. A tradução de S2 para C é trivial e será mostrada<br />

através de um exemplo. O programa S2 dado a seguir,<br />

var<br />

i, n : integer;<br />

ok : boolean;<br />

begin<br />

ok = false;<br />

read(n);<br />

if (n > 0) and not ok<br />

then<br />

i = 1;<br />

while i

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

Saved successfully!

Ooh no, something went wrong!