All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.firemage.autograder.treeg.ast.Chain Maven / Gradle / Ivy

package de.firemage.autograder.treeg.ast;

import de.firemage.autograder.treeg.TreePrinter;

import java.util.List;
import java.util.stream.Collectors;

public record Chain(List children) implements RegExNode {
    @Override
    public String toRegEx() {
        return this.children.stream().map(RegExNode::toRegEx).collect(Collectors.joining());
    }

    @Override
    public void toTree(TreePrinter printer) {
        printer.addLine("Chain");
        printer.indent();
        this.children.forEach(n -> n.toTree(printer));
        printer.unindent();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy