public String makeErrorMessage(ASTNode t) { return t.toString() + " at location " + t.getLocation() + " in file " + t.getSource() + " of class " + t.getClass().toString(); } }
public scala.collection.Set<Tag> toTags(List<Tag> labels, ASTNode loc) { return immutable(labels.stream().flatMap(l -> { java.util.Set<Production> productions = context.tags.get(l.name()); if (productions.isEmpty()) throw KEMException.outerParserError("Could not find any productions for tag: " + l.name(), loc.getSource(), loc.getLocation()); return productions.stream().map(p -> Tag(p.getKLabel(kore))); }).collect(Collectors.toSet())); }
public static org.kframework.attributes.Att convertAttributes(ASTNode t) { Attributes attributes = t.getAttributes(); Map<String, String> attributesSet = attributes .keySet() .stream() .map(key -> { String keyString = key.toString(); String valueString = attributes.get(key).getValue().toString(); if (keyString.equals("klabel")) { return Tuple2.apply("klabel", valueString); } else { return Tuple2.apply(keyString, valueString); } }).collect(Collectors.toMap(Tuple2::_1, Tuple2::_2)); return Att().addAll(attributesSet) .addAll(attributesFromLocation(t.getLocation())) .addAll(attributesFromSource(t.getSource())); }