00001: package clogs.ast; 00002: 00003: import clogs.util.List; 00004: import clogs.util.Optional; 00005: 00006: 00007: public class StatReturn extends Stat 00008: { 00009: public final Optional<Exp> oe; 00010: 00011: 00012: public StatReturn (Optional<Exp> oe) 00013: { 00014: this (List.<String>nil (), oe); 00015: } 00016: 00017: 00018: StatReturn (List<String> labels, Optional<Exp> oe) 00019: { 00020: super (labels); 00021: clogs.util.NonNull.check (oe); 00022: this.oe = oe; 00023: } 00024: 00025: 00026: public Stat removeLabels () 00027: { 00028: return new StatReturn (List.<String> nil (), oe); 00029: } 00030: 00031: 00032: public Stat addLabel (String label) 00033: { 00034: return new StatReturn (labels.cons (label), oe); 00035: } 00036: } 00037: