  Let $T$ be a $\R$-tree in the boundary of the Outer Space CV$_N$, with dense
orbits. The $Q$-index of $T$ is defined by means of the dual lamination of $T$.
It is a generalisation of the Euler-Poincar\'e index of a foliation on a
surface. We prove that the $Q$-index of $T$ is bounded above by $2N-2$, and we
study the case of equality. The main tool is to develop the Rips Machine in
order to deal with systems of isometries on compact $\R$-trees. Combining our
results on the $\CQ$-index with results on the classical geometric index of a
tree, we obtain a beginning of classification of trees. As a consequence, we
give a classification of iwip outer automorphisms of the free group, by
discussing the properties of their attracting and repelling trees.
