-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/IcaroRios/Compilador
- Loading branch information
Showing
18 changed files
with
353 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,3 @@ comentario em bloco | |
|
||
*/ | ||
/ || && >= != //comentario de linha na linha dos operadores | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<reservada - program> | ||
<reservada - var> | ||
<reservada - begin> | ||
<reservada - real> | ||
<identificador - raio> | ||
<delimitador - ;> | ||
<reservada - end> | ||
<reservada - function> | ||
<identificador - area_circulo> | ||
<delimitador - (> | ||
<reservada - real> | ||
<identificador - raio> | ||
<delimitador - )> | ||
<delimitador - :> | ||
<reservada - real> | ||
<reservada - begin> | ||
<reservada - return> | ||
<identificador - raio> | ||
<delimitador - ;> | ||
<reservada - end> | ||
<reservada - begin> | ||
<reservada - write> | ||
<delimitador - (> | ||
<cadeia_de_caracteres - "Digite o valor do raio"> | ||
<delimitador - )> | ||
<delimitador - ;> | ||
<reservada - read> | ||
<delimitador - (> | ||
<identificador - raio> | ||
<delimitador - )> | ||
<delimitador - ;> | ||
<reservada - write> | ||
<delimitador - (> | ||
<cadeia_de_caracteres - "A area do circulo eh "> | ||
<delimitador - ,> | ||
<identificador - area_circulo> | ||
<delimitador - (> | ||
<identificador - raio> | ||
<delimitador - )> | ||
<delimitador - )> | ||
<delimitador - ;> | ||
<reservada - end> | ||
|
||
SUCESSO NA ANALISE LEXICA DO ARQUIVO: area_circ.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
<reservada - program> | ||
<reservada - var> | ||
<reservada - begin> | ||
<reservada - integer> | ||
<identificador - fat> | ||
<delimitador - ,> | ||
<identificador - m> | ||
<delimitador - [> | ||
<numero - 2> | ||
<delimitador - ]> | ||
<delimitador - ;> | ||
<reservada - end> | ||
<reservada - const> | ||
<reservada - begin> | ||
<reservada - integer> | ||
<identificador - c1> | ||
<delimitador - ;> | ||
<reservada - end> | ||
<reservada - function> | ||
<identificador - fatorial> | ||
<delimitador - (> | ||
<reservada - integer> | ||
<identificador - n> | ||
<delimitador - ,> | ||
<reservada - real> | ||
<identificador - a> | ||
<delimitador - )> | ||
<delimitador - :> | ||
<reservada - integer> | ||
<reservada - begin> | ||
<reservada - var> | ||
<reservada - begin> | ||
<reservada - integer> | ||
<identificador - k> | ||
<delimitador - ,> | ||
<identificador - fat> | ||
<delimitador - ;> | ||
<reservada - end> | ||
<reservada - if> | ||
<delimitador - (> | ||
<identificador - k> | ||
<operador_relacional - >> | ||
<numero - 1> | ||
<delimitador - )> | ||
<reservada - then> | ||
<reservada - begin> | ||
<identificador - k> | ||
<operador_de_atribuicao - => | ||
<identificador - n> | ||
<operador_aritmetico - *> | ||
<identificador - fatorial> | ||
<delimitador - (> | ||
<identificador - n> | ||
<operador_aritmetico - -> | ||
<numero - 1> | ||
<delimitador - )> | ||
<delimitador - ;> | ||
<reservada - return> | ||
<identificador - k> | ||
<delimitador - ;> | ||
<reservada - end> | ||
<reservada - else> | ||
<reservada - begin> | ||
<identificador - k> | ||
<operador_de_atribuicao - => | ||
<caractere - 'a'> | ||
<delimitador - ;> | ||
<reservada - return> | ||
<identificador - k> | ||
<delimitador - ;> | ||
<reservada - end> | ||
<reservada - return> | ||
<identificador - k> | ||
<delimitador - ;> | ||
<reservada - end> | ||
<reservada - function> | ||
<identificador - f> | ||
<delimitador - (> | ||
<delimitador - )> | ||
<delimitador - :> | ||
<reservada - real> | ||
<reservada - begin> | ||
<reservada - return> | ||
<identificador - fat> | ||
<delimitador - ;> | ||
<reservada - end> | ||
<reservada - begin> | ||
<reservada - write> | ||
<delimitador - (> | ||
<cadeia_de_caracteres - "Digite o numero para calcular o fatorial."> | ||
<delimitador - )> | ||
<delimitador - ;> | ||
<reservada - read> | ||
<delimitador - (> | ||
<identificador - m> | ||
<delimitador - )> | ||
<delimitador - ;> | ||
<identificador - fat> | ||
<operador_de_atribuicao - => | ||
<identificador - fatorial> | ||
<delimitador - (> | ||
<delimitador - )> | ||
<delimitador - ;> | ||
<reservada - while> | ||
<delimitador - (> | ||
<delimitador - (> | ||
<numero - 3> | ||
<operador_aritmetico - -> | ||
<numero - 1> | ||
<delimitador - )> | ||
<operador_relacional - <> | ||
<delimitador - (> | ||
<numero - 2> | ||
<operador_aritmetico - +> | ||
<numero - 1> | ||
<delimitador - )> | ||
<delimitador - )> | ||
<reservada - do> | ||
<reservada - begin> | ||
<reservada - end> | ||
<reservada - write> | ||
<delimitador - (> | ||
<identificador - fat> | ||
<delimitador - )> | ||
<delimitador - ;> | ||
<reservada - end> | ||
|
||
SUCESSO NA ANALISE LEXICA DO ARQUIVO: fatorial.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SUCESSO NA ANALISE SEMANTICA DO ARQUIVO: area_circ.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SUCESSO NA ANALISE SEMANTICA DO ARQUIVO: fatorial.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SUCESSO NA ANALISE SINTATICA DO ARQUIVO: area_circ.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SUCESSO NA ANALISE SINTATICA DO ARQUIVO: fatorial.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,38 @@ | ||
program | ||
|
||
var begin | ||
integer fat, m[2] = [2,3,2,4]; | ||
integer fat, m[2]; | ||
end | ||
|
||
const begin | ||
integer c1; | ||
end | ||
|
||
function fatorial(integer n) : integer | ||
function fatorial(integer n, real a) : integer | ||
begin | ||
var begin | ||
integer k, fat; | ||
end | ||
if(n > 1) then begin | ||
k = n*fatorial(n-1); | ||
return k; | ||
end else begin | ||
var begin | ||
integer k, fat; | ||
end | ||
if(k>1) then begin | ||
k = n*fatorial(n-1); | ||
return k; | ||
end else begin | ||
k = 'a'; | ||
return k; | ||
end | ||
|
||
return k; | ||
return k; | ||
end | ||
return k; | ||
end | ||
|
||
|
||
function f() : real | ||
begin | ||
return fat; | ||
end | ||
|
||
begin | ||
write("Digite o numero para calcular o fatorial."); | ||
read(m); | ||
fat = fatorial(); | ||
while((3-1) > (2+1)) do begin | ||
write("Digite o numero para calcular o fatorial."); | ||
read(m); | ||
fat = fatorial(); | ||
while((3-1) < (2+1)) do begin | ||
|
||
end | ||
write(fat); | ||
write(fat); | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.