final public void Import() throws ParseException {
Token t;
Token href;
Token as = null;
Name entity = null;
Name[] decls;
boolean added = false;
DefinitionStatement scope = flowPeek().getDefinitionStatement();
try {
t = jj_consume_token(IMPORT);
Location location = toLocation(t);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case STRING_LITERAL:
href = jj_consume_token(STRING_LITERAL);
String pathinfo = Conversions.unescape(href.image, true);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case AS:
case COLON:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case AS:
jj_consume_token(AS);
as = jj_consume_token(SYMBOL);
scope.addHrefImport(this, location, pathinfo, as.image, null, false);
added = true;
break;
case COLON:
jj_consume_token(COLON);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case MODULE:
case SYMBOL:
decls = RequestedDeclarations();
scope.addHrefImport(this, location, pathinfo, null, decls, false);
added = true;
break;
case STAR:
jj_consume_token(STAR);
scope.addHrefImport(this, location, pathinfo, null, null, true);
added = true;
break;
default:
jj_la1[13] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[14] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[15] = jj_gen;
;
}
if (!added) {
scope.addHrefImport(this, location, pathinfo, null, null, false);
}
break;
case MODULE:
case SYMBOL:
entity = Name(null);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case DOT:
case AS:
case COLON:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case DOT:
jj_consume_token(DOT);
jj_consume_token(STAR);
scope.addEntityImport(this, location, entity, null, true);
added = true;
break;
case AS:
jj_consume_token(AS);
as = jj_consume_token(SYMBOL);
entity.setAs(as.image);
scope.addEntityImport(this, location, entity, null, false);
added = true;
break;
case COLON:
jj_consume_token(COLON);