MCPcopy Create free account
hub / github.com/Whiley/WhileyCompiler / Invoke

Class Invoke

src/main/java/wyil/lang/WyilFile.java:2833–2884  ·  view source on GitHub ↗

Represents an invocation of the form " x.y.f(e1,..en) ". Here, x.y.f constitute a partially- or fully-qualified name and e1 ... en are the argument expressions . @author David J. Pearce

Source from the content-addressed store, hash-verified

2831 *
2832 */
2833 public static class Invoke extends AbstractItem implements Expr, NaryOperator, Bindable {
2834
2835 public Invoke(Decl.Binding<Type.Callable, Decl.Callable> binding, Tuple<Expr> arguments) {
2836 super(EXPR_invoke, binding, arguments);
2837 }
2838
2839 @Override
2840 public Type getType() {
2841 return getBinding().getConcreteType().getReturn();
2842 }
2843
2844 @Override
2845 public void setType(Type type) {
2846 throw new UnsupportedOperationException();
2847 }
2848
2849 @Override
2850 public Decl.Link<Decl.Callable> getLink() {
2851 return getBinding().getLink();
2852 }
2853
2854 @Override
2855 public Decl.Binding<Type.Callable,Decl.Callable> getBinding() {
2856 return (Decl.Binding<Type.Callable,Decl.Callable>) get(0);
2857 }
2858
2859 @Override
2860 @SuppressWarnings("unchecked")
2861 public Tuple<Expr> getOperands() {
2862 return (Tuple<Expr>) get(1);
2863 }
2864
2865 @SuppressWarnings("unchecked")
2866 @Override
2867 public Invoke clone(Syntactic.Item[] operands) {
2868 return new Invoke((Decl.Binding<Type.Callable, Decl.Callable>) operands[0], (Tuple<Expr>) operands[1]);
2869 }
2870
2871 @Override
2872 public String toString() {
2873 return getBinding().toString() + getOperands();
2874 }
2875
2876 public static final Descriptor DESCRIPTOR_0 = new Descriptor(Operands.TWO, Data.ZERO, "EXPR_invoke") {
2877 @SuppressWarnings("unchecked")
2878 @Override
2879 public Syntactic.Item construct(int opcode, Syntactic.Item[] operands, byte[] data) {
2880 return new Invoke((Decl.Binding<Type.Callable, Decl.Callable>) operands[0],
2881 (Tuple<Expr>) operands[1]);
2882 }
2883 };
2884 }
2885
2886 /**
2887 * Represents an indirect invocation of the form "<code>x.y(e1,..en)</code>".

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected