01: /**************************************************************************/
02: /* N I C E */
03: /* A simple imperative object-oriented research language */
04: /* (c) Daniel Bonniot 1999 */
05: /* */
06: /* This program is free software; you can redistribute it and/or modify */
07: /* it under the terms of the GNU General Public License as published by */
08: /* the Free Software Foundation; either version 2 of the License, or */
09: /* (at your option) any later version. */
10: /* */
11: /**************************************************************************/package nice.tools.code;
12:
13: import gnu.expr.Expression;
14: import gnu.expr.ApplyExp;
15: import gnu.mapping.*;
16:
17: /**
18: Static class to inline code written in <code>Procedure</code>s.
19:
20: @author Daniel Bonniot
21: */
22:
23: public final class Inline {
24: public static Expression inline(Procedure1 proc) {
25: return new ApplyExp(proc, Expression.noExpressions);
26: }
27:
28: public static Expression inline(Procedure1 proc, Expression arg1) {
29: return new ApplyExp(proc, new Expression[] { arg1 });
30: }
31:
32: public static Expression inline(Procedure2 proc, Expression arg1,
33: Expression arg2) {
34: return new ApplyExp(proc, new Expression[] { arg1, arg2 });
35: }
36: }
|