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

com.laamella.sexpression.model.Node Maven / Gradle / Ivy

There is a newer version: 0.2
Show newest version
package com.laamella.sexpression.model;

import com.laamella.sexpression.visitor.Visitor;

import java.util.function.Consumer;

public interface Node {
     R visit(Visitor visitor, A arg) throws Exception;

    Otherwise whenList(Consumer action);

    Otherwise whenAtom(Consumer action);

    Otherwise whenComment(Consumer action);

    boolean isAtom();

    boolean isList();

    boolean isComment();

    Atom toAtom();

    AtomList toList();

    Comment toComment();

    class Otherwise {
        private final boolean b;

        public Otherwise(boolean executeElse) {
            this.b = executeElse;
        }

        public void otherwise(Runnable r) {
            if (b) r.run();
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy