package compiler;

/*
 Verificar operacao unaria negacao valor em laco
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
import IntermediaryCode.BaseTacGen;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Eugenio
 */
public class IVANNOSYS {

    protected static IvannosysCompiler compiler;

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception {

        try {
            String cmd = "";
            if (args.length
                    > 0) {
                cmd = args[0];
            }
            switch (cmd) {
                case "create":
                    break;
                default:
                    compiler = new IvannosysCompiler(
                            "src\\samples\\program.go",
                            "UTF-8",
                            IvannosysCompiler.INPUT_FILE)
                            // Especifica a classe de geração de codigo de tres enderecos
                            .TacGen(new BaseTacGen())
                            // Especifica a classe de geração de codigo alvo mips
                            .RegisterTarget("mips", new target.mips.Gen())
                            .include(".\\src\\samples")
                            // Variavel de ambiente que indica o caminho do repositorio de includes
                            .EnvPathVar("IVANPATH")
                            // Extensao dos arquivos 
                            .setExtensionLibrary(".go")
                            .setSetting("developement", "true")
                            .setSetting("displayAst", "true")
                            .setSetting("displayTac", "true")
                            .setSetting("clearCode", "false")
                            .setDisplayParserTree(false)
                            .setDisplayErros(true)
                            .Compile();
            }

        } catch (Exception ex) {
            Logger.getLogger(IVANNOSYS.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
