@SuppressWarnings("unchecked") public AFunctionType getPreType(AOperationType type, AStateDefinition state, SClassDefinition classname, boolean isStatic) { if (state != null) { PTypeList params = new PTypeList(); params.addAll((LinkedList<PType>) type.getParameters().clone()); params.add(AstFactory.newAUnresolvedType(state.getName())); return AstFactory.newAFunctionType(type.getLocation(), false, params, AstFactory.newABooleanBasicType(type.getLocation())); } else if (classname != null && !isStatic) { PTypeList params = new PTypeList(); params.addAll((Collection<? extends PType>) type.getParameters().clone()); params.add(AstFactory.newAUnresolvedType(classname.getName())); return AstFactory.newAFunctionType(type.getLocation(), false, params, AstFactory.newABooleanBasicType(type.getLocation())); } else { return AstFactory.newAFunctionType(type.getLocation(), false, (List<PType>) type.getParameters().clone(), AstFactory.newABooleanBasicType(type.getLocation())); } }
@SuppressWarnings("unchecked") public AFunctionType getPostType(AOperationType type, AStateDefinition state, SClassDefinition classname, boolean isStatic) { PTypeList params = new PTypeList(); params.addAll((LinkedList<PType>) type.getParameters().clone()); if (!(type.getResult() instanceof AVoidType)) { params.add(type.getResult().clone()); } if (state != null) { params.add(AstFactory.newAUnresolvedType(state.getName())); params.add(AstFactory.newAUnresolvedType(state.getName())); } else if (classname != null) { AMapMapType map = AstFactory.newAMapMapType(type.getLocation(), AstFactory.newASeqSeqType(type.getLocation(), AstFactory.newACharBasicType(type.getLocation())), AstFactory.newAUnknownType(type.getLocation())); params.add(map); if (!isStatic) { params.add(AstFactory.newAUnresolvedType(classname.getName())); } } return AstFactory.newAFunctionType(type.getLocation(), false, params, AstFactory.newABooleanBasicType(type.getLocation())); }
fixed.add(AstFactory.newAUnknownType(type.getLocation())); fixed.add(AstFactory.newAUnknownType(type.getLocation()));