Search in sources :

Example 1 with JVMMethodCompiler

use of st.gravel.support.compiler.jvm.JVMMethodCompiler in project gravel by gravel-st.

the class JVMBlockCompiler method compileBlock.

public JVMClass compileBlock() {
    final JVMMethod _m;
    final JVMField[] _fields;
    final JVMMethodCompiler _methodCompiler;
    final JVMClass _jvmClass;
    _fields = st.gravel.support.jvm.ArrayExtensions.collect_(_block.copiedVariables(), ((st.gravel.support.jvm.Block1<JVMField, JVMVariable>) (new st.gravel.support.jvm.Block1<JVMField, JVMVariable>() {

        @Override
        public JVMField value_(final JVMVariable _each) {
            return (JVMField) _each.asField_isStatic_(_block.ownerType(), false);
        }
    })));
    _methodCompiler = JVMMethodCompiler.factory.parent_(_parent);
    _methodCompiler.isStatic_(false);
    _m = _methodCompiler.buildBlock_copiedVariables_blockType_(_block.blockNode(), _fields, _block.ownerType());
    _jvmClass = JVMClass.factory.type_superType_fields_methods_astConstants_(_block.ownerType(), this.superType(), _fields, st.gravel.support.jvm.ArrayFactory.with_with_(_m, this.createInit()), new BlockSendArgument[] {});
    if (_block.blockNode().sourcePosition() != null) {
        _jvmClass.source_(_block.blockNode().sourcePosition().sourceFile().name());
    }
    return _jvmClass;
}
Also used : JVMClass(st.gravel.support.compiler.jvm.JVMClass) JVMVariable(st.gravel.support.compiler.jvm.JVMVariable) JVMMethod(st.gravel.support.compiler.jvm.JVMMethod) BlockSendArgument(st.gravel.support.compiler.jvm.BlockSendArgument) JVMField(st.gravel.support.compiler.jvm.JVMField) JVMMethodCompiler(st.gravel.support.compiler.jvm.JVMMethodCompiler)

Example 2 with JVMMethodCompiler

use of st.gravel.support.compiler.jvm.JVMMethodCompiler in project gravel by gravel-st.

the class JVMClassCompiler method compileMethod_.

public JVMClassCompiler compileMethod_(final MethodNode _aMethodNode) {
    JVMMethodCompiler _temp1 = JVMMethodCompiler.factory.parent_(this);
    _temp1.visit_(_aMethodNode);
    _jvmMethods.add(_temp1.buildMethod());
    return this;
}
Also used : JVMMethodCompiler(st.gravel.support.compiler.jvm.JVMMethodCompiler)

Aggregations

JVMMethodCompiler (st.gravel.support.compiler.jvm.JVMMethodCompiler)2 BlockSendArgument (st.gravel.support.compiler.jvm.BlockSendArgument)1 JVMClass (st.gravel.support.compiler.jvm.JVMClass)1 JVMField (st.gravel.support.compiler.jvm.JVMField)1 JVMMethod (st.gravel.support.compiler.jvm.JVMMethod)1 JVMVariable (st.gravel.support.compiler.jvm.JVMVariable)1