Package anvil.script.expression

Source Code of anvil.script.expression.ConcatenationAssignmentNode

/*
* $Id: ConcatenationAssignmentNode.java,v 1.11 2002/09/16 08:05:04 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.Location;
import anvil.core.Any;
import anvil.codec.Code;
import anvil.script.compiler.ByteCompiler;
import anvil.script.Context;
import java.io.IOException;

/**
* class ConcatenationAssignmentNode
*
* @author: Jani Lehtim�ki
*/
public class ConcatenationAssignmentNode extends AbstractAssignmentNode
{

  public ConcatenationAssignmentNode(Location location, int childs)
  {
    super(location, childs);
  }


  public int typeOf()
  {
    return Node.EXPR_ASSIGN_CONCAT;
  }

  public String getOperator()
  {
    return "&=";
  }

  protected String getAssignmentMethod()
  {
    return "concat";
  }


  protected void compileOperation(ByteCompiler context, final Node left, final Node right)
  {
    left.compile(context, new Node() {
      public void compile(ByteCompiler context, int operation)
      {
        left.compile(context, GET);
        right.compile(context, GET);
        Code code = context.getCode();
        code.invokevirtual(code.getPool().addMethodRef(context.TYPE_ANY,
          "concat", "(Lanvil/core/Any;)Lanvil/core/Any;"));
      }     
    });
  }
}
TOP

Related Classes of anvil.script.expression.ConcatenationAssignmentNode

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.