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

com.github.bloodshura.sparkium.brainfxck.action.Action Maven / Gradle / Ivy

The newest version!
package com.github.bloodshura.sparkium.brainfxck.action;

import com.github.bloodshura.sparkium.brainfxck.BrainfuckContext;
import com.github.bloodshura.sparkium.brainfxck.BrainfuckInterpreter;

import javax.annotation.Nonnull;
import java.io.IOException;

/**
 * This class represents a Brainfuck action, which can be executed by some form of input in Brainfuck code.
 * 

Actions are always called and processed from a single input character. */ public interface Action { /** * Acts when the specified character is interpreted on a Brainfuck code. *

Note: Implementations must return TRUE if the character were processed/consumed by this action, or FALSE if it wasn't. * * @param ch The current character * @param context The current interpreter context * @return boolean indicating if the character was processed or not * @throws IOException If an I/O exception occurs on this action; the exception will be directly thrown * on the {@link BrainfuckInterpreter#interpret(CharSequence)} method */ boolean act(char ch, @Nonnull BrainfuckContext context) throws IOException; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy