// ** This class was generated with DemFGen (vers:06/04/2009) package gen; import edu.neu.ccs.demeterf.control.Fields; import edu.neu.ccs.demeterf.demfgen.lib.ident; import edu.neu.ccs.demeterf.demfgen.lib.verbatim; import edu.neu.ccs.demeterf.demfgen.lib.*; import edu.neu.ccs.demeterf.demfgen.lib.*; import edu.neu.ccs.demeterf.demfgen.lib.*; import edu.neu.ccs.demeterf.demfgen.lib.*; /** Computes a nested String representation with field names and values */ public class Display extends edu.neu.ccs.demeterf.ID{ /** Static stub method for calling display */ public static String DisplayM(Object o){ return new edu.neu.ccs.demeterf.Traversal(new Display(),edu.neu.ccs.demeterf.Control.builtins()).traverse(o," "); } public String combine(byte _h_){ return ": byte "+""+_h_; } public String combine(short _h_){ return ": short "+""+_h_; } public String combine(int _h_){ return ": int "+""+_h_; } public String combine(long _h_){ return ": long "+""+_h_; } public String combine(float _h_){ return ": float "+""+_h_; } public String combine(double _h_){ return ": double "+""+_h_; } public String combine(char _h_){ return ": char "+"\'"+escape(""+_h_)+"\'"; } public String combine(boolean _h_){ return ": boolean "+""+_h_; } public String combine(String _h_){ return ": String "+"\""+escape(""+_h_)+"\""; } public String combine(ident _h_){ return ": ident "+""+_h_; } public String combine(verbatim _h_){ return ": verbatim "+""+_h_; } public String update(Object o, Fields.any f, String d){ return d+" "; } public static String escape(String s){ char str[] = s.toCharArray(); StringBuffer ret = new StringBuffer(""); for(char c:str)ret.append(escape(c)); return ret.toString(); } public static String escape(char c){ switch(c){ case '\n':return "\\n"; case '\t':return "\t"; case '\b':return "\\b"; case '\r':return "\r"; case '\f':return "\\f"; case '\\':return "\\"; case '\'':return "\\'"; case '\"':return "\\\""; default: return ""+c; } } public String combine(Type _h_, String kind, String instances, String _d_){ return ": Type ("+"\n"+_d_+" "+kind+"\n"+_d_+" "+instances+" )"; } public String combine(Classic _h_, String _d_){ return ": Classic ("+" )"; } public String combine(Secret _h_, String _d_){ return ": Secret ("+" )"; } public String combine(TypeInstance _h_, String r, String _d_){ return ": TypeInstance ("+"\n"+_d_+" "+r+" )"; } public String combine(Solution _h_, String assignment, String _d_){ return ": Solution ("+"\n"+_d_+" "+assignment+" )"; } public String combine(ChallengeInstance _h_, String cs, String secret, String _d_){ return ": ChallengeInstance ("+"\n"+_d_+" "+cs+"\n"+_d_+" "+secret+" )"; } public String combine(SecretOfChallenge _h_, String assign, String quality, String _d_){ return ": SecretOfChallenge ("+"\n"+_d_+" "+assign+"\n"+_d_+" "+quality+" )"; } public String combine(Constraint _h_, String w, String r, String vs, String _d_){ return ": Constraint ("+"\n"+_d_+" "+w+"\n"+_d_+" "+r+"\n"+_d_+" "+vs+" )"; } public String combine(Weight _h_, String v, String _d_){ return ": Weight ("+"\n"+_d_+" "+v+" )"; } public String combine(RelationNr _h_, String v, String _d_){ return ": RelationNr ("+"\n"+_d_+" "+v+" )"; } public String combine(Variable _h_, String v, String _d_){ return ": Variable ("+"\n"+_d_+" "+v+" )"; } public String combine(Predicate _h_, String pred, String _d_){ return ": Predicate ("+"\n"+_d_+" "+pred+" )"; } public String combine(Assignment _h_, String literals, String _d_){ return ": Assignment ("+"\n"+_d_+" "+literals+" )"; } public String combine(Literal _h_, String value, String var, String _d_){ return ": Literal ("+"\n"+_d_+" "+value+"\n"+_d_+" "+var+" )"; } public String combine(Pos _h_, String _d_){ return ": Pos ("+" )"; } public String combine(Neg _h_, String _d_){ return ": Neg ("+" )"; } public String combine(Price _h_, String val, String _d_){ return ": Price ("+"\n"+_d_+" "+val+" )"; } public String combine(Quality _h_, String val, String _d_){ return ": Quality ("+"\n"+_d_+" "+val+" )"; } public String combine(PlayerID _h_, String id, String _d_){ return ": PlayerID ("+"\n"+_d_+" "+id+" )"; } public String combine(Player _h_, String id, String name, String _d_){ return ": Player ("+"\n"+_d_+" "+id+"\n"+_d_+" "+name+" )"; } public String combine(Challenge _h_, String name, String seller, String optbuyer, String price, String type, String optraw, String optfinished, String _d_){ return ": Challenge ("+"\n"+_d_+" "+name+"\n"+_d_+" "+seller+"\n"+_d_+" "+optbuyer+"\n"+_d_+" "+price+"\n"+_d_+" "+type+"\n"+_d_+" "+optraw+"\n"+_d_+" "+optfinished+" )"; } public String combine(History _h_, String rounds, String _d_){ return ": History ("+"\n"+_d_+" "+rounds+" )"; } public String combine(Round _h_, String num, String ptransactions, String _d_){ return ": Round ("+"\n"+_d_+" "+num+"\n"+_d_+" "+ptransactions+" )"; } public String combine(PlayerTransaction _h_, String player, String transactions, String _d_){ return ": PlayerTransaction ("+"\n"+_d_+" "+player+"\n"+_d_+" "+transactions+" )"; } public String combine(Transaction _h_, String ttype, String deriv, String _d_){ return ": Transaction ("+"\n"+_d_+" "+ttype+"\n"+_d_+" "+deriv+" )"; } public String combine(Buy _h_, String _d_){ return ": Buy ("+" )"; } public String combine(Create _h_, String _d_){ return ": Create ("+" )"; } public String combine(Reoffer _h_, String _d_){ return ": Reoffer ("+" )"; } public String combine(Deliver _h_, String _d_){ return ": Deliver ("+" )"; } public String combine(Finish _h_, String _d_){ return ": Finish ("+" )"; } public String combine(Players _h_, String players, String _d_){ return ": Players ("+"\n"+_d_+" "+players+" )"; } public String combine(Pair _h_, String a, String b, String _d_){ return ": Pair ("+"\n"+_d_+" "+a+"\n"+_d_+" "+b+" )"; } public String combine(Accounts _h_, String accounts, String _d_){ return ": Accounts ("+"\n"+_d_+" "+accounts+" )"; } public String combine(Store _h_, String stores, String _d_){ return ": Store ("+"\n"+_d_+" "+stores+" )"; } public String combine(PlayerStore _h_, String forSale, String bought, String _d_){ return ": PlayerStore ("+"\n"+_d_+" "+forSale+"\n"+_d_+" "+bought+" )"; } public String combine(Config _h_, String Money, String Rounds, String Time, String MPD, String MaxCreates, String MaxRawMaterialLen, String _d_){ return ": Config ("+"\n"+_d_+" "+Money+"\n"+_d_+" "+Rounds+"\n"+_d_+"