package edu.gac.max.mcs388.s2003.c3; import java_cup.runtime.Symbol; class Main { static public void main(String[] args) throws Exception{ parser parser_obj = new parser(); Symbol parse_tree; if (args.length == 1) // real dumb option parsing! parse_tree = parser_obj.debug_parse(); else parse_tree = parser_obj.parse(); Proc main_proc = (Proc) parse_tree.value; output_print_int(); System.out.print(main_proc.gen()); } static private void output_print_int(){ System.out.println("\t.data"); System.out.println("print_int_newline: "); System.out.println("\t.asciiz \"\\n\""); System.out.println("\t.text"); System.out.println("print_int: "); System.out.println("\tli $v0, 1"); System.out.println("\tsyscall"); System.out.println("\tla $a0, print_int_newline"); System.out.println("\tli $v0, 4"); System.out.println("\tsyscall"); System.out.println("\tjr $ra"); } }