Search in sources :

Example 1 with IdentityClassPartMapping

use of st.gravel.support.compiler.ast.IdentityClassPartMapping in project gravel by gravel-st.

the class SystemMappingUpdater method compileClassDescriptionNodeNonStatic_.

public SystemMappingUpdater compileClassDescriptionNodeNonStatic_(final ClassDescriptionNode _aClassDescriptionNode) {
    final Class _identityClass;
    final IdentityClassPartMapping _identityMapping;
    final MethodNode[] _allMethods;
    final MethodNode[] _extraMethods;
    final ClassDescriptionNode _ecdn;
    _extraMethods = this.extraMethodsFor_(_aClassDescriptionNode);
    _ecdn = _aClassDescriptionNode.withExtraMethods_(_extraMethods);
    _identityClass = this.compileClass_isStatic_(_ecdn, false);
    _allMethods = this.methods_withExtraMethods_(_aClassDescriptionNode.methods(), _extraMethods);
    _identityMapping = ((IdentityClassPartMapping) this.linkMethods_in_identityClass_to_isStatic_(_allMethods, _identityClass, _identityClass, IdentityClassPartMapping.factory.javaClass_isGenerated_(_identityClass, true), false));
    _systemMapping.addClassMapping_(ClassMapping.factory.identityMapping_extensions_instVarMappings_classNode_(_identityMapping, new ExtensionClassPartMapping[] {}, new java.util.HashMap<String, InstVarMapping>(), _aClassDescriptionNode));
    return this;
}
Also used : UnaryMethodNode(st.gravel.support.compiler.ast.UnaryMethodNode) MethodNode(st.gravel.support.compiler.ast.MethodNode) HashMap(java.util.HashMap) ExtensionClassPartMapping(st.gravel.support.compiler.ast.ExtensionClassPartMapping) JVMClass(st.gravel.support.compiler.jvm.JVMClass) IdentityClassPartMapping(st.gravel.support.compiler.ast.IdentityClassPartMapping) ClassDescriptionNode(st.gravel.support.compiler.ast.ClassDescriptionNode)

Example 2 with IdentityClassPartMapping

use of st.gravel.support.compiler.ast.IdentityClassPartMapping in project gravel by gravel-st.

the class SystemMappingUpdater method compileClassDescriptionNodeStatic_.

public SystemMappingUpdater compileClassDescriptionNodeStatic_(final ClassDescriptionNode _aClassDescriptionNode) {
    final Class _extensionClass;
    IdentityClassPartMapping _identityMapping;
    final MethodNode[] _allMethods;
    final MethodNode[] _extraMethods;
    final ClassDescriptionNode _ecdn;
    _extraMethods = this.extraMethodsFor_(_aClassDescriptionNode);
    _allMethods = this.methods_withExtraMethods_(_aClassDescriptionNode.methods(), _extraMethods);
    _ecdn = _aClassDescriptionNode.withExtraMethods_(_extraMethods);
    _extensionClass = this.compileClass_isStatic_(_ecdn, true);
    _identityMapping = IdentityClassPartMapping.factory.javaClass_isGenerated_(_aClassDescriptionNode.isNilClass() ? null : _extensionClass, true);
    _identityMapping = ((IdentityClassPartMapping) this.linkMethods_in_identityClass_to_isStatic_(_allMethods, _extensionClass, _extensionClass, _identityMapping, true));
    _systemMapping.addClassMapping_(ClassMapping.factory.identityMapping_extensions_instVarMappings_classNode_(_identityMapping, new ExtensionClassPartMapping[] {}, new java.util.HashMap<String, InstVarMapping>(), _aClassDescriptionNode));
    return this;
}
Also used : UnaryMethodNode(st.gravel.support.compiler.ast.UnaryMethodNode) MethodNode(st.gravel.support.compiler.ast.MethodNode) HashMap(java.util.HashMap) ExtensionClassPartMapping(st.gravel.support.compiler.ast.ExtensionClassPartMapping) JVMClass(st.gravel.support.compiler.jvm.JVMClass) IdentityClassPartMapping(st.gravel.support.compiler.ast.IdentityClassPartMapping) ClassDescriptionNode(st.gravel.support.compiler.ast.ClassDescriptionNode)

Example 3 with IdentityClassPartMapping

use of st.gravel.support.compiler.ast.IdentityClassPartMapping in project gravel by gravel-st.

the class SystemMappingUpdater method visitWrapJavaclassDiff_.

@Override
public SystemMappingUpdater visitWrapJavaclassDiff_(final WrapJavaclassDiff _aWrapJavaclassDiff) {
    final IdentityClassPartMapping _identityMapping;
    final ExtensionClassPartMapping _ecm;
    final MethodNode[] _allMethods;
    final MethodNode[] _extraMethods;
    final ClassDescriptionNode _ecdn;
    _identityMapping = IdentityClassPartMapping.factory.javaClass_isGenerated_(_compilerTools.findJavaClass_(_aWrapJavaclassDiff.classNode().javaClassPath()), false);
    _extraMethods = this.extraMethodsFor_(_aWrapJavaclassDiff.classNode());
    _ecdn = _aWrapJavaclassDiff.classNode().withExtraMethods_(_extraMethods);
    _allMethods = this.methods_withExtraMethods_(_aWrapJavaclassDiff.classNode().methods(), _extraMethods);
    _ecm = this.compileExtensionClassPartMapping_methods_identityClass_instVars_sourceFile_(_ecdn, _allMethods, _identityMapping.javaClass(), new BoundVariableDeclarationNode[] {}, _aWrapJavaclassDiff.classNode().findSourceFile());
    _systemMapping.addClassMapping_(ClassMapping.factory.identityMapping_extensions_instVarMappings_classNode_(_identityMapping, st.gravel.support.jvm.ArrayFactory.with_(_ecm), new java.util.HashMap<String, InstVarMapping>(), _aWrapJavaclassDiff.classNode()));
    this.compileClassDescriptionNode_(_aWrapJavaclassDiff.classNode().metaclassNode());
    _toInitialize.add(_aWrapJavaclassDiff.classNode().metaclassNode().reference());
    return this;
}
Also used : UnaryMethodNode(st.gravel.support.compiler.ast.UnaryMethodNode) MethodNode(st.gravel.support.compiler.ast.MethodNode) HashMap(java.util.HashMap) ExtensionClassPartMapping(st.gravel.support.compiler.ast.ExtensionClassPartMapping) IdentityClassPartMapping(st.gravel.support.compiler.ast.IdentityClassPartMapping) ClassDescriptionNode(st.gravel.support.compiler.ast.ClassDescriptionNode) BoundVariableDeclarationNode(st.gravel.support.compiler.ast.BoundVariableDeclarationNode)

Aggregations

HashMap (java.util.HashMap)3 ClassDescriptionNode (st.gravel.support.compiler.ast.ClassDescriptionNode)3 ExtensionClassPartMapping (st.gravel.support.compiler.ast.ExtensionClassPartMapping)3 IdentityClassPartMapping (st.gravel.support.compiler.ast.IdentityClassPartMapping)3 MethodNode (st.gravel.support.compiler.ast.MethodNode)3 UnaryMethodNode (st.gravel.support.compiler.ast.UnaryMethodNode)3 JVMClass (st.gravel.support.compiler.jvm.JVMClass)2 BoundVariableDeclarationNode (st.gravel.support.compiler.ast.BoundVariableDeclarationNode)1