01: package org.pnuts.lang;
02:
03: import pnuts.lang.*;
04:
05: public class CompositeGenerator extends Generator {
06: private Generator g1, g2;
07:
08: public CompositeGenerator(Generator g1, Generator g2) {
09: this .g1 = g1;
10: this .g2 = g2;
11: }
12:
13: public Object apply(PnutsFunction closure, Context context) {
14: g1.apply(closure, context);
15: return g2.apply(closure, context);
16: }
17: }
|