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

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

package de.firemage.autograder.treeg.ast;

import de.firemage.autograder.treeg.TreePrinter;

public record RegExCharacter(char content, boolean escaped) implements RegExNode, CharacterClassEntry {
    @Override
    public String toRegEx() {
        return (this.escaped ? "\\" : "") + this.content;
    }

    @Override
    public void toTree(TreePrinter printer) {
        printer.addLine(this.content + (this.escaped ? " (escaped)" : ""));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy