01: /*=============================================================================
02: * Copyright Texas Instruments 2000. All Rights Reserved.
03: *
04: * This program is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This program is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: *
18: * $ProjectHeader: OSCRIPT 0.155 Fri, 20 Dec 2002 18:34:22 -0800 rclark $
19: */
20:
21: package oscript;
22:
23: import oscript.syntaxtree.Node;
24:
25: /* XXX TODO... need to change API to:
26: * public NodeEvaluator createNodeEvaluator( Value name, Node node );
27: */
28:
29: /**
30: * A <code>NodeEvaluatorFactory</code> transforms a <code>Node</code> into a
31: * <code>NodeEvaluator</code>. This forms the basis for the plug-in evaluator
32: * and/or compiler. By creating a <code>NodeEvaluator</code> we can abstract
33: * away wether or not the code gets compiled. It may seem weird to have the
34: * interpreter be a pluggable component, but just think of it as a nice clean
35: * distinction between the interpreter and the data.
36: *
37: * @author Rob Clark (rob@ti.com)
38: * <!--$Format: " * @version $Revision$"$-->
39: * @version 1.3
40: */
41: public interface NodeEvaluatorFactory {
42: /**
43: * Given a <code>Node</code>, generate a <code>NodeEvaluator</code>.
44: *
45: * @param name name of node to process, for debugging
46: * @param node the node
47: * @return the node-evaluator
48: */
49: public NodeEvaluator createNodeEvaluator(String name, Node node);
50: }
51:
52: /*
53: * Local Variables:
54: * tab-width: 2
55: * indent-tabs-mode: nil
56: * mode: java
57: * c-indentation-style: java
58: * c-basic-offset: 2
59: * eval: (c-set-offset 'substatement-open '0)
60: * eval: (c-set-offset 'case-label '+)
61: * eval: (c-set-offset 'inclass '+)
62: * eval: (c-set-offset 'inline-open '0)
63: * End:
64: */
|