<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Thiago Melo &#187; C++</title>
	<atom:link href="http://thiago.oxente.org/category/programacao/c/feed" rel="self" type="application/rss+xml" />
	<link>http://thiago.oxente.org</link>
	<description>Linux, Programação, Redes e Jogos.</description>
	<lastBuildDate>Thu, 04 Feb 2010 18:03:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tanques de Guerra v0.5</title>
		<link>http://thiago.oxente.org/2007/05/21/tanques-de-guerra-v05</link>
		<comments>http://thiago.oxente.org/2007/05/21/tanques-de-guerra-v05#comments</comments>
		<pubDate>Mon, 21 May 2007 18:37:12 +0000</pubDate>
		<dc:creator>Thiago Melo</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Jogos]]></category>
		<category><![CDATA[Programação]]></category>

		<guid isPermaLink="false">http://thiago.oxente.org/2007/05/21/tanques-de-guerra-v05/</guid>
		<description><![CDATA[Depois de um bom tempo aprendendo a usar &#8220;Tiles&#8221; no Allegro, chegou a hora de aperfeiçoar o Tanque de Guerra, nesta versão tive que usar o compilador C no lugar do Cpp, estranhamente não conseguia usar o mesmo cabeçalho para todos os arquivos, pois na hora de compilar o &#8220;linker&#8221; dava erro de existir múltiplas [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://i17.photobucket.com/albums/b55/reiserfs/tg5.jpg" align="left" />Depois de um bom tempo aprendendo a usar &#8220;Tiles&#8221; no Allegro, chegou a hora de aperfeiçoar o Tanque de Guerra, nesta versão tive que usar o compilador C no lugar do Cpp, estranhamente não conseguia usar o mesmo cabeçalho para todos os arquivos, pois na hora de compilar o &#8220;linker&#8221; dava erro de existir múltiplas declarações das variáveis contidas no cabeçalho. Isto não deveria ocorrer pois o cabeçalho faz a verificação da declaração da Macro antes de compilar.<br />
Lendo em alguns sites encontrados pelo Google, verifiquei que o &#8220;#ifndef&#8221; não funciona da mesma forma de C para Cpp, com isso mudei todo código para *.c e compilei com o compilador GNU C.<br />
Abaixo está o link com o binário, esqueci de por o fonte, quem quiser o fonte entra em contato que eu mando.<br />
Próximo capitulo é o mais esperado, Timer, Interrupt, Handlers, and Multi-Threading. Fazia tempo que eu queria aprender Threading, o livro de sockets ensina mas eu não tive tempo de terminar, quando terminar o livro de Allegro eu volto a estudar sockets.</p>
<p>Download: <a href="http://reiserfs.killermonkeys.net/Thiago/Cpp/guerra_tanquev5.rar">http://reiserfs.killermonkeys.net/Thiago/Cpp/guerra_tanquev5.rar</a></p>
]]></content:encoded>
			<wfw:commentRss>http://thiago.oxente.org/2007/05/21/tanques-de-guerra-v05/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Tanques de Guerra v0.3</title>
		<link>http://thiago.oxente.org/2007/04/27/tanques-de-guerra-v03</link>
		<comments>http://thiago.oxente.org/2007/04/27/tanques-de-guerra-v03#comments</comments>
		<pubDate>Fri, 27 Apr 2007 20:56:23 +0000</pubDate>
		<dc:creator>Thiago Melo</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Jogos]]></category>
		<category><![CDATA[Programação]]></category>

		<guid isPermaLink="false">http://thiago.oxente.org/2007/04/27/tanques-de-guerra-v03/</guid>
		<description><![CDATA[Bom a um tempo atrás eu publiquei aqui meu primeiro jogo em Allegro [Clique aqui para ver o artigo] Um jogo de &#8220;guerra entre dois tanques&#8221; bem simples no estilo Atari. Como eu voltei a ler o livro de Jonathan S. Harbour, comecei a melhorar o programa seguindo os capítulos. Neste ultimo o livro ensina [...]]]></description>
			<content:encoded><![CDATA[<p><img align="left" src="http://i17.photobucket.com/albums/b55/reiserfs/guerra_de_tankv3.jpg" />Bom a um tempo atrás eu publiquei aqui meu primeiro jogo em <a target="_blank" href="http://thiago.oxente.org/www.allegro.cc">Allegro</a> <a target="_blank" href="http://thiago.oxente.org/2006/10/17/meu-primeiro-jogo-usando-allegro/">[Clique aqui para ver o artigo]</a> Um jogo de &#8220;guerra entre dois tanques&#8221; bem simples no estilo Atari. Como eu voltei a ler o livro de <a title="Jharbour" target="_blank" href="http://www.jharbour.com/home.aspx">Jonathan S. Harbour</a>, comecei a melhorar o programa seguindo os capítulos. Neste ultimo o livro ensina como utilizar Sprites (não é Refrigerante) em um jogo, uma técnica simples onde o programa carrega imagens BMP ou outra extensão e coloca no jogo, rotacionando, redimensionando e etc.</p>
<p>Nesta nova versão os obstáculos foram removidos pois todo o código de desenhar no jogo eu apaguei e usei apenas código de controle de BITMAP. O interessante que o código ficou bem menor, não pelo fato de remover o código dos obstáculos mas da funções de atualizar os tanques e as balas também.</p>
<p>O Jogo também aparentou estar mais leve, pois o processador não precisa ficar desenhando retângulos na tela o tempo todo.</p>
<p>A próxima etapa vai ser trabalhar com Sprites Animados e também vai tratar de detecção de colisão. O Legal desse livro é que ele aborta um jogo (o TankWars) como foco do livro, cada capitulo nos aprimoramos o jogo, estou até ansioso de ver como vai ficar a versão final. Se você gostaria de fazer jogos e não sabe por onde começar, o <a target="_blank" href="http://thiago.oxente.org/www.allegro.cc">Allegro </a>é uma ótima biblioteca gráfica para aprender a fazer um jogo, e o livro de <a title="Jharbour" target="_blank" href="http://www.jharbour.com/home.aspx">Jonathan S. Harbour</a> é ótimo, o unico problema foi que eu não achei o livro no Brasil, apenas em inglês.<br />
Download da nova versão e do código fonte em C++ (usei o DevCpp assim como na outra versão)<br />
<a href="http://reiserfs.killermonkeys.net/Thiago/Cpp/allegro_tank_v3.rar">http://reiserfs.killermonkeys.net/Thiago/Cpp/allegro_tank_v3.rar</a></p>
]]></content:encoded>
			<wfw:commentRss>http://thiago.oxente.org/2007/04/27/tanques-de-guerra-v03/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Meu primeiro Jogo usando Allegro</title>
		<link>http://thiago.oxente.org/2006/10/17/meu-primeiro-jogo-usando-allegro</link>
		<comments>http://thiago.oxente.org/2006/10/17/meu-primeiro-jogo-usando-allegro#comments</comments>
		<pubDate>Tue, 17 Oct 2006 19:25:56 +0000</pubDate>
		<dc:creator>Thiago Melo</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Jogos]]></category>
		<category><![CDATA[Programação]]></category>

		<guid isPermaLink="false">http://thiago.killermonkeys.net/2006/10/17/meu-primeiro-jogo-usando-allegro/</guid>
		<description><![CDATA[Hoje eu fiz meu primeiro jogo usando a Biblioteca Grafica Allegro, o jogo é bastante simples nos moldes dos velhos tempos de ATARI.
Chamado de guerra de tanque (tanque de guerra hehehe) o jogo é para dois jogadores, pois ainda não cheguei a ponto de desenvolver uma IA para controlar o outro tanque.
Estou usando o Livro [...]]]></description>
			<content:encoded><![CDATA[<p><img align="left" title="Tanque" alt="Tanque" src="http://i17.photobucket.com/albums/b55/reiserfs/tanque.jpg" />Hoje eu fiz meu primeiro jogo usando a Biblioteca Grafica Allegro, o jogo é bastante simples nos moldes dos velhos tempos de ATARI.</p>
<p>Chamado de guerra de tanque (tanque de guerra hehehe) o jogo é para dois jogadores, pois ainda não cheguei a ponto de desenvolver uma IA para controlar o outro tanque.</p>
<p>Estou usando o Livro Game Programming All in One Second Edition escrito por <a target="_blank" title="Jharbour" href="http://www.jharbour.com/home.aspx">Jonathan S. Harbour</a>, para estudar o desenvolvimento de Games com Allegro.<br />
No link abaixo você pode baixar o código fonte em C++ e o jogo compilado.<br />
<a title="Tanque de Guerra Source " href="http://reiserfs.killermonkeys.net/Thiago/Cpp/tanque_static.rar">http://reiserfs.killermonkeys.net/Thiago/Cpp/tanque_static.rar</a></p>
]]></content:encoded>
			<wfw:commentRss>http://thiago.oxente.org/2006/10/17/meu-primeiro-jogo-usando-allegro/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Trabalho de Paradigmas de Programação</title>
		<link>http://thiago.oxente.org/2006/10/09/trabalho-de-paradigmas-de-programacao</link>
		<comments>http://thiago.oxente.org/2006/10/09/trabalho-de-paradigmas-de-programacao#comments</comments>
		<pubDate>Mon, 09 Oct 2006 18:33:49 +0000</pubDate>
		<dc:creator>Thiago Melo</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Programação]]></category>

		<guid isPermaLink="false">http://thiago.killermonkeys.net/2006/10/09/trabalho-de-paradigmas-de-programacao/</guid>
		<description><![CDATA[Curso de Sistema de Informação
Disciplina Paradigmas de Programação
Fábio José Rodrigues Pinheiro
Escrever um programa (em qualquer linguagem de programação) que contenha um analisador léxico e um analisador sintático para a seguinte gramática:
atribuição → id = expr
id → A &#124; B &#124; C
expr → id + expr
&#124; id * expr
&#124; (expr)
&#124; id
Tal programa deve reconhecer todas as [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Curso de Sistema de Informação<br />
Disciplina Paradigmas de Programação<br />
Fábio José Rodrigues Pinheiro</strong></p>
<p>Escrever um programa (em qualquer linguagem de programação) que contenha um analisador léxico e um analisador sintático para a seguinte gramática:</p>
<p>atribuição → id = expr<br />
id → A | B | C<br />
expr → id + expr<br />
| id * expr<br />
| (expr)<br />
| id</p>
<p>Tal programa deve reconhecer todas as sentenças possíveis geradas por essa gramática.<br />
Exemplos:<br />
A + B<br />
A + C + B<br />
(((A)))<br />
A = B * (A + C)</p>
<p><span id="more-12"></span></p>
<p>Agradecimentos a Manoel Teixeira.</p>
<div class="igBar"><span id="lcode-2"><a href="#" onclick="javascript:showPlainTxt('code-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-2">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#include</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#include</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#include</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">using namespace std;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">int analiza<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// Função principal, dá inicio ao analisador sintático</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">const char * str_replace<span style="color:#006600; font-weight:bold;">&#40;</span>string o, char * r, string s<span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// Função para tirar os espaços da sentença</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">void analizador_lexico<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// Analisador Léxico - Função para obter o próximo token</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">void expressao<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// Analisador Sintático</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">void debugador<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// Funçao de Debug</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">int pos,p_aberto,token,xerro,debug_on=<span style="color:#800000;color:#800000;">0</span>; <span style="color:#FF9933; font-style:italic;">// posição expressão,parênteses abertos,próximo token,mensagem de erro, argumento</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">string sentenca; <span style="color:#FF9933; font-style:italic;">// sentença capturada pelo teclado</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">enum token <span style="color:#006600; font-weight:bold;">&#123;</span>id,op,p_esq,p_dir,igual,fim<span style="color:#006600; font-weight:bold;">&#125;</span>; <span style="color:#FF9933; font-style:italic;">// tokens permitidos</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">int main<span style="color:#006600; font-weight:bold;">&#40;</span>int argc, char *argv<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#FF9933; font-style:italic;">// função principal</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cout &lt;&lt;<span style="color:#CC0000;">" Escrever um programa (em qualquer linguagem de programa‡Æo) que contenha um <span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cout &lt;&lt;<span style="color:#CC0000;">" analisador l‚xico e um analisador sint tico para a seguinte gram tica:<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cout &lt;&lt;<span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\n</span>&nbsp; -&gt;&nbsp; = <span style="color:#000099; font-weight:bold;">\n</span>"</span>; cout &lt;&lt;<span style="color:#CC0000;">"&nbsp; -&gt; A | B | C<span style="color:#000099; font-weight:bold;">\n</span>"</span>; cout &lt;&lt;<span style="color:#CC0000;">"&nbsp; -&gt;&nbsp; + <span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cout &lt;&lt;<span style="color:#CC0000;">"&nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; *&nbsp; <span style="color:#000099; font-weight:bold;">\n</span>"</span>; cout &lt;&lt;<span style="color:#CC0000;">"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | ()<span style="color:#000099; font-weight:bold;">\n</span>"</span>; cout &lt;&lt;<span style="color:#CC0000;">"&nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; <span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cout &lt;&lt;<span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\n</span> Ex:<span style="color:#000099; font-weight:bold;">\n</span>&nbsp; A + B <span style="color:#000099; font-weight:bold;">\n</span>&nbsp; A + C + B<span style="color:#000099; font-weight:bold;">\n</span>&nbsp; (((A)))<span style="color:#000099; font-weight:bold;">\n</span>&nbsp; A = B * (A + C) "</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>argv<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>if <span style="color:#006600; font-weight:bold;">&#40;</span>strcmp<span style="color:#006600; font-weight:bold;">&#40;</span>argv<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<span style="color:#CC0000;">"debug"</span><span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> debug_on=<span style="color:#800000;color:#800000;">1</span>;<span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#FF9933; font-style:italic;">// verifica o argumento de debug</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">while <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// laço principal</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">pos = <span style="color:#800000;color:#800000;">0</span>; p_aberto = <span style="color:#800000;color:#800000;">0</span>; xerro = <span style="color:#800000;color:#800000;">0</span>; <span style="color:#FF9933; font-style:italic;">// zera os valores para multiplas consultas</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if<span style="color:#006600; font-weight:bold;">&#40;</span>debug_on<span style="color:#006600; font-weight:bold;">&#41;</span> cout &lt;&lt;<span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\n</span><span style="color:#000099; font-weight:bold;">\n</span> **** MODO DEBUG LIGADO **** <span style="color:#000099; font-weight:bold;">\n</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cout &lt;&lt;<span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\n</span><span style="color:#000099; font-weight:bold;">\n</span> Digite a senten‡a ou 0 (zero) para sair: <span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">getline<span style="color:#006600; font-weight:bold;">&#40;</span>cin, sentenca<span style="color:#006600; font-weight:bold;">&#41;</span>; strupr<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>char *<span style="color:#006600; font-weight:bold;">&#41;</span> sentenca.<span style="">c_str</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; sentenca = str_replace<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">" "</span>,<span style="color:#CC0000;">""</span>,sentenca<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>sentenca == <span style="color:#CC0000;">"0"</span><span style="color:#006600; font-weight:bold;">&#41;</span> break;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>analiza<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> cout &lt;&lt;<span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\n</span> Senten‡a v lida!<span style="color:#000099; font-weight:bold;">\n</span>"</span>; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">else <span style="color:#006600; font-weight:bold;">&#123;</span> cout &lt;&lt;<span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\n</span> Senten‡a inv lida!<span style="color:#000099; font-weight:bold;">\n</span>"</span>; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cout &lt;&lt;sentenca &lt;&lt;<span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">return EXIT_SUCCESS;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">const char * str_replace<span style="color:#006600; font-weight:bold;">&#40;</span>string o, char * r, string s<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">int i;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">string t;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">while <span style="color:#006600; font-weight:bold;">&#40;</span>s.<span style="">find</span><span style="color:#006600; font-weight:bold;">&#40;</span>o,<span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> &lt;string::<span style="">npos</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">for <span style="color:#006600; font-weight:bold;">&#40;</span>i=<span style="color:#800000;color:#800000;">0</span>;i</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">t = s<span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>strcmp <span style="color:#006600; font-weight:bold;">&#40;</span>t.<span style="">c_str</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>,o.<span style="">c_str</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>==<span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> s.<span style="">replace</span><span style="color:#006600; font-weight:bold;">&#40;</span>i,<span style="color:#800000;color:#800000;">1</span>,r<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> return s.<span style="">c_str</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">int analiza<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">analizador_lexico<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>token == id<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#FF9933; font-style:italic;">// Caracteriza: atribuição e expr</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">analizador_lexico<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>token == igual<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#FF9933; font-style:italic;">// Caracteriza: atribuição</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">analizador_lexico<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">expressao<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> else <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>token == op<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#FF9933; font-style:italic;">// Caracteriza: expressão</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">analizador_lexico<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if<span style="color:#006600; font-weight:bold;">&#40;</span> token == fim<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> cout &lt;&lt;<span style="color:#CC0000;">"ERRO 1: Fim inesperado! <span style="color:#000099; font-weight:bold;">\n</span>"</span>; return <span style="color:#800000;color:#800000;">0</span>;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">else expressao<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> else <span style="color:#006600; font-weight:bold;">&#123;</span> cout &lt;&lt;<span style="color:#CC0000;">"ERRO 2: Operador +, * ou = esperado! <span style="color:#000099; font-weight:bold;">\n</span>"</span>; return <span style="color:#800000;color:#800000;">0</span>;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> else expressao<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">switch <span style="color:#006600; font-weight:bold;">&#40;</span>xerro<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">case <span style="color:#800000;color:#800000;">0</span>: return <span style="color:#800000;color:#800000;">1</span>;&nbsp; break;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">case <span style="color:#800000;color:#800000;">1</span>: return <span style="color:#800000;color:#800000;">0</span>; break;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">void debugador<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if<span style="color:#006600; font-weight:bold;">&#40;</span>debug_on<span style="color:#006600; font-weight:bold;">&#41;</span> cout &lt;&lt;<span style="color:#CC0000;">"DEBUG: sentenca[pos]: "</span> &lt;&lt;sentenca<span style="color:#006600; font-weight:bold;">&#91;</span>pos<span style="color:#006600; font-weight:bold;">&#93;</span> &lt;&lt;<span style="color:#CC0000;">" pos: "</span> &lt;&lt;pos &lt;&lt;<span style="color:#CC0000;">" token: "</span> &lt;&lt;token &lt;&lt;<span style="color:#CC0000;">" p_aberto: "</span> &lt;&lt;p_aberto &lt;&lt;<span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">void analizador_lexico<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">debugador<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>pos &lt;sentenca.<span style="">length</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">switch <span style="color:#006600; font-weight:bold;">&#40;</span>sentenca<span style="color:#006600; font-weight:bold;">&#91;</span>pos<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">case <span style="color:#CC0000;">'A'</span>:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">case <span style="color:#CC0000;">'B'</span>:</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">case <span style="color:#CC0000;">'C'</span>:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">token = id;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">break;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">case <span style="color:#CC0000;">'+'</span>:</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">case <span style="color:#CC0000;">'*'</span>:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">token = op;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">break;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">case <span style="color:#CC0000;">'='</span>:</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">token = igual;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">break;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">case <span style="color:#CC0000;">')'</span>:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">token = p_dir;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">break;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">case <span style="color:#CC0000;">'('</span>:</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">token = p_esq;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">break;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">default:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">token = fim;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cout &lt;&lt;<span style="color:#CC0000;">"ERRO 3: Caracter nÆo reconhecido "</span> &lt;&lt;sentenca<span style="color:#006600; font-weight:bold;">&#91;</span>pos<span style="color:#006600; font-weight:bold;">&#93;</span> &lt;&lt;pos &lt;&lt; <span style="color:#CC0000;">"&nbsp; <span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">xerro=<span style="color:#800000;color:#800000;">1</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">break;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> else token = fim;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">pos++;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">void expressao<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">debugador<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>token == id<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">analizador_lexico<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>token == op<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">analizador_lexico<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">expressao<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> else <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>token == p_dir &amp;&amp; p_aberto&gt; <span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> p_aberto--; analizador_lexico<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; expressao<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">else <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>token == fim<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>p_aberto&gt; <span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> cout &lt;&lt;<span style="color:#CC0000;">"ERRO 4: Fechamento de parˆnteses esperado! <span style="color:#000099; font-weight:bold;">\n</span>"</span>; xerro=<span style="color:#800000;color:#800000;">1</span>; return; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">else return;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> else <span style="color:#006600; font-weight:bold;">&#123;</span> cout &lt;&lt;<span style="color:#CC0000;">"ERRO 5: Operador +,* esperado!<span style="color:#000099; font-weight:bold;">\n</span>"</span>; xerro=<span style="color:#800000;color:#800000;">1</span>; return; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> else <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>token == p_esq<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>p_aberto++; analizador_lexico<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; expressao<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">else <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>token == p_dir &amp;&amp; p_aberto&gt; <span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">p_aberto--; analizador_lexico<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; expressao<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>token == fim &amp;&amp; p_aberto == <span style="color:#800000;color:#800000;">0</span> <span style="color:#006600; font-weight:bold;">&#41;</span> return;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">else <span style="color:#006600; font-weight:bold;">&#123;</span>cout &lt;&lt;<span style="color:#CC0000;">"ERRO 6: Caracter nÆo esperado! <span style="color:#000099; font-weight:bold;">\n</span>"</span>; xerro=<span style="color:#800000;color:#800000;">1</span>; return;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> else <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>token == fim<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>p_aberto ==<span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> return;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">else <span style="color:#006600; font-weight:bold;">&#123;</span>cout &lt;&lt;<span style="color:#CC0000;">"ERRO 7: Parˆnteses desbalanceados! <span style="color:#000099; font-weight:bold;">\n</span>"</span>; xerro=<span style="color:#800000;color:#800000;">1</span>; return;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> else <span style="color:#006600; font-weight:bold;">&#123;</span>analizador_lexico<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;expressao<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://thiago.oxente.org/2006/10/09/trabalho-de-paradigmas-de-programacao/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Livro: Programação de Rede Unix</title>
		<link>http://thiago.oxente.org/2006/08/29/livro-programacao-de-rede-unix</link>
		<comments>http://thiago.oxente.org/2006/08/29/livro-programacao-de-rede-unix#comments</comments>
		<pubDate>Tue, 29 Aug 2006 19:54:37 +0000</pubDate>
		<dc:creator>Thiago Melo</dc:creator>
				<category><![CDATA[Assuntos Gerais]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programação]]></category>
		<category><![CDATA[Redes]]></category>

		<guid isPermaLink="false">http://thiago.killermonkeys.net/2006/08/29/livro-programacao-de-rede-unix/</guid>
		<description><![CDATA[Recentemente adquiri um livro para me ajudar nos estudo no uso de sockets no unix com C++.
Eu estava meio travado na tentativa de gerenciar as conexões dos clientes no servidor e terminar um simples chat assim como fiz no Delphi.
O livro parece ser excelente, e pelos comentários que vi pela internet é considerado a Biblia [...]]]></description>
			<content:encoded><![CDATA[<p>Recentemente adquiri um livro para me ajudar nos estudo no uso de sockets no unix com C++.<br />
Eu estava meio travado na tentativa de gerenciar as conexões dos clientes no servidor e terminar um simples chat assim como fiz no Delphi.</p>
<p>O livro parece ser excelente, e pelos comentários que vi pela internet é considerado a Biblia no desenvolvimento de uma API para soquetes de rede para UNIX.</p>
<p>Informaços do Livro:</p>
<p><span class="txtPretoBoldLivros">Título:</span>         	<span class="txtPretoLivros">Livro - Programação de Rede UNIX   </span>                                          	<span class="txtPretoBoldLivros"><br />
Título Original: </span><em>UNIX Network Programming</em><span class="txtPretoBoldLivros"><br />
</span>  <span class="txtPretoLivros"></span><span class="txtPretoBoldLivros">Subtítulo:</span>          	<span class="txtPretoLivros">API para Soquetes de Rede  </span>                                         	<span class="txtPretoBoldLivros"><br />
Autor:</span>         	<span class="txtPretoLivros"></span><span class="link-pequenoB">W. Richard Stevens</span>, <span class="link-pequenoB">Bill Fenner</span>, <span class="link-pequenoB">Andrew M. Rudoff</span>                                           	<span class="txtPretoBoldLivros"><br />
</span><span class="txtPretoLivros"> </span><span class="txtPretoBoldLivros">  Editora:</span>             <span class="txtPretoLivros">Artmed </span>                                          	<span class="txtPretoBoldLivros"></span><span class="txtPretoBoldLivros"><br />
ISBN:</span>              <span class="txtPretoLivros">8536304707 </span>                                         	<span class="txtPretoBoldLivros">Idioma:</span>         	<span class="txtPretoLivros">Português<br />
</span><span class="txtPretoBoldLivros">Tipo de Capa: </span>             <span class="txtPretoLivros">BROCHURA </span>                                          	<span class="txtPretoBoldLivros"><br />
Edição:</span>         	<span class="txtPretoLivros">1<br />
</span><span class="txtPretoBoldLivros">Número de Páginas: </span>         	<span class="txtPretoLivros">904 </span>                                <img width="1" height="10" src="http://images.americanas.com.br/Applications/BookStore/spacer.gif" /></p>
<p>Resenha:</p>
<p><em>  Para construir as aplicações e os serviços em rede altamente distribuídos de hoje, é preciso um profundo domínio sobre soquetes e outras APIs de rede fundamentais. Este livro oferece orientação abrangente, do começo ao fim, para construir sistemas de rede robustos e de alto desempenho em qualquer ambiente.<br />
O guia clássico para APIs de redes UNIX... agora completamente atualizado!</em><img src="http://images.americanas.com.br/produtos/item/184/6/184679g.gif" /></p>
<p>capa original:<br />
<img src="http://www.kohala.com/start/gifs/unpv12e.gif" /></p>
]]></content:encoded>
			<wfw:commentRss>http://thiago.oxente.org/2006/08/29/livro-programacao-de-rede-unix/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
