REBEL
- This article is not detailed enough and needs to be expanded. Please help us by adding some more information.
REBEL stands for Regular Expression Based Esoteric Language. REBEL is a declarative programming language that works by iteratively replacing substrings.
A program in REBEL consists of an initial state and a list of regular expression substitutions, separated by slash characters:
- initial state
/
RE/
RHS/
RE/
RHS/
...
where RE is a regular expression and RHS is the right hand side that is substituted if that RE matches.
Special constructs $<
and $>
in the RHS allow for input and output respectively.
Programs are executed by assigning the memory with the initial state, then performing a substitution loop. In the substitution loop each pair of RE with RHS is taken into consideration in turn. If the RE matches, then a regex replacement s/RE/RHS is made to the state, and the overall substitution loop is restarted. If no matches are made, the program ends.
Computational class
The trivial possibility of translation from any deterministic Thue program into REBEL gives a proof that REBEL is Turing-complete. There exists a universal REBEL program consisting of an initial state, a single match, and single replacement.