Ejemplo n.º 1
0
  @Override
  public ASTNode visit(org.kframework.kil.Definition node, Void _void) {
    Definition definition = new Definition(context, kem, indexingData);
    globalContext.setDefinition(definition);

    Module singletonModule = node.getSingletonModule();

    for (org.kframework.kil.Rule rule : singletonModule.getRules()) {
      if (rule.containsAttribute(Attribute.PREDICATE_KEY)) {
        continue;
      }

      definition.addRule((Rule) this.visitNode(rule));
    }

    for (String kLabelName : singletonModule.getModuleKLabels()) {
      definition.addKLabel(KLabelConstant.of(kLabelName, globalContext.getDefinition()));
    }

    return definition;
  }
Ejemplo n.º 2
0
  public Definition transformDefinition(org.kframework.kil.Definition node) {
    Definition transformedDef = (Definition) this.visitNode(node);
    globalContext.setDefinition(transformedDef);

    return expandAndEvaluate(termContext, kem);
  }