CSC448: Transformations [2/14] |
The transformations must construct a new AST; they cannot modify the existing AST because the AST classes are immutable.
file:clogs/transform/Phase.java [source] [doc-public] [doc-private]
00001: package clogs.transform; 00002: 00003: import clogs.ast.*; 00004: import clogs.util.*; 00005: 00006: 00007: public abstract class Phase 00008: { 00009: public boolean printAfterTransform = false; 00010: public boolean printAfterTransformAndTypeCheck = false; 00011: 00012: public abstract List<ExtDecl> transform (List<ExtDecl> edecls); 00013: } 00014:
file:clogs/transform/EmptyPhase.java [source] [doc-public] [doc-private]
00001: package clogs.transform; 00002: 00003: import clogs.ast.*; 00004: import clogs.util.*; 00005: 00006: 00007: public class EmptyPhase extends Phase 00008: { 00009: public List<ExtDecl> transform (List<ExtDecl> edecls) 00010: { 00011: return edecls; 00012: } 00013: } 00014: 00015: