// ** 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.*; /** 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(Cons _h_, String first, String rest, String _d_){ return ": Cons ("+"\n"+_d_+" "+first+"\n"+_d_+" "+rest+" )"; } public String combine(Empty _h_, String _d_){ return ": Empty ("+" )"; } public String combine(Start _h_, String r, String _d_){ return ": Start ("+"\n"+_d_+" "+r+" )"; } public String combine(RandomGenerationAspect _h_, String cd, String advisedFields, String _d_){ return ": RandomGenerationAspect ("+"\n"+_d_+" "+cd+"\n"+_d_+" "+advisedFields+" )"; } public String combine(AdvisedField _h_, String f, String k, String _d_){ return ": AdvisedField ("+"\n"+_d_+" "+f+"\n"+_d_+" "+k+" )"; } public String combine(ClassDictionary _h_, String _d_){ return ": ClassDictionary ("+" )"; } public String combine(ListField _h_, String length, String element, String _d_){ return ": ListField ("+"\n"+_d_+" "+length+"\n"+_d_+" "+element+" )"; } public String combine(Subset _h_, String r, String _d_){ return ": Subset ("+"\n"+_d_+" "+r+" )"; } public String combine(Distinct _h_, String _d_){ return ": Distinct ("+" )"; } public String combine(Single _h_, String v, String _d_){ return ": Single ("+"\n"+_d_+" "+v+" )"; } public String combine(Range _h_, String low, String high, String _d_){ return ": Range ("+"\n"+_d_+" "+low+"\n"+_d_+" "+high+" )"; } public String combine(Enumeration _h_, String l, String _d_){ return ": Enumeration ("+"\n"+_d_+" "+l+" )"; } public String combine(Ref _h_, String v, String _d_){ return ": Ref ("+"\n"+_d_+" "+v+" )"; } public String combine(QualIdent _h_, String first, String rest, String _d_){ return ": QualIdent ("+"\n"+_d_+" "+first+"\n"+_d_+" "+rest+" )"; } public String combine(DField _h_, String f, String _d_){ return ": DField ("+"\n"+_d_+" "+f+" )"; } public String combine(Field _h_, String v, String _d_){ return ": Field ("+"\n"+_d_+" "+v+" )"; } public String combine(NumericalField _h_, String nc, String _d_){ return ": NumericalField ("+"\n"+_d_+" "+nc+" )"; } public String combine(ConstrainedField _h_, String v, String _d_){ return ": ConstrainedField ("+"\n"+_d_+" "+v+" )"; } public String combine(B _h_, String xyz, String _d_){ return ": B ("+"\n"+_d_+" "+xyz+" )"; } public String combine(Basket _h_, String z, String items, String _d_){ return ": Basket ("+"\n"+_d_+" "+z+"\n"+_d_+" "+items+" )"; } public String combine(Pencil _h_, String _d_){ return ": Pencil ("+" )"; } public String combine(Apple _h_, String _d_){ return ": Apple ("+" )"; } public String combine(Orange _h_, String _d_){ return ": Orange ("+" )"; } public String combine(Z _h_, String _d_){ return ": Z ("+" )"; } }