KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > armedbear > lisp > DispatchMacroFunction


1 /*
2  * DispatchMacroFunction.java
3  *
4  * Copyright (C) 2004 Peter Graves
5  * $Id: DispatchMacroFunction.java,v 1.2 2004/04/18 04:50:17 piso Exp $
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  */

21
22 package org.armedbear.lisp;
23
24 public abstract class DispatchMacroFunction extends Function
25 {
26     public DispatchMacroFunction(String JavaDoc name)
27     {
28         super(name);
29     }
30
31     public DispatchMacroFunction(String JavaDoc name, String JavaDoc arglist)
32     {
33         super(name, arglist);
34     }
35
36     public DispatchMacroFunction(String JavaDoc name, Package JavaDoc pkg)
37     {
38         super(name, pkg);
39     }
40
41     public DispatchMacroFunction(String JavaDoc name, Package JavaDoc pkg, boolean exported)
42     {
43         super(name, pkg, exported);
44     }
45
46     public DispatchMacroFunction(String JavaDoc name, Package JavaDoc pkg, boolean exported,
47                       String JavaDoc arglist)
48     {
49         super(name, pkg, exported, arglist);
50     }
51
52     public LispObject execute(LispObject first, LispObject second,
53                               LispObject third)
54         throws ConditionThrowable
55     {
56         Stream stream = inSynonymOf(first);
57         char c = LispCharacter.getValue(second);
58         int n;
59         if (third == NIL)
60             n = -1;
61         else
62             n = Fixnum.getValue(third);
63         return execute(stream, c, n);
64     }
65
66     public abstract LispObject execute(Stream stream, char c, int n)
67         throws ConditionThrowable;
68 }
69
Popular Tags