// ** This class was generated with DemFGen (vers:10/21/2008) 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.*; public class Print extends edu.neu.ccs.demeterf.ID{ public static String PrintM(Object o){ return new edu.neu.ccs.demeterf.Traversal(new Print(),edu.neu.ccs.demeterf.Control.builtins()).traverse(o).toString(); } _LT combine(byte o){ return empty.append(new _S(""+o)); } _LT combine(short o){ return empty.append(new _S(""+o)); } _LT combine(int o){ return empty.append(new _S(""+o)); } _LT combine(long o){ return empty.append(new _S(""+o)); } _LT combine(float o){ return empty.append(new _S(""+o)); } _LT combine(double o){ return empty.append(new _S(""+o)); } _LT combine(char o){ return empty.append(new _S(""+o)); } _LT combine(boolean o){ return empty.append(new _S(""+o)); } _LT combine(String o){ return empty.append(new _S("\""+o+"\"")); } _LT combine(ident o){ return empty.append(new _S(""+o)); } _LT combine(verbatim o){ return empty.append(new _S(""+o)); } static _LT empty = new _LT(); public static class _LT{ edu.neu.ccs.demeterf.demfgen.lib.List<_T> l; public _LT(){ l = new edu.neu.ccs.demeterf.demfgen.lib.Empty<_T>(); } public _LT(edu.neu.ccs.demeterf.demfgen.lib.List<_T> ll){ l = ll; } public _LT push(_T t){ return new _LT(l.push(t)); } public _LT append(_T t){ return new _LT(l.append(t)); } public _LT append(_LT t){ return new _LT(l.append(t.l)); } public String toString(){ return l.fold(new _F(),""); } } public static class _T{} public static class _P extends _T{ public static _P p = new _P(); } public static class _M extends _T{ public static _M m = new _M(); } public static class _N extends _T{ public static _N n = new _N(); } public static class _S extends _T{ public String s; public _S(String ss){s = ss;} } public static class _F extends edu.neu.ccs.demeterf.demfgen.lib.List.Fold<_T,String>{ int idt = 0; public String fold(_T t, String s){ if(t == _P.p)plus(); else if(t == _M.m)minus(); else if(t == _N.n)s += "\n"+indent(); else s += ((_S)t).s; return s; } void plus(){ idt++; } void minus(){ idt--; } String indent(){ return indent(idt); } static String indent(int i){ return (i <= 0)?"":" "+indent(i-1); } } _LT combine(TypeInstance _h_, _LT r){ return new _LT().append(r); } _LT combine(IntermediateProduct _h_, _LT assignment){ return new _LT().append(new _S("(assignment:")).append(assignment).append(new _S(")")); } _LT combine(RawMaterialInstance _h_, _LT cs){ return new _LT().append(cs); } _LT combine(Constraint _h_, _LT w, _LT r, _LT vs){ return new _LT().append(w).append(r).append(vs).append(_N.n); } _LT combine(Weight _h_, _LT v){ return new _LT().append(v).append(new _S(":")).append(new _S(" ")); } _LT combine(RelationNr _h_, _LT v){ return new _LT().append(v).append(new _S(" ")); } _LT combine(Variable _h_, _LT v){ return new _LT().append(v).append(new _S(" ")); } _LT combine(Predicate _h_, _LT pred){ return new _LT().append(pred); } _LT combine(Assignment _h_, _LT literals){ return new _LT().append(new _S("[")).append(literals).append(new _S("]")); } _LT combine(Literal _h_, _LT value, _LT var){ return new _LT().append(new _S(" ")).append(value).append(new _S(" ")).append(var).append(new _S(" ")); } _LT combine(Pos _h_){ return new _LT(); } _LT combine(Neg _h_){ return new _LT().append(new _S("!")); } _LT combine(Price _h_, _LT val){ return new _LT().append(val); } _LT combine(Quality _h_, _LT val){ return new _LT().append(val); } _LT combine(PlayerID _h_, _LT id){ return new _LT().append(id); } _LT combine(Player _h_, _LT id, _LT name){ return new _LT().append(new _S("player")).append(new _S(" ")).append(id).append(new _S(" ")).append(name); } _LT combine(Type _h_, _LT instances){ return new _LT().append(new _S("type")).append(new _S("[")).append(instances).append(new _S("]")); } _LT combine(Derivative _h_, _LT name, _LT seller, _LT optbuyer, _LT price, _LT type, _LT optraw, _LT optfinished){ return new _LT().append(new _S("deriv[")).append(name).append(new _S(" ")).append(seller).append(new _S(" ")).append(optbuyer).append(new _S(" ")).append(price).append(new _S(" ")).append(type).append(new _S(" ")).append(optraw).append(new _S(" ")).append(optfinished).append(new _S("]")); } _LT combine(RawMaterial _h_, _LT instance){ return new _LT().append(new _S("rm[")).append(instance).append(new _S("]")); } _LT combine(FinishedProduct _h_, _LT ip, _LT quality){ return new _LT().append(new _S("finish[")).append(ip).append(new _S(" ")).append(quality).append(new _S("]")); } _LT combine(History _h_, _LT rounds){ return new _LT().append(new _S("history[")).append(rounds).append(new _S("]")); } _LT combine(Round _h_, _LT num, _LT ptransactions){ return new _LT().append(new _S("round")).append(new _S(" ")).append(num).append(new _S(" ")).append(new _S("[")).append(ptransactions).append(new _S("]")); } _LT combine(PlayerTransaction _h_, _LT player, _LT transactions){ return new _LT().append(new _S("ptrans[")).append(player).append(new _S(" ")).append(transactions).append(new _S("]")); } _LT combine(Transaction _h_, _LT ttype, _LT deriv){ return new _LT().append(new _S("trans[")).append(ttype).append(new _S(" ")).append(deriv).append(new _S("]")); } _LT combine(Buy _h_){ return new _LT().append(new _S("BUY")); } _LT combine(Create _h_){ return new _LT().append(new _S("CREATE")); } _LT combine(Reoffer _h_){ return new _LT().append(new _S("REOFFER")); } _LT combine(Deliver _h_){ return new _LT().append(new _S("DELIVER")); } _LT combine(Finish _h_){ return new _LT().append(new _S("FINISH")); } _LT combine(Players _h_, _LT players){ return new _LT().append(new _S("players[")).append(players).append(new _S("]")); } _LT combine(Pair _h_, _LT a, _LT b){ return new _LT().append(new _S(" ")).append(a).append(new _S(" ")).append(b).append(new _S(" ")); } _LT combine(Accounts _h_, _LT accounts){ return new _LT().append(new _S("accounts[")).append(accounts).append(new _S("]")); } _LT combine(Store _h_, _LT stores){ return new _LT().append(new _S("store[")).append(stores).append(new _S("]")); } _LT combine(PlayerStore _h_, _LT forSale, _LT bought){ return new _LT().append(new _S("pstore")).append(new _S(" ")).append(new _S("forsale")).append(new _S(" ")).append(forSale).append(new _S(" ")).append(new _S("bought")).append(new _S(" ")).append(bought); } _LT combine(Config _h_, _LT Money, _LT Rounds, _LT Time, _LT MPD){ return new _LT().append(new _S("Money:")).append(Money).append(new _S(" ")).append(new _S("Rounds:")).append(Rounds).append(new _S(" ")).append(new _S("Time:")).append(Time).append(new _S(" ")).append(new _S("MinPriceDecrement:")).append(MPD); } _LT combine(Cons _h_, _LT first, _LT rest){ return new _LT().append(first).append(rest); } _LT combine(Empty _h_){ return new _LT(); } _LT combine(Some _h_, _LT just){ return new _LT().append(just); } _LT combine(None _h_){ return new _LT(); } }