diff --git a/src/main/java/complexityparser/types/Input.java b/src/main/java/complexityparser/types/FOTier.java similarity index 56% rename from src/main/java/complexityparser/types/Input.java rename to src/main/java/complexityparser/types/FOTier.java index 81afd5155e1b700ebcece91364c54c5e4fd22764..03d19c42d27087f3d2569111f91188d573b0dba7 100644 --- a/src/main/java/complexityparser/types/Input.java +++ b/src/main/java/complexityparser/types/FOTier.java @@ -18,27 +18,36 @@ package complexityparser.types; import lib.Mask; import java.util.Arrays; +import java.util.Objects; -public class Input { +public class FOTier { private Tier[] in; - private Output out; +// private Output out; + private Tier out; + private Tier env; /** - * Class for encoding the tier types of operators. - * @param out - the operator output type. - * @param in - the operator input tiered type. + * Class for encoding the First Order Tier of operators, constructors, and methods. + * @param out - the output tier. + * @param in - the input tiers. + * @param env - the environment tier. */ - public Input(Output out, Tier... in) { + public FOTier(Tier out, Tier... in) { this.in = in; this.out = out; } + public FOTier(Tier out, Tier env, Tier... in) { + this.in = in; + this.out = out; + this.env = env; + } - public Input() { + public FOTier() { } /** * - * @return the operator input tiers. + * @return the input tiers. */ public Tier[] getIn() { return in; @@ -46,16 +55,40 @@ public class Input { /** * - * @return the operator output type. + * @return the output tier. */ - public Output getOut() { + public Tier getOut() { return out; } + /** + * Sets the output tier. + * @param out - a tier. + */ + public void setOut(Tier out) { + this.out = out; + } + + /** + * + * @return the environment tier (unused for operators). + */ + public Tier getEnv() { + return env; + } + + /** + * Sets the environment tier. + * @param env - a tier. + */ + public void setEnv(Tier env) { + this.env = env; + } + /** * * @param in - input tiers. - * @return true if the parameter tiers matches the operator input tiers. + * @return true if the parameter tiers match the input tiers. */ public boolean contains(Tier... in) { return Arrays.equals(this.in, in); @@ -92,7 +125,7 @@ public class Input { /** * - * @return the number of parameters (arity) of the current operator. + * @return the number of input tiers (arity) of the current operator. */ public int size() { return in.length; @@ -100,6 +133,27 @@ public class Input { @Override public String toString() { - return Arrays.toString(in) + " > " + out; + return Arrays.toString(in) + " > " + "(" + out + ", " + env + ")"; + } + + /* @Override + public String toString() { + return "(" + out + ", " + env + ")"; + }*/ + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + FOTier output = (FOTier) o; + return out == output.out && + env == output.env; + } +//taken directly from former class Output... + @Override + public int hashCode() { + return Objects.hash(out, env); } + + } \ No newline at end of file diff --git a/src/main/java/complexityparser/types/Operator.java b/src/main/java/complexityparser/types/Operator.java index 36dc7b6cb75756169550709834c2043674c6fb8d..17ce37599c2db49f6d8eedfffa7ba835c8852a8f 100644 --- a/src/main/java/complexityparser/types/Operator.java +++ b/src/main/java/complexityparser/types/Operator.java @@ -25,10 +25,10 @@ import complexityparser.types.env.TypingEnv; /** - * Represents the admissible tier types of an operator. + * Represents the admissible first order tiers of an operator, constructor, or method. */ public class Operator { - private ArrayList<Input> results; + private ArrayList<FOTier> results; private int arity; private boolean primitiveReturnType; @@ -57,16 +57,16 @@ public class Operator { * @param p - the input tiers * @throws IOException */ - public void add(Output res, Tier... p) throws IOException { + public void add(Tier out, Tier env, Tier... in) throws IOException { if(arity == -1) { - arity = p.length; + arity = in.length; } - if(arity != p.length) { + if(arity != in.length) { //If the cardinality of the input tiers given as paramater is distinct from the operator arity //then an exception is thrown. - throw new IOException("Operator::addObserver input of wrong size expected " + arity + " got " + p.length); + throw new IOException("Operator::addObserver input of wrong size expected " + arity + " got " + in.length); } - results.add(new Input(res, p)); + results.add(new FOTier(out,env,in)); } /** @@ -87,9 +87,9 @@ public class Operator { /** * * @param i - the index to get. - * @return the input tier of index i. + * @return the first order tier of index i. */ - public Input get(int i) { + public FOTier get(int i) { return results.get(i); } @@ -98,13 +98,13 @@ public class Operator { * @param in - input tiers. * @return the output tier matching the given input tiers in and (NONE, NONE), if no match is found. */ - public Output findRes(Tier... in) { - for(Input i : results) { + public FOTier findRes(Tier... in) { + for(FOTier i : results) { if(i.contains(in)) { - return i.getOut(); + return i; } } - return new Output(Tier.None, Tier.None); + return new FOTier(Tier.None, Tier.None, new Tier[0]); } /** @@ -113,17 +113,17 @@ public class Operator { * @param in - input tiers. * @return a compatible output marching the input tiers in and the mask m, (NONE, NONE) if no match is found. */ - public Output findCompatibleRes(Mask m, Tier... in) { - for(Input i : results) { + public FOTier findCompatibleRes(Mask m, Tier... in) { + for(FOTier i : results) { if(i.isCompatibleWith(m, in)) { //the array is deep copied to avoid any unwanted side effect //and to provide another possible returned value (the current input tiers instead of the parameter input tiers, //both being compatible) System.arraycopy(i.getIn(), 0, in, 0, in.length); - return i.getOut(); + return i; } } - return new Output(Tier.None, Tier.None); + return new FOTier(Tier.None, Tier.None, new Tier[0]); } /** @@ -132,20 +132,20 @@ public class Operator { * @param in - input tiers. * @return all the compatible inputs of the operator. */ - public Input[] findAllCompatibles(Mask m, Tier... in) { - ArrayList<Input> res = new ArrayList<>(results.size()); - for(Input i : results) { + public FOTier[] findAllCompatibles(Mask m, Tier... in) { + ArrayList<FOTier> res = new ArrayList<>(results.size()); + for(FOTier i : results) { if(i.isCompatibleWith(m, in)) { res.add(i); } } - return res.toArray(new Input[0]); + return res.toArray(new FOTier[0]); } @Override public String toString() { StringBuilder str = new StringBuilder(); - for(Input i : results) { + for(FOTier i : results) { str.append("\t"); str.append(i); str.append(";\n"); diff --git a/src/main/java/complexityparser/types/Output.java b/src/main/java/complexityparser/types/Output.java deleted file mode 100644 index aafe37c0b0456e8ca252b709e78e6c9132c5e2d1..0000000000000000000000000000000000000000 --- a/src/main/java/complexityparser/types/Output.java +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 2019 ZEYEN Olivier, PÉCHOUX Romain, HAINRY Emmanuel, JEANDEL Emmanuel - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package complexityparser.types; - -import java.util.Objects; - -/** - * a class encoding the output tier of a method - * that consists of a return tier #out and a (method) body (block) tier #env. - */ -public class Output { - private Tier out; - private Tier env; - - public Output(Tier out) { - this.out = out; - } - - public Output(Tier out, Tier env) { - this.out = out; - this.env = env; - } - - /** - * - * @return the return tier. - */ - public Tier getOut() { - return out; - } - - /** - * Sets the return tier. - * @param out - a tier. - */ - public void setOut(Tier out) { - this.out = out; - } - - /** - * - * @return the method body tier (unused for operators). - */ - public Tier getEnv() { - return env; - } - - /** - * Sets the body tier. - * @param env - a tier. - */ - public void setEnv(Tier env) { - this.env = env; - } - - @Override - public String toString() { - return "(" + out + ", " + env + ")"; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Output output = (Output) o; - return out == output.out && - env == output.env; - } - - @Override - public int hashCode() { - return Objects.hash(out, env); - } -} \ No newline at end of file diff --git a/src/main/java/complexityparser/types/env/OperatorTypingEnvBuilder.java b/src/main/java/complexityparser/types/env/OperatorTypingEnvBuilder.java index 4ca8906c5904e9a43af1e1cc15b6e7bb21bda5d6..8d539402ec48d76b1f80413c3548b1035171d462 100644 --- a/src/main/java/complexityparser/types/env/OperatorTypingEnvBuilder.java +++ b/src/main/java/complexityparser/types/env/OperatorTypingEnvBuilder.java @@ -20,11 +20,12 @@ import org.antlr.v4.runtime.tree.TerminalNode; import java.io.IOException; import java.util.List; import complexityparser.types.Tier; +import complexityparser.types.FOTier; import complexityparser.types.Operator; -import complexityparser.types.Output; /** - * This class is only used to load the Operators configuration file. + * This class is only used to load the configuration file operators.config containing a description of + * the operators admissible first order tiers. */ public class OperatorTypingEnvBuilder extends OperatorsBaseListener { @@ -69,7 +70,7 @@ public class OperatorTypingEnvBuilder extends OperatorsBaseListener { in[i] = Tier.fromString(list.get(i).getText()); } try { - latest.add(new Output(out, Tier.T0), in); + latest.add(out, Tier.T0,in); } catch (IOException e) { e.printStackTrace(); te = null; diff --git a/src/main/java/complexityparser/types/env/TypingEnv.java b/src/main/java/complexityparser/types/env/TypingEnv.java index 87f7d77d2f8ba1c1f218ca0f3f4ab20f75cf554d..e88116bb443a813d1d74cf76ef966767b3a26520 100644 --- a/src/main/java/complexityparser/types/env/TypingEnv.java +++ b/src/main/java/complexityparser/types/env/TypingEnv.java @@ -16,10 +16,9 @@ limitations under the License. package complexityparser.types.env; -import complexityparser.types.Operator; import complexityparser.types.Tier; -import complexityparser.types.Output; -import complexityparser.types.Input; +import complexityparser.types.FOTier; +import complexityparser.types.Operator; import complexityparser.tos.TOS; import lib.Mask; import org.antlr.v4.runtime.CharStream; @@ -35,7 +34,9 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Map; /** -* This class encodes typing environements: information about the operations (operator, method, ...) and their (admissible) types. +* A singleton class encoding typing environments. +* A hashmap relating an operation (operator, method, ...) name to the corresponding operator. +* (An operator has an attribute results of type ArrayList<FOTier> containing an arraylist of admissible FOTier). */ public class TypingEnv { private static TypingEnv instance = null; @@ -46,7 +47,7 @@ public class TypingEnv { } /** - * Initializes the singleton using the file 'operators.config' in the working directory + * Initializes the singleton using the file 'operators.config' in the working directory. * @throws IOException */ public static void loadInstanceFromFile() throws IOException { @@ -57,8 +58,8 @@ public class TypingEnv { } /** - * Removes any entry, starting from <root>. - * The entries are supposed to be method entries generated by the parser visitor. + * Removes any entry of the hashmap env, starting from <root>. + * The entries are supposed to be method entries generated by the visitor parser. */ public void clear() { ArrayList<String> keys = new ArrayList<>(); @@ -82,8 +83,8 @@ public class TypingEnv { /** * Adds an operator and a name to the typing environment. - * @param k - a name - * @param o - an operator + * @param k - a name. + * @param o - an operator. */ public void add(String k, Operator o) { env.put(k, o); @@ -96,11 +97,11 @@ public class TypingEnv { * @return an output tier matching an given operator namespace and input tiers given as parameters. * A default output tier (None) if no match is found. */ - public Output findRes(String r, Tier... in) { + public FOTier findRes(String r, Tier... in) { if(env.containsKey(r)) { return env.get(r).findRes(in); } - return new Output(Tier.None, Tier.None); + return new FOTier(Tier.None, Tier.None, new Tier[0]); } /** @@ -108,23 +109,25 @@ public class TypingEnv { * @param r - a name. * @param m - a mask. * @param in - input tiers. - * @return a compatible output tier matching a namespace, a mask, and input tiers. A default output tier if no match is found. + * @return a compatible FOTier matching a namespace, a mask, and input tiers. + * A default FOTier if no match is found. */ - public Output findCompatibleIn(String r, Mask m, Tier... in) { + public FOTier findCompatibleIn(String r, Mask m, Tier... in) { if(env.containsKey(r)) { return env.get(r).findCompatibleRes(m, in); } - return new Output(Tier.None, Tier.None); + return new FOTier(Tier.None, Tier.None,new Tier[0]); } /** - * the behaviour is different from #findRes(String r, Tier... in) because additional checks need to be performed on overriden methods + * The behaviour is different from #findRes(String r, Tier... in): + * Additional checks are performed on overriden methods. * @param r - a name. * @param in - input tiers. - * @return the output tier matching a method namespace and input tiers. + * @return the FOTier matching a method namespace and input tiers. */ - public Output findMethod(String r, Tier... in) { - Output res = null; + public FOTier findMethod(String r, Tier... in) { + FOTier res = null; TOS tos = TOS.getInstance(); while (!r.contains("<root>::Object::") && !env.containsKey(r)) { r = tos.getParentNamespace(r); @@ -138,60 +141,62 @@ public class TypingEnv { } /** - * the behaviour is different from f#indCompatibleIn(String r, Mask m, Tier... in) because additional checks need to be performed on overriden methods + * The behaviour is different from #findCompatibleIn(String r, Mask m, Tier... in): + * Additional checks are performed on overriden methods. * @param r - a name. + * @param m - a mask. * @param in - input tiers. - * @return a compatible output tier matching a method namespace and input tiers. + * @return a compatible FOTier matching a method namespace, mask, and input tiers. */ - public Output findCompatibleMethod(String r, Mask m, Tier... in) { + public FOTier findCompatibleMethod(String r, Mask m, Tier... in) { TOS tos = TOS.getInstance(); while (!r.contains("<root>::Object::") && !env.containsKey(r)) { r = tos.getParentNamespace(r); } if(!r.contains("<root>::Object") && env.containsKey(r)) { - Input[] res = env.get(r).findAllCompatibles(m, in); - for(Input i : res) { - Output tmp = checkOverrideMethod(r, i.getOut(), i.getIn()); - if( ! tmp.equals(new Output(Tier.None, Tier.None))) { + FOTier[] res = env.get(r).findAllCompatibles(m, in); + for(FOTier i : res) { + FOTier tmp = checkOverrideMethod(r, i, i.getIn()); + if( ! tmp.equals(new FOTier(Tier.None, Tier.None,in))) { return tmp; } } } - return new Output(Tier.None, Tier.None); + return new FOTier(Tier.None, Tier.None, new Tier[0]); } /** * Methods returning a primitive type do not need to return exactly the same tier. * Methods returning reference type need to preserve exactly the tier. - * The check will be performed on every subclass to handle of polymorphism (overrides). + * The check will be performed on every subclass to handle method overrides. * @param r - a name. - * @param out - an output tier. + * @param out - a FOTier. * @param in - input tiers. - * @return an output tier matching the input and a default output tier if there is no match. + * @return a FOTier matching the inputs. A default output tier if there is no match. */ - public Output checkOverrideMethod(String r, Output out, Tier... in) { + public FOTier checkOverrideMethod(String r, FOTier out, Tier... in) { TOS tos = TOS.getInstance(); //Only the children need to be verified since no superclass can be used in case of polymorphism. return checkOverrideMethod_aux(r, out, in); } /** - * A recursive algorithm to check the if the method of namespace r, input tiers, and output tier are compatible whith + * A recursive algorithm to check the if the method of namespace, input tiers, and FOTier are compatible with * the class hierarchy. - * @param r - a method name. - * @param out - an output tier. + * @param r - a namespace. + * @param out - a FOTier. * @param in - input tiers. - * @return an output tier matching the input and a default output tier if there is no match. + * @return a FOTier matching the inputs. A default FOTier if there is no match. */ - private Output checkOverrideMethod_aux(String r, Output out, Tier... in) { - Output res = new Output(out.getOut(), out.getEnv()); + private FOTier checkOverrideMethod_aux(String r, FOTier out, Tier... in) { + FOTier res = new FOTier(out.getOut(),out.getEnv(),in); if(env.containsKey(r)) { - Output tmp = env.get(r).findRes(in); + FOTier tmp = env.get(r).findRes(in); /* - the method return type has to be typed by considering possible overridings: + The method return type has to be typed by considering possible method overrides: --if the return type is a primitive type: the output tier is the minimum of input tiers; - --else (the return type is a reference type): all the tiers must be equal. - The tier of the method body is the maximum of the input tiers. + --else, if the return type is a reference type, all the tiers must be equal. + The environment tier is the maximum of the input tiers. */ res.setEnv(Tier.max(tmp.getEnv(), out.getEnv())); if(env.get(r).isPrimitiveReturnType()) { @@ -199,7 +204,7 @@ public class TypingEnv { } else { if(res.getOut() != out.getOut()) { - return new Output(Tier.None, Tier.None); + return new FOTier(Tier.None, Tier.None, new Tier[0]); } } } @@ -207,14 +212,14 @@ public class TypingEnv { String[] children = tos.getChildrenNamespaces(r); if(children != null) { for (int i = 0; i < children.length; i++) { - Output tmp = checkOverrideMethod_aux(children[i], res, in); + FOTier tmp = checkOverrideMethod_aux(children[i], res, in); res.setEnv(Tier.max(tmp.getEnv(), out.getEnv())); if(env.get(r).isPrimitiveReturnType()) { res.setOut(Tier.min(tmp.getOut(), out.getOut())); } else { if(res.getOut() != out.getOut()) { - return new Output(Tier.None, Tier.None); + return new FOTier(Tier.None, Tier.None, new Tier[0]); } } } @@ -223,7 +228,7 @@ public class TypingEnv { } /** - * loads the operators FOTypes from a file using the ANTLR grammar and the OperatorTypingEnvBuilder class. + * Loads the operators FOTiers from a file using the ANTLR grammar and the OperatorTypingEnvBuilder class. * @param fileName - a file name. * @return the singleton instance of TypingEnv. */ @@ -252,7 +257,7 @@ public class TypingEnv { /** * * @param namespace - a namespace. - * @return the operator associated with the given namespace + * @return the operator associated with the given namespace. */ public Operator get(String namespace) { return env.get(namespace); diff --git a/src/main/java/complexityparser/typingVisitors/FinalPass.java b/src/main/java/complexityparser/typingVisitors/FinalPass.java index d93533fdaef53b1336dce92fbcfdcf1d9367c22c..39f54e4626dcc4f2a84725bd271350f373cbc697 100644 --- a/src/main/java/complexityparser/typingVisitors/FinalPass.java +++ b/src/main/java/complexityparser/typingVisitors/FinalPass.java @@ -20,9 +20,8 @@ package complexityparser.typingVisitors; import complexityparser.analyse.antlr.JavaParser; import complexityparser.listeners.TOSBuilder; import complexityparser.listeners.TypingListener; -import complexityparser.types.Input; import complexityparser.types.Operator; -import complexityparser.types.Output; +import complexityparser.types.FOTier; import complexityparser.types.Tier; import complexityparser.typingVisitors.base.ObjectVisitor; import org.antlr.v4.runtime.CommonTokenStream; @@ -88,8 +87,8 @@ public class FinalPass extends ObjectVisitor { putTierType(ctx, Tier.None, Tier.None); } else { - Input o = op.get(0); - putTierType(ctx, o.getOut().getOut(), o.getOut().getEnv()); + FOTier o = op.get(0); + putTierType(ctx, o.getOut(), o.getEnv()); } return null; } diff --git a/src/main/java/complexityparser/typingVisitors/FirstPass.java b/src/main/java/complexityparser/typingVisitors/FirstPass.java index 04ebab484397845f11d25e939d7cf8f0a46fe4a7..51cfa9257f52d891fe3b6d32c6353c975bb9ee7a 100644 --- a/src/main/java/complexityparser/typingVisitors/FirstPass.java +++ b/src/main/java/complexityparser/typingVisitors/FirstPass.java @@ -21,7 +21,7 @@ import complexityparser.listeners.TOSBuilder; import complexityparser.listeners.TypingListener; import complexityparser.types.Tier; import complexityparser.types.Operator; -import complexityparser.types.Output; +import complexityparser.types.FOTier; import complexityparser.types.TierArray; import complexityparser.typingVisitors.base.ObjectVisitor; import lib.graph.Graph; @@ -91,7 +91,7 @@ public class FirstPass extends ObjectVisitor { tmp = Tier.T0; } try { - op.add(new Output(tmp, env), paramTiers.getArray()); + op.add(tmp, env, paramTiers.getArray()); } catch (IOException e) { e.printStackTrace(); } @@ -112,7 +112,7 @@ public class FirstPass extends ObjectVisitor { resEnv = env; res = tmp; try { - op.add(new Output(tmp, env), paramTiers.getArray()); + op.add(tmp, env, paramTiers.getArray()); } catch (IOException e) { e.printStackTrace(); } diff --git a/src/main/java/complexityparser/typingVisitors/SecondPass.java b/src/main/java/complexityparser/typingVisitors/SecondPass.java index 76742bc4175b405611b81b797e04e9711ca69ada..6c9080fb55486d3915b1e59c384cc744e3a0f48a 100644 --- a/src/main/java/complexityparser/typingVisitors/SecondPass.java +++ b/src/main/java/complexityparser/typingVisitors/SecondPass.java @@ -17,7 +17,7 @@ limitations under the License. package complexityparser.typingVisitors; import complexityparser.types.Tier; -import complexityparser.types.Input; +import complexityparser.types.FOTier; import complexityparser.types.Operator; import complexityparser.analyse.antlr.JavaParser; import complexityparser.listeners.TOSBuilder; @@ -78,7 +78,7 @@ public class SecondPass extends ObjectVisitor { setRecursiveCallsReceivers(new HashSet<>()); setWhileCount(0); //Set the parameters types in the TOS. - Input input = op.get(i); + FOTier input = op.get(i); setActualEnvironment(input.getIn()[0]); if(nbParam != 0) { setParamTiers(ctx.formalParameters(), input.getIn(), noBloc); diff --git a/src/main/java/complexityparser/typingVisitors/base/BaseExpressionVisitor.java b/src/main/java/complexityparser/typingVisitors/base/BaseExpressionVisitor.java index 6e176e2469799085473e25f59b14c966108791ef..d000e780038aae557966bb813d7c6d939c5b5ae4 100644 --- a/src/main/java/complexityparser/typingVisitors/base/BaseExpressionVisitor.java +++ b/src/main/java/complexityparser/typingVisitors/base/BaseExpressionVisitor.java @@ -21,7 +21,7 @@ import complexityparser.analyse.antlr.JavaParser; import complexityparser.listeners.TOSBuilder; import complexityparser.listeners.TypingListener; import complexityparser.tos.id.VariableID; -import complexityparser.types.Output; +import complexityparser.types.FOTier; import complexityparser.types.Tier; import complexityparser.types.tieredtypes.TieredType; import complexityparser.types.tieredtypes.VariableTieredType; @@ -231,7 +231,7 @@ public abstract class BaseExpressionVisitor extends BaseVisitor { Tier env = getEnvironmentType(ctx.expression()); String op = ctx.prefix.getText(); String type = getType(ctx.expression()); - Output out = te.findRes(op, res); + FOTier out = te.findRes(op, res); if(out == null || out.getOut() == Tier.None) { if(type.equals("int") || type.equals("boolean")) { Mask m = new Mask(1); diff --git a/src/main/java/complexityparser/typingVisitors/base/ObjectVisitor.java b/src/main/java/complexityparser/typingVisitors/base/ObjectVisitor.java index b0ed56f68cc71a721662ef9017aff9f6d5db4ff9..17dc7f53b97563a795f99c3c8402e38445d95f60 100644 --- a/src/main/java/complexityparser/typingVisitors/base/ObjectVisitor.java +++ b/src/main/java/complexityparser/typingVisitors/base/ObjectVisitor.java @@ -18,9 +18,8 @@ package complexityparser.typingVisitors.base; import complexityparser.types.Tier; import complexityparser.types.tieredtypes.TieredType; -import complexityparser.types.Input; +import complexityparser.types.FOTier; import complexityparser.types.Operator; -import complexityparser.types.Output; import complexityparser.analyse.antlr.JavaParser; import complexityparser.listeners.TOSBuilder; import complexityparser.listeners.TypingListener; @@ -246,7 +245,7 @@ public abstract class ObjectVisitor extends BaseBlockStatementVisitor { } //Finds the namespace in the operator table //and returns a compatible output with the input found in the parameters and the receiver type. - Output output = te.findMethod(namespace, paramTiers.getArray()); + FOTier output = te.findMethod(namespace, paramTiers.getArray()); if(output == null || output.getOut() == Tier.None) { output = te.findCompatibleMethod(namespace, mask, paramTiers.getArray()); if(output == null) {