Giter VIP home page Giter VIP logo

logcomp-compilador's Introduction

Status dos testes

git status

Diagrama sintático

Diagrama sintático

EBNF

BLOCK = { STATEMENT };
STATEMENT = ( λ | ASSIGNMENT | PRINT), "\n" ;
ASSIGNMENT = IDENTIFIER, "=", EXPRESSION ;
PRINT = "println", "(", EXPRESSION, ")" ;
EXPRESSION = TERM, { ("+" | "-"), TERM } ;
TERM = FACTOR, { ("*" | "/"), FACTOR } ;
FACTOR = (("+" | "-"), FACTOR) | NUMBER | "(", EXPRESSION, ")" | IDENTIFIER ;
IDENTIFIER = LETTER, { LETTER | DIGIT | "_" } ;
NUMBER = DIGIT, { DIGIT } ;
LETTER = ( a | ... | z | A | ... | Z ) ;
DIGIT = ( 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 ) ;

logcomp-compilador's People

Contributors

nicolascho avatar

Watchers

 avatar

logcomp-compilador's Issues

Problemas na v3.0.3

NicolasCho/LogComp-Compilador
teste1: falha
Timeout, teste demorou mais de 10.0 segundo para rodar, assumo que entrou em um loop infinito

Problemas na v3.0.4

NicolasCho/LogComp-Compilador
teste1: falha
Timeout, teste demorou mais de 10.0 segundo para rodar, assumo que entrou em um loop infinito

Problemas na v2.2.1

NicolasCho/LogComp-Compilador
teste5: falha
input do teste:



x1 = 3
  y_2_ = 4
println(x1+y_2_+1)

output esperado:
8

output recebido:

Mas algo saiu no stderror(que não deveria):
Traceback (most recent call last):
File "main.py", line 266, in
b = a.run(code)
File "main.py", line 243, in run
return self.parseBlock()
File "main.py", line 102, in parseBlock
self.tokenizer.selectNext()
File "main.py", line 46, in selectNext
next_token_literal, pos = self.run_tokenizer(self.source, self.position)
File "main.py", line 93, in run_tokenizer
raise Exception ("Unrecognizable character!")
Exception: Unrecognizable character!

teste26: falha
input do teste:




    if -1+2 == 3*1-2
        println(1)
    end


output esperado:
1

output recebido:

Mas algo saiu no stderror(que não deveria):
Traceback (most recent call last):
File "main.py", line 266, in
b = a.run(code)
File "main.py", line 243, in run
return self.parseBlock()
File "main.py", line 105, in parseBlock
statement_val = self.parseStatement()
File "main.py", line 141, in parseStatement
raise Exception("Syntax error")
Exception: Syntax error

Problemas na v3.0.5

NicolasCho/LogComp-Compilador
teste1: falha
Timeout, teste demorou mais de 10.0 segundo para rodar, assumo que entrou em um loop infinito

Problemas na v1.0.1

NicolasCho/LogComp-Compilador
teste11: falha
input do teste:


100 + 100 -  100+1                                               -101                  - 900

output esperado:
-900

output recebido:

Mas algo saiu no stderror(que não deveria):
Traceback (most recent call last):
File "main.py", line 97, in
b = a.run(sys.argv[1])
File "main.py", line 93, in run
return self.parseExpression()
File "main.py", line 82, in parseExpression
raise Exception("An operator can only be followed by a number")
Exception: An operator can only be followed by a number

Problemas na v3.0.2

NicolasCho/LogComp-Compilador
Mas algo saiu no stderror(que não deveria):
teste1.asm:111: error: label if_1" inconsistently redefined teste1.asm:92: note: label if_1" originally defined here
teste1.asm:121: error: label ELSE_1" inconsistently redefined teste1.asm:109: note: label ELSE_1" originally defined here
teste1.asm:124: error: label EXIT_1" inconsistently redefined teste1.asm:110: note: label EXIT_1" originally defined here
teste1.asm:142: error: label EXIT_1" inconsistently redefined teste1.asm:124: note: label EXIT_1" originally defined here

Problemas na v2.1.2

NicolasCho/LogComp-Compilador
teste16: falha
input do teste:


  3 = 2 + 1

não recebi nada de output!(stderr e stdout estão vazios e não deveriam)

Problemas na v2.3.2

NicolasCho/LogComp-Compilador
teste1: falha
input do teste:


  
    # v2.2 testing
     x_1::Int
    
    x_1 = readline()
    if ((x_1 > 1) && !(x_1 < 1)) 
        x_1 = 3
    
    else 
        
        x_1 = (-20+30)*4*3/40 # teste de comentario
        
    end
    println(x_1)
    x_1 = readline()
    if (x_1 > 1) && !(x_1 < 1)
        x_1 = 3
    else
        x_1 = (-20+30)*12/40


    end    
    println(x_1)
    while ((x_1 > 1) || (x_1 == 1)) 
        x_1 = x_1 - 1
        println(x_1)
    end
    

stdin do teste:
3
0
output esperado:
3
3
2
1
0

output recebido:

3

Mas algo saiu no stderror(que não deveria):
Traceback (most recent call last):
File "main.py", line 300, in
b.Evaluate()
File "/home/ubuntu/LogCompTester/Compilers/src/NicolasCho/LogComp-Compilador/ats.py", line 85, in Evaluate
child.Evaluate()
File "/home/ubuntu/LogCompTester/Compilers/src/NicolasCho/LogComp-Compilador/ats.py", line 78, in Evaluate
if self.children[1].Evaluate()[0] != symbol_table.table[self.children[0].value][0]:
File "/home/ubuntu/LogCompTester/Compilers/src/NicolasCho/LogComp-Compilador/ats.py", line 89, in Evaluate
return ("Int",int(input()))
EOFError: EOF when reading a line

Problemas na v3.0.1

NicolasCho/LogComp-Compilador
Mas algo saiu no stderror(que não deveria):
Traceback (most recent call last):
File "main.py", line 317, in
b.Evaluate()
File "/home/ubuntu/LogCompTester/Compilers/src/NicolasCho/LogComp-Compilador/ats.py", line 149, in Evaluate
child.Evaluate()
File "/home/ubuntu/LogCompTester/Compilers/src/NicolasCho/LogComp-Compilador/ats.py", line 175, in Evaluate
if len(self.children == 3): # Condição if/else presente
TypeError: object of type "bool" has no len()

Problemas na v2.3.1

NicolasCho/LogComp-Compilador
teste3: falha
input do teste:



  # All bool and int operations
  y::Int = 2
  z::Int  
  z = (y == 2)
  println(y+z)
  println(y-z)
  println(y*z)
  println(y/z)
  println(y == z)
  println(y < z)
  println(y > z)

output esperado:
3
1
2
2
0
0
1

output recebido:

3
1
2
2
False
False
True

teste4: falha
input do teste:



  # All str operations 
  a::String 
  b::String
  x_1::Int
  y::Int
  z::Int
  x_1 = 1 
  y = 1 
  z = 2
  a = "abc"
  b = "def"
  println(a.b)
  println(a.x_1)
  println(x_1.a)
  println(y.z)
  println(a.(x_1==1))
  println(a == a)
  println(a < b)
  println(a > b)

output esperado:
abcdef
abc1
1abc
12
abc1
1
1
0

output recebido:

abcdef
abc1
1abc
12
abcTrue
True
True
False

teste23: falha
input do teste:



   x::Int
   x::String


não recebi nada de output!(stderr e stdout estão vazios e não deveriam)

teste26: falha, não deu erro mais deveria (algo deveria ter saido no stderr)
input do teste:



   x::String
  x = readline()
  println(x+1)

stdin do teste:
2
teste32: falha
input do teste:



   x::Int
   x::Int

não recebi nada de output!(stderr e stdout estão vazios e não deveriam)

teste33: falha
input do teste:



   x::String
  x = "a"
   y::Int
  y = 1
  println(x==y)

output esperado:
0

output recebido:

Mas algo saiu no stderror(que não deveria):
Traceback (most recent call last):
File "main.py", line 300, in
b.Evaluate()
File "/home/ubuntu/LogCompTester/Compilers/src/NicolasCho/LogComp-Compilador/ats.py", line 81, in Evaluate
child.Evaluate()
File "/home/ubuntu/LogCompTester/Compilers/src/NicolasCho/LogComp-Compilador/ats.py", line 72, in Evaluate
print(self.children[0].Evaluate()[1])
File "/home/ubuntu/LogCompTester/Compilers/src/NicolasCho/LogComp-Compilador/ats.py", line 20, in Evaluate
raise Exception ("Incompatible types")
Exception: Incompatible types

Problemas na v1.2.1

NicolasCho/LogComp-Compilador
teste9: falha
input do teste:


100 + 100 -  100+1

output esperado:
101

output recebido:

Mas algo saiu no stderror(que não deveria):
Traceback (most recent call last):
File "main.py", line 141, in
b = a.run(sys.argv[1])
File "main.py", line 127, in run
return self.parseExpression()
File "main.py", line 84, in parseExpression
ret_val = self.parseTerm()
File "main.py", line 91, in parseTerm
val = self.parseFactor()
File "main.py", line 122, in parseFactor
raise Exception ("ERROR")
Exception: ERROR

teste10: falha
input do teste:


100 + 100 -  100+1                                               -101                  - 900

output esperado:
-900

output recebido:

Mas algo saiu no stderror(que não deveria):
Traceback (most recent call last):
File "main.py", line 141, in
b = a.run(sys.argv[1])
File "main.py", line 127, in run
return self.parseExpression()
File "main.py", line 84, in parseExpression
ret_val = self.parseTerm()
File "main.py", line 91, in parseTerm
val = self.parseFactor()
File "main.py", line 122, in parseFactor
raise Exception ("ERROR")
Exception: ERROR

teste18: falha
input do teste:


8  * 9 / 2

output esperado:
36

output recebido:

Mas algo saiu no stderror(que não deveria):
Traceback (most recent call last):
File "main.py", line 141, in
b = a.run(sys.argv[1])
File "main.py", line 127, in run
return self.parseExpression()
File "main.py", line 84, in parseExpression
ret_val = self.parseTerm()
File "main.py", line 91, in parseTerm
val = self.parseFactor()
File "main.py", line 122, in parseFactor
raise Exception ("ERROR")
Exception: ERROR

teste23: falha
input do teste:


2 # A /* 1 */ 2

output esperado:
2

output recebido:

Mas algo saiu no stderror(que não deveria):
Traceback (most recent call last):
File "main.py", line 141, in
b = a.run(sys.argv[1])
File "main.py", line 127, in run
return self.parseExpression()
File "main.py", line 79, in parseExpression
val = self.parseTerm()
File "main.py", line 93, in parseTerm
self.tokenizer.selectNext()
File "main.py", line 45, in selectNext
next_token_literal, pos = self.run_tokenizer(self.source, self.position)
File "main.py", line 62, in run_tokenizer
if self.is_digit(code[curr_char]):
IndexError: string index out of range

teste24: falha
input do teste:


1 #* A */ 1 /* A */

output esperado:
1

output recebido:

Mas algo saiu no stderror(que não deveria):
Traceback (most recent call last):
File "main.py", line 141, in
b = a.run(sys.argv[1])
File "main.py", line 127, in run
return self.parseExpression()
File "main.py", line 79, in parseExpression
val = self.parseTerm()
File "main.py", line 93, in parseTerm
self.tokenizer.selectNext()
File "main.py", line 45, in selectNext
next_token_literal, pos = self.run_tokenizer(self.source, self.position)
File "main.py", line 62, in run_tokenizer
if self.is_digit(code[curr_char]):
IndexError: string index out of range

teste27: falha
input do teste:


1 # A

output esperado:
1

output recebido:

Mas algo saiu no stderror(que não deveria):
Traceback (most recent call last):
File "main.py", line 141, in
b = a.run(sys.argv[1])
File "main.py", line 127, in run
return self.parseExpression()
File "main.py", line 79, in parseExpression
val = self.parseTerm()
File "main.py", line 93, in parseTerm
self.tokenizer.selectNext()
File "main.py", line 45, in selectNext
next_token_literal, pos = self.run_tokenizer(self.source, self.position)
File "main.py", line 62, in run_tokenizer
if self.is_digit(code[curr_char]):
IndexError: string index out of range

teste35: falha, não deu erro mais deveria (algo deveria ter saido no stderr)
input do teste:


1+1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.