bin/pep8analysis:
mkdir -p bin
- ../../bin/nitg --global -o bin/pep8analysis -I lib src/pep8analysis.nit
+ ../../bin/nitg --global -o bin/pep8analysis src/pep8analysis.nit
doc/index.html:
- ../../bin/nitdoc -I lib src/pep8analysis.nit
+ ../../bin/nitdoc src/pep8analysis.nit
tests: bin/pep8analysis
bin/pep8analysis --cfg-long tests/privat/*.pep tests/laf/*.pep tests/terrasa/*.pep
import cfg
-import advanced_collections
class FlowAnalysis[S]
super Visitor
for e in self do res += res.hash
return res
end
+
+ # Returns the union of this set with the `other` set
+ fun union(other: Set[E]): Set[E]
+ do
+ var nhs = new_set
+ nhs.add_all self
+ nhs.add_all other
+ return nhs
+ end
+
+ # Returns the intersection of this set with the `other` set
+ fun intersection(other: Set[E]): Set[E]
+ do
+ var nhs = new_set
+ for v in self do if other.has(v) then nhs.add(v)
+ return nhs
+ end
+
+ protected fun new_set: Set[E] is abstract
end
# MapRead are abstract associative collections: `key` -> `item`.
# Create an empty set with a given capacity.
init with_capacity(i: Int) do _array = new Array[E].with_capacity(i)
+
+ redef fun new_set do return new ArraySet[E]
end
# Iterators on sets implemented with arrays.
init
add_all(coll)
end
+
+ redef fun new_set do return new HashSet[E]
end
private class HashSetNode[E: Object]