-
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.
- Loading branch information
Showing
22 changed files
with
466 additions
and
133 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
103 changes: 103 additions & 0 deletions
103
...hup.jvisualg.examples/src/main/resources/dev/thihup/jvisualg/examples/custom/coverage.alg
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,103 @@ | ||
algoritmo "coverage" | ||
|
||
arquivo "inexistente" | ||
|
||
procedimento referencia(var x: logico) | ||
inicio | ||
x <- verdadeiro | ||
fimprocedimento | ||
|
||
funcao narrowArguments(x: inteiro): inteiro | ||
inicio | ||
retorne x | ||
fimfuncao | ||
|
||
funcao widenArguments(x: real): real | ||
inicio | ||
retorne x | ||
fimfuncao | ||
|
||
var | ||
|
||
arrayInteiro: vetor[1..10] de inteiro | ||
matrizInteiro: vetor[1..2,1..2] de inteiro | ||
|
||
arrayReal: vetor[1..10] de real | ||
matrizReal: vetor[1..2,1..2] de real | ||
|
||
|
||
arrayLogico: vetor[1..10] de logico | ||
matrizLogico: vetor[1..2,1..2] de logico | ||
|
||
|
||
arrayCaracter: vetor[1..10] de caracter | ||
matrizCaracter: vetor[1..2,1..2] de caracter | ||
|
||
|
||
flutuante: real | ||
|
||
meuInteiro: inteiro | ||
meuReal: real | ||
meuCaracter: caracter | ||
meuLogico: logico | ||
|
||
inicio | ||
|
||
aleatorio on | ||
|
||
mudaCor("VERMELHO", "FRENTE") | ||
mudaCor("Amarelo", "FUNDOS") | ||
mudaCor("azul", "FRENTE") | ||
mudaCor("branco", "FUNDOS") | ||
mudaCor("preto", "FUNDOS") | ||
mudaCor("verde", "FUNDOS") | ||
|
||
flutuante <- pi | ||
meuInteiro <- narrowArguments(flutuante) | ||
escreval(meuInteiro) | ||
|
||
meuReal <- widenArguments(12) | ||
escreval(meuReal) | ||
meuReal <- widenArguments(meuInteiro) | ||
|
||
leia(arrayInteiro[1]) | ||
leia(matrizInteiro[1,2]) | ||
|
||
escreval(arrayInteiro[1]) | ||
escreval(matrizInteiro[1,2]) | ||
|
||
arrayInteiro[1] <- 5 | ||
matrizInteiro[1,2] <- 10 | ||
|
||
arrayReal[1] <- arrayInteiro[1] | ||
matrizReal[1, 2] <- arrayInteiro[1] | ||
|
||
meuReal <- 2 ^ 5 | ||
|
||
debug 1 < 1 | ||
|
||
referencia(meuLogico) | ||
|
||
escreval(+meuInteiro) | ||
escreval(+meuReal) | ||
|
||
escolha arrayInteiro[1] faca | ||
caso 4 | ||
escreval("Nao aparecer") | ||
caso 5 | ||
escreval("Apareci") | ||
fimescolha | ||
|
||
escolha matrizInteiro[1,2] faca | ||
caso 1 ate 3 | ||
escreval("Nao aparecer") | ||
caso 4 ate 10 | ||
escreval("Apareci") | ||
fimescolha | ||
|
||
leia(meuCaracter) | ||
leia(meuLogico) | ||
leia(meuInteiro) | ||
leia(meuReal) | ||
|
||
fimalgoritmo |
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
11 changes: 11 additions & 0 deletions
11
...g.examples/src/main/resources/dev/thihup/jvisualg/examples/errors/assignment/argument.alg
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,11 @@ | ||
algoritmo "erro argumento procedimento" | ||
|
||
procedimento proc(teste: inteiro) | ||
inicio | ||
fimprocedimento | ||
|
||
inicio | ||
|
||
proc("a") | ||
|
||
fimalgoritmo |
10 changes: 10 additions & 0 deletions
10
...ualg.examples/src/main/resources/dev/thihup/jvisualg/examples/errors/assignment/array.alg
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,10 @@ | ||
algoritmo "erro atribuicao" | ||
|
||
var | ||
teste: vetor[1..1] de inteiro | ||
|
||
inicio | ||
|
||
teste[1] <- "a" | ||
|
||
fimalgoritmo |
10 changes: 10 additions & 0 deletions
10
...examples/src/main/resources/dev/thihup/jvisualg/examples/errors/assignment/assignment.alg
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,10 @@ | ||
algoritmo "erro atribuicao" | ||
|
||
var | ||
teste: inteiro | ||
|
||
inicio | ||
|
||
teste <- "a" | ||
|
||
fimalgoritmo |
10 changes: 10 additions & 0 deletions
10
....jvisualg.examples/src/main/resources/dev/thihup/jvisualg/examples/errors/index/index.alg
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,10 @@ | ||
algoritmo "erro argumento procedimento" | ||
|
||
var | ||
x: vetor[1..2] de inteiro | ||
|
||
inicio | ||
|
||
escreval(x[5]) | ||
|
||
fimalgoritmo |
7 changes: 7 additions & 0 deletions
7
...lg.examples/src/main/resources/dev/thihup/jvisualg/examples/errors/invalidOperand/add.alg
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,7 @@ | ||
algoritmo "erro add logico" | ||
|
||
inicio | ||
|
||
escreval(verdadeiro + "s") | ||
|
||
fimalgoritmo |
7 changes: 7 additions & 0 deletions
7
...xamples/src/main/resources/dev/thihup/jvisualg/examples/errors/notfound/function/func.alg
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,7 @@ | ||
algoritmo "erro funcao nao existe" | ||
|
||
inicio | ||
|
||
escreval(oi()) | ||
|
||
fimalgoritmo |
7 changes: 7 additions & 0 deletions
7
...amples/src/main/resources/dev/thihup/jvisualg/examples/errors/notfound/procedure/proc.alg
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,7 @@ | ||
algoritmo "erro procedimento nao existe" | ||
|
||
inicio | ||
|
||
oi() | ||
|
||
fimalgoritmo |
7 changes: 7 additions & 0 deletions
7
...g.examples/src/main/resources/dev/thihup/jvisualg/examples/errors/notfound/type/array.alg
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,7 @@ | ||
algoritmo "erro tipo nao existe" | ||
|
||
var | ||
x: vetor[1..1] de inexistente | ||
inicio | ||
|
||
fimalgoritmo |
7 changes: 7 additions & 0 deletions
7
...lg.examples/src/main/resources/dev/thihup/jvisualg/examples/errors/notfound/type/type.alg
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,7 @@ | ||
algoritmo "erro tipo nao existe" | ||
|
||
var | ||
x: inexistente | ||
inicio | ||
|
||
fimalgoritmo |
7 changes: 7 additions & 0 deletions
7
...s/src/main/resources/dev/thihup/jvisualg/examples/errors/notfound/variable/assignment.alg
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,7 @@ | ||
algoritmo "erro variavel nao existe" | ||
|
||
inicio | ||
|
||
oi <- 5 | ||
|
||
fimalgoritmo |
7 changes: 7 additions & 0 deletions
7
...examples/src/main/resources/dev/thihup/jvisualg/examples/errors/notfound/variable/var.alg
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,7 @@ | ||
algoritmo "erro variavel nao existe" | ||
|
||
inicio | ||
|
||
escreval(oi) | ||
|
||
fimalgoritmo |
7 changes: 7 additions & 0 deletions
7
...mples/src/main/resources/dev/thihup/jvisualg/examples/errors/unsupported/stdfunctions.alg
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,7 @@ | ||
algoritmo "erro dentro funcao padrao" | ||
|
||
inicio | ||
|
||
escreval(randi(-1)) | ||
|
||
fimalgoritmo |
11 changes: 11 additions & 0 deletions
11
...mples/src/main/resources/dev/thihup/jvisualg/examples/errors/wrongArguments/arguments.alg
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,11 @@ | ||
algoritmo "erro argumento procedimento" | ||
|
||
procedimento proc(teste: inteiro; foo: real) | ||
inicio | ||
fimprocedimento | ||
|
||
inicio | ||
|
||
proc("a") | ||
|
||
fimalgoritmo |
8 changes: 8 additions & 0 deletions
8
...s/src/main/resources/dev/thihup/jvisualg/examples/errors/wrongArguments/funcoesPadrao.alg
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,8 @@ | ||
algoritmo "erro procedimento funcao abs" | ||
|
||
|
||
inicio | ||
|
||
escreval(abs(-30,20)) | ||
|
||
fimalgoritmo |
10 changes: 10 additions & 0 deletions
10
...xamples/src/main/resources/dev/thihup/jvisualg/examples/errors/wrongArguments/mudaCor.alg
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,10 @@ | ||
algoritmo "erro procedimento mudacor" | ||
|
||
|
||
inicio | ||
|
||
mudaCor("aaa", "fundos") | ||
mudaCor("vermelho", "aaa") | ||
mudaCor("a") | ||
|
||
fimalgoritmo |
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.