forked from runtimeverification/k
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBackend.java
More file actions
31 lines (23 loc) · 1.01 KB
/
Backend.java
File metadata and controls
31 lines (23 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) 2015-2019 K Team. All Rights Reserved.
package org.kframework.compile;
import org.kframework.definition.Definition;
import org.kframework.definition.Module;
import org.kframework.definition.ModuleTransformer;
import org.kframework.kompile.CompiledDefinition;
import java.util.Set;
import java.util.function.Function;
/**
* Created by dwightguth on 9/1/15.
*/
public interface Backend {
void accept(CompiledDefinition def);
Function<Definition, Definition> steps();
Function<Module, Module> specificationSteps(Definition def);
Set<String> excludedModuleTags();
default ModuleTransformer restoreDefinitionModulesTransformer(Definition kompiledDefinition) {
return ModuleTransformer.from(mod -> kompiledDefinition.getModule(mod.name()).isDefined()
? kompiledDefinition.getModule(mod.name()).get()
: mod,
"restore definition modules to same state as in definition");
}
}