Skip to content

Commit

Permalink
Adicionada mensagem de sucesso
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsgeneroso committed May 21, 2018
1 parent 6a31bc4 commit 2251a07
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 92 deletions.
5 changes: 3 additions & 2 deletions samples/Exemplo1.lms
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ var
var
a :integer;
begin
a:=2000;
a:=200000;
readln(a);
if a=x then
z:=z+x
else begin
z:=z-x;
call p;
end;
(* comentario integer *)
(* comentario integer .*)
end;
begin
z:=0;
Expand All @@ -25,4 +25,5 @@ begin
writeln(z);
end.



20 changes: 12 additions & 8 deletions samples/Exemplo2.lms
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ PROGRAM TESTE123;
array_a : ARRAY[0..20] OF INTEGER;
array_b, array_c, array_d : ARRAY[0..1000] OF INTEGER;

(*Declaração de procedure, inicia novo bloco*)
(*Declarao de procedure, inicia novo bloco*)
PROCEDURE p_teste(idd : INTEGER);
LABEL
label_a, label_b;

CONST
(*A constante não aceita valores negativos*)
(*A constante no aceita valores negativos*)
a = 100;
b = 200;

Expand All @@ -30,15 +30,10 @@ PROGRAM TESTE123;

END;

(*
- Início do bloco principal
- Verificar, porque em alguns casos não é exigido o ; no final da expressão.
*)

BEGIN
x := 150;
begin
x := 20;
x := 20000;
end;

(*Chama a procedure*)
Expand Down Expand Up @@ -78,3 +73,12 @@ BEGIN
30 : BEGIN END
END;
END.









2 changes: 2 additions & 0 deletions src/net/unesc/hal/compiler/Lexicon.java
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ private void run() {
}
if (is_comment_loop || is_literal_loop) {
literal_count++;
if(cur_char != null)
System.out.println(cur_char.getChar());
cur_char = chars.get(++car);
buffer.clear();
}
Expand Down
2 changes: 1 addition & 1 deletion src/net/unesc/hal/compiler/Syntactic.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private void run() {
// Busca a derivação correspondente aos códigos
public ArrayList getParsing(int c1, int c2) {

System.out.println(c1 + "|" + c2);
//System.out.println(c1 + "|" + c2);
String der = parsing.get(c1 + "|" + c2);
ArrayList derivation;
if (der != null) {
Expand Down
2 changes: 1 addition & 1 deletion src/net/unesc/hal/data/Char.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void setEndFile(boolean value){

@Override
public String toString() {
return character.toString();
return (character != null) ? character.toString() : "";
}

public boolean isSymbol() {
Expand Down
2 changes: 0 additions & 2 deletions src/net/unesc/hal/languages/HAL.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package net.unesc.hal.languages;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import net.unesc.hal.data.Token;

public class HAL implements Language {
Expand Down
Binary file added src/net/unesc/hal/resources/check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions src/net/unesc/hal/utils/File.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package net.unesc.hal.utils;

import java.awt.Component;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
Expand Down Expand Up @@ -38,7 +37,7 @@ public static String write(String str, Editor comp, String path) throws FileNotF
arq = new FileOutputStream(f);

try {
ps = new PrintStream(arq);
ps = new PrintStream(arq, true, "UTF-8");
ps.println(str);

return path;
Expand Down
15 changes: 10 additions & 5 deletions src/net/unesc/hal/views/Editor.form
Original file line number Diff line number Diff line change
Expand Up @@ -524,11 +524,11 @@
</Property>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Erro">
<TitledBorder justification="1" position="1" title="Sa&#xed;da">
<Border PropertyName="innerBorder" info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
<EmptyBorder/>
<EmptyBorder bottom="2" left="2" right="2" top="2"/>
</Border>
<Font PropertyName="font" name="Segoe UI" size="14" style="0"/>
<Font PropertyName="font" name="SansSerif" size="14" style="0"/>
<Color PropertyName="color" blue="ff" green="ff" red="ff" type="rgb"/>
</TitledBorder>
</Border>
Expand All @@ -551,7 +551,7 @@
</Constraints>

<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout">
<Property name="axis" type="int" value="3"/>
<Property name="axis" type="int" value="1"/>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="spErrors">
Expand All @@ -566,8 +566,11 @@
<EmptyBorder/>
</Border>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 15]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[168, 100]"/>
<Dimension value="[164, 100]"/>
</Property>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
Expand All @@ -580,7 +583,9 @@
<Component class="javax.swing.JTextArea" name="txaErrors">
<Properties>
<Property name="columns" type="int" value="20"/>
<Property name="lineWrap" type="boolean" value="true"/>
<Property name="rows" type="int" value="5"/>
<Property name="wrapStyleWord" type="boolean" value="true"/>
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
<Color id="Cursor Padr&#xe3;o"/>
</Property>
Expand Down
Loading

0 comments on commit 2251a07

Please sign in to comment.