diff --git a/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/staticanalyser/EolStaticAnalyser.java b/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/staticanalyser/EolStaticAnalyser.java index ccdba67a0..30ebeb3e0 100644 --- a/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/staticanalyser/EolStaticAnalyser.java +++ b/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/staticanalyser/EolStaticAnalyser.java @@ -115,18 +115,9 @@ public class EolStaticAnalyser implements IModuleValidator, IEolVisitor { protected List errors = new ArrayList<>(); protected List warnings = new ArrayList<>(); protected EolModule module; - protected BuiltinEolModule builtinModule = new BuiltinEolModule(); protected EolStaticAnalysisContext context = new EolStaticAnalysisContext(); protected List operations = new ArrayList<>(); - HashMap returnFlags = new HashMap<>(); - // For compiling user and builtin operations -// HashMap> operations = new HashMap<>(); // keeping all matched - // operations with same name - HashMap> matchedOperations = new HashMap<>(); // keeping all matched - // parameters - HashMap> matchedReturnType = new HashMap<>(); // keeping returnTypes of - // matched operations - HashMap matched = new HashMap<>(); // finding one perfect match, in doesn't change // for every missmatch + HashMap returnFlags = new HashMap<>(); // for every missmatch public EolStaticAnalyser() { } @@ -137,7 +128,6 @@ public EolStaticAnalyser(IModelFactory modelFactory) { @Override public void visit(AbortStatement abortStatement) { - // TODO Auto-generated method stub } @Override @@ -153,7 +143,6 @@ public void visit(DeleteStatement deleteStatement) { @Override public void visit(AnnotationBlock annotationBlock) { - // TODO Auto-generated method stub } @Override @@ -190,14 +179,10 @@ public void visit(BooleanLiteral booleanLiteral) { @Override public void visit(BreakStatement breakStatement) { - // TODO Auto-generated method stub - } @Override public void visit(Case case_) { - // TODO Auto-generated method stub - } @Override @@ -212,14 +197,10 @@ public void visit(CollectionLiteralExpression collectionLiteralExpression) { @Override public void visit(ComplexOperationCallExpression complexOperationCallExpression) { - // TODO Auto-generated method stub - } @Override public void visit(ContinueStatement continueStatement) { - // TODO Auto-generated method stub - } @Override @@ -242,8 +223,6 @@ public void visit(ElvisOperatorExpression elvisOperatorExpression) { @Override public void visit(EnumerationLiteralExpression enumerationLiteralExpression) { - // TODO Auto-generated method stub - } @Override @@ -473,8 +452,6 @@ public void visit(ImpliesOperatorExpression impliesOperatorExpression) { @Override public void visit(Import import_) { - // TODO Auto-generated method stub - } @Override @@ -515,8 +492,6 @@ public void visit(LessThanOperatorExpression lessThanOperatorExpression) { @Override public void visit(MapLiteralExpression mapLiteralExpression) { - // TODO Auto-generated method stub - } @Override @@ -589,8 +564,6 @@ public void visit(ModelDeclaration modelDeclaration) { @Override public void visit(ModelDeclarationParameter modelDeclarationParameter) { - // TODO Auto-generated method stub - } @Override @@ -674,7 +647,6 @@ public void visit(OperationCallExpression operationCallExpression) { Expression targetExpression = operationCallExpression.getTargetExpression(); List parameterExpressions = operationCallExpression.getParameterExpressions(); NameExpression nameExpression = operationCallExpression.getNameExpression(); - setMatchedReturnType(operationCallExpression, new ArrayList()); EolType contextType = EolNoType.Instance; if (targetExpression != null) { @@ -980,8 +952,6 @@ public void visit(ReturnStatement returnStatement) { @Override public void visit(SimpleAnnotation simpleAnnotation) { - // TODO Auto-generated method stub - } @Override @@ -998,8 +968,6 @@ public void visit(StringLiteral stringLiteral) { @Override public void visit(SwitchStatement switchStatement) { - // TODO Auto-generated method stub - } @Override @@ -1021,8 +989,6 @@ public void visit(TimesOperatorExpression timesOperatorExpression) { @Override public void visit(TransactionStatement transactionStatement) { - // TODO Auto-generated method stub - } @Override @@ -1086,7 +1052,6 @@ public void visit(TypeExpression typeExpression) { EolModelElementType modelElementType = getModelElementType(typeExpression.getName(), typeExpression); if (modelElementType != null) { type = modelElementType; - // System.out.println("Printing:"+modelElementType.getMetaClass().getSuperTypes().get(0).getName()); if (modelElementType.getMetaClass() == null && !context.getModelDeclarations().isEmpty()) { errors.add(new ModuleMarker(typeExpression, "Unknown type " + typeExpression.getName(), Severity.Error)); @@ -1312,112 +1277,6 @@ public void createTypeCompatibilityError(Expression requiredExpression, Expressi Severity.Error)); } - public Operation getExactMatchedOperation(OperationCallExpression oc) { - List operations = matchedOperations.get(oc); - if (operations == null) - return null; - if (operations.isEmpty()) - return null; - if (operations.size() > 1) { - // Check contextType - for (Operation operation : operations) { - if (operation.getContextTypeExpression() != null) { - EolType operationContextType = getResolvedType(operation.getContextTypeExpression()); - EolType opCallExpContextType = getResolvedType(oc.getTargetExpression()); - - if (isCompatible(operationContextType, opCallExpContextType)) { - int loopCounter = 0; - if (oc.getParameterExpressions().size() > 1) { - for (Expression parameter : oc.getParameterExpressions()) { - EolType paramContextType = getResolvedType( - operation.getFormalParameters().get(loopCounter).getTypeExpression()); - EolType paramTargetType = getResolvedType(parameter); - if (isCompatible(paramContextType, paramTargetType)) { - oc.getData().put("exactMatch", operation); - return operation; - } - loopCounter++; - } - loopCounter = 0; - for (Expression parameter : oc.getParameterExpressions()) { - EolType paramContextType = getResolvedType( - operation.getFormalParameters().get(loopCounter).getTypeExpression()); - EolType paramTargetType = getResolvedType(parameter); - if (canBeCompatible(paramContextType, paramTargetType)) { - oc.getData().put("exactMatch", operation); - return operation; - } - loopCounter++; - } - - } - return operation; - - } else if (canBeCompatible(operationContextType, opCallExpContextType)) { - int loopCounter = 0; - if (oc.getParameterExpressions().size() > 1) { - for (Expression parameter : oc.getParameterExpressions()) { - EolType paramContextType = getResolvedType( - operation.getFormalParameters().get(loopCounter).getTypeExpression()); - EolType paramTargetType = getResolvedType(parameter); - if (isCompatible(paramContextType, paramTargetType)) { - oc.getData().put("exactMatch", operation); - return operation; - } - loopCounter++; - } - loopCounter = 0; - for (Expression parameter : oc.getParameterExpressions()) { - EolType paramContextType = getResolvedType( - operation.getFormalParameters().get(loopCounter).getTypeExpression()); - EolType paramTargetType = getResolvedType(parameter); - if (canBeCompatible(paramContextType, paramTargetType)) { - oc.getData().put("exactMatch", operation); - return operation; - } - loopCounter++; - } - - } - oc.getData().put("exactMatch", operation); - return operation; - } - } else { - if (oc.getParameterExpressions().size() > 1) { - int loopCounter = 0; - for (Expression parameter : oc.getParameterExpressions()) { - EolType paramContextType = getResolvedType( - operation.getFormalParameters().get(loopCounter).getTypeExpression()); - EolType paramTargetType = getResolvedType(parameter); - if (isCompatible(paramContextType, paramTargetType)) { - oc.getData().put("exactMatch", operation); - return operation; - } - loopCounter++; - } - loopCounter = 0; - for (Expression parameter : oc.getParameterExpressions()) { - EolType paramContextType = getResolvedType( - operation.getFormalParameters().get(loopCounter).getTypeExpression()); - EolType paramTargetType = getResolvedType(parameter); - if (canBeCompatible(paramContextType, paramTargetType)) { - oc.getData().put("exactMatch", operation); - return operation; - } - loopCounter++; - } - - } - oc.getData().put("exactMatch", operation); - return operation; - } - } - - } - oc.getData().put("exactMatch", operations.get(0)); - return operations.get(0); - } - public boolean isCompatible(EolType targetType, EolType valueType) { if (targetType.equals(EolNoType.Instance) || valueType.equals(EolNoType.Instance)) { @@ -1647,38 +1506,6 @@ public void setReturnFlag(Operation op, boolean returnFlag) { returnFlags.put(op, returnFlag); } -// public ArrayList getOperations(OperationCallExpression operationCallExpression) { -// return operations.get(operationCallExpression); -// } -// -// public void setOperations(OperationCallExpression operationCallExpression, ArrayList ops) { -// operations.put(operationCallExpression, ops); -// } - - public ArrayList getMatchedOperations(OperationCallExpression operationCallExpression) { - return matchedOperations.get(operationCallExpression); - } - - public void setMatchedOperations(OperationCallExpression operationCallExpression, ArrayList ops) { - matchedOperations.put(operationCallExpression, ops); - } - - public ArrayList getMatchedReturnType(OperationCallExpression operationCallExpression) { - return matchedReturnType.get(operationCallExpression); - } - - public void setMatchedReturnType(OperationCallExpression operationCallExpression, ArrayList returnTypes) { - matchedReturnType.put(operationCallExpression, returnTypes); - } - - public Boolean getMatched(OperationCallExpression operationCallExpression) { - return matched.get(operationCallExpression); - } - - public void setMatched(OperationCallExpression operationCallExpression, boolean match) { - matched.put(operationCallExpression, match); - } - public void setResolvedType(Expression expression, EolType type) { expression.getData().put("resolvedType", type); } diff --git a/plugins/org.eclipse.epsilon.examples.staticanalyser/.META-INF_MANIFEST.MF b/plugins/org.eclipse.epsilon.examples.staticanalyser/.META-INF_MANIFEST.MF deleted file mode 100644 index e69de29bb..000000000 diff --git a/plugins/org.eclipse.epsilon.examples.staticanalyser/.polyglot..META-INF_MANIFEST.MF b/plugins/org.eclipse.epsilon.examples.staticanalyser/.polyglot..META-INF_MANIFEST.MF deleted file mode 100644 index e69de29bb..000000000