core: import java.lang.*; import java.io.*; import edu.neu.ccs.demeter.dj.*; import java.util.*; import edu.neu.ccs.demeter.*; add: class Month { protected int month; public int get_month() {{ return month; }} public void set_month(int new_month) {{ month = new_month; }} public constructor Month() {{ super(); }} public constructor Month(int month) {{ super(); set_month(month); }} public static Month parse(java.io.Reader in) throws ParseException {{ return new Parser(in)._Month(); }} public static Month parse(java.io.InputStream in) throws ParseException {{ return new Parser(in)._Month(); }} public static Month parse(String s) {{ try { return parse(new java.io.StringReader(s)); } catch (ParseException e) { throw new RuntimeException(e.toString()); } }} public static Month prompt(String prompt) {{ /* This function will get a new month from the user input: prompt - a string to prompt the user output: a new Month object */ int returnMonthVal = 0; //the int value of the month boolean valid = false; //flag tells if the given month is valid while (!valid){ returnMonthVal = Main.promptInt(prompt); valid = (returnMonthVal > 0 && returnMonthVal < 13); } Month returnMonth = new Month(returnMonthVal); return returnMonth; }} {{ void universal_trv0_bef(UniversalVisitor _v_) { ((UniversalVisitor) _v_).before(this); } }} {{ void universal_trv0_aft(UniversalVisitor _v_) { ((UniversalVisitor) _v_).after(this); } }} {{ void universal_trv0(UniversalVisitor _v_) { universal_trv0_bef(_v_); ((UniversalVisitor) _v_).before_month(this, month); ((UniversalVisitor) _v_).after_month(this, month); universal_trv0_aft(_v_); } }} {{ void everything_Bank_trv_bef(PrintVisitor __v0) { ((UniversalVisitor) __v0).before(this); } }} {{ void everything_Bank_trv_aft(PrintVisitor __v0) { ((UniversalVisitor) __v0).after(this); } }} {{ void everything_Bank_trv(PrintVisitor __v0) { everything_Bank_trv_bef(__v0); ((PrintVisitor) __v0).before_month(this, month); ((UniversalVisitor) __v0).after_month(this, month); everything_Bank_trv_aft(__v0); } }} {{ void __trav_print_Bank_trv_bef(PrintVisitor __v0) { ((UniversalVisitor) __v0).before(this); } }} {{ void __trav_print_Bank_trv_aft(PrintVisitor __v0) { ((UniversalVisitor) __v0).after(this); } }} {{ void __trav_print_Bank_trv(PrintVisitor __v0) { __trav_print_Bank_trv_bef(__v0); ((PrintVisitor) __v0).before_month(this, month); ((UniversalVisitor) __v0).after_month(this, month); __trav_print_Bank_trv_aft(__v0); } }} {{ void __trav_display_Bank_trv_bef(DisplayVisitor __v0) { ((DisplayVisitor) __v0).before(this); } }} {{ void __trav_display_Bank_trv_aft(DisplayVisitor __v0) { ((DisplayVisitor) __v0).after(this); } }} {{ void __trav_display_Bank_trv(DisplayVisitor __v0) { __trav_display_Bank_trv_bef(__v0); ((DisplayVisitor) __v0).before_month(this, month); ((UniversalVisitor) __v0).after_month(this, month); __trav_display_Bank_trv_aft(__v0); } }} {{ void __trav_viewParty_Party_trv_bef(PrintVisitor __v0) { ((UniversalVisitor) __v0).before(this); } }} {{ void __trav_viewParty_Party_trv_aft(PrintVisitor __v0) { ((UniversalVisitor) __v0).after(this); } }} {{ void __trav_viewParty_Party_trv(PrintVisitor __v0) { __trav_viewParty_Party_trv_bef(__v0); ((PrintVisitor) __v0).before_month(this, month); ((UniversalVisitor) __v0).after_month(this, month); __trav_viewParty_Party_trv_aft(__v0); } }} {{ void __trav_viewPosting_Posting_trv_bef(PrintVisitor __v0) { ((UniversalVisitor) __v0).before(this); } }} {{ void __trav_viewPosting_Posting_trv_aft(PrintVisitor __v0) { ((UniversalVisitor) __v0).after(this); } }} {{ void __trav_viewPosting_Posting_trv(PrintVisitor __v0) { __trav_viewPosting_Posting_trv_bef(__v0); ((PrintVisitor) __v0).before_month(this, month); ((UniversalVisitor) __v0).after_month(this, month); __trav_viewPosting_Posting_trv_aft(__v0); } }} }