offset = 1;
}
if (element instanceof Alternation)
{
Alternation alternation = (Alternation)element;
for (int i = 0; i<alternation.getPatternCount(); i++)
statecount += getStateCount(alternation.getPattern(i));
if (alternation.getPatternCount()>1)
statecount++;
}
else if (element instanceof BeginOfLine)
statecount = 1;
else if (element instanceof CharacterClass)