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