Execute a Markov algorithm: Difference between revisions
Content added Content deleted
No edit summary |
m (tidy up description of task a little) |
||
Line 1: | Line 1: | ||
{{Wikipedia|Markov_algorithm|en}} |
{{Wikipedia|Markov_algorithm|en}} |
||
{{task|Compilers and Interpreters}}Create an interpreter for a Markov Algorithm. Rules have the syntax: |
{{task|Compilers and Interpreters}}Create an interpreter for a Markov Algorithm. Rules have the syntax: |
||
<comment> ::= # {<any character>} |
<comment> ::= # {<any character>} |
||
<rule> ::= <pattern> <whitespace> -> <whitespace> [.] <replacement |
<rule> ::= <pattern> <whitespace> -> <whitespace> [.] <replacement> |
||
<whitespace> ::= (<tab> | <space>) [<whitespace>] |
<whitespace> ::= (<tab> | <space>) [<whitespace>] |
||
There is one rule per line. If there is a . present before the <replacement>, then this is a terminating rule in which case the interpreter must halt execution. |
There is one rule per line. If there is a . present before the <replacement>, then this is a terminating rule in which case the interpreter must halt execution. |
||