spec: signale ein wenig umbenannt; layout angepasst
[hwmod.git] / spec / sm / parser.tex
index 20589c3cbf3064c0e12d024b310ac9b75d24f455..2bd3382c40d00c974768da381725c38300e6b812 100644 (file)
@@ -6,45 +6,21 @@
 
 \begin{document}
 
-\begin{psmatrix}[mnode=oval, colsep=1.91cm, rowsep=1cm]
-[mnode=R,name=vars]{\shortstack[l]{bool s=F,first=T;\\int z:=0, c,\\\, strich:=0, punkt:=1;\\opcode
-op,opn;}} &
-[name=calc]{\shortstack{\textbf{calc}\\z:=z*10\\+(c-'0');}} &
-[name=null]{\shortstack{\textbf{null}\\op:=DONE;}} \\
+\begin{psmatrix}[mnode=oval, colsep=1.95cm, rowsep=1cm]
+[mnode=R,name=vars]{\shortstack[l]{int s, z, c,\\\, strich, punkt;\\opcode aktop,opp;}} &
+[name=int]{\shortstack{\textbf{int}\\z:=z*10\\+(c-'0');}} &
+[name=blank]{\shortstack{\textbf{blank}}} \\
 %%
 [mnode=R,name=res]{sys\_res} &
-[name=sign]{\shortstack{\textbf{sign}\\s:=true;}} &
-[name=alu1]{
-       \shortstack{
-               \textbf{ALU1}\\
-               \shortstack[l]{
-                       if(first)\{\\
-                               \, alu(ADD,z*s,strich);\\
-                               \, first:=false;\\
-                       \} else\{\\
-                               \, alu(opd,z*s,strich);\\
-                       \}\\
-                       do\_calc=1;\\
-                       opn=op;
-               }
-       }
-} \\
+[name=sign]{\shortstack{\textbf{sign}\\s:=-1;}} &
+[name=null]{\shortstack{\textbf{null}\\aktop:=DONE;}} \\
 %%
-[name=idle]{\shortstack{\textbf{idle}}} &
-[name=read]{\shortstack{\textbf{read char}\\z:=0;\\s:=false;}} &
-[name=alu2]{
+[name=idle]{\shortstack{\textbf{idle}\\strich:=0;\\punkt:=1;\\opp:=NOP;}} &
+[name=read]{\shortstack{\textbf{read char}\\z:=0;\\s:=1;}} &
+[name=calc]{
        \shortstack{
-               \textbf{ALU2}\\
-               \shortstack[l]{
-                       if(first)\{\\
-                               \, alu(MUL,z*s,punkt);\\
-                               \, first:=false;\\
-                       \} else\{\\
-                               \, alu(opd,z*s,punkt);\\
-                       \}\\
-                       do\_calc=1;\\
-                       opn=op;
-               }
+               \textbf{calc}\\
+               siehe Listing
        }
 } \\
 %%
@@ -57,27 +33,27 @@ op,opn;}} &
 
 \ncline[linestyle=dotted]{res}{idle}
 \ncline[linestyle=dotted]{void}{err}
-\ncarc[arcangle=10]{done}{idle}
+\ncarc[arcangle=0]{done}{idle}
 \ncarc[arcangle=0]{err}{idle}
 
 \ncarc[arcangle=0]{idle}{read}\ncput*[npos=.50]{do\_it$\uparrow$}
-
+\nccurve[angleA=45,angleB=75,ncurvA=2,ncurvB=2]{read}{read}\ncput*{' '}
 \ncarc[arcangle=0]{read}{sign}\ncput*[npos=.50]{'-'}
-\ncarc[arcangle=0]{sign}{calc}
-\ncarc[arcangle=35]{read}{calc}\ncput*[npos=.35]{c = '0'\dots{}'9'}
-\nccircle[angle=0]{calc}{.8cm}\ncput*{c = '0'\dots{}'9'}
 
-\ncarc[arcangle=15]{calc}{alu1}\ncput*[npos=.50]{op = '+','-'}
-\ncarc[arcangle=-5]{calc}{alu2}\ncput*[npos=.30]{op = '*','/'}
+\ncarc[arcangle=0]{sign}{int}
+\ncarc[arcangle=50]{read}{int}\ncput*[npos=.35]{c = '0'\dots{}'9'}
+\nccircle[angleA=0]{int}{.78cm}\ncput*[npos=0.5]{c = '0'\dots{}'9'}
 
-\ncarc[arcangle=0]{calc}{null}\ncput*[npos=.50]{'\textbackslash 0'}
+\ncarc[arcangle=15]{int}{blank}\ncput*[npos=.50]{' '}
+\nccircle[angleA=0]{blank}{.70cm}\ncput*[npos=0.5]{' '}
 
-\ncarc[arcangle=0]{null}{alu1}\ncput*[npos=.50]{opd in ['+','-']}
-\ncarc[arcangle=48]{null}{alu2}\ncput*[npos=.80]{opd in ['*','/']}
+\ncarc[arcangle=67]{blank}{calc}\ncput*[npos=.80]{aktop = '+','-','*','/'}
+\ncarc[arcangle=0]{blank}{null}\ncput*[npos=.50]{aktop = '\textbackslash 0'}
 
-\ncarc[arcangle=0]{alu1}{read}\ncput*[npos=.50]{calc\_done$\uparrow$}
-\ncarc[arcangle=20]{alu2}{read}\ncput*[npos=.50]{calc\_done$\uparrow$}
+\ncarc[arcangle=0]{int}{calc}\ncput*[npos=.70]{aktop = '+','-','*','/'}
+\ncarc[arcangle=0]{int}{null}\ncput*[npos=.50]{aktop = '\textbackslash 0'}
+\ncarc[arcangle=0]{null}{calc}
 
-\ncarc[arcangle=80]{alu1}{done}\ncput*[npos=.50]{op == DONE}
-\ncarc[arcangle=-60]{alu2}{done}\ncput*[npos=.66]{op == DONE}
+\ncarc[arcangle=0]{calc}{read}\ncput*[npos=.45]{else}
+\ncarc[arcangle=0]{calc}{done}\ncput*[npos=.50]{aktop = DONE}
 \end{document}