// ** This file was generated with DemFGen (vers:4/12/2011) package gen; import edu.neu.ccs.demeterf.Fields; import edu.neu.ccs.demeterf.lib.ident; import edu.neu.ccs.demeterf.lib.verbatim; import edu.neu.ccs.demeterf.lib.*; import edu.neu.ccs.demeterf.*; /** Computes a nested String representation with field names and values */ public class Display extends edu.neu.ccs.demeterf.FC{ /** 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(NetworkFlowInstance _h_, String g, String source, String sink, String _d_){ return ": NetworkFlowInstance ("+"\n"+_d_+" "+g+"\n"+_d_+" "+source+"\n"+_d_+" "+sink+" )"; } public String combine(Node _h_, String v, String _d_){ return ": Node ("+"\n"+_d_+" "+v+" )"; } public String combine(EdgeCapacity _h_, String v, String _d_){ return ": EdgeCapacity ("+"\n"+_d_+" "+v+" )"; } public String combine(Flow _h_, String g, String _d_){ return ": Flow ("+"\n"+_d_+" "+g+" )"; } public String combine(EdgeFlow _h_, String v, String _d_){ return ": EdgeFlow ("+"\n"+_d_+" "+v+" )"; } public String combine(Nothing _h_, String _d_){ return ": Nothing ("+" )"; } public String combine(TestNetworkFlow _h_, String lop, String _d_){ return ": TestNetworkFlow ("+"\n"+_d_+" "+lop+" )"; } public String combine(InstanceAndSolution _h_, String nfi, String f, String c, String _d_){ return ": InstanceAndSolution ("+"\n"+_d_+" "+nfi+"\n"+_d_+" "+f+"\n"+_d_+" "+c+" )"; } public String combine(Claim _h_, String proposer, String name, String nfi, String q, String _d_){ return ": Claim ("+"\n"+_d_+" "+proposer+"\n"+_d_+" "+name+"\n"+_d_+" "+nfi+"\n"+_d_+" "+q+" )"; } public String combine(Quality _h_, String v, String _d_){ return ": Quality ("+"\n"+_d_+" "+v+" )"; } public String combine(None _h_, String _d_){ return ": None ("+" )"; } public String combine(Some _h_, String just, String _d_){ return ": Some ("+"\n"+_d_+" "+just+" )"; } public String combine(Empty _h_, String _d_){ return ": Empty ("+" )"; } public String combine(Cons _h_, String first, String rest, String _d_){ return ": Cons ("+"\n"+_d_+" "+first+"\n"+_d_+" "+rest+" )"; } public String combine(EdgeLabeledGraph _h_, String adjs, String _d_){ return ": EdgeLabeledGraph ("+"\n"+_d_+" "+adjs+" )"; } public String combine(Adjacency _h_, String source, String successors, String _d_){ return ": Adjacency ("+"\n"+_d_+" "+source+"\n"+_d_+" "+successors+" )"; } public String combine(NodeAndLabel _h_, String n, String label1, String label2, String _d_){ return ": NodeAndLabel ("+"\n"+_d_+" "+n+"\n"+_d_+" "+label1+"\n"+_d_+" "+label2+" )"; } }