switch (state) {
case IGNORING:
if (TokenType.IMPORT.equals(type)) {
state = State.DETERMINING;
currentImport = new Import();
currentImport.setFile(file);
}
break;
case DETERMINING:
if (TokenType.LPAREN.equals(type)) {
state = State.MULTIPLE;
}
else if (TokenType.QUOTE.equals(type)) {
state = State.SINGLE;
currentImport.prefixType = Import.PrefixType.NONE;
}
else if (TokenType.PERIOD.equals(type)) {
if (currentImport != null) {
currentImport.prefixType = Import.PrefixType.INCLUDED;
}
}
else if (TokenType.IDENTIFIER.equals(type)) {
if (currentImport != null) {
currentImport.prefixType = Import.PrefixType.ALIAS;
currentImport.prefix = value;
}
}
break;
case SINGLE:
if (TokenType.QUOTE.equals(type)) {
imports.add(currentImport);
currentImport = null;
state = State.IGNORING;
} else {
currentImport.path += value;
currentImport.setLine(linenumber);
}
break;
case MULTIPLE:
if (currentImport == null) {
currentImport = new Import();
currentImport.setFile(file);
}
if (TokenType.QUOTE.equals(type)) {
reading = !reading;