01: /*
02: * $Id: JavaClassNode.java,v 1.4 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.core.AnyClass;
14: import anvil.core.reflect.Reflection;
15: import anvil.codec.Code;
16: import anvil.script.compiler.ByteCompiler;
17: import anvil.script.Context;
18: import anvil.script.ClassType;
19: import anvil.script.statements.ModuleStatement;
20: import java.io.IOException;
21:
22: /**
23: * class JavaClassNode
24: *
25: * @author: Jani Lehtimäki
26: */
27: public class JavaClassNode extends Node {
28:
29: protected ModuleStatement _script;
30: protected String _classname;
31:
32: public JavaClassNode(String classname) {
33: super ();
34: _classname = classname;
35: }
36:
37: public int typeOf() {
38: return Node.EXPR_TYPE;
39: }
40:
41: public boolean isConstant() {
42: return false;
43: }
44:
45: public Node optimize() {
46: return this ;
47: }
48:
49: public void compile(ByteCompiler context, int operation) {
50: context.reflect(_classname);
51: if (operation == GET_BOOLEAN) {
52: context.any2boolean();
53: }
54: }
55:
56: }
|