IVANNOSYS.java 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package compiler;
  2. /*
  3. Verificar operacao unaria negacao valor em laco
  4. * To change this license header, choose License Headers in Project Properties.
  5. * To change this template file, choose Tools | Templates
  6. * and open the template in the editor.
  7. */
  8. import IntermediaryCode.BaseTacGen;
  9. import java.util.logging.Level;
  10. import java.util.logging.Logger;
  11. /**
  12. *
  13. * @author Eugenio
  14. */
  15. public class IVANNOSYS {
  16. protected static IvannosysCompiler compiler;
  17. /**
  18. * @param args the command line arguments
  19. */
  20. public static void main(String[] args) throws Exception {
  21. try {
  22. String cmd = "";
  23. if (args.length
  24. > 0) {
  25. cmd = args[0];
  26. }
  27. switch (cmd) {
  28. case "create":
  29. break;
  30. default:
  31. compiler = new IvannosysCompiler(
  32. "src\\samples\\program.go",
  33. "UTF-8",
  34. IvannosysCompiler.INPUT_FILE)
  35. // Especifica a classe de geração de codigo de tres enderecos
  36. .TacGen(new BaseTacGen())
  37. // Especifica a classe de geração de codigo alvo mips
  38. .RegisterTarget("mips", new target.mips.Gen())
  39. .include(".\\src\\samples")
  40. // Variavel de ambiente que indica o caminho do repositorio de includes
  41. .EnvPathVar("IVANPATH")
  42. // Extensao dos arquivos
  43. .setExtensionLibrary(".go")
  44. .setSetting("developement", "true")
  45. .setSetting("displayAst", "true")
  46. .setSetting("displayTac", "true")
  47. .setSetting("clearCode", "false")
  48. .setDisplayParserTree(false)
  49. .setDisplayErros(true)
  50. .Compile()
  51. .Simulate();
  52. }
  53. } catch (Exception ex) {
  54. Logger.getLogger(IVANNOSYS.class.getName()).log(Level.SEVERE, null, ex);
  55. }
  56. }
  57. }