package temp;
import java.io.*;

import org.antlr.runtime.*;

import temp.testLexer;
import temp.testParser;



//import temp.testParser.model_return;


public class Sim2bip_out {
	public static void main(String[] args) throws IOException, RecognitionException
	{
		//String s=args[0];
		String s="enable_export";

		//InputStream in = new FileInputStream(s);//("ex_2_trig_subsub.mdl");
		InputStream in = new FileInputStream("models/"+s+'/'+s+".mdl");
	    ANTLRInputStream input = new ANTLRInputStream(in);
		
	    testLexer lexer = new testLexer(input);
        CommonTokenStream tokens = new CommonTokenStream(lexer);
        testParser parser = new testParser(tokens);
        
        Model model= parser.model();
        System.out.println(model.model_name);
        
        PrintStream out = new PrintStream(new FileOutputStream("models/"+s+'/'+model.model_name+".bip"));
        //PrintStream out = new PrintStream(new FileOutputStream(model.model_name+".bip"));
        
        model.translate(out,model.model_name);
	}

}
