01: /*
02: * $Id: GreaterThanOrEqualToNode.java,v 1.7 2002/09/16 08:05:04 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.Any.Op;
14: import anvil.codec.Code;
15: import anvil.script.compiler.ByteCompiler;
16: import anvil.script.Context;
17: import java.io.IOException;
18:
19: /**
20: * class GreaterThanOrEqualToNode
21: *
22: * @author: Jani Lehtimäki
23: */
24: public class GreaterThanOrEqualToNode extends BinaryParent {
25: public GreaterThanOrEqualToNode(Node left, Node right) {
26: super (left, right);
27: }
28:
29: public int typeOf() {
30: return Node.EXPR_GREATER_EQUAL;
31: }
32:
33: public Any eval() {
34: return Op.geA(_left.eval(), _right.eval());
35: }
36:
37: public void compile(ByteCompiler context, int operation) {
38: super .compile(context, GET);
39: Code code = context.getCode();
40: if (operation == GET_BOOLEAN) {
41: code.invokestatic(code.getPool().addMethodRef(
42: context.TYPE_ANY_OP, "ge",
43: "(Lanvil/core/Any;Lanvil/core/Any;)Z"));
44: } else {
45: code
46: .invokestatic(code
47: .getPool()
48: .addMethodRef(context.TYPE_ANY_OP, "geA",
49: "(Lanvil/core/Any;Lanvil/core/Any;)Lanvil/core/Any;"));
50: }
51: }
52:
53: }
|