/*
* $Id: LessThanNode.java,v 1.7 2002/09/16 08:05:05 jkl Exp $
*
* Copyright (c) 2002 Njet Communications Ltd. All Rights Reserved.
*
* Use is subject to license terms, as defined in
* Anvil Sofware License, Version 1.1. See LICENSE
* file, or http://njet.org/license-1.1.txt
*/
package anvil.script.expression;
import anvil.core.Any;
import anvil.core.Any.Op;
import anvil.codec.Code;
import anvil.script.compiler.ByteCompiler;
import anvil.script.Context;
import java.io.IOException;
/**
* class LessThanNode
*
* @author: Jani Lehtim�ki
*/
public class LessThanNode extends BinaryParent
{
public LessThanNode(Node left, Node right)
{
super(left,right);
}
public int typeOf()
{
return Node.EXPR_LESS;
}
public Any eval()
{
return Op.ltA(_left.eval(), _right.eval());
}
public void compile(ByteCompiler context, int operation)
{
super.compile(context, GET);
Code code = context.getCode();
if (operation == GET_BOOLEAN) {
code.invokestatic(code.getPool().addMethodRef(context.TYPE_ANY_OP,
"lt", "(Lanvil/core/Any;Lanvil/core/Any;)Z"));
} else {
code.invokestatic(code.getPool().addMethodRef(context.TYPE_ANY_OP,
"ltA", "(Lanvil/core/Any;Lanvil/core/Any;)Lanvil/core/Any;"));
}
}
}