@@ -356,6 +356,91 @@ class JavaASMGenerator extends AsmToJavaGenerator {
356
356
' ' ' );
357
357
}
358
358
}
359
+ else { // getter per le funzioni con Dominio -> Codominio
360
+
361
+ for (dd : asm. headerSection. signature. domain){
362
+ if (dd. equals(fd. domain)){
363
+ if (dd instanceof EnumTd ){
364
+ for (var int i = 0 ; i < dd. element. size; i++ ) {
365
+ var symbol = new ToString (asm). visit(dd. element. get(i))
366
+ sb. append(System . lineSeparator)
367
+ if (fd. codomain instanceof ConcreteDomain ){ // considero subsetOf Integer
368
+ sb. append(" \t " ). append(' ' ' private int get_«fd.name»_«symbol»(){' ' ' );
369
+ sb. append(System . lineSeparator)
370
+ sb. append(" \t\t " ). append(' ' ' return this.esecuzione.«fd.name».get(' ' ' );
371
+ sb. append(System . lineSeparator)
372
+ sb. append(" \t\t\t " ). append(' ' ' this.esecuzione.«fd.domain.name»_elemsList.get(«i»)).value;' ' ' );
373
+ sb. append(System . lineSeparator)
374
+ sb. append(" \t " ). append(' ' ' }' ' ' );
375
+ } else {
376
+ if (fd. codomain. name. equals(" Integer" )){
377
+ sb. append(" \t " ). append(' ' ' private int get_«fd.name»_«symbol»(){' ' ' );
378
+ }
379
+ else if (fd. codomain. name. equals(" Boolean" )){
380
+ sb. append(" \t " ). append(' ' ' private boolean get_«fd.name»_«symbol»(){' ' ' );
381
+ }
382
+ else if (fd. codomain. name. equals(" String" )){
383
+ sb. append(" \t " ). append(' ' ' private String get_«fd.name»_«symbol»(){' ' ' );
384
+ }
385
+ else {
386
+ sb. append(" \t " ). append(' ' ' private «asmName».«fd.codomain.name» get_«fd.name»_«symbol»(){' ' ' );
387
+ }
388
+ sb. append(System . lineSeparator)
389
+ sb. append(" \t\t " ). append(' ' ' return this.esecuzione.«fd.name».get(' ' ' );
390
+ sb. append(System . lineSeparator)
391
+ sb. append(" \t\t\t " ). append(' ' ' this.esecuzione.«fd.domain.name»_elemsList.get(«i»));' ' ' );
392
+ sb. append(System . lineSeparator)
393
+ sb. append(" \t " ). append(' ' ' }' ' ' );
394
+ }
395
+ sb. append(System . lineSeparator)
396
+ }
397
+ }
398
+ else if (dd instanceof AbstractTd ){
399
+ for (sf : asm. headerSection. signature. function) { // controllo le funzioni statiche e prendo quelle che aggiungono al dominio astratto
400
+ if (sf instanceof StaticFunction ){
401
+ if (sf. codomain. equals(dd)){
402
+ var symbol = sf. name
403
+ sb. append(System . lineSeparator)
404
+ if (fd. codomain instanceof ConcreteDomain ){
405
+ sb. append(" \t " ). append(' ' ' private int get_«fd.name»_«symbol»(){' ' ' );
406
+ sb. append(System . lineSeparator)
407
+ sb. append(" \t\t " ). append(' ' ' return this.esecuzione.«fd.name».get(' ' ' );
408
+ sb. append(System . lineSeparator)
409
+ sb. append(" \t\t\t " ). append(' ' ' this.esecuzione.«fd.domain.name»_Class.get(' ' ' );
410
+ sb. append(System . lineSeparator)
411
+ sb. append(" \t\t\t " ). append(' ' ' this.esecuzione.«fd.domain.name»_elemsList.indexOf("«symbol»")).value);' ' ' );
412
+ sb. append(System . lineSeparator)
413
+ sb. append(" \t " ). append(' ' ' }' ' ' );
414
+ } else {
415
+ if (fd. codomain. name. equals(" Integer" )){
416
+ sb. append(" \t " ). append(' ' ' private int get_«fd.name»_«symbol»(){' ' ' );
417
+ }
418
+ else if (fd. codomain. name. equals(" Boolean" )){
419
+ sb. append(" \t " ). append(' ' ' private boolean get_«fd.name»_«symbol»(){' ' ' );
420
+ }
421
+ else if (fd. codomain. name. equals(" String" )){
422
+ sb. append(" \t " ). append(' ' ' private Srting get_«fd.name»_«symbol»(){' ' ' );
423
+ }
424
+ else {
425
+ sb. append(" \t " ). append(' ' ' private «asm.name».«fd.codomain.name» get_«fd.name»_«symbol»(){' ' ' );
426
+ }
427
+ sb. append(System . lineSeparator)
428
+ sb. append(" \t\t " ). append(' ' ' return this.esecuzione.«fd.name».get(' ' ' );
429
+ sb. append(System . lineSeparator)
430
+ sb. append(" \t\t\t " ). append(' ' ' this.esecuzione.«fd.domain.name»_Class.get(' ' ' );
431
+ sb. append(System . lineSeparator)
432
+ sb. append(" \t\t\t " ). append(' ' ' this.esecuzione.«fd.domain.name»_elemsList.indexOf("«symbol»")));' ' ' );
433
+ sb. append(System . lineSeparator)
434
+ sb. append(" \t " ). append(' ' ' }' ' ' );
435
+ }
436
+ sb. append(System . lineSeparator)
437
+ }
438
+ }
439
+ }
440
+ }
441
+ }
442
+ }
443
+ }
359
444
}
360
445
}
361
446
}
0 commit comments