public Import getImportSyntax() { if (isImportSyntax()) { return this; } return new Import(name + IMPORTS_SYNTAX_SUFFIX, getLocation(), getSource()); }
imp -> { String name; if (imp.isImportSyntax()) { name = imp.getMainModuleName(); } else { name = imp.getName(); result = apply(mod, allKilModules, koreModules, cons(mainModule, visitedModules)); if (imp.isImportSyntax()) { return koreModules.get(imp.getName()); } else if (koreModules.containsKey(imp.getName())) { return koreModules.get(imp.getName()); } else { throw KEMException.compilerError("Could not find module: " + imp.getName(), imp); .map(resolveImport).collect(Collectors.toSet()); Set<org.kframework.definition.Sentence> syntaxItems = items.stream().filter(org.kframework.definition.Sentence::isSyntax).collect(Collectors.toSet()); org.kframework.definition.Module newSyntaxModule = Module(new Import(mainModule.getName()).getImportSyntax().getName(), immutable(importedSyntaxModules), immutable(syntaxItems), convertAttributes(mainModule));
@Override public Import shallowCopy() { return new Import(this); }
public String getMainModuleName() { assert isImportSyntax(); return name.substring(0, name.length() - IMPORTS_SYNTAX_SUFFIX.length()); } }
/** Parses an Import and adds it to module */ final public void Import(Module module) throws ParseException { Location loc = startLoc(); boolean isSyntax = false; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IMPORTS: jj_consume_token(IMPORTS); break; case IMPORTS2: jj_consume_token(IMPORTS2); break; default: jj_la1[27] = jj_gen; jj_consume_token(-1); throw new ParseException(); } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IMPORTSSYNTAX: jj_consume_token(IMPORTSSYNTAX); isSyntax = true; break; default: jj_la1[28] = jj_gen; ; } jj_consume_token(MODNAME); module.appendModuleItem(markLoc(loc, new Import(image(), isSyntax))); }