01: /*
02: * $Id: NamedNode.java,v 1.3 2002/09/16 08:05:05 jkl Exp $
03: *
04: * Copyright (c) 2002 Njet Communications Ltd. All Rights Reserved.
05: *
06: * Use is subject to license terms, as defined in
07: * Anvil Sofware License, Version 1.1. See LICENSE
08: * file, or http://njet.org/license-1.1.txt
09: */
10: package anvil.script.expression;
11:
12: import anvil.core.Any;
13: import anvil.codec.Code;
14: import anvil.script.compiler.ByteCompiler;
15: import anvil.script.Context;
16: import java.io.IOException;
17:
18: /**
19: * class NamedNode
20: *
21: * @author: Jani Lehtimäki
22: */
23: public class NamedNode extends UnaryParent {
24:
25: protected String _name;
26:
27: public NamedNode(Node child, String name) {
28: super (child);
29: _name = name;
30: }
31:
32: public int typeOf() {
33: return Node.EXPR_NAMED;
34: }
35:
36: public String getName() {
37: return _name;
38: }
39:
40: public Node optimize() {
41: optimizeChilds();
42: return this ;
43: }
44:
45: public Any eval() {
46: return _child.eval();
47: }
48:
49: public void compile(ByteCompiler context, int operation) {
50: _child.compile(context, operation);
51: }
52:
53: }
|