Sha256: bc20857ac52bf17c179a355577f3913e50e708d06e589bf519586d36d3290897

Contents?: true

Size: 1.63 KB

Versions: 119

Compression:

Stored size: 1.63 KB

Contents

/**
 * Copyright 2007 Ye Zheng
 * Distributed under the BSD License
 */

package com.xruby.runtime.lang.util;

/*
import java.lang.annotation.Annotation;

import org.objectweb.asm.Type;
import org.objectweb.asm.commons.GeneratorAdapter;
import org.objectweb.asm.commons.Method;

import com.xruby.compiler.codegen.CgUtil;
import com.xruby.compiler.codegen.Types;
import com.xruby.runtime.lang.annotation.RubyLevelModule;

class RubyModuleFactory extends RubyTypeFactory {
	private static final Method RubyModuleBuilderCreateRubyModuleMethod = 
		CgUtil.getMethod("createRubyModule", Types.RUBY_MODULE_TYPE);
	private static final Method RubyAPIDefineModuleMethod = 
		CgUtil.getMethod("defineModule", Types.RUBY_MODULE_TYPE, Type.getType(String.class));
	private static final Type BuilderInterface = Type.getType(RubyModuleBuilder.class);
	
	RubyModuleFactory(Class klass) {
		super(klass);
	}
	
	protected boolean isModule() {
		return true;
	}
	
	protected Class getTypeAnnotationClass() {
		return RubyLevelModule.class;
	}
	
	protected String getBuilderName(Class klass) {
		return CgUtil.getInternalName(klass.getName() + "$ModuleBuilder");
	}

	protected Type getInterface() {
		return BuilderInterface;
	}
	
	protected Method getBuilderMethod() {
		return RubyModuleBuilderCreateRubyModuleMethod;
	}
	
	protected int createRubyType(GeneratorAdapter mg, Annotation annotation) {
		RubyLevelModule moduleAnnotation = (RubyLevelModule)annotation;
		mg.push(moduleAnnotation.name());
		mg.invokeStatic(Types.RUBY_API_TYPE, RubyAPIDefineModuleMethod);
		int rubyTypeIdx = mg.newLocal(Types.RUBY_MODULE_TYPE);
		mg.storeLocal(rubyTypeIdx);
		
		return rubyTypeIdx;
	}
}*/

Version data entries

119 entries across 119 versions & 1 rubygems

Version Path
rhodes-3.0.0.beta.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.4.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.4.1.beta.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.4.0 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.4.0.beta.2 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.4.0.beta.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.3.2 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.3.2.beta.2 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.3.2.beta.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.3.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.3.1.beta.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.3.0 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.3.0.beta.3 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.3.0.beta.2 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.3.0.beta.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.2.6 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.2.6.beta.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.2.5 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.2.5.beta.3 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java
rhodes-2.2.5.beta.2 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyModuleFactory.java