IVANNOSYS.java 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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.IRGenerator;
  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. // "src\\samples\\program.go",
  34. // "src\\samples\\program_mult_manycore.go",
  35. // "src\\samples\\program_mult_jon.go",
  36. // "src\\samples\\program_mult.go",
  37. "src\\samples\\program_jun_bit_count.go",
  38. "UTF-8",
  39. IvannosysCompiler.INPUT_FILE)
  40. // Especifica a classe de geração de codigo de tres enderecos
  41. .TacGen(new IRGenerator())
  42. // Especifica a classe de geração de codigo alvo mips
  43. .RegisterTarget("mips", new target.mips.Gen())
  44. .RegisterTarget("mipsjun", new target.mips.jun.Gen())
  45. .include(".\\src\\samples")
  46. // Variavel de ambiente que indica o caminho do repositorio de includes
  47. .EnvPathVar("IVANPATH")
  48. // Extensao dos arquivos
  49. .setExtensionLibrary(".go")
  50. .SetOption("developement", "true")
  51. .SetOption("displayAst", "true")
  52. .SetOption("displayTac", "true")
  53. .SetOption("clearCode", "false")
  54. .setDisplayParserTree(false)
  55. .setDisplayErros(true)
  56. .Compile();
  57. }
  58. } catch (Exception ex) {
  59. Logger.getLogger(IVANNOSYS.class.getName()).log(Level.SEVERE, null, ex);
  60. }
  61. }
  62. }