Compiler ZRa in Scheme+Turtle

Aus ProgrammingWiki
Archivierte Version vom 2008-12-11T09:32:11+00:00. Aktuelle Version
$G = (N, T, P, s)$ \\ \begin{eqnarray*} N & = & \{Programm,\ Anweisungen,\ Anweisung,\ Zahl,\ Ziffer-ab-1,\ Ziffer,\ Zahl0,\ Farbwert,\ Status\}\\ T & = & \{\texttt{WH},\ \texttt{[},\ \texttt{]},\ \texttt{FARBE},\ \texttt{RE},\ \texttt{STIFT},\ \texttt{VW},\ \texttt{1},\ \texttt{2},\ \texttt{3},\ \texttt{4},\ \texttt{5},\ \texttt{6},\ \texttt{7},\ \texttt{8},\ \texttt{9},\ \texttt{0},\ \texttt{blau},\ \texttt{gruen},\ \texttt{rot},\ \texttt{schwarz},\ \texttt{weiss},\ \texttt{oben},\ \texttt{radiert},\ \texttt{schreibt},\ \texttt{unten}\}\\ P & = & \{ Programm \rightarrow Anweisungen\ \\ & & \ \ Anweisungen \rightarrow Anweisung\ Anweisungen\ \mid\ \varepsilon \\ & & \ \ Anweisung \rightarrow \texttt{WH}\ Zahl\ \texttt{[}\ Anweisungen\ \texttt{]}\ \\ & & \hspace{0.4cm}\mid\ \texttt{FARBE}\ Farbwert\ \mid\ \texttt{RE}\ Zahl\ \mid\ \texttt{STIFT}\ Status\ \mid\ \texttt{VW}\ Zahl\ \\ & & \ \ Zahl \rightarrow Ziffer\ \mid\ Ziffer-ab-1\ Zahl0\ \\ & & \ \ Ziffer-ab-1 \rightarrow \texttt{1}\ \mid\ \texttt{2}\ \mid\ \texttt{3}\ \mid\ \texttt{4}\ \mid\ \texttt{5}\ \mid\ \texttt{6}\ \mid\ \texttt{7}\ \mid\ \texttt{8}\ \mid\ \texttt{9}\ \\ & & \ \ Ziffer \rightarrow \texttt{0}\ \mid\ Ziffer-ab-1\ \\ & & \ \ Zahl0 \rightarrow Ziffer\ \mid\ Ziffer\ Zahl0\ \\ & & \ \ Farbwert \rightarrow \texttt{blau}\ \mid\ \texttt{gruen}\ \mid\ \texttt{rot}\ \mid\ \texttt{schwarz}\ \mid\ \texttt{weiss}\ \\ & & \ \ Status \rightarrow \texttt{oben}\ \mid\ \texttt{radiert}\ \mid\ \texttt{schreibt}\ \mid\ \texttt{unten}\ \\ & & \}\\ s & = & Programm \end{eqnarray*}