CSC448: Parsing: Clogs AST: Functions [15/26] |
file:FunDef.java [source] [doc-public] [doc-private]
00001: package clogs.ast; 00002: 00003: import clogs.util.List; 00004: import clogs.util.Optional; 00005: 00006: 00007: public class FunDef extends FunDefSig 00008: { 00009: public final StatCompound body; 00010: 00011: 00012: public FunDef (Type type, String name, List<Decl> params, StatCompound body) 00013: { 00014: super (type, name, params); 00015: clogs.util.NonNull.check (body); 00016: this.body = body; 00017: } 00018: 00019: 00020: public String toString () 00021: { 00022: PrettyPrinter pp = new PrettyPrinter (); 00023: pp.printFunDef (this); 00024: return pp.toString (); 00025: } 00026: } 00027:
file:FunDefSig.java [source] [doc-public] [doc-private]
00001: package clogs.ast; 00002: 00003: import clogs.util.List; 00004: import clogs.util.Optional; 00005: 00006: 00007: public class FunDefSig extends ExtDecl 00008: { 00009: public final Type type; 00010: public final String name; 00011: public final List<Decl> params; 00012: 00013: 00014: public FunDefSig (Type type, String name, List<Decl> params) 00015: { 00016: clogs.util.NonNull.check (type, name, params); 00017: this.type = type; 00018: this.name = name; 00019: this.params = params; 00020: } 00021: } 00022: