IVANNOSYS.java 2.3 KB

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