Package anvil.script.statements

Source Code of anvil.script.statements.ConstructorStatement

/*
* $Id: ConstructorStatement.java,v 1.5 2002/09/16 08:05:06 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.statements;

import anvil.Location;
import anvil.codec.ClassRoom;
import anvil.codec.Method;
import anvil.codec.Field;
import anvil.core.Any;
import anvil.core.AnyClass;
import anvil.script.compiler.ByteCompiler;
import anvil.script.Context;
import anvil.script.Type;
import anvil.script.ParameterListDeclaration;
import anvil.script.expression.Expression;
import anvil.java.util.Hashlist;
import java.io.IOException;
import java.util.Enumeration;

/**
* class ConstructorStatement
*
* @author: Jani Lehtim�ki
*/
public class ConstructorStatement extends MethodStatement
{

  public ConstructorStatement(ClassStatement clazz, Location location)
  {
    super(clazz, location);
  }


  public ConstructorStatement(
      Location location,
      ClassStatement clazz,
      boolean sync,
      String name,
      String document,
      ParameterListDeclaration parameters)
  {
    super(location, clazz, null, sync, name, document, parameters);
  }


  public int getType()
  {
    return CONSTRUCTOR;
  }


  public void compile(ByteCompiler context)
  {
    ClassRoom clazz = context.getClassRoom();
    String name = getDescriptor();
    Field typefield = clazz.createField(name, "Lanvil/script/Function;", ACC_PUBLIC|ACC_STATIC);
    clazz.createField("M_"+_name, "Lanvil/core/Any;", ACC_PUBLIC|ACC_STATIC);
    Method method = clazz.createMethod(name, getSignature(), ACC_PUBLIC);
    compileBody(context, method, typefield);
  }


}
TOP

Related Classes of anvil.script.statements.ConstructorStatement

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.