use of st.gravel.support.compiler.ast.ClassDescriptionNode in project gravel by gravel-st.
the class UpdateClassDescriptorDiff method applyOnClassNode_.
public ClassDescriptionNode applyOnClassNode_(final ClassDescriptionNode _startClassNode) {
ClassDescriptionNode _classNode;
_classNode = ((ClassDescriptionNode) st.gravel.support.jvm.ArrayExtensions.inject_into_(_methodNodes, _startClassNode, ((st.gravel.support.jvm.Block2<ClassDescriptionNode, ClassDescriptionNode, MethodNode>) (new st.gravel.support.jvm.Block2<ClassDescriptionNode, ClassDescriptionNode, MethodNode>() {
@Override
public ClassDescriptionNode value_value_(final ClassDescriptionNode _cn, final MethodNode _m) {
return (ClassDescriptionNode) _cn.withMethodNode_(_m);
}
}))));
_classNode = ((ClassDescriptionNode) st.gravel.support.jvm.ArrayExtensions.inject_into_(_updatedMethodNodes, _classNode, ((st.gravel.support.jvm.Block2<ClassDescriptionNode, ClassDescriptionNode, MethodNode>) (new st.gravel.support.jvm.Block2<ClassDescriptionNode, ClassDescriptionNode, MethodNode>() {
@Override
public ClassDescriptionNode value_value_(final ClassDescriptionNode _cn, final MethodNode _m) {
return (ClassDescriptionNode) _cn.copyReplaceMethodNode_(_m);
}
}))));
return ((ClassDescriptionNode) st.gravel.support.jvm.ArrayExtensions.inject_into_(_deletedSelectors, _classNode, ((st.gravel.support.jvm.Block2<ClassDescriptionNode, ClassDescriptionNode, String>) (new st.gravel.support.jvm.Block2<ClassDescriptionNode, ClassDescriptionNode, String>() {
@Override
public ClassDescriptionNode value_value_(final ClassDescriptionNode _cn, final String _sel) {
return (ClassDescriptionNode) _cn.copyRemoveSelector_(_sel);
}
}))));
}
use of st.gravel.support.compiler.ast.ClassDescriptionNode in project gravel by gravel-st.
the class SimpleTraitUsageNode method allMethodsIn_do_.
@Override
public SimpleTraitUsageNode allMethodsIn_do_(final SystemNode _aSystemNode, final st.gravel.support.jvm.Block1<Object, MethodNode> _aBlock) {
final ClassDescriptionNode _trait;
_trait = _aSystemNode.classNodeAt_(_reference);
_trait.allMethodsIn_do_(_aSystemNode, _aBlock);
return this;
}
use of st.gravel.support.compiler.ast.ClassDescriptionNode 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;
}
use of st.gravel.support.compiler.ast.ClassDescriptionNode in project gravel by gravel-st.
the class SystemMappingUpdater method executeUpdateClassDescriptorDiff_reference_.
public SystemMappingUpdater executeUpdateClassDescriptorDiff_reference_(final UpdateClassDescriptorDiff _anUpdateClassDescriptorDiff, final Reference _aReference) {
final ExtensionClassPartMapping _ecm;
ClassMapping _cm;
final ClassDescriptionNode _ncn;
final MethodNode[] _methods;
_cm = ((ClassMapping) _systemMapping.classMappingAtReference_(_aReference));
_cm = ((ClassMapping) st.gravel.support.jvm.ArrayExtensions.inject_into_(_anUpdateClassDescriptorDiff.updatedMethodNodes(), _cm, ((st.gravel.support.jvm.Block2<ClassMapping, ClassMapping, MethodNode>) (new st.gravel.support.jvm.Block2<ClassMapping, ClassMapping, MethodNode>() {
@Override
public ClassMapping value_value_(final ClassMapping _classMapping, final MethodNode _methodNode) {
return (ClassMapping) _classMapping.withoutMethodMapping_(_methodNode.selector());
}
}))));
_cm = ((ClassMapping) st.gravel.support.jvm.ArrayExtensions.inject_into_(_anUpdateClassDescriptorDiff.deletedSelectors(), _cm, ((st.gravel.support.jvm.Block2<ClassMapping, ClassMapping, String>) (new st.gravel.support.jvm.Block2<ClassMapping, ClassMapping, String>() {
@Override
public ClassMapping value_value_(final ClassMapping _classMapping, final String _selector) {
return (ClassMapping) _classMapping.withoutMethodMapping_(_selector);
}
}))));
_ncn = _anUpdateClassDescriptorDiff.applyOnClassNode_(_cm.classNode());
_methods = st.gravel.support.jvm.ArrayExtensions.copyWithAll_(_anUpdateClassDescriptorDiff.methodNodes(), _anUpdateClassDescriptorDiff.updatedMethodNodes());
_ecm = this.compileExtensionClassPartMapping_methods_identityClass_instVars_sourceFile_(_ncn, _methods, _cm.identityClass(), _cm.classNode().boundInstVars(), this.findSourceFile_(_anUpdateClassDescriptorDiff.methodNodes()));
_systemMapping.addClassMapping_(_cm.withClassNode_(_ncn).withExtension_(_ecm));
return this;
}
use of st.gravel.support.compiler.ast.ClassDescriptionNode 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;
}
Aggregations