8 public Sources(State s) {
12 public boolean setSource(SetDescriptor sd) {
15 public boolean allocSource(SetDescriptor sd) {
18 public SetDescriptor getSourceSet(SetDescriptor sd) {
21 public void generateSourceAlloc(CodeWriter cr,VarDescriptor vd, SetDescriptor sd) {
22 TypeDescriptor td=sd.getType();
23 Expr e=td.getSizeExpr();
24 VarDescriptor size=VarDescriptor.makeNew("size");
25 cr.pushSymbolTable(state.stGlobals);
28 cr.outputline(td.getGenerateType().getSafeSymbol()+" "+vd.getSafeSymbol()+"=("+td.getGenerateType().getSafeSymbol()+") malloc("+size.getSafeSymbol()+");");
31 public boolean relsetSource(RelationDescriptor rd, boolean domain) {
34 public boolean relallocSource(RelationDescriptor rd, boolean domain) {
37 public SetDescriptor relgetSourceSet(RelationDescriptor rd, boolean domain) {
40 public void relgenerateSourceAlloc(CodeWriter cr,VarDescriptor vd, RelationDescriptor rd, boolean domain) {
41 SetDescriptor sd=null;
46 TypeDescriptor td=sd.getType();
47 Expr e=td.getSizeExpr();
48 VarDescriptor size=VarDescriptor.makeNew("size");
49 cr.pushSymbolTable(state.stGlobals);
52 cr.outputline(td.getGenerateType().getSafeSymbol()+" "+vd.getSafeSymbol()+"=("+td.getGenerateType().getSafeSymbol()+") malloc("+size.getSafeSymbol()+");");