Package org.eolang.opeo.ast
Class InterfaceInvocation
- java.lang.Object
-
- org.eolang.opeo.ast.InterfaceInvocation
-
public final class InterfaceInvocation extends Object implements AstNode, Typed
Interface invocation.- Since:
- 0.2
- To do:
- #173:90min Remove code duplication between Invocations.
I just copied some code from other invocations and changed the opcode.
It means that we have a code duplication. We need to remove it somehow.
Also pay attention that
#xargs
method is duplicate of the same method fromorg.eolang.opeo.compilation.XmirParser#args
class., #344:90min Interface Invocation Type Inference We used to infer 'owner' of a interface method invocation from thesource
. However it led to failed tests.Here is how we did it:
We should use the similar approach, but we also have to ensure that all the tests pass.final Typed owner = (Typed) this.source; res.add( new Opcode( Opcodes.INVOKEINTERFACE, owner.type().getClassName().replace('.', '/'), this.attrs.name(), this.attrs.descriptor(), this.attrs.interfaced() ) );
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eolang.opeo.ast.AstNode
AstNode.Empty
-
-
Constructor Summary
Constructors Constructor Description InterfaceInvocation(org.eolang.jeo.representation.xmir.XmlNode node, Parser parser)
Constructor.InterfaceInvocation(AstNode source, Attributes attributes, List<AstNode> args)
Constructor.InterfaceInvocation(AstNode source, Attributes attributes, AstNode... args)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<AstNode>
opcodes()
Bytecode instructions.Iterable<org.xembly.Directive>
toXmir()
Convert node to XMIR.org.objectweb.asm.Type
type()
Node type.
-
-
-
Constructor Detail
-
InterfaceInvocation
public InterfaceInvocation(org.eolang.jeo.representation.xmir.XmlNode node, Parser parser)
Constructor.- Parameters:
node
- XML node.parser
- Parser, which can extract AstNode from XmlNode.
-
InterfaceInvocation
public InterfaceInvocation(AstNode source, Attributes attributes, AstNode... args)
Constructor.- Parameters:
source
- Source or target on which the invocation is performedattributes
- Method attributes.args
- Arguments of the method.
-
InterfaceInvocation
public InterfaceInvocation(AstNode source, Attributes attributes, List<AstNode> args)
Constructor.- Parameters:
source
- Source or target on which the invocation is performedattributes
- Method attributes.args
- Arguments of the method.
-
-