Skip to content

mauricio-ms/rinha-compilers

Repository files navigation

Rinha Compilers

./img/banner.png

Este é o meu projeto utilizando Java a ANTLR para participar da Rinha de Compiladores.

Building and Running

# Build the image
docker build -t rinha-compilers .

# Run
docker run rinha-compilers
 

AST example for Fibonacci program

let fib = fn (n) => {
  if (n < 2) {
    n
  } else {
    fib(n - 1) + fib(n - 2)
  }
};

print(fib(46))

./img/fib-ast.png

To Do

  • Remove escape chars in the print output
  • fix print \n
  • use labels in expressions with multiples derivations like term and try to remove the op and binop token labels
  • use -no-listener option in scripts to not generate listeners
  • analyze to use ParseTreeProperty<T>
  • define reserved words
  • create tests to make enhancements more safely

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages